[wpt-sync] Sync PR 64228 - Harden Element attribute mutation methods against re-entrant changes
Categories
(Core :: DOM: Core & HTML, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox162 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 64228 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/64228
Details from upstream follow.
Mason Freed <masonf@chromium.org> wrote:
Harden Element attribute mutation methods against re-entrant changes
Element::WillModifyAttribute() can run script both by pausing in the
debugger (via probe::WillModifyDOMAttr) and when UpdateName() lazily
initializes a frame's WindowProxy and synchronously invokes a
page-defined setter (e.g. via chrome.loadTimes). If script mutates the
element's attributes and reallocates or re-indexes
UniqueElementData::attribute_vector_, references and indices into the
attribute storage acquired before WillModifyAttribute() become invalid.While https://crrev.com/c/8510124 already hardened
SetAttributeInternal() and RemoveAttributeInternal(), this CL:
- Checks in AppendAttributeInternal() whether WillModifyAttribute()
already added the attribute re-entrantly before appending.- Copies id_attr and class_attr by value in DidMoveToNewDocument()
before calling SetIdAttribute() / setAttribute().- Updates comments in SetAttributeInternal() and
RemoveAttributeInternal() and adds regression tests.Bug: 576203565, 575317938
Change-Id: Ic63c0b5a15568a9c8d2331e7b49dde89e36b5283
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8633017
Auto-Submit: Mason Freed \<masonf@chromium.org>
Commit-Queue: Mason Freed \<masonf@chromium.org>
Reviewed-by: Joey Arhar \<jarhar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1727352}
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Updated•26 days ago
|
| Assignee | ||
Updated•26 days ago
|
| Assignee | ||
Updated•25 days ago
|
| Assignee | ||
Updated•25 days ago
|
| Assignee | ||
Updated•25 days ago
|
| Assignee | ||
Comment 1•25 days ago
|
||
Pushed to try (stability) https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=115049
| Assignee | ||
Comment 2•24 days ago
|
||
CI Results
Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 1 tests and 4 subtests
Status Summary
Firefox
OK : 1
PASS: 4
Chrome
OK : 1
PASS: 4
Safari
OK : 1
PASS: 4
Links
| Assignee | ||
Updated•24 days ago
|
| Assignee | ||
Updated•24 days ago
|
| Assignee | ||
Comment 3•24 days ago
|
||
CI Results
Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 1 tests and 4 subtests
Status Summary
Firefox
OK : 1
PASS: 4
Chrome
OK : 1
PASS: 4
Safari
OK : 1
PASS: 4
Links
Comment 5•18 days ago
|
||
| bugherder | ||
Description
•