Bug 312719

Summary: test_driver.click() cannot target elements in popup windows opened via window.open()
Product: WebKit Reporter: klee
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, gsnedders, ryanhaddad, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: All   
See Also: https://bugs.webkit.org/show_bug.cgi?id=313716

klee
Reported 2026-04-19 06:43:02 PDT
testdriver-vendor.js implements test_driver.click() using eventSender, which operates in the main test window's coordinate space. When test_driver.click() is called on an element in a popup window opened via window.open(), eventSender cannot target the element because it does not handle the popup window's coordinate space. This causes the click to not reach the intended element, resulting in test timeouts. Affected WPT tests include those that use cross-window test_driver.click(), such as html/user-activation/navigate-to-sameorigin.html from whatwg/html#11454. - WPT test case: https://github.com/web-platform-tests/wpt/blob/master/html/user-activation/navigate-to-sameorigin.html - "Sticky User Activation Carry-Over" Spec PR: https://github.com/whatwg/html/pull/11454
Attachments
klee
Comment 2 2026-04-21 18:20:37 PDT
I'm looking into this. The root cause is that eventSender in WebKitTestRunner always dispatches events to mainWebView(), even when test_driver.click() is called on an element in a popup window. The script message from the popup does carry frame/page info via WKScriptMessageGetFrameInfo / WKFrameInfoGetPage, so it should be possible to route the event to the correct view's backend. Still investigating.
klee
Comment 3 2026-04-23 08:47:40 PDT
Radar WebKit Bug Importer
Comment 4 2026-04-26 06:43:10 PDT
EWS
Comment 5 2026-05-01 05:56:55 PDT
Committed 312424@main (75e2fd9ca577): <https://commits.webkit.org/312424@main> Reviewed commits have been landed. Closing PR #63430 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.