<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>312719</bug_id>
          
          <creation_ts>2026-04-19 06:43:02 -0700</creation_ts>
          <short_desc>test_driver.click() cannot target elements in popup windows opened via window.open()</short_desc>
          <delta_ts>2026-05-01 05:56:57 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=313716</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>klee</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>gsnedders</cc>
    
    <cc>ryanhaddad</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2201987</commentid>
    <comment_count>0</comment_count>
    <who name="">klee</who>
    <bug_when>2026-04-19 06:43:02 -0700</bug_when>
    <thetext>testdriver-vendor.js implements test_driver.click() using eventSender, which operates in the main test window&apos;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&apos;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
- &quot;Sticky User Activation Carry-Over&quot; Spec PR: https://github.com/whatwg/html/pull/11454</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2202734</commentid>
    <comment_count>1</comment_count>
    <who name="">klee</who>
    <bug_when>2026-04-21 07:45:02 -0700</bug_when>
    <thetext>Here&apos;s the result of running &apos;navigate-to-sameorigin.html&apos; 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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2202981</commentid>
    <comment_count>2</comment_count>
    <who name="">klee</who>
    <bug_when>2026-04-21 18:20:37 -0700</bug_when>
    <thetext>I&apos;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&apos;s backend. Still investigating.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2203709</commentid>
    <comment_count>3</comment_count>
    <who name="">klee</who>
    <bug_when>2026-04-23 08:47:40 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/63430</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2204597</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-04-26 06:43:10 -0700</bug_when>
    <thetext>&lt;rdar://problem/175621915&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2206552</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-05-01 05:56:55 -0700</bug_when>
    <thetext>Committed 312424@main (75e2fd9ca577): &lt;https://commits.webkit.org/312424@main&gt;

Reviewed commits have been landed. Closing PR #63430 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>