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

Change subject: DesktopArticleTarget: Save scroll position before transformPage
......................................................................


DesktopArticleTarget: Save scroll position before transformPage

transformPage() makes significant changes to the DOM, so measuring the
scroll position synchronously right after that results in a slow forced reflow.
Instead, measure the scroll position before reorganizing half the DOM.

Change-Id: I3baee5c11ca228696ddbfb30789745f5f0faa20a
---
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
1 file changed, 3 insertions(+), 2 deletions(-)

Approvals:
  DLynch: Looks good to me, approved
  Jforrester: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js 
b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
index a6eb3ce..96a6189 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
@@ -480,11 +480,12 @@
                this.originalEditondbclick = mw.user.options.get( 
'editondblclick' );
                mw.user.options.set( 'editondblclick', 0 );
 
+               // Save the scroll position; will be restored by surfaceReady()
+               this.saveScrollPosition();
+
                // User interface changes
                this.transformPage();
                this.setupLocalNoticeMessages();
-
-               this.saveScrollPosition();
 
                // Create dummy surface to show toolbar while loading
                surface = this.addSurface( new ve.dm.Document( [ { type: 
'internalList' }, { type: '/internalList' } ] ) );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3baee5c11ca228696ddbfb30789745f5f0faa20a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <roan.katt...@gmail.com>
Gerrit-Reviewer: DLynch <dly...@wikimedia.org>
Gerrit-Reviewer: Esanders <esand...@wikimedia.org>
Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to