Inez has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/60928


Change subject: New static property - renderHtmlAttributes
......................................................................

New static property - renderHtmlAttributes

It is going to be used at least for figure tags for which Parsoid gives as a 
lot of CSS class names that are useless for rendering purpose

Change-Id: I4b1e8084a6b7ab5294e0c3cf153fc6cffb3e8dac
---
M modules/ve/ce/ve.ce.View.js
1 file changed, 17 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/28/60928/1

diff --git a/modules/ve/ce/ve.ce.View.js b/modules/ve/ce/ve.ce.View.js
index cb9ae7e..c5b4d55 100644
--- a/modules/ve/ce/ve.ce.View.js
+++ b/modules/ve/ce/ve.ce.View.js
@@ -26,11 +26,13 @@
 
        // Initialization
        this.$.data( 'view', this );
-       ve.setDomAttributes(
-               this.$[0],
-               this.model.getAttributes( 'html/0/' ),
-               this.constructor.static.domAttributeWhitelist
-       );
+       if ( this.constructor.static.renderHtmlAttributes ) {
+               ve.setDomAttributes(
+                       this.$[0],
+                       this.model.getAttributes( 'html/0/' ),
+                       this.constructor.static.domAttributeWhitelist
+               );
+       }
 };
 
 /* Inheritance */
@@ -71,6 +73,16 @@
        'summary', 'title', 'type', 'typeof', 'valign', 'value', 'width'
 ];
 
+/**
+ * Whether or not HTML attributes listed in domAttributeWhitelist and present 
in HTMLDOM should be
+ * added to node anchor (this.$).
+ *
+ * @static
+ * @property static.renderHtmlAttributes
+ * @inheritable
+ */
+ve.ce.View.static.renderHtmlAttributes = true; 
+
 /* Methods */
 
 /**

-- 
To view, visit https://gerrit.wikimedia.org/r/60928
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4b1e8084a6b7ab5294e0c3cf153fc6cffb3e8dac
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Inez <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to