summaryrefslogtreecommitdiff
path: root/chromium/third_party/WebKit/Source/web/WebInputEventConversion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/WebKit/Source/web/WebInputEventConversion.cpp')
-rw-r--r--chromium/third_party/WebKit/Source/web/WebInputEventConversion.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/chromium/third_party/WebKit/Source/web/WebInputEventConversion.cpp b/chromium/third_party/WebKit/Source/web/WebInputEventConversion.cpp
index 819d6961170..140af9d4cb7 100644
--- a/chromium/third_party/WebKit/Source/web/WebInputEventConversion.cpp
+++ b/chromium/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;