Bug 312719
| Summary: | test_driver.click() cannot target elements in popup windows opened via window.open() | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | klee |
| Component: | Tools / Tests | Assignee: | 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
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
klee
Here's the result of running 'navigate-to-sameorigin.html' wpt test case.
- macOS:
https://ews-build.s3-us-west-2.amazonaws.com/macOS-Sequoia-Release-WK2-Tests-EWS/7afd2b82-20990/imported/w3c/web-platform-tests/html/user-activation/navigate-to-sameorigin-actual.txt
- WPE:
https://ews-build.s3-us-west-2.amazonaws.com/WPE-WK2-Tests-EWS/7afd2b82-122059/imported/w3c/web-platform-tests/html/user-activation/navigate-to-sameorigin-actual.txt
klee
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
Pull request: https://github.com/WebKit/WebKit/pull/63430
Radar WebKit Bug Importer
<rdar://problem/175621915>
EWS
Committed 312424@main (75e2fd9ca577): <https://commits.webkit.org/312424@main>
Reviewed commits have been landed. Closing PR #63430 and removing active labels.