From 061d7009c095967340265c13b701ea3abc065548 Mon Sep 17 00:00:00 2001 From: Rune Lillesveen Date: Fri, 2 May 2025 09:17:15 +0200 Subject: [PATCH 1/2] [css-values-5] Don't use flat tree for tree-counting #9562 Per resolution[1], tree counting functions should not use the flat tree for indexing. Instead use the term 'inclusive siblings' from the DOM spec, which is the same term that :nth-*() selectors use. [1] https://github.com/w3c/csswg-drafts/issues/9562#issuecomment-2824834068 --- css-values-5/Overview.bs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/css-values-5/Overview.bs b/css-values-5/Overview.bs index b280a82c838..82e9c358ec2 100644 --- a/css-values-5/Overview.bs +++ b/css-values-5/Overview.bs @@ -2755,7 +2755,7 @@ Tree Counting Functions: the ''sibling-count()'' and ''sibling-index()'' notatio as an <>, the index of the element on which the notation is used - among the children of its parent. + among its [=inclusive siblings=]. Like '':nth-child()'', ''sibling-index()'' is 1-indexed. @@ -2803,9 +2803,8 @@ Tree Counting Functions: the ''sibling-count()'' and ''sibling-index()'' notatio - Note: Like the rest of CSS (other than [=selectors=]), - ''sibling-count()'' and ''sibling-index()'' - operate on the [=flat tree=]. + Note: These functions may, in the future, have variants that support counting + [=flat tree=] siblings. Note: These functions may, in the future, be extended to accept an ''of <>'' argument, From 34a8ab703af518ea3e4a72627ec30a818724dc80 Mon Sep 17 00:00:00 2001 From: "Tab Atkins Jr." Date: Fri, 2 May 2025 12:55:53 -0700 Subject: [PATCH 2/2] Update css-values-5/Overview.bs --- css-values-5/Overview.bs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/css-values-5/Overview.bs b/css-values-5/Overview.bs index 82e9c358ec2..ad2fca2d667 100644 --- a/css-values-5/Overview.bs +++ b/css-values-5/Overview.bs @@ -2803,8 +2803,9 @@ Tree Counting Functions: the ''sibling-count()'' and ''sibling-index()'' notatio - Note: These functions may, in the future, have variants that support counting - [=flat tree=] siblings. + Note: These functions, to match [=selectors=] like '':nth-child()'', operate on the DOM tree, + rather than the [=flat tree] like most CSS values do. + They may, in the future, have variants that support counting [=flat tree=] siblings. Note: These functions may, in the future, be extended to accept an ''of <>'' argument,