From a19366a51233a43614b5bb7bc9edc62ef813c7f6 Mon Sep 17 00:00:00 2001
From: Anne van Kesteren
Date: Wed, 10 Jun 2026 04:59:00 -0700
Subject: [PATCH] headingoffset computation should not use the flat tree
Like the lang attribute it should use the composed tree. Or in other words, semantics should not be impacted by slotting.
---
source | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/source b/source
index 640465da59f..6dc9d19de2d 100644
--- a/source
+++ b/source
@@ -20833,8 +20833,12 @@ interface HTMLHeadingElement : HTMLElement {
and has a headingreset attribute, then return
offset.
- Set inclusiveAncestor to the parent node of inclusiveAncestor
- within the flat tree.
+ If inclusiveAncestor's parent is a shadow root, then set
+ inclusiveAncestor to that shadow root's host and continue.
+
+ Set inclusiveAncestor to inclusiveAncestor's parent
+ element.