Closed Bug 2094847 Opened 11 days ago Closed 8 days ago

[wpt-sync] Sync PR 65004 - XML parser: fully construct synchronous custom elements

Categories

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

task

Tracking

()

RESOLVED FIXED
163 Branch
Tracking Status
firefox163 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Noam Rosenthal <nrosenthal@chromium.org> wrote:

XML parser: fully construct synchronous custom elements

Since r1711702 the XML parser sets a token's attributes one by one via
setAttribute() when a synchronous custom element constructor has run,
instead of the batched ParserSetAttributes(). But the element was still
created with the CreatedByParser flag, and some elements (notably
HTMLInputElement) only partially construct themselves in that case,
relying on ParserDidSetAttributes() to finish up (e.g. creating
input_type_). That hook is never reached on the setAttribute() path, so
\<input is="..." type="..."> in an XHTML document crashed in
HTMLInputElement::ParseAttribute with a null input_type_.

Mirror HTMLConstructionSite::CreateElement and clear the CreatedByParser
flag when creating an element whose synchronous custom element
constructor will run, so that it is fully constructed. Apply the same
change to both the libxml2-based and the Rust-based XML parsers.

Adds a WPT covering customized built-in \<input> elements in XHTML,
which crashes without this change.

Bug: 583431476
Change-Id: I06690e7c7d1e3b9ae4b8a64092a21b1618d1408e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8776454
Commit-Queue: Noam Rosenthal \<nrosenthal@google.com>
Reviewed-by: Joey Arhar \<jarhar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1740707}

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 1 tests and 2 subtests

Status Summary

Firefox

OK : 1
PASS : 2

Chrome

CRASH: 1

Safari

OK : 1
FAIL : 2

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Pushed by wptsync@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/7817f164bd94 https://hg.mozilla.org/integration/autoland/rev/6218ef039fc2 [wpt PR 65004] - XML parser: fully construct synchronous custom elements, a=testonly
Status: NEW → RESOLVED
Closed: 8 days ago
Resolution: --- → FIXED
Target Milestone: --- → 163 Branch
You need to log in before you can comment on or make changes to this bug.