Changeset 245639 in webkit
- Timestamp:
- May 22, 2019, 12:58:15 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 20 edited
- 1 moved
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/resources/testdriver-vendor.js (modified) (3 diffs)
-
LayoutTests/platform/ios/imported/w3c/web-platform-tests/pointerevents (added)
-
LayoutTests/platform/ios/imported/w3c/web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_click-expected.txt (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Headers.cmake (modified) (2 diffs)
-
Source/WebCore/WebCore.xcodeproj/project.pbxproj (modified) (4 diffs)
-
Source/WebCore/dom/Element.cpp (modified) (2 diffs)
-
Source/WebCore/dom/PointerEvent.h (modified) (3 diffs)
-
Source/WebCore/page/PointerCaptureController.cpp (modified) (2 diffs)
-
Source/WebCore/page/PointerCaptureController.h (modified) (1 diff)
-
Source/WebCore/platform/PlatformMouseEvent.h (modified) (5 diffs)
-
Source/WebCore/platform/PointerID.h (moved) (moved from trunk/Source/WebCore/dom/PointerID.h ) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/UIProcess/WebPageProxy.h (modified) (1 diff)
-
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (modified) (4 diffs)
-
Source/WebKit/UIProcess/ios/WKSyntheticTapGestureRecognizer.h (modified) (1 diff)
-
Source/WebKit/UIProcess/ios/WKSyntheticTapGestureRecognizer.m (modified) (1 diff)
-
Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm (modified) (2 diffs)
-
Source/WebKit/WebProcess/WebPage/WebPage.h (modified) (3 diffs)
-
Source/WebKit/WebProcess/WebPage/WebPage.messages.in (modified) (1 diff)
-
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r245638 r245639 1 2019-05-22 Antoine Quint <graouts@apple.com> 2 3 [iOS] Compatibility mouse events aren't prevented by calling preventDefault() on pointerdown 4 https://bugs.webkit.org/show_bug.cgi?id=198124 5 <rdar://problem/50410863> 6 7 Reviewed by Tim Horton. 8 9 We're adding an iOS-specific expectation since this test prints out the pointer type detected while it runs, which is "touch" 10 on iOS and "mouse" in the expectation that already exists for macOS. 11 12 * platform/ios/imported/w3c/web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_click-expected.txt: Added. 13 1 14 2019-05-22 Jiewen Tan <jiewen_tan@apple.com> 2 15 -
trunk/LayoutTests/imported/w3c/ChangeLog
r245625 r245639 1 2019-05-22 Antoine Quint <graouts@apple.com> 2 3 [iOS] Compatibility mouse events aren't prevented by calling preventDefault() on pointerdown 4 https://bugs.webkit.org/show_bug.cgi?id=198124 5 <rdar://problem/50410863> 6 7 Reviewed by Tim Horton. 8 9 We add basic support to run a test that wasn't specifically designed for a touch-based interaction such that the test 10 at imported/w3c/web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_click.html may run on iOS. The 11 trick here is to add a pause after a touch ends to avoid the likelihood or two tap gestures triggering a double tap. 12 13 * web-platform-tests/resources/testdriver-vendor.js: 14 1 15 2019-05-22 Youenn Fablet <youenn@apple.com> 2 16 -
trunk/LayoutTests/imported/w3c/web-platform-tests/resources/testdriver-vendor.js
r245584 r245639 47 47 } 48 48 49 function dispatchTouchActions(actions )49 function dispatchTouchActions(actions, options = { insertPauseAfterPointerUp: false }) 50 50 { 51 51 if (!window.testRunner || typeof window.testRunner.runUIScript !== "function") … … 100 100 touch.y = y; 101 101 id++; 102 // We need to add a pause after a pointer up to ensure that a subsequent tap may be recognized as such. 103 if (options.insertPauseAfterPointerUp) 104 timeOffsetIncrease = 0.5; 102 105 break; 103 106 case "pause": … … 174 177 logDebug(() => JSON.stringify(pointerSource)); 175 178 179 if (pointerType === "touch") 180 return dispatchTouchActions(pointerSource.actions); 181 if ("createTouch" in document) 182 return dispatchTouchActions(pointerSource.actions, { insertPauseAfterPointerUp: true }); 176 183 if (pointerType === "mouse") 177 184 return dispatchMouseActions(pointerSource.actions); 178 if (pointerType === "touch")179 return dispatchTouchActions(pointerSource.actions);180 185 }; -
trunk/Source/WebCore/ChangeLog
r245638 r245639 1 2019-05-22 Antoine Quint <graouts@apple.com> 2 3 [iOS] Compatibility mouse events aren't prevented by calling preventDefault() on pointerdown 4 https://bugs.webkit.org/show_bug.cgi?id=198124 5 <rdar://problem/50410863> 6 7 Reviewed by Tim Horton. 8 9 This fix builds atop the one made for wkb.ug/198072 which fixes this bug on macOS alone. 10 11 In order to correctly prevent "compatibility" mouse events from being dispatched when the initial "pointerdown" event had preventDefault() 12 called while handled, we need to pass the PointerID for the touch that triggered a tap gesture in the UI process down in the Web process 13 and into the resulting PlatformMouseEvent. This will allow upon dispatch of a PlatformMouseEvent to call into PointerCaptureController 14 to identify if the dispatch of mouse events is allowed for the event's PointerID. 15 16 To support this, some refactoring was required. The PointerID header is now under platform/ such that PlatformMouseEvent may safely use it. 17 Additionally, PointerEvent::defaultMousePointerIdentifier() is now a global mousePointerID defined in PointerID.h. 18 19 Finally, PointerCaptureController::touchEndedOrWasCancelledForIdentifier() has been renamed to PointerCaptureController::touchWithIdentifierWasRemoved() and 20 has WEBCORE_EXPORT such that it may be called from WebKit as the indication that a pointer is no longer active will now be initiated in WebKit 21 on the UI process side. 22 23 Testing is covered by the pre-existing imported/w3c/web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_click.html 24 which will now run on iOS through a change to WebKitAdditions. 25 26 * Headers.cmake: 27 * WebCore.xcodeproj/project.pbxproj: 28 * dom/Element.cpp: 29 (WebCore::Element::dispatchMouseEvent): When dealing with a mouse event on iOS, check whether the mouse event's PointerID allows for compatibility 30 mouse events to be dispatched using PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier(). The "click" event is not a compatibility 31 mouse event. 32 * dom/PointerEvent.h: 33 * page/PointerCaptureController.cpp: 34 (WebCore::PointerCaptureController::PointerCaptureController): 35 (WebCore::PointerCaptureController::touchWithIdentifierWasRemoved): 36 (WebCore::PointerCaptureController::touchEndedOrWasCancelledForIdentifier): Deleted. 37 * page/PointerCaptureController.h: 38 * platform/PlatformMouseEvent.h: 39 (WebCore::PlatformMouseEvent::PlatformMouseEvent): 40 (WebCore::PlatformMouseEvent::pointerId const): 41 * platform/PointerID.h: Renamed from Source/WebCore/dom/PointerID.h. 42 (WebCore::mousePointerID): 43 1 44 2019-05-22 Jiewen Tan <jiewen_tan@apple.com> 2 45 -
trunk/Source/WebCore/Headers.cmake
r245638 r245639 421 421 dom/NodeTraversal.h 422 422 dom/OverflowEvent.h 423 dom/PointerID.h424 423 dom/Position.h 425 424 dom/ProcessingInstruction.h … … 929 928 platform/PlatformTouchPoint.h 930 929 platform/PlatformWheelEvent.h 930 platform/PointerID.h 931 931 platform/PopupMenu.h 932 932 platform/PopupMenuClient.h -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r245638 r245639 932 932 316FE11A0E6E1DA700BF6088 /* KeyframeAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 316FE1100E6E1DA700BF6088 /* KeyframeAnimation.h */; }; 933 933 31741AAD16636609008A5B7E /* SimulatedClickOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 31741AAB16635E45008A5B7E /* SimulatedClickOptions.h */; settings = {ATTRIBUTES = (Private, ); }; }; 934 317D3FF3215599F40034E3B9 /* PointerEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 317D3FF2215599E30034E3B9 /* PointerEvent.h */; };934 317D3FF3215599F40034E3B9 /* PointerEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 317D3FF2215599E30034E3B9 /* PointerEvent.h */; settings = {ATTRIBUTES = (Private, ); }; }; 935 935 31815A311F9A6C8F00FCBF89 /* ImageBitmap.h in Headers */ = {isa = PBXBuildFile; fileRef = 31D26BBF1F86D189008FF255 /* ImageBitmap.h */; settings = {ATTRIBUTES = (Private, ); }; }; 936 936 318436DE21B9DAAF00ED383E /* WebGPULayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 318436DB21B9DAA000ED383E /* WebGPULayer.h */; }; … … 17010 17010 isa = PBXGroup; 17011 17011 children = ( 17012 5215862C229377B7005925EF /* WHLSLAST.h */,17013 17012 1C840B9021EC30F900D0500D /* WHLSLAddressSpace.h */, 17014 17013 C21BF72521CD89E200227979 /* WHLSLArrayReferenceType.h */, 17015 17014 C21BF70921CD89CA00227979 /* WHLSLArrayType.h */, 17016 17015 C21BF73021CD89ED00227979 /* WHLSLAssignmentExpression.h */, 17016 5215862C229377B7005925EF /* WHLSLAST.h */, 17017 17017 C21BF70A21CD89CB00227979 /* WHLSLBaseFunctionAttribute.h */, 17018 17018 C21BF6FA21CD89BE00227979 /* WHLSLBaseSemantic.h */, … … 25315 25315 BCBB8AB613F1AFB000734DF0 /* PODIntervalTree.h */, 25316 25316 BCBB8AB713F1AFB000734DF0 /* PODRedBlackTree.h */, 25317 71EADCD622087E6D0065A45F /* PointerID.h */, 25317 25318 0668E1890ADD9624004128E0 /* PopupMenu.h */, 25318 25319 ABC128760B33AA6D00C693D5 /* PopupMenuClient.h */, … … 27476 27477 317D3FF2215599E30034E3B9 /* PointerEvent.h */, 27477 27478 317D3FEF215599E10034E3B9 /* PointerEvent.idl */, 27478 71EADCD622087E6D0065A45F /* PointerID.h */,27479 27479 5189F0DD10B46B0E00F3C739 /* PopStateEvent.cpp */, 27480 27480 5174E20810A1F44F00F95E6F /* PopStateEvent.h */, -
trunk/Source/WebCore/dom/Element.cpp
r245585 r245639 304 304 bool didNotSwallowEvent = true; 305 305 306 #if ENABLE(POINTER_EVENTS) && !ENABLE(TOUCH_EVENTS)306 #if ENABLE(POINTER_EVENTS) 307 307 if (RuntimeEnabledFeatures::sharedFeatures().pointerEventsEnabled()) { 308 #if ENABLE(TOUCH_EVENTS) 309 if (auto* page = document().page()) { 310 if (mouseEvent->type() != eventNames().clickEvent && page->pointerCaptureController().preventsCompatibilityMouseEventsForIdentifier(platformEvent.pointerId())) 311 return false; 312 } 313 #else 308 314 if (auto pointerEvent = PointerEvent::create(mouseEvent)) { 309 315 if (auto* page = document().page()) { … … 318 324 } 319 325 } 326 #endif 320 327 } 321 328 #endif -
trunk/Source/WebCore/dom/PointerEvent.h
r245020 r245639 41 41 public: 42 42 struct Init : MouseEventInit { 43 PointerID pointerId { PointerEvent::defaultMousePointerIdentifier()};43 PointerID pointerId { mousePointerID }; 44 44 double width { 1 }; 45 45 double height { 1 }; … … 86 86 static const String& penPointerType(); 87 87 static const String& touchPointerType(); 88 static PointerID defaultMousePointerIdentifier() { return 1; }89 88 90 89 virtual ~PointerEvent(); … … 114 113 #endif 115 114 116 PointerID m_pointerId { PointerEvent::defaultMousePointerIdentifier()};115 PointerID m_pointerId { mousePointerID }; 117 116 double m_width { 1 }; 118 117 double m_height { 1 }; -
trunk/Source/WebCore/page/PointerCaptureController.cpp
r245585 r245639 48 48 CapturingData capturingData; 49 49 capturingData.pointerType = PointerEvent::mousePointerType(); 50 m_activePointerIdsToCapturingData.set( PointerEvent::defaultMousePointerIdentifier(), capturingData);50 m_activePointerIdsToCapturingData.set(mousePointerID, capturingData); 51 51 #endif 52 52 } … … 147 147 } 148 148 149 void PointerCaptureController::touch EndedOrWasCancelledForIdentifier(PointerID pointerId)149 void PointerCaptureController::touchWithIdentifierWasRemoved(PointerID pointerId) 150 150 { 151 151 m_activePointerIdsToCapturingData.remove(pointerId); -
trunk/Source/WebCore/page/PointerCaptureController.h
r245585 r245639 53 53 #endif 54 54 55 void touchEndedOrWasCancelledForIdentifier(PointerID);55 WEBCORE_EXPORT void touchWithIdentifierWasRemoved(PointerID); 56 56 bool hasCancelledPointerEventForIdentifier(PointerID); 57 57 bool preventsCompatibilityMouseEventsForIdentifier(PointerID); -
trunk/Source/WebCore/platform/PlatformMouseEvent.h
r223264 r245639 29 29 #include "IntPoint.h" 30 30 #include "PlatformEvent.h" 31 #include "PointerID.h" 31 32 #include <wtf/WindowsExtras.h> 32 33 … … 62 63 63 64 PlatformMouseEvent(const IntPoint& position, const IntPoint& globalPosition, MouseButton button, PlatformEvent::Type type, 64 int clickCount, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey, WallTime timestamp, double force, SyntheticClickType syntheticClickType )65 int clickCount, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey, WallTime timestamp, double force, SyntheticClickType syntheticClickType, PointerID pointerId = mousePointerID) 65 66 : PlatformEvent(type, shiftKey, ctrlKey, altKey, metaKey, timestamp) 66 67 , m_position(position) … … 71 72 , m_force(force) 72 73 , m_syntheticClickType(syntheticClickType) 74 , m_pointerId(pointerId) 73 75 #if PLATFORM(MAC) 74 76 , m_eventNumber(0) … … 92 94 double force() const { return m_force; } 93 95 SyntheticClickType syntheticClickType() const { return m_syntheticClickType; } 96 PointerID pointerId() const { return m_pointerId; } 94 97 95 98 #if PLATFORM(GTK) … … 122 125 double m_force { 0 }; 123 126 SyntheticClickType m_syntheticClickType { NoTap }; 127 PointerID m_pointerId { mousePointerID }; 124 128 125 129 #if PLATFORM(MAC) -
trunk/Source/WebCore/platform/PointerID.h
r245638 r245639 26 26 #pragma once 27 27 28 #if ENABLE(POINTER_EVENTS)29 30 28 namespace WebCore { 31 29 32 30 using PointerID = int32_t; 33 31 32 static PointerID mousePointerID = 1; 33 34 34 } 35 36 #endif // ENABLE(POINTER_EVENTS) -
trunk/Source/WebKit/ChangeLog
r245638 r245639 1 2019-05-22 Antoine Quint <graouts@apple.com> 2 3 [iOS] Compatibility mouse events aren't prevented by calling preventDefault() on pointerdown 4 https://bugs.webkit.org/show_bug.cgi?id=198124 5 <rdar://problem/50410863> 6 7 Reviewed by Tim Horton. 8 9 In order to correctly prevent "compatibility" mouse events from being dispatched when the initial "pointerdown" event had preventDefault() 10 called while handled, we need to pass the PointerID for the touch that triggered a tap gesture in the UI process down in the Web process 11 and into the resulting PlatformMouseEvent. 12 13 This means we need to identify the touch identifier, which is the same as the PointerID used for Pointer Events, in the single tap gesture 14 recognizer, an instance of WKSyntheticTapGestureRecognizer. To do this, we subclass the -[UIResponder touchesEnded:withEvent:] method and 15 track the touch identifier as the lastActiveTouchIdentifier, a new public property of WKSyntheticTapGestureRecognizer. To allow for this, 16 we need the support of the content view's UIWebTouchEventsGestureRecognizer which is exposed to the WKSyntheticTapGestureRecognizer as its 17 supportingWebTouchEventsGestureRecognizer property. This lastActiveTouchIdentifier property is cleared as the gesture recognizer is reset. 18 19 This allows the content view to pass the PointerID down to the Web process starting from -[WKContentView _singleTapRecognized:], going 20 through WebPageProxy::commitPotentialTap() and eventually WebPage::completeSyntheticClick(). 21 22 While we used to tell the PointerCaptureController that a PointerID was no longer active when a given touch ended or was canceled (in 23 WebKitAdditions code), we can no longer do this as the dispatch of a synthetic tap is performed asynchronously and will happen past the 24 dispatch of "pointerup" and "pointercancel" Pointer Events. To clear inactive PointerIDs from the PointerCaptureController, we add a new 25 touchWithIdentifierWasRemoved() method on the WebPage and its proxy. When the WKSyntheticTapGestureRecognizer resets and -[WKContentView _singleTapDidReset:] 26 is called, we call that method which allows for only active PointerIDs to be tracked by the PointerCaptureController. 27 28 * UIProcess/WebPageProxy.h: 29 * UIProcess/ios/WKContentViewInteraction.mm: 30 (-[WKContentView setupInteraction]): 31 (-[WKContentView cleanupInteraction]): 32 (-[WKContentView _singleTapDidReset:]): 33 (-[WKContentView _singleTapRecognized:]): 34 * UIProcess/ios/WKSyntheticTapGestureRecognizer.h: 35 * UIProcess/ios/WKSyntheticTapGestureRecognizer.m: 36 (-[WKSyntheticTapGestureRecognizer reset]): 37 (-[WKSyntheticTapGestureRecognizer touchesEnded:withEvent:]): 38 * UIProcess/ios/WebPageProxyIOS.mm: 39 (WebKit::WebPageProxy::touchWithIdentifierWasRemoved): 40 (WebKit::WebPageProxy::commitPotentialTap): 41 * WebProcess/WebPage/WebPage.h: 42 * WebProcess/WebPage/WebPage.messages.in: 43 * WebProcess/WebPage/ios/WebPageIOS.mm: 44 (WebKit::dispatchSyntheticMouseMove): 45 (WebKit::WebPage::handleSyntheticClick): 46 (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver): 47 (WebKit::WebPage::completeSyntheticClick): 48 (WebKit::WebPage::commitPotentialTap): 49 (WebKit::WebPage::touchWithIdentifierWasRemoved): 50 1 51 2019-05-22 Jiewen Tan <jiewen_tan@apple.com> 2 52 -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r245595 r245639 1213 1213 void willStartUserTriggeredZooming(); 1214 1214 1215 #if ENABLE(POINTER_EVENTS) 1216 void touchWithIdentifierWasRemoved(WebCore::PointerID); 1217 #endif 1218 1215 1219 void potentialTapAtPosition(const WebCore::FloatPoint&, bool shouldRequestMagnificationInformation, uint64_t& requestID); 1216 void commitPotentialTap(OptionSet<WebKit::WebEvent::Modifier>, uint64_t layerTreeTransactionIdAtLastTouchStart );1220 void commitPotentialTap(OptionSet<WebKit::WebEvent::Modifier>, uint64_t layerTreeTransactionIdAtLastTouchStart, WebCore::PointerID); 1217 1221 void cancelPotentialTap(); 1218 1222 void tapHighlightAtPosition(const WebCore::FloatPoint&, uint64_t& requestID); -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r245597 r245639 728 728 [_singleTapGestureRecognizer setGestureIdentifiedTarget:self action:@selector(_singleTapIdentified:)]; 729 729 [_singleTapGestureRecognizer setResetTarget:self action:@selector(_singleTapDidReset:)]; 730 #if ENABLE(POINTER_EVENTS) 731 [_singleTapGestureRecognizer setSupportingWebTouchEventsGestureRecognizer:_touchEventGestureRecognizer.get()]; 732 #endif 730 733 [self addGestureRecognizer:_singleTapGestureRecognizer.get()]; 731 734 … … 865 868 [_singleTapGestureRecognizer setGestureIdentifiedTarget:nil action:nil]; 866 869 [_singleTapGestureRecognizer setResetTarget:nil action:nil]; 870 #if ENABLE(POINTER_EVENTS) 871 [_singleTapGestureRecognizer setSupportingWebTouchEventsGestureRecognizer:nil]; 872 #endif 867 873 [self removeGestureRecognizer:_singleTapGestureRecognizer.get()]; 868 874 … … 2313 2319 ASSERT(gestureRecognizer == _singleTapGestureRecognizer); 2314 2320 cancelPotentialTapIfNecessary(self); 2321 #if ENABLE(POINTER_EVENTS) 2322 if (auto* singleTapTouchIdentifier = [_singleTapGestureRecognizer lastActiveTouchIdentifier]) 2323 _page->touchWithIdentifierWasRemoved([singleTapTouchIdentifier unsignedIntValue]); 2324 #endif 2315 2325 } 2316 2326 … … 2376 2386 RELEASE_LOG(ViewGestures, "Single tap recognized - commit potential tap (%p)", self); 2377 2387 2378 _page->commitPotentialTap(WebKit::webEventModifierFlags(gestureRecognizerModifierFlags(gestureRecognizer)), _layerTreeTransactionIdAtLastTouchStart); 2388 WebCore::PointerID pointerId = WebCore::mousePointerID; 2389 #if ENABLE(POINTER_EVENTS) 2390 if (auto* singleTapTouchIdentifier = [_singleTapGestureRecognizer lastActiveTouchIdentifier]) 2391 pointerId = [singleTapTouchIdentifier unsignedIntValue]; 2392 #endif 2393 _page->commitPotentialTap(WebKit::webEventModifierFlags(gestureRecognizerModifierFlags(gestureRecognizer)), _layerTreeTransactionIdAtLastTouchStart, pointerId); 2379 2394 2380 2395 if (!_isExpectingFastSingleTapCommit) -
trunk/Source/WebKit/UIProcess/ios/WKSyntheticTapGestureRecognizer.h
r244955 r245639 36 36 - (void)setGestureFailedTarget:(id)target action:(SEL)action; 37 37 - (void)setResetTarget:(id)target action:(SEL)action; 38 #if ENABLE(POINTER_EVENTS) 39 @property (nonatomic, weak) UIWebTouchEventsGestureRecognizer *supportingWebTouchEventsGestureRecognizer; 40 @property (nonatomic, readonly) NSNumber *lastActiveTouchIdentifier; 41 #endif 38 42 @end 39 43 -
trunk/Source/WebKit/UIProcess/ios/WKSyntheticTapGestureRecognizer.m
r242757 r245639 71 71 [super reset]; 72 72 [_resetTarget performSelector:_resetAction withObject:self]; 73 _lastActiveTouchIdentifier = nil; 74 } 75 76 - (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event 77 { 78 [super touchesEnded:touches withEvent:event]; 79 if (!_supportingWebTouchEventsGestureRecognizer) 80 return; 81 82 #if ENABLE(POINTER_EVENTS) && HAVE(UI_WEB_TOUCH_EVENTS_GESTURE_RECOGNIZER_WITH_ACTIVE_TOUCHES_BY_ID) 83 // FIXME: <rdar://problem/48035706> 84 NSMapTable<NSNumber *, UITouch *> *activeTouches = [_supportingWebTouchEventsGestureRecognizer activeTouchesByIdentifier]; 85 for (NSNumber *touchIdentifier in activeTouches) { 86 UITouch *touch = [activeTouches objectForKey:touchIdentifier]; 87 if ([touch.gestureRecognizers containsObject:self]) { 88 _lastActiveTouchIdentifier = touchIdentifier; 89 break; 90 } 91 } 92 #endif 73 93 } 74 94 -
trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
r245079 r245639 837 837 } 838 838 839 #if ENABLE(POINTER_EVENTS) 840 void WebPageProxy::touchWithIdentifierWasRemoved(WebCore::PointerID pointerId) 841 { 842 process().send(Messages::WebPage::TouchWithIdentifierWasRemoved(pointerId), m_pageID); 843 } 844 #endif 845 839 846 void WebPageProxy::potentialTapAtPosition(const WebCore::FloatPoint& position, bool shouldRequestMagnificationInformation, uint64_t& requestID) 840 847 { … … 843 850 } 844 851 845 void WebPageProxy::commitPotentialTap(OptionSet<WebEvent::Modifier> modifiers, uint64_t layerTreeTransactionIdAtLastTouchStart )846 { 847 process().send(Messages::WebPage::CommitPotentialTap(modifiers, layerTreeTransactionIdAtLastTouchStart ), m_pageID);852 void WebPageProxy::commitPotentialTap(OptionSet<WebEvent::Modifier> modifiers, uint64_t layerTreeTransactionIdAtLastTouchStart, WebCore::PointerID pointerId) 853 { 854 process().send(Messages::WebPage::CommitPotentialTap(modifiers, layerTreeTransactionIdAtLastTouchStart, pointerId), m_pageID); 848 855 } 849 856 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r245595 r245639 623 623 bool hasStablePageScaleFactor() const { return m_hasStablePageScaleFactor; } 624 624 625 #if ENABLE(POINTER_EVENTS) 626 void touchWithIdentifierWasRemoved(WebCore::PointerID); 627 #endif 628 625 629 void handleTap(const WebCore::IntPoint&, OptionSet<WebKit::WebEvent::Modifier>, uint64_t lastLayerTreeTransactionId); 626 630 void potentialTapAtPosition(uint64_t requestID, const WebCore::FloatPoint&, bool shouldRequestMagnificationInformation); 627 void commitPotentialTap(OptionSet<WebKit::WebEvent::Modifier>, uint64_t lastLayerTreeTransactionId );631 void commitPotentialTap(OptionSet<WebKit::WebEvent::Modifier>, uint64_t lastLayerTreeTransactionId, WebCore::PointerID); 628 632 void commitPotentialTapFailed(); 629 633 void cancelPotentialTap(); … … 1235 1239 void platformInitializeAccessibility(); 1236 1240 void generateSyntheticEditingCommand(SyntheticEditingCommandType); 1237 void handleSyntheticClick(WebCore::Node& nodeRespondingToClick, const WebCore::FloatPoint& location, OptionSet<WebKit::WebEvent::Modifier> );1238 void completeSyntheticClick(WebCore::Node& nodeRespondingToClick, const WebCore::FloatPoint& location, OptionSet<WebKit::WebEvent::Modifier>, WebCore::SyntheticClickType );1241 void handleSyntheticClick(WebCore::Node& nodeRespondingToClick, const WebCore::FloatPoint& location, OptionSet<WebKit::WebEvent::Modifier>, WebCore::PointerID = WebCore::mousePointerID); 1242 void completeSyntheticClick(WebCore::Node& nodeRespondingToClick, const WebCore::FloatPoint& location, OptionSet<WebKit::WebEvent::Modifier>, WebCore::SyntheticClickType, WebCore::PointerID = WebCore::mousePointerID); 1239 1243 void sendTapHighlightForNodeIfNecessary(uint64_t requestID, WebCore::Node*); 1240 1244 void resetTextAutosizing(); … … 1845 1849 WebCore::FloatRect m_previousExposedContentRect; 1846 1850 OptionSet<WebKit::WebEvent::Modifier> m_pendingSyntheticClickModifiers; 1851 WebCore::PointerID m_pendingSyntheticClickPointerId { 0 }; 1847 1852 FocusedElementIdentifier m_currentFocusedElementIdentifier { 0 }; 1848 1853 Optional<DynamicViewportSizeUpdateID> m_pendingDynamicViewportSizeUpdateID; -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in
r245595 r245639 52 52 DynamicViewportSizeUpdate(WebCore::FloatSize viewLayoutSize, WebCore::FloatSize maximumUnobscuredSize, WebCore::FloatRect targetExposedContentRect, WebCore::FloatRect targetUnobscuredRect, WebCore::FloatRect targetUnobscuredRectInScrollViewCoordinates, WebCore::RectEdges<float> targetUnobscuredSafeAreaInsets, double scale, int32_t deviceOrientation, uint64_t dynamicViewportSizeUpdateID) 53 53 54 TouchWithIdentifierWasRemoved(WebCore::PointerID pointerId) 54 55 HandleTap(WebCore::IntPoint point, OptionSet<WebKit::WebEvent::Modifier> modifiers, uint64_t lastLayerTreeTransactionId) 55 56 PotentialTapAtPosition(uint64_t requestID, WebCore::FloatPoint point, bool shouldRequestMagnificationInformation) 56 CommitPotentialTap(OptionSet<WebKit::WebEvent::Modifier> modifiers, uint64_t lastLayerTreeTransactionId )57 CommitPotentialTap(OptionSet<WebKit::WebEvent::Modifier> modifiers, uint64_t lastLayerTreeTransactionId, WebCore::PointerID pointerId) 57 58 CancelPotentialTap() 58 59 TapHighlightAtPosition(uint64_t requestID, WebCore::FloatPoint point) -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r245561 r245639 109 109 #import <WebCore/PlatformKeyboardEvent.h> 110 110 #import <WebCore/PlatformMouseEvent.h> 111 #import <WebCore/PointerCaptureController.h> 111 112 #import <WebCore/Quirks.h> 112 113 #import <WebCore/RenderBlock.h> … … 564 565 } 565 566 566 static void dispatchSyntheticMouseMove(Frame& mainFrame, const WebCore::FloatPoint& location, OptionSet<WebEvent::Modifier> modifiers )567 static void dispatchSyntheticMouseMove(Frame& mainFrame, const WebCore::FloatPoint& location, OptionSet<WebEvent::Modifier> modifiers, WebCore::PointerID pointerId = WebCore::mousePointerID) 567 568 { 568 569 IntPoint roundedAdjustedPoint = roundedIntPoint(location); … … 571 572 auto altKey = modifiers.contains(WebEvent::Modifier::AltKey); 572 573 auto metaKey = modifiers.contains(WebEvent::Modifier::MetaKey); 573 auto mouseEvent = PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, shiftKey, ctrlKey, altKey, metaKey, WallTime::now(), WebCore::ForceAtClick, WebCore::NoTap );574 auto mouseEvent = PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, shiftKey, ctrlKey, altKey, metaKey, WallTime::now(), WebCore::ForceAtClick, WebCore::NoTap, pointerId); 574 575 // FIXME: Pass caps lock state. 575 576 mainFrame.eventHandler().dispatchSyntheticMouseMove(mouseEvent); … … 628 629 } 629 630 630 void WebPage::handleSyntheticClick(Node& nodeRespondingToClick, const WebCore::FloatPoint& location, OptionSet<WebEvent::Modifier> modifiers )631 void WebPage::handleSyntheticClick(Node& nodeRespondingToClick, const WebCore::FloatPoint& location, OptionSet<WebEvent::Modifier> modifiers, WebCore::PointerID pointerId) 631 632 { 632 633 if (!nodeRespondingToClick.document().settings().contentChangeObserverEnabled()) { 633 completeSyntheticClick(nodeRespondingToClick, location, modifiers, WebCore::OneFingerTap );634 completeSyntheticClick(nodeRespondingToClick, location, modifiers, WebCore::OneFingerTap, pointerId); 634 635 return; 635 636 } … … 640 641 ContentChangeObserver::MouseMovedScope observingScope(respondingDocument); 641 642 auto& mainFrame = m_page->mainFrame(); 642 dispatchSyntheticMouseMove(mainFrame, location, modifiers );643 dispatchSyntheticMouseMove(mainFrame, location, modifiers, pointerId); 643 644 mainFrame.document()->updateStyleIfNeeded(); 644 645 } … … 660 661 m_pendingSyntheticClickLocation = location; 661 662 m_pendingSyntheticClickModifiers = modifiers; 662 return; 663 } 664 665 callOnMainThread([protectedThis = makeRefPtr(this), targetNode = Ref<Node>(nodeRespondingToClick), location, modifiers, observedContentChange, targetNodeTriggersClick] { 663 m_pendingSyntheticClickPointerId = pointerId; 664 return; 665 } 666 667 callOnMainThread([protectedThis = makeRefPtr(this), targetNode = Ref<Node>(nodeRespondingToClick), location, modifiers, observedContentChange, targetNodeTriggersClick, pointerId] { 666 668 if (protectedThis->m_isClosed || !protectedThis->corePage()) 667 669 return; … … 670 672 if (shouldStayAtHoverState) { 671 673 // The move event caused new contents to appear. Don't send synthetic click event, but just ensure that the mouse is on the most recent content. 672 dispatchSyntheticMouseMove(protectedThis->corePage()->mainFrame(), location, modifiers );674 dispatchSyntheticMouseMove(protectedThis->corePage()->mainFrame(), location, modifiers, pointerId); 673 675 LOG(ContentObservation, "handleSyntheticClick: Observed meaningful visible change -> hover."); 674 676 return; 675 677 } 676 678 LOG(ContentObservation, "handleSyntheticClick: calling completeSyntheticClick -> click."); 677 protectedThis->completeSyntheticClick(targetNode, location, modifiers, WebCore::OneFingerTap );679 protectedThis->completeSyntheticClick(targetNode, location, modifiers, WebCore::OneFingerTap, pointerId); 678 680 }); 679 681 } … … 688 690 if (observedContentChange == WKContentNoChange) { 689 691 LOG(ContentObservation, "No chage was observed -> click."); 690 completeSyntheticClick(*m_pendingSyntheticClickNode, m_pendingSyntheticClickLocation, m_pendingSyntheticClickModifiers, WebCore::OneFingerTap );692 completeSyntheticClick(*m_pendingSyntheticClickNode, m_pendingSyntheticClickLocation, m_pendingSyntheticClickModifiers, WebCore::OneFingerTap, m_pendingSyntheticClickPointerId); 691 693 } else { 692 694 // Ensure that the mouse is on the most recent content. 693 dispatchSyntheticMouseMove(m_page->mainFrame(), m_pendingSyntheticClickLocation, m_pendingSyntheticClickModifiers );695 dispatchSyntheticMouseMove(m_page->mainFrame(), m_pendingSyntheticClickLocation, m_pendingSyntheticClickModifiers, m_pendingSyntheticClickPointerId); 694 696 LOG(ContentObservation, "Observed meaningful visible change -> hover."); 695 697 } … … 698 700 m_pendingSyntheticClickLocation = FloatPoint(); 699 701 m_pendingSyntheticClickModifiers = { }; 700 } 701 702 void WebPage::completeSyntheticClick(Node& nodeRespondingToClick, const WebCore::FloatPoint& location, OptionSet<WebEvent::Modifier> modifiers, SyntheticClickType syntheticClickType) 702 m_pendingSyntheticClickPointerId = 0; 703 } 704 705 void WebPage::completeSyntheticClick(Node& nodeRespondingToClick, const WebCore::FloatPoint& location, OptionSet<WebEvent::Modifier> modifiers, SyntheticClickType syntheticClickType, WebCore::PointerID pointerId) 703 706 { 704 707 IntPoint roundedAdjustedPoint = roundedIntPoint(location); … … 719 722 bool metaKey = modifiers.contains(WebEvent::Modifier::MetaKey); 720 723 721 tapWasHandled |= mainframe.eventHandler().handleMousePressEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MousePressed, 1, shiftKey, ctrlKey, altKey, metaKey, WallTime::now(), WebCore::ForceAtClick, syntheticClickType ));724 tapWasHandled |= mainframe.eventHandler().handleMousePressEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MousePressed, 1, shiftKey, ctrlKey, altKey, metaKey, WallTime::now(), WebCore::ForceAtClick, syntheticClickType, pointerId)); 722 725 if (m_isClosed) 723 726 return; 724 727 725 tapWasHandled |= mainframe.eventHandler().handleMouseReleaseEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MouseReleased, 1, shiftKey, ctrlKey, altKey, metaKey, WallTime::now(), WebCore::ForceAtClick, syntheticClickType ));728 tapWasHandled |= mainframe.eventHandler().handleMouseReleaseEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MouseReleased, 1, shiftKey, ctrlKey, altKey, metaKey, WallTime::now(), WebCore::ForceAtClick, syntheticClickType, pointerId)); 726 729 if (m_isClosed) 727 730 return; … … 739 742 // Only send a synthetic mouse out event if synthetic mouse move events were sent; this is true when ContentChangeObserver is enabled. 740 743 if (nodeRespondingToClick.document().settings().contentChangeObserverEnabled() && !tapWasHandled && nodeRespondingToClick.document().frame()) 741 nodeRespondingToClick.document().frame()->eventHandler().dispatchSyntheticMouseOut(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::NoType, 0, shiftKey, ctrlKey, altKey, metaKey, WallTime::now(), 0, WebCore::NoTap ));744 nodeRespondingToClick.document().frame()->eventHandler().dispatchSyntheticMouseOut(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::NoType, 0, shiftKey, ctrlKey, altKey, metaKey, WallTime::now(), 0, WebCore::NoTap, pointerId)); 742 745 743 746 if (m_isClosed) … … 960 963 } 961 964 962 void WebPage::commitPotentialTap(OptionSet<WebEvent::Modifier> modifiers, uint64_t lastLayerTreeTransactionId )965 void WebPage::commitPotentialTap(OptionSet<WebEvent::Modifier> modifiers, uint64_t lastLayerTreeTransactionId, WebCore::PointerID pointerId) 963 966 { 964 967 if (!m_potentialTapNode || (!m_potentialTapNode->renderer() && !is<HTMLAreaElement>(m_potentialTapNode.get()))) { … … 984 987 } else 985 988 #endif 986 handleSyntheticClick(*nodeRespondingToClick, adjustedPoint, modifiers );989 handleSyntheticClick(*nodeRespondingToClick, adjustedPoint, modifiers, pointerId); 987 990 } else 988 991 commitPotentialTapFailed(); … … 1033 1036 sendTapHighlightForNodeIfNecessary(requestID, mainframe.nodeRespondingToClickEvents(position, adjustedPoint)); 1034 1037 } 1038 1039 #if ENABLE(POINTER_EVENTS) 1040 void WebPage::touchWithIdentifierWasRemoved(WebCore::PointerID pointerId) 1041 { 1042 m_page->pointerCaptureController().touchWithIdentifierWasRemoved(pointerId); 1043 } 1044 #endif 1035 1045 1036 1046 void WebPage::inspectorNodeSearchMovedToPosition(const FloatPoint& position)
Note:
See TracChangeset
for help on using the changeset viewer.