Changeset 244042 in webkit
- Timestamp:
- Apr 8, 2019, 1:50:08 PM (7 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h (modified) (1 diff)
-
UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r244035 r244042 1 2019-04-08 Antti Koivisto <antti@apple.com> 2 3 Compute touch actions for touch point from remote layer tree regions 4 https://bugs.webkit.org/show_bug.cgi?id=196701 5 6 Reviewed by Simon Fraser. 7 8 Add a function for finding the right layer and getting the touch actions in UI process side. 9 10 The code is not used yet. 11 12 * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h: 13 * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm: 14 (WebKit::touchActionsForPoint): 15 16 Use the same code as overlap hit testing for collecting the candidate layers for the touch point, 17 taking event regions into account. 18 Return the touch actions from the deepest event sensitive layer hit. 19 20 (-[UIView _web_findDescendantViewAtPoint:withEvent:]): 21 22 Modernize. 23 1 24 2019-04-08 Brent Fulgham <bfulgham@apple.com> 2 25 -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h
r243134 r244042 73 73 @end 74 74 75 namespace WebKit { 76 77 #if ENABLE(POINTER_EVENTS) 78 OptionSet<WebCore::TouchAction> touchActionsForPoint(UIView *rootView, const WebCore::IntPoint&); 79 #endif 80 81 } 82 75 83 #endif // PLATFORM(IOS_FAMILY) -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm
r243380 r244042 90 90 } 91 91 92 #if ENABLE(POINTER_EVENTS) 93 OptionSet<WebCore::TouchAction> touchActionsForPoint(UIView *rootView, const WebCore::IntPoint& point) 94 { 95 Vector<UIView *, 16> viewsAtPoint; 96 collectDescendantViewsAtPoint(viewsAtPoint, rootView, point, nil); 97 98 if (viewsAtPoint.isEmpty()) 99 return { WebCore::TouchAction::Auto }; 100 101 auto *hitView = viewsAtPoint.last(); 102 103 CGPoint hitViewPoint = [hitView convertPoint:point fromView:rootView]; 104 105 auto* node = RemoteLayerTreeNode::forCALayer(hitView.layer); 106 if (!node) 107 return { WebCore::TouchAction::Auto }; 108 109 return node->eventRegion().touchActionsForPoint(WebCore::IntPoint(hitViewPoint)); 110 } 111 #endif 112 92 113 } 93 114 … … 103 124 WebKit::collectDescendantViewsAtPoint(viewsAtPoint, self, point, event); 104 125 105 for (auto i = viewsAtPoint.size(); i--;) { 106 auto *view = viewsAtPoint[i]; 126 for (auto *view : WTF::makeReversedRange(viewsAtPoint)) { 107 127 if (!view.isUserInteractionEnabled) 108 128 continue;
Note:
See TracChangeset
for help on using the changeset viewer.