diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-05-05 15:22:25 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-05-05 15:22:44 +0200 |
commit | 4f62685dfa09d64a8fcd2de9ed0adb7fe5747b78 (patch) | |
tree | 9dc9c3ba8ab461f7ee3d444222246be5ed55ae3f /chromium/third_party/WebKit/Source/web/WebInputEventConversion.cpp | |
parent | 19de26b7efd6b993f2af26cf435f04c716d3f5bc (diff) | |
parent | bb09965444b5bb20b096a291445170876225268d (diff) | |
download | qtwebengine-chromium-4f62685dfa09d64a8fcd2de9ed0adb7fe5747b78.tar.gz |
Merge branch 'upstream-master' into 58-based
Change-Id: I8c280ca9068fdda9cf6276725bfb8608eccb497a
Diffstat (limited to 'chromium/third_party/WebKit/Source/web/WebInputEventConversion.cpp')
-rw-r--r-- | chromium/third_party/WebKit/Source/web/WebInputEventConversion.cpp | 12 |
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; |