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

Unified Diff: third_party/WebKit/Source/web/PopupMenuImpl.cpp

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: 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
Index: third_party/WebKit/Source/web/PopupMenuImpl.cpp
diff --git a/third_party/WebKit/Source/web/PopupMenuImpl.cpp b/third_party/WebKit/Source/web/PopupMenuImpl.cpp
index fb5b708e805c7daee9cf85d58a25c2ec790db557..63b1a6620a15b9d9fd84677cfbb631491353003a 100644
--- a/third_party/WebKit/Source/web/PopupMenuImpl.cpp
+++ b/third_party/WebKit/Source/web/PopupMenuImpl.cpp
@@ -289,9 +289,11 @@ void PopupMenuImpl::writeDocument(SharedBuffer* data)
context.finishGroupIfNecessary();
PagePopupClient::addString("],\n", data);
- float zoom = zoomFactor();
addProperty("anchorRectInScreen", anchorRectInScreen, data);
- addProperty("zoomFactor", zoom, data);
+ float zoom = zoomFactor();
+ IntRect inScreen = m_chromeClient->viewportToScreen(IntRect(0, 0, 100, 0));
oshima 2015/12/08 21:21:32 Please let me know if you prefer to add a separate
+ float scaleFactor = 100.f / inScreen.width();
+ addProperty("zoomFactor", zoom / scaleFactor, data);
oshima 2015/12/08 21:21:32 Please let me know if you prefer to rename zoomFac
bool isRTL = !ownerStyle->isLeftToRightDirection();
addProperty("isRTL", isRTL, data);
addProperty("paddingStart", isRTL ? ownerElement.clientPaddingRight().toDouble() / zoom : ownerElement.clientPaddingLeft().toDouble() / zoom, data);

Powered by Google App Engine
This is Rietveld 408576698