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

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

Issue 2814473003: Fix frame coordinate translation issue with scroll views. (Closed)
Patch Set: Add unittest 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/WebInputEventConversion.cpp
diff --git a/third_party/WebKit/Source/web/WebInputEventConversion.cpp b/third_party/WebKit/Source/web/WebInputEventConversion.cpp
index 7b9defc7bf238a88ca6681c5367b07a8f38c8403..b7092abc7a0a7448b8ad936dc455bef3ab22314a 100644
--- a/third_party/WebKit/Source/web/WebInputEventConversion.cpp
+++ b/third_party/WebKit/Source/web/WebInputEventConversion.cpp
@@ -196,6 +196,13 @@ WebMouseEventBuilder::WebMouseEventBuilder(const FrameView* plugin_parent,
*static_cast<WebMouseEvent*>(this) =
event.NativeEvent()->FlattenTransform();
WebFloatPoint absolute_root_frame_location = PositionInRootFrame();
mustaq 2017/04/12 15:38:38 Nit: after flattening, s/PositionInRootFrame()/Pos
bokan 2017/04/12 17:28:44 Isn't the transform what gets us from Widget to Ro
mustaq 2017/04/12 17:52:04 |PositionInRootFrame| is correct but I thought |Po
dtapuska 2017/04/12 19:02:56 Ya it is the same. But for readability sake we pro
+
+ // Translate the root frame position to content coordinates.
+ if (plugin_parent) {
bokan 2017/04/12 17:28:44 There seems to be only one call site and plugin_pa
dtapuska 2017/04/12 19:02:56 Done.
+ absolute_root_frame_location =
+ plugin_parent->RootFrameToContents(absolute_root_frame_location);
+ }
+
IntPoint local_point = RoundedIntPoint(layout_item.AbsoluteToLocal(
absolute_root_frame_location, kUseTransforms));
SetPositionInWidget(local_point.X(), local_point.Y());

Powered by Google App Engine
This is Rietveld 408576698