GWicke has uploaded a new change for review.

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


Change subject: Bug 47426: Omit id member so that data-mw attribute is 
deterministic
......................................................................

Bug 47426: Omit id member so that data-mw attribute is deterministic

The non-deterministic id member in data-mw made the entire attribute
serialization non-deterministic. The attribute difference triggers a DOM diff
and full serialization rather than selective serialization. Full serialization
introduces avoidable whitespace diffs.

No differences in parserTests and tested with roundtrip-test on Obama.

Change-Id: Ic615b11b5bc7cd7cb83a59ffa9fcccb135909a28
---
M js/lib/ext.core.TemplateHandler.js
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid 
refs/changes/39/60039/1

diff --git a/js/lib/ext.core.TemplateHandler.js 
b/js/lib/ext.core.TemplateHandler.js
index 31156f2..21d704c 100644
--- a/js/lib/ext.core.TemplateHandler.js
+++ b/js/lib/ext.core.TemplateHandler.js
@@ -406,7 +406,11 @@
                // Use a data-attribute to prevent the sanitizer from stripping 
this
                // attribute before it reaches the DOM pass where it is needed.
                attrs.push(new KV("data-mw-arginfo", JSON.stringify({
-                       id: state.wrappedObjectId,
+                       // gwicke: Removed the non-deterministic id member for 
now as this
+                       // makes the data-mw attribute non-deterministic across 
reparses.
+                       // That in turn triggers diffs. See
+                       // https://bugzilla.wikimedia.org/show_bug.cgi?id=47426.
+                       //id: state.wrappedObjectId,
                        target: { wt: tplTgtWT },
                        params: dict
                })));

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic615b11b5bc7cd7cb83a59ffa9fcccb135909a28
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: GWicke <[email protected]>

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

Reply via email to