<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Relative URLs not resolved in the correct iframe when triggering click event cross-frame"
   href="https://bugs.webkit.org/show_bug.cgi?id=161311">161311</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Relative URLs not resolved in the correct iframe when triggering click event cross-frame
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Frames
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>zenojevski&#64;gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=287268" name="attach_287268" title="Test case">attachment 287268</a> <a href="attachment.cgi?id=287268&amp;action=edit" title="Test case">[details]</a></span>
Test case

Version 10.0 (12602.1.50.0.2)
iOS and macOS

When programmatically triggering a click event on a button which is inside an iframe,
relative URLS are not resolved according to that frame, but to the frame from where the event
was sent.

Included is a testcase which demonstrates the bug. Open the top.html frame, and try to
click the outside button (which clicks the inside button) and the inside button.

Look at the console to see the issue:

<span class="quote">&gt; Failed to load resource: the server responded with a status of 404 (File not found) - <a href="http://localhost:8080/Testcase/other.html">http://localhost:8080/Testcase/other.html</a></span >

Instead it should resolve the URL as:

<span class="quote">&gt; <a href="http://localhost:8080/Testcase/sub/other.html">http://localhost:8080/Testcase/sub/other.html</a></span >

Which is relative to the frame containing the button.

URLs should be resolved relative to the frame where the clicked element resides.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>