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
This commit is contained in:
Inez Korczyński 2013-04-25 14:41:21 -07:00
parent e7ee9564e6
commit 2286259681

View file

@ -26,11 +26,13 @@ ve.ce.View = function VeCeView( model, $element ) {
// 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 @@ ve.ce.View.static.domAttributeWhitelist = [
'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 */
/**