Title: [255691] trunk/Source/WebKit
Revision
255691
Author
[email protected]
Date
2020-02-04 13:35:36 -0800 (Tue, 04 Feb 2020)

Log Message

[macCatalyst] Missing custom cursors in subframes that are offset from the origin of the root view
https://bugs.webkit.org/show_bug.cgi?id=207215
<rdar://problem/59157625>

Reviewed by Tim Horton.

<https://trac.webkit.org/r255046> added support for custom cursor styles when hovering over subframes. However,
we currently try to hit-test content in the subframe using the interaction information request's point, which is
in root view coordinates; as such, we only get the correct custom cursor styles when hovering over elements in a
subframe, if the subframe is also at the origin of the root view.

To fix this, simply convert from root view coordinates to frame coordinates when performing the hit-test.
Unfortunately, this change is currently untestable; see <rdar://problem/59158410>.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::lineCaretExtent):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (255690 => 255691)


--- trunk/Source/WebKit/ChangeLog	2020-02-04 20:01:42 UTC (rev 255690)
+++ trunk/Source/WebKit/ChangeLog	2020-02-04 21:35:36 UTC (rev 255691)
@@ -1,3 +1,22 @@
+2020-02-04  Wenson Hsieh  <[email protected]>
+
+        [macCatalyst] Missing custom cursors in subframes that are offset from the origin of the root view
+        https://bugs.webkit.org/show_bug.cgi?id=207215
+        <rdar://problem/59157625>
+
+        Reviewed by Tim Horton.
+
+        <https://trac.webkit.org/r255046> added support for custom cursor styles when hovering over subframes. However,
+        we currently try to hit-test content in the subframe using the interaction information request's point, which is
+        in root view coordinates; as such, we only get the correct custom cursor styles when hovering over elements in a
+        subframe, if the subframe is also at the origin of the root view.
+
+        To fix this, simply convert from root view coordinates to frame coordinates when performing the hit-test.
+        Unfortunately, this change is currently untestable; see <rdar://problem/59158410>.
+
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::lineCaretExtent):
+
 2020-02-04  Megan Gardner  <[email protected]>
 
         Fixed Deprecated API

Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (255690 => 255691)


--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2020-02-04 20:01:42 UTC (rev 255690)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2020-02-04 21:35:36 UTC (rev 255691)
@@ -2764,10 +2764,14 @@
 
 static FloatRect lineCaretExtent(const InteractionInformationRequest& request, const HitTestResult& hitTestResult)
 {
-    auto* frame = hitTestResult.innerNodeFrame();
+    auto frame = makeRefPtr(hitTestResult.innerNodeFrame());
     if (!frame)
         return { };
 
+    auto view = makeRefPtr(frame->view());
+    if (!view)
+        return { };
+
     auto* renderer = hitTestResult.innerNode()->renderer();
     if (!renderer)
         return { };
@@ -2781,7 +2785,7 @@
     // FIXME: We should be able to retrieve this geometry information without
     // forcing the text to fall out of Simple Line Layout.
     auto& blockFlow = downcast<RenderBlockFlow>(*renderer);
-    VisiblePosition position = frame->visiblePositionForPoint(request.point);
+    auto position = frame->visiblePositionForPoint(view->rootViewToContents(request.point));
     auto lineRect = position.absoluteSelectionBoundsForLine();
     lineRect.setWidth(blockFlow.contentWidth());
     return lineRect;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to