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

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

Issue 2814473003: 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
Index: third_party/WebKit/Source/web/WebPluginContainerImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp b/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp
index 7802cd487bbc30deeef86de85c1bef7fb4cb9b58..0df3c95919b96add10d2e2eb5f10f0156a943e12 100644
--- a/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp
@@ -830,9 +830,18 @@ void WebPluginContainerImpl::HandleTouchEvent(TouchEvent* event) {
WebTouchEvent transformed_event =
event->NativeEvent()->FlattenTransform();
+ FrameView* view = ToFrameView(Parent());
+
for (unsigned i = 0; i < transformed_event.touches_length; ++i) {
WebFloatPoint absolute_root_frame_location =
transformed_event.touches[i].position;
+
+ // Translate the absolute position to content coordinates.
+ if (view) {
+ absolute_root_frame_location =
+ view->RootFrameToContents(absolute_root_frame_location);
+ }
+
IntPoint local_point =
RoundedIntPoint(element_->GetLayoutObject()->AbsoluteToLocal(
absolute_root_frame_location, kUseTransforms));

Powered by Google App Engine
This is Rietveld 408576698