Closed Bug 1426642 Opened 6 years ago Closed 6 years ago

JS module test module-in-xhtml.xhtml fails

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(1 file)

The following test is currently expected to fail:

html/semantics/scripting-1/the-script-element/module/module-in-xhtml.xhtml
This one is just a bug in the test.  Module scripts are scheduled to execute after the document has been parsed, like 'defer' scripts.

The test comes from Blink which doesn't support module scripts in XHTML documents at all:

https://github.com/w3c/web-platform-tests/commit/74e8746b8e49b1dfc4a3d004e91b63da3f578ff5#diff-a3c3a4988a7313fc551c33ef2b8a17ed
Attachment #8938332 - Flags: review?(james)
Comment on attachment 8938332 [details] [diff] [review]
bug1426642-xhtml-module-script

Review of attachment 8938332 [details] [diff] [review]:
-----------------------------------------------------------------

::: testing/web-platform/tests/html/semantics/scripting-1/the-script-element/module/module-in-xhtml.xhtml
@@ +9,5 @@
>  <script type="module">
>  window.evaluated_module_script = true;
>  </script>
>  <script>
> +  var test = async_test("module script in XHTML documents should be evaluated.");

FWIW you could write this

addEventListener("load", 
                 async_test(t => {
                              assert_true(window.evaluated_module_script);
                              t.done()
                            }),
                            "module script in XHTML documents should be evaluated."));

But your way is fine too.
Attachment #8938332 - Flags: review?(james) → review+
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f6b74e7c3c09
Fix test that didn't take account of module scripts' defer scheduling r=jgraham
https://hg.mozilla.org/mozilla-central/rev/f6b74e7c3c09
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: