From d3d391beb0fd077491601565cfacb8269b66ee6d Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Mon, 4 Sep 2023 03:10:46 -0700 Subject: [PATCH 1/2] Add flat tree parent definition This can be used in the HTML spec as suggested in this issue: https://github.com/whatwg/html/issues/8970 --- dom.bs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dom.bs b/dom.bs index 80e4de6e..d4486a30 100644 --- a/dom.bs +++ b/dom.bs @@ -5956,6 +5956,20 @@ is an object or one of its shadow-including ancestors.

The retargeting algorithm is used by event dispatch as well as other specifications, such as Fullscreen. [[FULLSCREEN]] +

To get the flat tree parent of a node:

+ +
    +
  1. Let parent be node's parent.

  2. + +
  3. If parent is not a shadow host, then return + node.

  4. + +
  5. If node's assigned slot is null, then return null.

  6. + +
  7. Return node's assigned slot's parent.

  8. +
+

Interface {{Element}}

From db55472d19c23000c3da54c97a9ff41cf21eef49 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Mon, 4 Sep 2023 03:22:50 -0700 Subject: [PATCH 2/2] add step for shadowroots --- dom.bs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dom.bs b/dom.bs index d4486a30..1befcd6c 100644 --- a/dom.bs +++ b/dom.bs @@ -5961,6 +5961,9 @@ as other specifications, such as Fullscreen. [[FULLSCREEN]]
  1. Let parent be node's parent.

  2. +
  3. If parent is a shadow root, then return parent's host.

  4. +
  5. If parent is not a shadow host, then return node.