Catrope has uploaded a new change for review.
https://gerrit.wikimedia.org/r/81173
Change subject: Kill domAttributeWhitelist in favor or renderHtmlAttributes
......................................................................
Kill domAttributeWhitelist in favor or renderHtmlAttributes
domAttributeWhitelist wasn't actually being observed. Instead, we
already had the code in place to treat renderHtmlAttributes as a
boolean/whitelist/blacklist hybrid, it just wasn't used that way
yet.
This makes the interface nicer and fixes the bug where all attributes
(including data-parsoid and even things like onmouseover) were
rendered by CE.
Change-Id: I02e266c7c7dc197ed845164b7a705d786846a33b
---
M modules/ve/ce/ve.ce.View.js
1 file changed, 3 insertions(+), 13 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/73/81173/1
diff --git a/modules/ve/ce/ve.ce.View.js b/modules/ve/ce/ve.ce.View.js
index 751c0ab..51a0744 100644
--- a/modules/ve/ce/ve.ce.View.js
+++ b/modules/ve/ce/ve.ce.View.js
@@ -65,7 +65,7 @@
/* Static Members */
/**
- * Allowed attributes for DOM elements.
+ * Allowed attributes for DOM elements, in the same format as
ve.dm.Model#static.storeHtmlAttributes
*
* This list includes attributes that are generally safe to include in HTML
loaded from a
* foreign source and displaying it inside the browser. It doesn't include any
event attributes,
@@ -76,10 +76,10 @@
* sense for that view in particular.
*
* @static
- * @property static.domAttributeWhitelist
+ * @property {boolean|string|RegExp|Array|Object} static.renderHtmlAttributes
* @inheritable
*/
-ve.ce.View.static.domAttributeWhitelist = [
+ve.ce.View.static.renderHtmlAttributes = [
'abbr', 'about', 'align', 'alt', 'axis', 'bgcolor', 'border',
'cellpadding', 'cellspacing',
'char', 'charoff', 'cite', 'class', 'clear', 'color', 'colspan',
'datatype', 'datetime',
'dir', 'face', 'frame', 'headers', 'height', 'href', 'id', 'itemid',
'itemprop', 'itemref',
@@ -87,16 +87,6 @@
'resource', 'rev', 'rowspan', 'rules', 'scope', 'size', 'span', 'src',
'start', 'style',
'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/81173
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I02e266c7c7dc197ed845164b7a705d786846a33b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits