jenkins-bot has submitted this change and it was merged.

Change subject: Remove #rebuildTree calls and ensure #getDocumentNode is used
......................................................................


Remove #rebuildTree calls and ensure #getDocumentNode is used

Change-Id: I2e95ea905f15196c7825d45172350d776e6159b8
---
M demos/ve/ve.demo.SurfaceContainer.js
M src/dm/ve.dm.VisualDiff.js
M src/ui/elements/ve.ui.DiffElement.js
3 files changed, 4 insertions(+), 10 deletions(-)

Approvals:
  Tchanders: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/demos/ve/ve.demo.SurfaceContainer.js 
b/demos/ve/ve.demo.SurfaceContainer.js
index 251be23..1ba1f68 100644
--- a/demos/ve/ve.demo.SurfaceContainer.js
+++ b/demos/ve/ve.demo.SurfaceContainer.js
@@ -83,7 +83,6 @@
        diffButton.on( 'click', function () {
                var windowManager = new OO.ui.WindowManager( { factory: 
ve.ui.windowFactory } );
                $( 'body' ).append( windowManager.$element );
-               container.target.oldDoc.rebuildTree();
                windowManager.openWindow( 'diff' );
        } );
 
@@ -290,7 +289,6 @@
 
        dmDoc = this.surface.getModel().getDocument();
        this.target.oldDoc = dmDoc.cloneFromRange( new ve.Range( 0, 
dmDoc.data.getLength() ) );
-       // rebuildTree is called when getDiff is run
 
        this.$surfaceWrapper.empty().append( this.surface.$element.parent() )
                .hide().slideDown().promise().done( function () {
diff --git a/src/dm/ve.dm.VisualDiff.js b/src/dm/ve.dm.VisualDiff.js
index 7368e1c..611e7eb 100644
--- a/src/dm/ve.dm.VisualDiff.js
+++ b/src/dm/ve.dm.VisualDiff.js
@@ -21,10 +21,8 @@
 
        this.oldDoc = oldDoc.cloneFromRange();
        this.newDoc = newDoc.cloneFromRange();
-       this.oldDoc.rebuildTree();
-       this.newDoc.rebuildTree();
-       this.oldDocNode = oldDoc.documentNode;
-       this.newDocNode = newDoc.documentNode;
+       this.oldDocNode = oldDoc.getDocumentNode();
+       this.newDocNode = newDoc.getDocumentNode();
        this.oldDocChildren = this.oldDocNode.children;
        this.newDocChildren = this.newDocNode.children;
        this.treeDiffer = treeDiffer;
diff --git a/src/ui/elements/ve.ui.DiffElement.js 
b/src/ui/elements/ve.ui.DiffElement.js
index 7ccd650..cb88dee 100644
--- a/src/ui/elements/ve.ui.DiffElement.js
+++ b/src/ui/elements/ve.ui.DiffElement.js
@@ -28,10 +28,8 @@
        // Documents
        this.oldDoc = visualDiff.oldDoc;
        this.newDoc = visualDiff.newDoc;
-       this.oldDoc.rebuildTree();
-       this.newDoc.rebuildTree();
-       this.oldDocChildren = this.oldDoc.documentNode.children;
-       this.newDocChildren = this.newDoc.documentNode.children;
+       this.oldDocChildren = this.oldDoc.getDocumentNode().children;
+       this.newDocChildren = this.newDoc.getDocumentNode().children;
 
        // Diff
        this.oldToNew = diff.docChildrenOldToNew;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2e95ea905f15196c7825d45172350d776e6159b8
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
Gerrit-Reviewer: Tchanders <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to