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

Change subject: Window: Disable transitions when changing window height to 
calculate content height
......................................................................


Window: Disable transitions when changing window height to calculate content 
height

Otherwise we're getting values from when the window height is animating.

Not entirely sure why this fixes T72061, but the change definitely corrects
an error in our reasoning. It just happens to fix that bug, too.

Bug: T72061
Change-Id: I624f1b0da906200abefbbf914172b8794cdf4d1b
---
M src/Window.js
1 file changed, 13 insertions(+), 4 deletions(-)

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



diff --git a/src/Window.js b/src/Window.js
index 620bb81..7a16e87 100644
--- a/src/Window.js
+++ b/src/Window.js
@@ -308,11 +308,20 @@
  * @return {number} Content height
  */
 OO.ui.Window.prototype.getContentHeight = function () {
-       // Temporarily resize the frame so getBodyHeight() can use scrollHeight 
measurements
-       var bodyHeight, oldHeight = this.$frame[0].style.height;
-       this.$frame[0].style.height = '1px';
+       // Temporarily resize the frame so getBodyHeight() can use scrollHeight 
measurements.
+       // Disable transitions first, otherwise we'll get values from when the 
window was animating.
+       var bodyHeight, oldHeight, oldTransition,
+               styleObj = this.$frame[0].style;
+       oldTransition = styleObj.transition || styleObj.OTransition || 
styleObj.MsTransition ||
+               styleObj.MozTransition || styleObj.WebkitTransition;
+       styleObj.transition = styleObj.OTransition = styleObj.MsTransition =
+               styleObj.MozTransition = styleObj.WebkitTransition = 'none';
+       oldHeight = styleObj.height;
+       styleObj.height = '1px';
        bodyHeight = this.getBodyHeight();
-       this.$frame[0].style.height = oldHeight;
+       styleObj.height = oldHeight;
+       styleObj.transition = styleObj.OTransition = styleObj.MsTransition =
+               styleObj.MozTransition = styleObj.WebkitTransition = 
oldTransition;
 
        return Math.round(
                // Add buffer for border

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I624f1b0da906200abefbbf914172b8794cdf4d1b
Gerrit-PatchSet: 4
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Trevor Parscal <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to