feat: implement ShadowRoot::setHTMLUnsafe (#36240)

Implements #36166

---------

Signed-off-by: TG <ebiritg@gmail.com>
This commit is contained in:
Kelechi Ebiri 2025-05-01 16:19:41 +01:00 committed by GitHub
parent 5cdb0865ba
commit 1a3f10bba4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 46 additions and 4940 deletions

View file

@ -453,6 +453,15 @@ impl ShadowRootMethods<crate::DomTypeHolder> for ShadowRoot {
self.slot_assignment_mode
}
/// <https://html.spec.whatwg.org/multipage/#dom-shadowroot-sethtmlunsafe>
fn SetHTMLUnsafe(&self, html: DOMString, can_gc: CanGc) {
// Step 2. Unsafely set HTMl given this, this's shadow host, and complaintHTML
let target = self.upcast::<Node>();
let context_element = self.Host();
Node::unsafely_set_html(target, &context_element, html, can_gc);
}
// https://dom.spec.whatwg.org/#dom-shadowroot-onslotchange
event_handler!(onslotchange, GetOnslotchange, SetOnslotchange);
}