From 8588e3b4b68e89a66e1081ec195d9bab2d8b644c Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Tue, 16 Jan 2024 13:49:00 -0800 Subject: [PATCH] Modify the logic for double-declarative shadow root attachment Per the discussion at https://github.com/whatwg/dom/issues/1235, this PR makes the *first* declarative shadow root "win". Prior behavior was for the *last* one to remain, but this PR changes second and subsequent declarative shadow roots to report an exception instead. --- source | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/source b/source index 9b91774e979..a37c3b578d1 100644 --- a/source +++ b/source @@ -126151,26 +126151,20 @@ document.body.appendChild(text); data-x="attr-template-shadowrootdelegatesfocus">shadowrootdelegatesfocus attribute; otherwise false.

-
  • Attach a shadow root with - declarative shadow host element, mode, clonable, - delegatesFocus, and "named".

  • +
  • If declarative shadow host element is a shadow host, then + insert an element at the adjusted insertion location with + template.

  • -

    If an exception was thrown by attach a - shadow root, then catch it, and run these steps:

    +

    Otherwise:

      -
    1. Report the exception.

    2. +
    3. Attach a shadow root with + declarative shadow host element, mode, clonable, + delegatesFocus, and "named". If an exception is thrown, + then catch it, report the exception, insert an element at the adjusted + insertion location with template, and return.

    4. -
    5. Insert an element at the adjusted insertion location with - template.

    6. -
    -
  • - -
  • -

    Otherwise:

    - -
    1. Let shadow be declarative shadow host element's shadow root.