[AppKit Gestures] Only mouse tracking mode produces pointer events#64980
Conversation
|
EWS run on previous version of this PR (hash d921ad3) Details |
| try await loadHTML() | ||
|
|
||
| let expectedEvents = ["pointerdown", "mousedown", "pointerup", "mouseup", "click"] | ||
| let jsEventList = expectedEvents.map { "\"\($0)\"" }.joined(separator: ", ") |
There was a problem hiding this comment.
you can use # for the string literal to avoid having to escape it
| @@ -77,6 +77,44 @@ struct AppKitGesturesTests { | |||
| self.window.makeKeyAndOrderFront(nil) | |||
| } | |||
|
|
|||
| @Test( | |||
| .bug("https://webkit.org/b/314880", "Only mouse tracking mode produces pointer events") | |||
| ) | |||
There was a problem hiding this comment.
can probably make this parameterized for content editable and not right?
There was a problem hiding this comment.
Probably, I need to double check click behavior over editable content, but I'll adjust accordingly.
| for (const eventType of [\(jsEventList)]) { | ||
| target.addEventListener(eventType, e => window.eventLog.push(e.type)); | ||
| } | ||
| return null; |
There was a problem hiding this comment.
why does this return null
There was a problem hiding this comment.
Artifact from a first draft of the test. Return isn't necessary here. I'll remove it
| let eventLog = try #require(try await page.callJavaScript("return window.eventLog;") as? [String]) | ||
|
|
||
| for eventType in expectedEvents { | ||
| #expect(eventLog.contains(eventType), "expected '\(eventType)' in event log: \(eventLog)") |
There was a problem hiding this comment.
the comment isn't necessary, Swift Testing will automatically tell you the values in the failure case
| await page.waitForPendingMouseEvents() | ||
| await page.waitForNextPresentationUpdate() | ||
|
|
||
| let eventLog = try #require(try await page.callJavaScript("return window.eventLog;") as? [String]) |
There was a problem hiding this comment.
| let eventLog = try #require(try await page.callJavaScript("return window.eventLog;") as? [String]) | |
| let eventLog = try await #require(page.callJavaScript("return window.eventLog;") as? [String]) |
| """ | ||
| window.eventLog = []; | ||
| const target = document.getElementById("div"); | ||
| for (const eventType of [\(jsEventList)]) { |
There was a problem hiding this comment.
this should use a JS parameter, and use the arguments parameter to callJavaScript to populate it
|
EWS run on previous version of this PR (hash 97e00be) Details
|
|
EWS run on previous version of this PR (hash e031dd8) Details |
|
EWS run on current version of this PR (hash f5e268a) Details |
|
Thank you for the review! |
https://bugs.webkit.org/show_bug.cgi?id=314880 rdar://177139516 Reviewed by Tim Horton. A single click via the gesture controller's synthetic click flow does not fire pointerdown/pointerup on the page -- we only see the final click event. We address this issue by adding an input source check on the suppression condition in dispatchPointerEventIfNeeded, since it is currently short circuiting away non-iOS synthetic events that do not otherwise have a pointer event dispatch path. Test: AppKitGesturesTests.singleClickFiresPointerMouseAndClickEvents * Source/WebCore/dom/Element.cpp: (WebCore::dispatchPointerEventIfNeeded): * Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKitGesturesTests.swift: (AppKitGesturesTests.singleClickFiresPointerMouseAndClickEvents(_:)): Canonical link: https://commits.webkit.org/313371@main
f5e268a to
d197477
Compare
|
Committed 313371@main (d197477): https://commits.webkit.org/313371@main Reviewed commits have been landed. Closing PR #64980 and removing active labels. |
🛠 ios-apple
d197477
f5e268a
🧪 ios-wk2🧪 ios-wk2-wpt🧪 vision-wk2