From d94ce87a60632decdc0b8992a349864d6f88fde0 Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Sun, 14 Jan 2024 03:49:38 -0800 Subject: [PATCH] Reset declarative to false when calling attachShadow() This was an oversight in the spec and this matches browser behavior. This makes a second call to `attachShadow()` throw. Closes https://github.com/whatwg/dom/issues/1234. --- dom.bs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/dom.bs b/dom.bs index 6babae31..d588c12b 100644 --- a/dom.bs +++ b/dom.bs @@ -6965,8 +6965,17 @@ a boolean delegatesFocus, and a boolean slotAssignment: is false, then throw an "{{NotSupportedError!!exception}}" {{DOMException}}.
  • -

    Otherwise, remove all of element's shadow root's - children, in tree order, and return. +

    Otherwise: + +

      +
    1. Remove all of element's shadow root's + children, in tree order. + +

    2. Set element's shadow root's + declarative to false. + +

    3. Return. +

    This means that if multiple declarative shadow roots are contained within a single shadow host, only the last one will remain.