Skip to content

Commit 8d80f3c

Browse files
lillestabatkins
andauthored
[css-values-5] Don't use flat tree for tree-counting #9562 (#12144)
* [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] #9562 (comment) * Update css-values-5/Overview.bs --------- Co-authored-by: Tab Atkins Jr. <[email protected]>
1 parent 5f59903 commit 8d80f3c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

css-values-5/Overview.bs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2755,7 +2755,7 @@ Tree Counting Functions: the ''sibling-count()'' and ''sibling-index()'' notatio
27552755
as an <<integer>>,
27562756
the index of the element
27572757
on which the notation is used
2758-
among the children of its parent.
2758+
among its [=inclusive siblings=].
27592759
Like '':nth-child()'',
27602760
''sibling-index()'' is 1-indexed.
27612761

@@ -2803,9 +2803,9 @@ Tree Counting Functions: the ''sibling-count()'' and ''sibling-index()'' notatio
28032803

28042804
</div>
28052805

2806-
Note: Like the rest of CSS (other than [=selectors=]),
2807-
''sibling-count()'' and ''sibling-index()''
2808-
operate on the [=flat tree=].
2806+
Note: These functions, to match [=selectors=] like '':nth-child()'', operate on the DOM tree,
2807+
rather than the [=flat tree] like most CSS values do.
2808+
They may, in the future, have variants that support counting [=flat tree=] siblings.
28092809

28102810
Note: These functions may, in the future,
28112811
be extended to accept an ''of <<complex-real-selector-list>>'' argument,

0 commit comments

Comments
 (0)