Title: [256557] branches/safari-609-branch/Source/WebKit
Revision
256557
Author
[email protected]
Date
2020-02-13 14:57:54 -0800 (Thu, 13 Feb 2020)

Log Message

Cherry-pick r256433. rdar://problem/59412971

    macCatalyst: Unable to grab scrollbar on editable text field
    https://bugs.webkit.org/show_bug.cgi?id=207615
    <rdar://problem/59212993>

    Reviewed by Tim Horton.

    In macCatalyst, hovering over the scrollbar (an instance of the internal UIKit class
    `_UIScrollViewScrollIndicator`) is required in order for a click and drag with the mouse to actually move the
    scrollbar. This is because UIKit depends on the cursor interaction added to this view to recognize and call its
    delegate methods.

    However, we override hit-testing in WebKit to skip over all children of scroll views, and instead force hit-
    testing to find the scroll view instead. This means that UIKit can never hit-test to the scroll indicator views
    embedded directly beneath each WKChildScrollView, so the cursor interactions described earlier will not
    recognize. To work around this, special case these scroll indicator views, such that we will allow
    -hitTest:withEvent: to find these views.

    * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
    (WebKit::scrollViewScrollIndicatorClass):
    (-[UIView _web_findDescendantViewAtPoint:withEvent:]):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256433 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-609-branch/Source/WebKit/ChangeLog (256556 => 256557)


--- branches/safari-609-branch/Source/WebKit/ChangeLog	2020-02-13 22:57:49 UTC (rev 256556)
+++ branches/safari-609-branch/Source/WebKit/ChangeLog	2020-02-13 22:57:54 UTC (rev 256557)
@@ -1,3 +1,54 @@
+2020-02-13  Russell Epstein  <[email protected]>
+
+        Cherry-pick r256433. rdar://problem/59412971
+
+    macCatalyst: Unable to grab scrollbar on editable text field
+    https://bugs.webkit.org/show_bug.cgi?id=207615
+    <rdar://problem/59212993>
+    
+    Reviewed by Tim Horton.
+    
+    In macCatalyst, hovering over the scrollbar (an instance of the internal UIKit class
+    `_UIScrollViewScrollIndicator`) is required in order for a click and drag with the mouse to actually move the
+    scrollbar. This is because UIKit depends on the cursor interaction added to this view to recognize and call its
+    delegate methods.
+    
+    However, we override hit-testing in WebKit to skip over all children of scroll views, and instead force hit-
+    testing to find the scroll view instead. This means that UIKit can never hit-test to the scroll indicator views
+    embedded directly beneath each WKChildScrollView, so the cursor interactions described earlier will not
+    recognize. To work around this, special case these scroll indicator views, such that we will allow
+    -hitTest:withEvent: to find these views.
+    
+    * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
+    (WebKit::scrollViewScrollIndicatorClass):
+    (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256433 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-02-12  Wenson Hsieh  <[email protected]>
+
+            macCatalyst: Unable to grab scrollbar on editable text field
+            https://bugs.webkit.org/show_bug.cgi?id=207615
+            <rdar://problem/59212993>
+
+            Reviewed by Tim Horton.
+
+            In macCatalyst, hovering over the scrollbar (an instance of the internal UIKit class
+            `_UIScrollViewScrollIndicator`) is required in order for a click and drag with the mouse to actually move the
+            scrollbar. This is because UIKit depends on the cursor interaction added to this view to recognize and call its
+            delegate methods.
+
+            However, we override hit-testing in WebKit to skip over all children of scroll views, and instead force hit-
+            testing to find the scroll view instead. This means that UIKit can never hit-test to the scroll indicator views
+            embedded directly beneath each WKChildScrollView, so the cursor interactions described earlier will not
+            recognize. To work around this, special case these scroll indicator views, such that we will allow
+            -hitTest:withEvent: to find these views.
+
+            * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
+            (WebKit::scrollViewScrollIndicatorClass):
+            (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
+
 2020-02-12  Alan Coon  <[email protected]>
 
         Cherry-pick r254859. rdar://problem/59298172

Modified: branches/safari-609-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm (256556 => 256557)


--- branches/safari-609-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm	2020-02-13 22:57:49 UTC (rev 256556)
+++ branches/safari-609-branch/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm	2020-02-13 22:57:54 UTC (rev 256557)
@@ -152,8 +152,18 @@
     return nil;
 }
 
+static Class scrollViewScrollIndicatorClass()
+{
+    static dispatch_once_t onceToken;
+    static Class scrollIndicatorClass;
+    dispatch_once(&onceToken, ^{
+        scrollIndicatorClass = NSClassFromString(@"_UIScrollViewScrollIndicator");
+    });
+    return scrollIndicatorClass;
 }
 
+}
+
 @interface UIView (WKHitTesting)
 - (UIView *)_web_findDescendantViewAtPoint:(CGPoint)point withEvent:(UIEvent *)event;
 @end
@@ -181,6 +191,13 @@
             }
         }
 
+        if ([view isKindOfClass:WebKit::scrollViewScrollIndicatorClass()] && [view.superview isKindOfClass:WKChildScrollView.class]) {
+            if (WebKit::isScrolledBy((WKChildScrollView *)view.superview, viewsAtPoint.last())) {
+                LOG_WITH_STREAM(UIHitTesting, stream << " " << (void*)view << " is the scroll indicator of child scroll view, which is scrolled by " << (void*)viewsAtPoint.last());
+                return view;
+            }
+        }
+
         LOG_WITH_STREAM(UIHitTesting, stream << " ignoring " << [view class] << " " << (void*)view);
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to