Closed Bug 2086904 Opened 1 month ago Closed 19 days ago

[wpt-sync] Sync PR 64119 - Don't hold references to name or id across UpdateName()/UpdateId()

Categories

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

task

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Mason Freed <masonf@chromium.org> wrote:

Don't hold references to name or id across UpdateName()/UpdateId()

Element::InsertedInto() took a const AtomicString& reference into the
element's attribute storage via GetNameAttribute() and passed it to
UpdateName(). UpdateName() calls HTMLDocument::AddNamedItem(), which
initializes the frame's WindowProxy before calling NamedItemAdded().
Initializing a sandboxed frame's script context installs
chrome.loadTimes, which can invoke a page-defined setter on a child
frame named 'chrome'. If that setter mutates the element's attributes
and reallocates the attribute vector, the name_value reference dangles
when NamedItemAdded() reads it.

This CL copies the name and id attributes into local AtomicStrings by
value before calling UpdateName() and UpdateId() in InsertedInto(),
RemovedFrom(), and CloneAttributesFrom().

Fixed: 576203565
Change-Id: If2164a83f298dcfbea9b191776016eeadd8271a3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8633114
Reviewed-by: David Baron \<dbaron@chromium.org>
Commit-Queue: David Baron \<dbaron@chromium.org>
Auto-Submit: Mason Freed \<masonf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1725772}

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]

CI Results

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

Total 57 tests and 2 subtests

Status Summary

Firefox

OK : 1[GitHub] 56[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-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS: 1[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt, GitHub] 283[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-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL: 2

Chrome

OK : 1
PASS: 1

Safari

OK : 1
PASS: 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Pushed by wptsync@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/d3d58bcd5344 https://hg.mozilla.org/integration/autoland/rev/db9227045e56 [wpt PR 64119] - Don't hold references to name or id across UpdateName()/UpdateId(), a=testonly
Status: NEW → RESOLVED
Closed: 19 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.