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

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: 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
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 6807b84f75dbe9784498dccca79629a8813bcc30..ddfe07a51c36793285ed3645f3ddc892144c6ea2 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));
+ float scaleFactor = 100.f / inScreen.width();
+ addProperty("zoomFactor", zoom / scaleFactor, data);
bool isRTL = !ownerStyle->isLeftToRightDirection();
addProperty("isRTL", isRTL, data);
addProperty("paddingStart", isRTL ? ownerElement.clientPaddingRight().toDouble() / zoom : ownerElement.clientPaddingLeft().toDouble() / zoom, data);
« no previous file with comments | « third_party/WebKit/Source/web/DateTimeChooserImpl.cpp ('k') | third_party/WebKit/Source/web/WebPagePopupImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698