From 35fad5b6fa425628bbb9ee2dfccb58288a4b8588 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Wed, 22 Feb 2023 14:33:56 +0100 Subject: [PATCH] Give ElementInternals element-reflecting attributes more power In particular allow them to point to any known element, as long as that has the same shadow-including root as the ElementInternals's element. This is not considered to break encapsulation as ElementInternals itself is encapsulated. Tests: anyone want to volunteer? Fixes #8544. --- source | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/source b/source index 120c2e3ee7b..9867d680232 100644 --- a/source +++ b/source @@ -8147,10 +8147,22 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute null:

@@ -8257,16 +8269,20 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  1. For each attrElement in - reflectedTarget's explicitly set attr-elements:

    + reflectedTarget's explicitly set attr-elements: if one of + the following is true: -
      -
    1. If attrElement is not a descendant of any of - element's shadow-including - ancestors, then continue.

    2. +
        +
      • reflectedTarget is an ElementInternals object and + attrElement's shadow-including root is element's + shadow-including root
      • -
      • Append attrElement to - elements.

      • -
    +
  2. attrElement is a descendant of any of element's + shadow-including ancestors
  3. + + +

    then append attrElement to + elements.