From cb6388c75503379832dbb171ae51df47708024ec Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Tue, 9 Jan 2024 13:26:14 -0800 Subject: [PATCH 1/2] 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 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dom.bs b/dom.bs index 6babae31..f0e31be3 100644 --- a/dom.bs +++ b/dom.bs @@ -6965,8 +6965,16 @@ 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. From 7e051b162485c97ce16f2f6168bcbaaf15a9e093 Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Fri, 12 Jan 2024 11:31:06 -0800 Subject: [PATCH 2/2] Fix indentation/wrapping --- dom.bs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dom.bs b/dom.bs index f0e31be3..d588c12b 100644 --- a/dom.bs +++ b/dom.bs @@ -6968,12 +6968,13 @@ a boolean delegatesFocus, and a boolean slotAssignment:

    Otherwise:

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

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

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

    4. Set element's shadow root's + declarative to false. -

    5. Return. +

    6. Return.

    This means that if multiple declarative shadow roots are contained within a single