Closed Bug 2080515 Opened 1 month ago Closed 1 month ago

[wpt-sync] Sync PR 63446 - Handle displaced reference node and stop parsing on write error in HTMLStream

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])

Attachments

(1 file)

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

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

Noam Rosenthal <nrosenthal@chromium.org> wrote:

Handle displaced reference node and stop parsing on write error in HTMLStream

When the reference node (next_child) is removed or moved out of its
expected parent mid-chunk (e.g. by a streamed inline script), drop
subsequent nodes, text, and foster-parented children instead of hitting
a DCHECK in ContainerNode::ParserInsertBefore or appending to the old
parent.

Also call parser_->StopParsing() in HTMLSink::write before throwing on
chunk string conversion failure or a displaced reference node, matching
the spec's writeSteps abort behavior.

Bug: 491743369
Change-Id: If4bd1f1b6aa1c9fbd1ca7040899131815102bda2
Reviewed-on: https://chromium-review.googlesource.com/8498307
WPT-Export-Revision: 146881ff3d5ec6cc26ca032b68eaa0b10e031e4c

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

CI Results

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

Total 36 tests

Status Summary

Firefox

OK : 1[GitHub] 35[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-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS: 1[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 53[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-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL: 70[GitHub] 1660[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-64-25h2-debug, Gecko-windows11-64-25h2-opt]

Chrome

OK : 1
PASS: 61
FAIL: 9

Safari

OK : 1
FAIL: 70

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

(See attachment for full changes)

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.

Attachment

General

Created:
Updated:
Size: