Closed Bug 2080548 Opened 1 month ago Closed 1 month ago

[wpt-sync] Sync PR 63511 - Clean up open elements and pending scripts on HTMLStream abort and EOF

Categories

(Core :: DOM: Core & HTML, task, P4)

task

Tracking

()

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 63511 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/63511
Details from upstream follow.

Noam Rosenthal <nrosenthal@chromium.org> wrote:

Clean up open elements and pending scripts on HTMLStream abort and EOF

Align HTMLDocumentParser, HTMLTreeBuilder, ScriptLoader, and PendingScript with the WHATWG HTML spec for fragment parser abort and EOF:

  • On StopParsing() for fragment parsers ('abort a parser', fragment case), mark open \<script> elements already-started, pop all open elements so elements like \<style> finish parsing children, and cancel pending parser-blocking and deferred scripts.
  • At EOF in the 'text' insertion mode, mark an unclosed \<script> already-started for fragment parsers, so it never runs even if it is later connected.

Bug: 491743369
Change-Id: I92f8b6e1fc762a28de590ed32ff98b3e33c6e628
Reviewed-on: https://chromium-review.googlesource.com/8529650
WPT-Export-Revision: ed486c78a12f81d5f5d678c38ac28eaf936a7837

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core

CI Results

Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 6 tests and 28 subtests

Status Summary

Firefox

OK : 5
PASS : 13
FAIL : 54
TIMEOUT: 2
NOTRUN : 11

Chrome

OK : 5
PASS : 70
FAIL : 7
TIMEOUT: 2

Safari

OK : 5
PASS : 10
FAIL : 56
TIMEOUT: 2
NOTRUN : 11

Links

GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /domparsing/tentative/stream-html-abort-unblocks-rendering.html [wpt.fyi]
    • abort() unblocks rendering on a streamed render-blocking parser-blocking script: FAIL (Chrome: TIMEOUT, Safari: FAIL)
  • /domparsing/tentative/stream-html-parser-blocking-script.html [wpt.fyi]
    • streamHTMLUnsafe with parser blocking script should process in order: FAIL (Chrome: PASS, Safari: FAIL)
    • Multiple parser-blocking scripts with out-of-order fetch times execute in document order: FAIL (Chrome: PASS, Safari: FAIL)
    • Inline script split across chunk boundaries executes only when tag closes: FAIL (Chrome: PASS, Safari: FAIL)
    • External script tag split across chunk boundaries parses and executes correctly: FAIL (Chrome: PASS, Safari: FAIL)
    • DOM mutations inside streamed parser-blocking script maintain correct insertion order: FAIL (Chrome: PASS, Safari: FAIL)
    • streamHTMLUnsafe with parser-blocking script should not execute after abort: FAIL (Chrome: PASS, Safari: FAIL)
    • streamHTMLUnsafe continues parsing after runtime script error: FAIL (Chrome: PASS, Safari: FAIL)
    • streamHTMLUnsafe on detached element should parse markup without executing scripts: FAIL (Chrome: PASS, Safari: FAIL)
    • Unclosed <script> at close() never runs, stays in the DOM, and is marked already started: FAIL (Chrome: PASS, Safari: FAIL)
    • Rejected write (symbol) stops the parser and prevents pending blocking script and buffered markup from running: FAIL (Chrome: FAIL, Safari: FAIL)
    • Rejected write (toStringThrow) stops the parser and prevents pending blocking script and buffered markup from running: FAIL (Chrome: FAIL, Safari: FAIL)
    • Rejected write (displacedRef) stops the parser and prevents pending blocking script and buffered markup from running: FAIL (Chrome: FAIL, Safari: FAIL)
    • Abort with an unclosed <script> marks it already started: FAIL (Chrome: PASS, Safari: FAIL)
  • /domparsing/tentative/stream-html-unsafe.html [wpt.fyi]
    • piping a response into streamHTMLUnsafe(): FAIL (Chrome: PASS, Safari: FAIL)
    • writing a string to streamHTMLUnsafe(): FAIL (Chrome: PASS, Safari: FAIL)
    • streamHTMLUnsafe() should remove existing content immediately: FAIL (Chrome: PASS, Safari: FAIL)
    • streamHTMLUnsafe() does not buffer until close(): FAIL (Chrome: PASS, Safari: FAIL)
    • writing a Symbol to streamHTMLUnsafe(): FAIL (Chrome: PASS, Safari: FAIL)
    • writing numbers to streamHTMLUnsafe(): FAIL (Chrome: PASS, Safari: FAIL)
    • writing null or undefined to streamHTMLUnsafe(): FAIL (Chrome: PASS, Safari: FAIL)
    • streamHTMLUnsafe() can stream into <style>: FAIL (Chrome: PASS, Safari: FAIL)
    • Aborting streamHTMLUnsafe(): FAIL (Chrome: PASS, Safari: FAIL)
    • streamHTMLUnsafe should not execute unclosed scripts on abort: FAIL (Chrome: PASS, Safari: FAIL)
    • Interleaved streamHTMLUnsafe() writes: FAIL (Chrome: PASS, Safari: FAIL)
    • streamHTMLUnsafe into a ShadowRoot: FAIL (Chrome: PASS, Safari: FAIL)
    • streamHTMLUnsafe into a template: FAIL (Chrome: PASS, Safari: FAIL)
    • streamHTMLUnsafe should execute scripts when connected: FAIL (Chrome: PASS, Safari: FAIL)
    • streamHTMLUnsafe should not execute scripts when disconnected: FAIL (Chrome: PASS, Safari: FAIL)
    • Aborting streamHTMLUnsafe with an open <style> element pops open elements and applies styles: FAIL (Chrome: FAIL, Safari: FAIL)
    • streamHTMLUnsafe() inserts bare text before close(): FAIL
  • /domparsing/tentative/stream-html.html [wpt.fyi]
    • piping a response into streamHTML(): FAIL (Chrome: PASS, Safari: FAIL)
    • writing a string to streamHTML(): FAIL (Chrome: PASS, Safari: FAIL)
    • streamHTML() should remove existing content immediately: FAIL (Chrome: PASS, Safari: FAIL)
    • streamHTML() does not buffer until close(): FAIL (Chrome: PASS, Safari: FAIL)
    • writing a Symbol to streamHTML(): FAIL (Chrome: PASS, Safari: FAIL)
    • writing numbers to streamHTML(): FAIL (Chrome: PASS, Safari: FAIL)
    • writing null or undefined to streamHTML(): FAIL (Chrome: PASS, Safari: FAIL)
    • streamHTML() can stream into <style>: FAIL (Chrome: PASS, Safari: FAIL)
    • Aborting streamHTML(): FAIL (Chrome: PASS, Safari: FAIL)
    • Interleaved streamHTML() writes: FAIL (Chrome: PASS, Safari: FAIL)
    • streamHTML should not execute scripts when connected: FAIL (Chrome: PASS, Safari: FAIL)
    • streamHTML should pass sanitizer options: FAIL (Chrome: PASS, Safari: FAIL)
    • streamHTML uses safe sanitizer: FAIL (Chrome: PASS, Safari: FAIL)
    • streamHTML on ShadowRoot: FAIL (Chrome: PASS, Safari: FAIL)
    • streamHTML on ShadowRoot uses safe sanitizer: FAIL (Chrome: PASS, Safari: FAIL)
    • Aborting streamHTML with an open <style> element pops open elements and applies styles: FAIL (Chrome: FAIL, Safari: FAIL)
  • /domparsing/tentative/unclosed-script-already-started.html [wpt.fyi]
    • Control: closed <script> from setHTMLUnsafe({runScripts: true}) runs: FAIL (Chrome: PASS, Safari: FAIL)
  • /html/webappapis/dynamic-markup-insertion/html-unsafe-methods/setHTMLUnsafe-runScripts.html [wpt.fyi]: TIMEOUT (Chrome: OK, Safari: TIMEOUT)
    • Element: setHTMLUnsafe with runScripts & no shadowdom.: FAIL (Chrome: PASS, Safari: FAIL)
    • Element: setHTMLUnsafe with script inside declarative shadow DOM.: FAIL (Chrome: PASS, Safari: FAIL)
    • Element: setHTMLUnsafe with external script.: TIMEOUT (Chrome: PASS, Safari: TIMEOUT)
    • Element: setHTMLUnsafe with external async script.: NOTRUN (Chrome: PASS, Safari: NOTRUN)
    • Element: setHTMLUnsafe with external defer script.: NOTRUN (Chrome: PASS, Safari: NOTRUN)
    • Element: setHTMLUnsafe script cannot observe intermediate state.: NOTRUN (Chrome: PASS, Safari: NOTRUN)
    • Element: setHTMLUnsafe script can remove subsequent scripts and prevent them from running.: NOTRUN (Chrome: PASS, Safari: NOTRUN)
    • Element: setHTMLUnsafe script cannot observe intermediate style.: NOTRUN (Chrome: PASS, Safari: NOTRUN)
    • Element: runScripts order of operations with custom element callbacks: FAIL (Chrome: PASS, Safari: FAIL)
    • ShadowRoot: setHTMLUnsafe with runScripts & no shadowdom.: FAIL (Chrome: PASS, Safari: FAIL)
    • ShadowRoot: setHTMLUnsafe with script inside declarative shadow DOM.: FAIL (Chrome: PASS, Safari: FAIL)
    • ShadowRoot: setHTMLUnsafe with external script.: NOTRUN (Chrome: PASS, Safari: NOTRUN)
    • ShadowRoot: setHTMLUnsafe with external async script.: NOTRUN (Chrome: PASS, Safari: NOTRUN)
    • ShadowRoot: setHTMLUnsafe with external defer script.: NOTRUN (Chrome: PASS, Safari: NOTRUN)
    • ShadowRoot: setHTMLUnsafe script cannot observe intermediate state.: NOTRUN (Chrome: PASS, Safari: NOTRUN)
    • ShadowRoot: setHTMLUnsafe script can remove subsequent scripts and prevent them from running.: NOTRUN (Chrome: PASS, Safari: NOTRUN)
    • ShadowRoot: setHTMLUnsafe script cannot observe intermediate style.: NOTRUN (Chrome: PASS, Safari: NOTRUN)
    • ShadowRoot: runScripts order of operations with custom element callbacks: FAIL (Chrome: PASS, Safari: FAIL)
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
You need to log in before you can comment on or make changes to this bug.