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

Unified Diff: Source/WebKit/chromium/src/PopupContainer.cpp

Issue 15877005: Popup menu is not aligned with the select element if inside a transformed webview. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added comment Created 7 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/chromium/src/PopupContainer.cpp
diff --git a/Source/WebKit/chromium/src/PopupContainer.cpp b/Source/WebKit/chromium/src/PopupContainer.cpp
index 901f33c583b60c09b4ac543bd8562c1f4184c5cd..eb6fc40c9e619692e2a36b8496f86ae55d971b74 100644
--- a/Source/WebKit/chromium/src/PopupContainer.cpp
+++ b/Source/WebKit/chromium/src/PopupContainer.cpp
@@ -386,10 +386,14 @@ void PopupContainer::showInRect(const FloatQuad& controlPosition, const IntSize&
// FIXME: make sure this is correct, and add an assertion.
// ASSERT(popupWindow(popup)->listBox()->selectedIndex() == index);
- // Save and convert the controlPosition to main window coords.
- m_controlPosition = controlPosition;
- IntPoint delta = v->contentsToWindow(IntPoint());
- m_controlPosition.move(delta.x(), delta.y());
+ // Save and convert the controlPosition to main window coords. Each point is converted separately
+ // to window coordinates because the control could be in a transformed webview and then each point
+ // would be transformed by a different delta.
+ m_controlPosition.setP1(v->contentsToWindow(IntPoint(controlPosition.p1().x(), controlPosition.p1().y())));
+ m_controlPosition.setP2(v->contentsToWindow(IntPoint(controlPosition.p2().x(), controlPosition.p2().y())));
+ m_controlPosition.setP3(v->contentsToWindow(IntPoint(controlPosition.p3().x(), controlPosition.p3().y())));
+ m_controlPosition.setP4(v->contentsToWindow(IntPoint(controlPosition.p4().x(), controlPosition.p4().y())));
+
m_controlSize = controlSize;
// Position at (0, 0) since the frameRect().location() is relative to the
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698