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

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

Issue 1603253003: Add dedicated windowToViewport method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/PopupMenuImpl.cpp
diff --git a/third_party/WebKit/Source/web/PopupMenuImpl.cpp b/third_party/WebKit/Source/web/PopupMenuImpl.cpp
index dc76843fc821f3267bedc33fc361ea9564a2a390..e9577f0fd87740308d6a97712bc06a0abf8ac4e6 100644
--- a/third_party/WebKit/Source/web/PopupMenuImpl.cpp
+++ b/third_party/WebKit/Source/web/PopupMenuImpl.cpp
@@ -290,8 +290,7 @@ void PopupMenuImpl::writeDocument(SharedBuffer* data)
addProperty("anchorRectInScreen", anchorRectInScreen, data);
float zoom = zoomFactor();
- IntRect inScreen = m_chromeClient->viewportToScreen(IntRect(0, 0, 100, 0));
- float scaleFactor = 100.f / inScreen.width();
+ float scaleFactor = m_chromeClient->windowToViewport(FloatRect(0, 0, 1.0f, 0)).width();
addProperty("zoomFactor", zoom / scaleFactor, data);
bool isRTL = !ownerStyle->isLeftToRightDirection();
addProperty("isRTL", isRTL, data);

Powered by Google App Engine
This is Rietveld 408576698