mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
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:
parent
e7ee9564e6
commit
2286259681
|
@ -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 */
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue