Commit 0c57767
committed
geforcenow.com: [macOS & iPadOS] The wrong values for are reported for the
https://bugs.webkit.org/show_bug.cgi?id=280755
rdar://137592588
Reviewed by Megan Gardner and Aditya Keerthi.
Re-landing 5aee38f with an added build fix.
`MouseEvent.button` and `MouseEvent.which` now return the correct values for
mouse events occuring as a result of a fourth or fifth mouse button being
pressed. Thanks to Abrar Protyasha for starting this patch, and for the work
in 289800@main which is re-landed here as the foundation for these changes.
`MouseEvent.button` and `MouseEvent.which` now return the correct value when
the wheel button is clicked on iOS (macOS already supported this button).
Tested by `fast/events/mouse-event-buttons.html` on non-iOS platforms, and
tested on iOS by new API test `iOSMouseSupport.NonPrimaryMouseButtonsForEvents`.
Added an extra, unrelated test
`iOSMouseSupport.LeftClickFiresPointerAndMouseEvents` to increase test
comprehensiveness for iOS mouse support.
Link WebKitTestRunner against JavaScriptCore on iOS and visionOS to resolve
a build failure that occurs for debug builds.
Tests: fast/events/mouse-event-buttons.html
Tools/TestWebKitAPI/Tests/WebKitCocoa/iOSMouseSupport.mm
* LayoutTests/fast/events/fire-mousedown-while-pressing-mouse-button.html:
* LayoutTests/fast/events/mouse-click-events-expected.txt:
* LayoutTests/fast/events/mouse-click-events.html:
* LayoutTests/fast/events/mouse-event-buttons-expected.txt: Added.
* LayoutTests/fast/events/mouse-event-buttons.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_attributes_mouse-right-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_attributes_mouse-right-nonstandard-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_attributes_pen-right-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_attributes_pen-right-nonstandard-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_click_on_chorded_mouse_button.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/uievents/mouse/synthetic-mouse-enter-leave-over-out-button-state-after-target-removed.tentative_buttonType=MIDDLE&button=1&buttons=4-expected.txt:
* LayoutTests/platform/ios/TestExpectations:
* LayoutTests/platform/mac-wk1/fast/events/mouse-event-buttons-expected.txt: Added.
* LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/uievents/mouse/synthetic-mouse-enter-leave-over-out-button-state-after-target-removed.tentative_buttonType=MIDDLE&button=1&buttons=4-expected.txt:
* LayoutTests/platform/win/TestExpectations:
* LayoutTests/platform/wpe/TestExpectations:
* Source/WebCore/dom/MouseEvent.cpp:
(WebCore::MouseEvent::button const):
* Source/WebCore/dom/MouseEventTypes.h:
(WebCore::buttonFromShort):
(WebCore::nsEventButtonNumberFromWebCoreMouseButton):
* Source/WebCore/platform/mac/PlatformEventFactoryMac.mm:
(WebCore::currentMouseButton):
(WebCore::buttonFromButtonNumber):
(WebCore::mouseButtonForEvent):
* Source/WebKit/Shared/API/c/WKEvent.h:
* Source/WebKit/Shared/API/c/WKSharedAPICast.h:
(WebKit::toAPI):
* Source/WebKit/Shared/WebEvent.serialization.in:
* Source/WebKit/Shared/WebEventConversion.cpp:
(WebKit::platform):
(WebKit::kit):
* Source/WebKit/Shared/WebMouseEvent.h:
* Source/WebKit/Shared/ios/AdditionalButtonMasksIOS.h: Added.
* Source/WebKit/Shared/ios/WebIOSEventFactory.mm:
(WebKit::WebIOSEventFactory::toUIEventButtonMask):
* Source/WebKit/Shared/mac/WebEventFactory.mm:
(WebKit::WebEventFactory::toNSButtonNumber):
* Source/WebKit/UIProcess/API/glib/WebKitPrivate.cpp:
(toWebKitMouseButton):
* Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp:
(MotionEvent::setState):
(webkitWebViewBaseSynthesizeMouseEvent):
* Source/WebKit/UIProcess/Automation/Automation.json:
* Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::WebAutomationSession):
* Source/WebKit/UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
(WebKit::mouseButtonToGdkButton):
* Source/WebKit/UIProcess/Automation/libwpe/WebAutomationSessionLibWPE.cpp:
(WebKit::mouseButtonToWPEButton):
(WebKit::stateModifierForWPEButton):
* Source/WebKit/UIProcess/Automation/libwpe/WebAutomationSessionWPE.cpp:
(WebKit::libWPEMouseButtonToWPEButton):
* Source/WebKit/UIProcess/Automation/mac/WebAutomationSessionMac.mm:
(WebKit::WebAutomationSession::sendSynthesizedEventsToPage):
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
* Source/WebKit/UIProcess/ios/WKMouseInteraction.mm:
(-[WKMouseInteraction createMouseEventWithType:wasCancelled:]):
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Tools/DumpRenderTree/mac/DumpRenderTree.mm:
(runTest):
* Tools/DumpRenderTree/mac/EventSendingController.h:
* Tools/DumpRenderTree/mac/EventSendingController.mm:
(eventTypeForMouseButtonAndAction):
(swizzledEventPressedMouseButtons):
(swizzledEventButtonNumber):
(-[EventSendingController mouseDown:withModifiers:]):
(-[EventSendingController mouseUp:withModifiers:]):
(-[EventSendingController contextClick]):
* Tools/TestWebKitAPI/Configurations/Base.xcconfig:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/IPCTestingAPI.mm:
(SerializedTypeInfo)):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/iOSMouseSupport.mm:
(-[TestWKWebView pointerInfoAtLocation:]):
((iOSMouseSupport, TrackButtonMaskFromTouchStart)):
((iOSMouseSupport, MouseTimestampTimebase)):
((iOSMouseSupport, EndedTouchesTriggerClick)):
((iOSMouseSupport, CancelledTouchesDoNotTriggerClick)):
((iOSMouseSupport, MouseDidMoveOverElement)):
((iOSMouseSupport, SelectionUpdatesBeforeContextMenuAppears)):
((iOSMouseSupport, DisablingTextIteractionPreventsSelectionWhenShowingContextMenu)):
((iOSMouseSupport, ShowingContextMenuSelectsEditableText)):
((iOSMouseSupport, ShowingContextMenuSelectsNonEditableText)):
((iOSMouseSupport, ContextClickAtEndOfSelection)):
((iOSMouseSupport, WebsiteMouseEventPolicies)):
((iOSMouseSupport, MouseInitiallyDisconnected)):
((iOSMouseSupport, MouseInitiallyConnected)):
((iOSMouseSupport, MouseLaterDisconnected)):
((iOSMouseSupport, MouseLaterConnected)):
((iOSMouseSupport, MouseAlwaysConnected)):
((iOSMouseSupport, BasicPointerInteractionRegions)):
((iOSMouseSupport, LeftClickFiresPointerAndMouseEvents)):
((iOSMouseSupport, NonPrimaryMouseButtonsForEvents)):
* Tools/TestWebKitAPI/Tests/mac/MenuTypesForMouseEvents.mm:
(TestWebKitAPI::buildAndPerformTest):
* Tools/TestWebKitAPI/mac/PlatformWebViewMac.mm:
(TestWebKitAPI::eventTypeForButton):
(TestWebKitAPI::PlatformWebView::simulateButtonClick):
* Tools/WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig:
* Tools/WebKitTestRunner/EventSenderProxy.h:
(WTR::EventSenderProxy::lastButtonDown const):
(WTR::EventSenderProxy::mouseButtonsCurrentlyDown const): Deleted.
* Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
* Tools/WebKitTestRunner/cocoa/EventSenderProxyCocoa.mm: Copied from Source/WebKit/Shared/API/c/WKEvent.h.
(WTR::EventSenderProxy::mouseButtonsCurrentlyDown const):
* Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp:
(WTR::eventSenderButtonToGDKButton):
(WTR::stateModifierForGdkButton):
* Tools/WebKitTestRunner/mac/EventSenderProxy.mm:
(WTR::eventTypeForMouseButtonAndAction):
(WTR::EventSenderProxy::EventSenderProxy):
(WTR::swizzledEventButtonNumber):
(WTR::EventSenderProxy::mouseDown):
(WTR::EventSenderProxy::mouseUp):
(WTR::EventSenderProxy::sendMouseDownToStartPressureEvents):
(): Deleted.
Canonical link: https://commits.webkit.org/304761@mainMouseEvent.button& MouseEvent.which property for extra mouse buttons.1 parent f8fe1f3 commit 0c57767
File tree
51 files changed
+757
-155
lines changed- LayoutTests
- fast/events
- imported/w3c/web-platform-tests
- pointerevents
- uievents/mouse
- platform
- ios
- mac-wk1
- fast/events
- imported/w3c/web-platform-tests/uievents/mouse
- win
- wpe
- Source
- WebCore
- dom
- platform/mac
- WebKit
- UIProcess
- API
- glib
- gtk
- Automation
- gtk
- libwpe
- mac
- ios
- WebKit.xcodeproj
- Tools
- DumpRenderTree/mac
- TestWebKitAPI
- Configurations
- Tests
- WebKitCocoa
- mac
- mac
- WebKitTestRunner
- Configurations
- WebKitTestRunner.xcodeproj
- cocoa
- gtk
- mac
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
51 files changed
+757
-155
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
59 | 57 | | |
| 58 | + | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
29 | 36 | | |
30 | 37 | | |
31 | 38 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
29 | 36 | | |
30 | 37 | | |
31 | 38 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
0 commit comments