Title: [174199] trunk/Source/WebCore
Revision
174199
Author
commit-qu...@webkit.org
Date
2014-10-01 23:10:59 -0700 (Wed, 01 Oct 2014)

Log Message

Click events offset in webkit-overflow-scrolling iframes
https://bugs.webkit.org/show_bug.cgi?id=134596

Patch by Benjamin Poulain <bpoul...@apple.com> on 2014-10-01
Reviewed by Sam Weinig.

* platform/ScrollView.cpp:
(WebCore::ScrollView::visibleContentRectInternal):
When converting coordinates from the main frame to a subframe's document, the position
is first converted to the subframe's FrameView coordinate system, then offset by the scroll
offset of the subframe itself.

The bug in this case was that the scroll offset used was the global scroll offset of the frame
in the view instead of the scroll offset of the document in its own frameview.

The regression was introduced by the refactoring r162663. On iOS WebKit1, the coordinate system
is different depending on VisibleContentRectIncludesScrollbars. In r162663, the value was set
such that the rect returned is always in absolute coordinate.

The ideal solution would be to refactor ScrollView::platformVisibleContentRect() to always return
the offsets in scroll view coordinates and verify and update all the call sites to use explicit
conversion to the top frame. In this patch I only reverted the coordinate change of r162663 to avoid
large scale impact.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (174198 => 174199)


--- trunk/Source/WebCore/ChangeLog	2014-10-02 05:25:56 UTC (rev 174198)
+++ trunk/Source/WebCore/ChangeLog	2014-10-02 06:10:59 UTC (rev 174199)
@@ -1,3 +1,28 @@
+2014-10-01  Benjamin Poulain  <bpoul...@apple.com>
+
+        Click events offset in webkit-overflow-scrolling iframes
+        https://bugs.webkit.org/show_bug.cgi?id=134596
+
+        Reviewed by Sam Weinig.
+
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::visibleContentRectInternal):
+        When converting coordinates from the main frame to a subframe's document, the position
+        is first converted to the subframe's FrameView coordinate system, then offset by the scroll
+        offset of the subframe itself.
+
+        The bug in this case was that the scroll offset used was the global scroll offset of the frame
+        in the view instead of the scroll offset of the document in its own frameview.
+
+        The regression was introduced by the refactoring r162663. On iOS WebKit1, the coordinate system
+        is different depending on VisibleContentRectIncludesScrollbars. In r162663, the value was set
+        such that the rect returned is always in absolute coordinate.
+
+        The ideal solution would be to refactor ScrollView::platformVisibleContentRect() to always return
+        the offsets in scroll view coordinates and verify and update all the call sites to use explicit
+        conversion to the top frame. In this patch I only reverted the coordinate change of r162663 to avoid
+        large scale impact.
+
 2014-10-01  Christophe Dumez  <cdu...@apple.com>
 
         Use is<>() / downcast<>() for File

Modified: trunk/Source/WebCore/platform/ScrollView.cpp (174198 => 174199)


--- trunk/Source/WebCore/platform/ScrollView.cpp	2014-10-02 05:25:56 UTC (rev 174198)
+++ trunk/Source/WebCore/platform/ScrollView.cpp	2014-10-02 06:10:59 UTC (rev 174199)
@@ -310,7 +310,7 @@
 #if PLATFORM(IOS)
     if (visibleContentRectBehavior == LegacyIOSDocumentViewRect) {
         if (platformWidget())
-            return platformVisibleContentRect(true /* include scrollbars */);
+            return platformVisibleContentRect(scrollbarInclusion == IncludeScrollbars);
     }
     
     if (platformWidget())
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to