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

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

Issue 1454613002: Page popups should respect zoom factor of the anchor element. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add 1.25 zoom tests Created 5 years, 1 month 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 1f5d2e964e2ed802a2ab77dc47596de0089b5045..89b9f8eca22f9fcf699b87bb2c387600c2f1cf21 100644
--- a/third_party/WebKit/Source/web/resources/listPicker.js
+++ b/third_party/WebKit/Source/web/resources/listPicker.js
@@ -223,16 +223,17 @@ ListPicker.prototype._fixWindowSize = function() {
desiredWindowWidth += getScrollbarWidth();
expectingScrollbar = true;
}
- desiredWindowWidth = Math.max(this._config.anchorRectInScreen.width, desiredWindowWidth);
- var windowRect = adjustWindowRect(desiredWindowWidth, desiredWindowHeight, this._selectElement.offsetWidth, 0);
+ var zoom = this._config.zoomFactor;
+ desiredWindowWidth = Math.max(this._config.anchorRectInScreen.width / zoom, desiredWindowWidth);
+ var windowRect = adjustWindowRect(desiredWindowWidth * zoom, desiredWindowHeight * zoom, this._selectElement.offsetWidth * zoom, 0);
// If the available screen space is smaller than maxHeight, we will get an unexpected scrollbar.
- if (!expectingScrollbar && windowRect.height < noScrollHeight) {
- desiredWindowWidth = windowRect.width + getScrollbarWidth();
+ if (!expectingScrollbar && windowRect.height < noScrollHeight * zoom) {
+ desiredWindowWidth = windowRect.width + getScrollbarWidth() * zoom;
windowRect = adjustWindowRect(desiredWindowWidth, windowRect.height, windowRect.width, windowRect.height);
}
- this._selectElement.style.width = windowRect.width + "px";
- this._selectElement.style.height = windowRect.height + "px";
- this._element.style.height = windowRect.height + "px";
+ this._selectElement.style.width = (windowRect.width / zoom) + "px";
+ this._selectElement.style.height = (windowRect.height / zoom) + "px";
+ this._element.style.height = (windowRect.height / zoom) + "px";
setWindowRect(windowRect);
};
« no previous file with comments | « third_party/WebKit/Source/web/WebPagePopupImpl.cpp ('k') | third_party/WebKit/Source/web/resources/pickerCommon.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698