Skip to content

Commit

Permalink
Test whether parse document check is done in #prepare-a-script (#23162)
Browse files Browse the repository at this point in the history
This PR adds empty-src tests, which moves <script src=""> elements
between Documents before #prepare-a-script. If the parser document
check is done in #prepare-a-script, the <script>'s error event is not fired,
and thus we can more-completely test whether the parser document check is done.

This PR also does some minor refactoring / documentation clean-up, as well as
adds a TODO to remove some of the tests once whatwg/html#2137
is closed and whatwg/html#5575 lands.

Co-authored-by: Dominic Farolino <[email protected]>
  • Loading branch information
hiroshige-g and domfarolino authored May 27, 2020
1 parent 86b883d commit eccee3e
Show file tree
Hide file tree
Showing 55 changed files with 114 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/moving-between-documents-helper.js"></script>

<body>
<script>
runTest("before-prepare", "createHTMLDocument", "success", "empty-src", "classic");
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/moving-between-documents-helper.js"></script>

<body>
<script>
runTest("before-prepare", "createHTMLDocument", "success", "empty-src", "module");
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/moving-between-documents-helper.js"></script>

<body>
<script>
runTest("before-prepare", "iframe", "success", "empty-src", "classic");
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/moving-between-documents-helper.js"></script>

<body>
<script>
runTest("before-prepare", "iframe", "success", "empty-src", "module");
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Moving script elements between documents</title>
<!-- This is generated by tools/generate.py. Do not manually edit. -->
<link rel="author" href="mailto:[email protected]" title="Domenic Denicola">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#execute-the-script-block">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Loading

0 comments on commit eccee3e

Please sign in to comment.