Catrope has uploaded a new change for review.

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


Change subject: Revert "Serialize alienated context-sensitive nodes correctly"
......................................................................

Revert "Serialize alienated context-sensitive nodes correctly"

This breaks because .html() has a bug that causes corruption of
data-parsoid attributes, see http://bugs.jquery.com/ticket/13821

This reverts commit 42c1aa10cd0ab93300fe56c8022082cf4b1edea1.

Change-Id: I14e1575f27d103fb73b3c5949fa24ac01ecf217f
---
M modules/ve/dm/nodes/ve.dm.AlienNode.js
M modules/ve/test/dm/ve.dm.example.js
2 files changed, 1 insertion(+), 21 deletions(-)


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

diff --git a/modules/ve/dm/nodes/ve.dm.AlienNode.js 
b/modules/ve/dm/nodes/ve.dm.AlienNode.js
index 7275c88..0698981 100644
--- a/modules/ve/dm/nodes/ve.dm.AlienNode.js
+++ b/modules/ve/dm/nodes/ve.dm.AlienNode.js
@@ -48,7 +48,7 @@
 
 ve.dm.AlienNode.static.toDomElements = function ( dataElement, doc ) {
        var wrapper = doc.createElement( 'div' );
-       $( wrapper ).html( dataElement.attributes.html );
+       wrapper.innerHTML = dataElement.attributes.html;
        // Convert wrapper.children to an array
        return Array.prototype.slice.call( wrapper.childNodes, 0 );
 };
diff --git a/modules/ve/test/dm/ve.dm.example.js 
b/modules/ve/test/dm/ve.dm.example.js
index 2caeddf..987a253 100644
--- a/modules/ve/test/dm/ve.dm.example.js
+++ b/modules/ve/test/dm/ve.dm.example.js
@@ -2370,26 +2370,6 @@
                        { 'type': '/paragraph' }
                ]
        },
-       'context-sensitive nodes are alienated correctly': {
-               'html': 
'<table><caption>Foo</caption><tbody><tr><td>Bar</td></tr></tbody></table>',
-               'data': [
-                       { 'type': 'table' },
-                       { 'type': 'alienBlock', 'attributes': { 'html': 
'<caption>Foo</caption>' } },
-                       { 'type': '/alienBlock' },
-                       { 'type': 'tableSection', 'attributes': { 'style': 
'body' } },
-                       { 'type': 'tableRow' },
-                       { 'type': 'tableCell', 'attributes': { 'style': 'data' 
} },
-                       { 'type': 'paragraph', 'internal': { 'generated': 
'wrapper' } },
-                       'B',
-                       'a',
-                       'r',
-                       { 'type': '/paragraph' },
-                       { 'type': '/tableCell' },
-                       { 'type': '/tableRow' },
-                       { 'type': '/tableSection' },
-                       { 'type': '/table' }
-               ]
-       },
        'whitespace before meta node in wrapping mode': {
                'html': '<body><table><tbody><tr><td>Foo\n<meta 
property="mw:foo" content="bar" /></td></tr></tbody></table></body>',
                'data': [

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I14e1575f27d103fb73b3c5949fa24ac01ecf217f
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

Reply via email to