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

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

Issue 2813903006: Fix frame coordinate translation issue with scroll views. (Closed)
Patch Set: Created 3 years, 8 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 | third_party/WebKit/Source/web/WebPluginContainerImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebInputEventConversion.cpp
diff --git a/third_party/WebKit/Source/web/WebInputEventConversion.cpp b/third_party/WebKit/Source/web/WebInputEventConversion.cpp
index 819d69611709e83ee6df427fc9331337c5f3c5f7..140af9d4cb7bc2f6061f945ae34a35e9a064b9e1 100644
--- a/third_party/WebKit/Source/web/WebInputEventConversion.cpp
+++ b/third_party/WebKit/Source/web/WebInputEventConversion.cpp
@@ -201,9 +201,17 @@ WebMouseEventBuilder::WebMouseEventBuilder(const FrameViewBase* frameViewBase,
if (event.nativeEvent()) {
*static_cast<WebMouseEvent*>(this) =
event.nativeEvent()->flattenTransform();
- WebFloatPoint absoluteRootFrameLocation = positionInRootFrame();
+ WebFloatPoint absoluteLocation = positionInRootFrame();
+
+ FrameView* view = frameViewBase ? toFrameView(frameViewBase->parent()) : 0;
+
+ // Translate the root frame position to content coordinates.
+ if (view) {
+ absoluteLocation = view->rootFrameToContents(absoluteLocation);
+ }
+
IntPoint localPoint = roundedIntPoint(
- layoutItem.absoluteToLocal(absoluteRootFrameLocation, UseTransforms));
+ layoutItem.absoluteToLocal(absoluteLocation, UseTransforms));
x = localPoint.x();
y = localPoint.y();
return;
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/WebPluginContainerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698