@@ -696,36 +696,56 @@ Name-Defining Constructs and Inheritance</h3>
696
696
697
697
If an at-rule or property defines a name that other CSS constructs can refer to it by,
698
698
such as a ''@font-face'' '@font-face/font-family!!descriptor' name
699
- or an ''@keyframes' ' name,
699
+ or an 'anchor-scope ' name,
700
700
it must be defined as a <dfn export for=CSS>tree-scoped name</dfn> .
701
- [=Tree-scoped names=] are "global" within a particular [=node tree=] ;
702
- unless otherwise specified,
703
- they're associated with the [=root=] of the [=element=] hosting the stylesheet that the at-rule or property is defined in.
704
-
705
- Properties or descriptors that reference a "global" name,
701
+ [=Tree-scoped names=] are associated with
702
+ the [=root=] of the [=element=] hosting the stylesheet
703
+ that the at-rule or property is declared in.
704
+
705
+ Additionally, [=tree-scoped names=] can be <dfn export for="tree-scoped name">loosely matched</dfn> or <dfn export for="tree-scoped name">strictly matched</dfn> ,
706
+ defaulting to [=loosely matched=] unless otherwise specified.
707
+ A [=loosely matched=] [=tree-scoped name=]
708
+ can be matched by [=tree-scoped references=]
709
+ (see below)
710
+ in the same tree or descendant trees,
711
+ while a [=strictly matched=] [=tree-scoped name=]
712
+ can only be matched by [=tree-scoped references=]
713
+ in the exact same tree.
714
+
715
+ Properties or descriptors that reference a [=tree-scoped name=] ,
706
716
such as the 'font-family!!property'
707
717
or 'animation-name' properties,
708
718
must define their value as a <dfn export for=CSS>tree-scoped reference</dfn> .
709
- [=Tree-scoped references=] implicitly capture
719
+ These references implicitly capture
710
720
a [=node tree=] [=root=]
711
721
along with their specified value:
712
722
unless otherwise specified,
713
- the [=root=] of the [=element=] hosting the stylesheet that the property or descriptor is defined in.
723
+ the [=root=] of the [=element=] hosting the stylesheet that the property or descriptor is declared in.
714
724
This [=root=] reference stays with the [=tree-scoped reference=]
715
725
as it is inherited.
716
726
717
- Whenever a [=tree-scoped reference=] is dereferenced
718
- to find the CSS construct it is referencing,
727
+ If a [=tree-scoped name=] is <dfn export for="tree-scoped name">global</dfn>
728
+ (such as ''@font-face'' names),
729
+ then when a [=tree-scoped reference=] is dereferenced to find it,
719
730
first search only the [=tree-scoped names=] associated with the same [=root=]
720
- as the [=tree-scoped reference=] must be searched .
731
+ as the [=tree-scoped reference=] .
721
732
If no relevant [=tree-scoped name=] is found,
722
733
and the [=root=] is a [=shadow root=] ,
723
- then repeat this search in the [=root=] 's [=host=]' s [=node tree=] .
724
- (In other words, [=tree-scoped names=] " inherit" into descendant shadow trees,
734
+ then repeat this search in the [=root=] 's [=host=]' s [=node tree=] (recursively) .
735
+ (In other words, global [=tree-scoped names=] “ inherit” into descendant shadow trees,
725
736
so long as they don't define the same name themselves.)
726
737
738
+ If a [=tree-scoped name=] is <dfn export for="tree-scoped name">local</dfn> to an element
739
+ (such as 'anchor-name' or 'anchor-scope' values),
740
+ then whether a [=tree-scoped reference=] matches the [=tree-scoped name=] on a given element
741
+ depends on whether the [=tree-scoped name=] is [=tree-scoped name/strictly matched|strictly=] or [=tree-scoped name/loosely matched|loosely=] matched.
742
+ A [=tree-scoped name/strictly matched=] [=tree-scoped name=] only matches if
743
+ both names are associated with the same tree.
744
+ A [=tree-scoped name/loosely matched=] [=tree-scoped name=] also matches if
745
+ the [=tree-scoped name=] is associated with an ancestor tree.
746
+
727
747
If two [=tree-scoped names=] are directly compared
728
- (for example, comparing an [=anchor name=] with an 'anchor-scope' ident ),
748
+ (for example, when comparing [=computed values=] ),
729
749
they are considered to match only if their identifiers match,
730
750
<em> and</em> their [=root=] s match exactly.
731
751
(If one has a [=root=] that's an ancestor of the other, for example,
@@ -736,6 +756,8 @@ Name-Defining Constructs and Inheritance</h3>
736
756
and the properties that reference them,
737
757
to use these concepts.
738
758
759
+ Global names include:
760
+
739
761
* ''@font-face'' , referenced by 'font-family!!property'
740
762
* ''@font-feature-values'' , referenced by 'font-family!!property'
741
763
* ''@keyframes'' , referenced by 'animation-name'
0 commit comments