[wpt-sync] Sync PR 39615 - Make element references via idrefs functional when disconnected
Categories
(Core :: DOM: Core & HTML, task, P4)
Tracking
()
Tracking | Status | |
---|---|---|
firefox114 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 39615 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/39615
Details from upstream follow.
Mason Freed <masonf@chromium.org> wrote:
Make element references via idrefs functional when disconnected
Per the spec [1], computing the attr-associated element does not
depend on connectedness. Step 4 (which runs whenever there is not
an explicitly set attr-element) says:
...return the first element candidate, in tree order, that meets the following criteria:
- candidate's root is the same as element's root,
- candidate's ID is contentAttributeValue, and
- candidate implements T.
If no such element exists, then return null.
The issue prior to this CL is that
getElementById()
uses the
TreeOrderedMap, and elements are removed from the map when they are
removed from the document. A partial fix for non-idref (IDL) element
references was made with [2], and this is the second half.[1] https://html.spec.whatwg.org/#attr-associated-element
[2] https://chromium-review.googlesource.com/c/chromium/src/+/4371122Fixed:1427374
Change-Id: I2a089a5fa1a925d40761ae2275ed34f855791513Reviewed-on: https://chromium-review.googlesource.com/4450333
WPT-Export-Revision: a85db43440805b1118de18cba5720eeb0669c3ad
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
Assignee | ||
Comment 2•2 years ago
|
||
Assignee | ||
Comment 4•2 years ago
|
||
Comment 5•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/0a23fbd75fc9
https://hg.mozilla.org/mozilla-central/rev/c58560aa8957
Description
•