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

Change subject: ve.init.Target: Wrap floating toolbar init in rAF
......................................................................


ve.init.Target: Wrap floating toolbar init in rAF

Determining whether we need to float or unfloat the toolbar
requires us to measure the position of the toolbar and the
scrollTop of its container, which causes a slow forced reflow.

Even with rAF this is still kind of slow, and we should probably
defer it more, because ve.ui.Surface#initialize still has
to wait for it.

Change-Id: Id189484e77c5dd6f676a5524fcb616c5e9ac7ea4
---
M src/init/ve.init.Target.js
1 file changed, 3 insertions(+), 2 deletions(-)

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



diff --git a/src/init/ve.init.Target.js b/src/init/ve.init.Target.js
index 7c6d510..99db2da 100644
--- a/src/init/ve.init.Target.js
+++ b/src/init/ve.init.Target.js
@@ -426,7 +426,8 @@
  */
 ve.init.Target.prototype.setupToolbar = function ( surface ) {
        var toolbar = this.getToolbar(),
-               actions = this.getActions();
+               actions = this.getActions(),
+               rAF = requestAnimationFrame || setTimeout;
 
        toolbar.connect( this, { resize: 'onToolbarResize' } );
 
@@ -435,7 +436,7 @@
        this.attachToolbar( surface );
        toolbar.$bar.append( surface.getToolbarDialogs().$element );
        toolbar.$actions.append( actions.$element );
-       this.onContainerScroll();
+       rAF( this.onContainerScrollHandler );
 };
 
 /**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id189484e77c5dd6f676a5524fcb616c5e9ac7ea4
Gerrit-PatchSet: 2
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <roan.katt...@gmail.com>
Gerrit-Reviewer: Divec <da...@troi.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