Files
sousa-gecko/testing/web-platform/tests/custom-elements
Blink WPT Bot 99c47af6f9 Bug 2035077 [wpt PR 59458] - Fix insertAdjacentHTML and outerHTML using wrong customElementRegistry, a=testonly
Automatic update from web-platform-tests
Fix insertAdjacentHTML and outerHTML using wrong customElementRegistry (#59458)

insertAdjacentHTML with 'beforebegin'/'afterend' and the outerHTML setter
were incorrectly passing the calling element's customElementRegistry to
the HTML fragment parser, instead of the containing scope's (parent's)
registry.

For 'beforebegin'/'afterend', new nodes become siblings under the
parent, so they should inherit the parent's registry. The code already
correctly resolved context_node to the parent, but the registry was
still taken from 'this' element.

The fix derives the registry from context_node: if it's an Element, use
its customElementRegistry(); otherwise fall back to the tree scope's
registry (handles ShadowRoot and DocumentFragment parents).

Bug: 489973914
Change-Id: I31658ed4c95039a92ee883ee57782e8947c206fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7789715
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Commit-Queue: Jayson Chen <jaysonchen@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1620451}

Co-authored-by: Jayson Chen <jaysonchen@microsoft.com>
--

wpt-commits: 2d0bdb9840ddf9755c3cf92339efdc982f2d98d4
wpt-pr: 59458
2026-05-15 21:09:39 +00:00
..