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/WebPluginContainerImpl.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/WebPluginContainerImpl.cpp')
-rw-r--r-- | chromium/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/chromium/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp b/chromium/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp index dfce5182a81..ad9aa19e129 100644 --- a/chromium/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp +++ b/chromium/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp @@ -761,11 +761,16 @@ void WebPluginContainerImpl::handleDragEvent(MouseEvent* event) { } void WebPluginContainerImpl::handleWheelEvent(WheelEvent* event) { - WebFloatPoint absoluteRootFrameLocation = - event->nativeEvent().positionInRootFrame(); + WebFloatPoint absoluteLocation = event->nativeEvent().positionInRootFrame(); + FrameView* view = toFrameView(parent()); + // Translate the root frame position to content coordinates. + if (view) { + absoluteLocation = view->rootFrameToContents(absoluteLocation); + } + IntPoint localPoint = roundedIntPoint(m_element->layoutObject()->absoluteToLocal( - absoluteRootFrameLocation, UseTransforms)); + absoluteLocation, UseTransforms)); WebMouseWheelEvent translatedEvent = event->nativeEvent().flattenTransform(); translatedEvent.x = localPoint.x(); translatedEvent.y = localPoint.y(); @@ -826,12 +831,17 @@ void WebPluginContainerImpl::handleTouchEvent(TouchEvent* event) { WebTouchEvent transformedEvent = event->nativeEvent()->flattenTransform(); + FrameView* view = toFrameView(parent()); + for (unsigned i = 0; i < transformedEvent.touchesLength; ++i) { - WebFloatPoint absoluteRootFrameLocation = - transformedEvent.touches[i].position; + WebFloatPoint absoluteLocation = transformedEvent.touches[i].position; + // Translate the root frame position to content coordinates. + if (view) { + absoluteLocation = view->rootFrameToContents(absoluteLocation); + } IntPoint localPoint = roundedIntPoint(m_element->layoutObject()->absoluteToLocal( - absoluteRootFrameLocation, UseTransforms)); + absoluteLocation, UseTransforms)); transformedEvent.touches[i].position.x = localPoint.x(); transformedEvent.touches[i].position.y = localPoint.y(); } |