summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/forms/form-submission-0/jsurl-form-submit.tentative.html
blob: f476308b7d98017282545425ab6c530d22da3b52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="author" title="Joey Arhar" href="mailto:jarhar@chromium.org">

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<!-- This behavior is not explicitly specified. -->

<iframe id=frameid name=framename></iframe>
<form id=formid target=framename action="resources/form.html"></form>

<script>
async_test(t => {
  frameid.src = 'resources/jsurl-form-submit-iframe.html';

  frameid.onload = t.step_func(() => {
    assert_equals(
      frameid.contentDocument.location.pathname,
      '/html/semantics/forms/form-submission-0/resources/jsurl-form-submit-iframe.html');

    frameid.onload = t.step_func_done(() => {
      assert_equals(
        frameid.contentDocument.location.pathname,
        '/html/semantics/forms/form-submission-0/resources/form.html');
    });

    frameid.contentDocument.getElementById('anchorid').click();
  });

}, `Verifies that form submissions scheduled inside javascript: urls take precedence over the javascript: url's return value.`);
</script>