Title: [256433] trunk/Source/WebKit
- Revision
- 256433
- Author
- [email protected]
- Date
- 2020-02-12 07:39:14 -0800 (Wed, 12 Feb 2020)
Log Message
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:]):
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (256432 => 256433)
--- trunk/Source/WebKit/ChangeLog 2020-02-12 15:32:51 UTC (rev 256432)
+++ trunk/Source/WebKit/ChangeLog 2020-02-12 15:39:14 UTC (rev 256433)
@@ -1,3 +1,26 @@
+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 Youenn Fablet <[email protected]>
WebSWServerConnection::registerServiceWorkerClient is not sending IPC message to UIProcess when it should
Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm (256432 => 256433)
--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm 2020-02-12 15:32:51 UTC (rev 256432)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm 2020-02-12 15:39:14 UTC (rev 256433)
@@ -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