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

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

Issue 1456753002: Compute the popup location/size correctly when use-zoom-for-dsf is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update TestExpectations Created 5 years 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
« no previous file with comments | « third_party/WebKit/Source/web/resources/listPicker.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/resources/suggestionPicker.js
diff --git a/third_party/WebKit/Source/web/resources/suggestionPicker.js b/third_party/WebKit/Source/web/resources/suggestionPicker.js
index da62067e4ae40589bfa0175f917c99a63ea4a3ed..41c3ea490ae2799a32dbe01dd254bd07ea2b29c2 100644
--- a/third_party/WebKit/Source/web/resources/suggestionPicker.js
+++ b/third_party/WebKit/Source/web/resources/suggestionPicker.js
@@ -138,9 +138,9 @@ SuggestionPicker.prototype._measureMaxContentWidth = function() {
SuggestionPicker.prototype._fixWindowSize = function() {
var ListBorder = 2;
var zoom = this._config.zoomFactor;
- var desiredWindowWidth = this._measureMaxContentWidth() + ListBorder;
+ var desiredWindowWidth = (this._measureMaxContentWidth() + ListBorder) * zoom;
if (typeof this._config.inputWidth === "number")
- desiredWindowWidth = Math.max(this._config.inputWidth / zoom, desiredWindowWidth);
+ desiredWindowWidth = Math.max(this._config.inputWidth, desiredWindowWidth);
var totalHeight = ListBorder;
var maxHeight = 0;
var entryCount = 0;
@@ -152,15 +152,14 @@ SuggestionPicker.prototype._fixWindowSize = function() {
if (maxHeight === 0 && entryCount == SuggestionPicker.NumberOfVisibleEntries)
maxHeight = totalHeight;
}
- var desiredWindowHeight = totalHeight;
- if (maxHeight !== 0 && totalHeight > maxHeight) {
+ var desiredWindowHeight = totalHeight * zoom;
+ if (maxHeight !== 0 && totalHeight > maxHeight * zoom) {
this._containerElement.style.maxHeight = (maxHeight - ListBorder) + "px";
- desiredWindowWidth += getScrollbarWidth();
- desiredWindowHeight = maxHeight;
+ desiredWindowWidth += getScrollbarWidth() * zoom;
+ desiredWindowHeight = maxHeight * zoom;
this._containerElement.style.overflowY = "scroll";
}
-
- var windowRect = adjustWindowRect(desiredWindowWidth * zoom, desiredWindowHeight * zoom, desiredWindowWidth * zoom, 0);
+ var windowRect = adjustWindowRect(desiredWindowWidth, desiredWindowHeight, desiredWindowWidth, 0);
this._containerElement.style.height = (windowRect.height / zoom - ListBorder) + "px";
setWindowRect(windowRect);
};
« no previous file with comments | « third_party/WebKit/Source/web/resources/listPicker.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698