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

Change subject: ClippableElement: Use 'overflow-[xy]: scroll' rather than 'auto'
......................................................................


ClippableElement: Use 'overflow-[xy]: scroll' rather than 'auto'

There is a curious wide-spread browser behavior [1] (can't tell if bug
or feature) where applying explicit height and 'overflow-y: auto' to
an element with no explicit width set doesn't cause the width to be
recalculated, inserts the vertical scrollbar, and thus causes a
horizontal scrollbar to also be necessary.

This doesn't happen with 'overflow-y: scroll' (which causes the width
to be enlarged to fit the scrollbar), and we can safely use it here as
we already know that the scrollbar will be necessary.

[1] Affects all browsers I tested except IE 11.

Bug: 65059
Change-Id: I330fd8c923d99af286cb10a1df428a62fdfbf3ae
---
M src/elements/ClippableElement.js
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/src/elements/ClippableElement.js b/src/elements/ClippableElement.js
index 26eef13..3eb1ff5 100644
--- a/src/elements/ClippableElement.js
+++ b/src/elements/ClippableElement.js
@@ -179,14 +179,14 @@
                clipHeight = desiredHeight < naturalHeight;
 
        if ( clipWidth ) {
-               this.$clippable.css( { overflowX: 'auto', width: desiredWidth } 
);
+               this.$clippable.css( { overflowX: 'scroll', width: desiredWidth 
} );
        } else {
                this.$clippable.css( 'width', this.idealWidth || '' );
                this.$clippable.width(); // Force reflow for 
https://code.google.com/p/chromium/issues/detail?id=387290
                this.$clippable.css( 'overflowX', '' );
        }
        if ( clipHeight ) {
-               this.$clippable.css( { overflowY: 'auto', height: desiredHeight 
} );
+               this.$clippable.css( { overflowY: 'scroll', height: 
desiredHeight } );
        } else {
                this.$clippable.css( 'height', this.idealHeight || '' );
                this.$clippable.height(); // Force reflow for 
https://code.google.com/p/chromium/issues/detail?id=387290

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I330fd8c923d99af286cb10a1df428a62fdfbf3ae
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Bartosz DziewoƄski <matma....@gmail.com>
Gerrit-Reviewer: Trevor Parscal <tpars...@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