Implement ElementInternals::shadowRoot (#35923)

* Implement ElementInternals::shadowRoot

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Update WPT expectations

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2025-03-12 01:09:32 +01:00 committed by GitHub
parent f527217bdc
commit 8034216d06
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 44 additions and 12 deletions

View file

@ -542,6 +542,16 @@ impl Element {
clonable,
can_gc,
);
// Step 7. If elements custom element state is "precustomized" or "custom",
// then set shadows available to element internals to true.
if matches!(
self.get_custom_element_state(),
CustomElementState::Precustomized | CustomElementState::Custom
) {
shadow_root.set_available_to_element_internals(true);
}
self.ensure_rare_data().shadow_root = Some(Dom::from_ref(&*shadow_root));
shadow_root
.upcast::<Node>()