Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Unified Diff: third_party/WebKit/Source/web/resources/listPicker.js

Issue 1930183002: Refactor scroll updates during flexbox layout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@rtl-scroll-origin
Patch Set: rebase + nits Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/resources/listPicker.js
diff --git a/third_party/WebKit/Source/web/resources/listPicker.js b/third_party/WebKit/Source/web/resources/listPicker.js
index 0e25f1ce4329b65262136c01622f26a96dad4ad2..efc8d0c8eb9e2c1830cc4e329764b54b7935ce13 100644
--- a/third_party/WebKit/Source/web/resources/listPicker.js
+++ b/third_party/WebKit/Source/web/resources/listPicker.js
@@ -221,7 +221,6 @@ ListPicker.prototype._fixWindowSize = function() {
var zoom = this._config.zoomFactor;
var maxHeight = this._selectElement.offsetHeight * zoom;
var noScrollHeight = (this._calculateScrollHeight() + ListPicker.ListboxSelectBorder * 2) * zoom;
- var scrollbarWidth = getScrollbarWidth() * zoom;
var elementOffsetWidth = this._selectElement.offsetWidth * zoom;
var desiredWindowHeight = noScrollHeight;
var desiredWindowWidth = elementOffsetWidth;
@@ -230,14 +229,13 @@ ListPicker.prototype._fixWindowSize = function() {
desiredWindowHeight = maxHeight;
// Setting overflow to auto does not increase width for the scrollbar
// so we need to do it manually.
- desiredWindowWidth += scrollbarWidth;
expectingScrollbar = true;
}
desiredWindowWidth = Math.max(this._config.anchorRectInScreen.width, desiredWindowWidth);
var windowRect = adjustWindowRect(desiredWindowWidth, desiredWindowHeight, elementOffsetWidth, 0);
// If the available screen space is smaller than maxHeight, we will get an unexpected scrollbar.
if (!expectingScrollbar && windowRect.height < noScrollHeight) {
- desiredWindowWidth = windowRect.width + scrollbarWidth;
+ desiredWindowWidth = windowRect.width;
windowRect = adjustWindowRect(desiredWindowWidth, windowRect.height, windowRect.width, windowRect.height);
}
this._selectElement.style.width = (windowRect.width / zoom) + "px";

Powered by Google App Engine
This is Rietveld 408576698