Closed Bug 2083400 Opened 1 month ago Closed 24 days ago

[wpt-sync] Sync PR 63801 - Wait for the fragment parser to stop parsing when closing HTMLStream

Categories

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

task

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Attachments

(1 file)

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

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

Noam Rosenthal <nrosenthal@chromium.org> wrote:

Wait for the fragment parser to stop parsing when closing HTMLStream

Align HTMLStream's close algorithm with the spec
(whatwg/html#12758): instead of resolving the close() promise
immediately after calling Finish(), wait until the fragment parser
stops parsing in HTMLDocumentParser::PrepareToStopParsing().

When the stream is blocked on a parser-blocking classic external script, Finish() marks EOF on the input stream and delays ending the parser
until the script finishes and any remaining buffered input has been
parsed. Running the close callback in PrepareToStopParsing() (just
before AttemptToRunDeferredScriptsAndEnd()) ensures that close()
resolves after all pending parser-blocking scripts have executed and all
written input is in the DOM, while still resolving before defer and
module scripts run in subsequent tasks.

Bug: 491743369
Change-Id: I3e05d7b8a3bb8d6b0414281b33118960f7935f49
Reviewed-on: https://chromium-review.googlesource.com/8579606
WPT-Export-Revision: 672ebb4c17fded42d08c659173f16691ad129fcd

PR 63801 applied with additional changes from upstream: d80fedd035bb0b03e1226efb30eebec73914d1c0

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core
Attached file Notable wpt changes —

CI Results

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

Total 35 tests and 4 subtests

Status Summary

Firefox

OK : 33
PASS : 1[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 50[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL : 18[GitHub] 1074[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
ERROR : 1
NOTRUN: 8

Chrome

OK : 1
PASS : 21
FAIL : 5

Safari

FAIL : 18
ERROR : 1
NOTRUN: 8

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

(See attachment for full changes)

Status: NEW → RESOLVED
Closed: 24 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: