[wpt-sync] Sync PR 63436 - Don't hold a reference to the id attribute across UpdateId()
Categories
(Core :: DOM: Core & HTML, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox160 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 63436 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/63436
Details from upstream follow.
Mason Freed <masonf@chromium.org> wrote:
Don't hold a reference to the id attribute across UpdateId()
Element::InsertedInto() took a reference into the element's attribute
storage via GetIdAttribute() and passed it to UpdateId(). UpdateId()
notifies id target observers, and those can update style and layout.
For example, a focused \<input list> whose datalist became usable
rebuilds its shadow tree and calls RevealSelection(). If that update
builds a \<use> instance tree that clones the element, cloning
serializes the element's dirty style attribute and appends it to the
attribute storage. When that reallocates the storage, the reference
dangles, and the remaining reads of the id in UpdateId() access freed
memory.This CL copies the id into a local AtomicString before calling
UpdateId(). RemovedFrom() passes the id to UpdateId() the same way, so
it gets the same change. Recent fixes for similar bugs in
ElementRuleCollector and HTMLAnchorElementBase::NavigateToHyperlink()
used the same approach.Fixed: 567638392
Change-Id: I1ebac072098091e5dc9d8898f2bced3cf0c3bbcc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8517119
Auto-Submit: Mason Freed \<masonf@chromium.org>
Reviewed-by: David Baron \<dbaron@chromium.org>
Commit-Queue: Mason Freed \<masonf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1715019}
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 1•1 month ago
|
||
Pushed to try (stability) https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=102842
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 2•1 month ago
|
||
CI Results
Ran 11 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 6 tests
Status Summary
Firefox
OK : 2
PASS: 1[GitHub] 2[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 3[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 5[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-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL: 2
Chrome
PASS: 1
Safari
PASS: 1
Links
Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base
Details
New Tests That Don't Pass
- /html/semantics/forms/the-datalist-element/datalistoptions.html [wpt.fyi]
- options label/value:
FAIL
- options label/value:
- /html/semantics/forms/the-datalist-element/input-list-detached.html [wpt.fyi]
- The list getter finds a datalist in a detached element tree:
FAIL
- The list getter finds a datalist in a detached element tree:
https://hg.mozilla.org/mozilla-central/rev/f8c97d113091
https://hg.mozilla.org/mozilla-central/rev/b757af37b669
Description
•