@@ -146,13 +146,17 @@ Cascade Sorting Order</h3>
146146 Each declaration has the same specificity as the style rule it appears in.
147147 The declaration with the highest specificity wins.
148148
149- <dt id='cascade-proximity'> <dfn>Scoping Proximity</dfn>
149+ <dt id='cascade-proximity'> <dfn>Scope Proximity</dfn>
150150 <dd>
151- If two declarations both have elements
152- selected by scoped descendant relationships
153- applying [=scoping proximity=] ,
154- then the declaration with the fewest generational hops
155- between the ancestor/descendant element pair wins.
151+ When comparing declarations that appear in style rules
152+ with different [=scoping roots=] ,
153+ then the declaration with the fewest
154+ generational or sibling-element hops
155+ between the [=scoping root=] and the
156+ [=scoped style rule=] [=subject=] wins.
157+ For this purpose,
158+ style rules without a [=scoping root=]
159+ are considered to have inifinite proximity hops.
156160
157161 <dt id='cascade-order'> Order of Appearance
158162 <dd>
@@ -308,17 +312,14 @@ Effects of ''@scope''</h4>
308312 * The [=cascade=] prioritizes declarations
309313 with a [=scope proximity|more proximate=] [=scoping root=] ,
310314 regardless of specificity or source order
311- by applying [=scoping proximity=]
312- between the [=scoping root=] and the [=subject=] of each [=scoped style rule=] .
313- <!-- This causes declarations [insert appropriate sentence from issue below] . -->
315+ by applying [=scope proximity=]
316+ between the [=scoping root=] and the [=subject=]
317+ of each [=scoped style rule=] .
314318
315319 Note: Unlike <a href="https://www.w3.org/TR/css-nesting/">Nesting</a> ,
316320 selectors within an ''@scope'' rule
317321 do not acquire the specificity of any parent selector(s) in the ''@scope'' prelude.
318322
319- Note: For [[#scope-scope|nested @scope rules]] ,
320- only the innermost ''@scope'' matters for determining [=scoping proximity=] .
321-
322323 <div class=example>
323324 The following selectors have the same specificity (0,0,1):
324325
@@ -334,7 +335,7 @@ Effects of ''@scope''</h4>
334335 is not applied to the specificity of the scoped selector.
335336 However, since one <{img}> selector is scoped,
336337 that selector is weighted more strongly in the cascade
337- with the application of [=scoping proximity=] .
338+ with the application of [=scope proximity=] .
338339 </div>
339340
340341 <div class=example>
@@ -598,11 +599,23 @@ Scope Nesting</h4>
598599
599600 ''@scope'' rules can be nested.
600601 In this case, just as with the nested style rules,
601- the selectors of the inner ''@scope''
602- (including those defining its [=scope=] )
602+ the prelude selectors of the inner ''@scope''
603+ (those defining its [=scope=] )
603604 are [=scoped selectors|scoped by=]
604605 the selectors of the outer one.
605606
607+ Note: The resulting [=scope=]
608+ for further nested [=scoped style rules=]
609+ is practically constrained by both
610+ the outer and inner ''@scope'' rules,
611+ but the [=scoping root=] is defined
612+ by the innermost ''@scope'' .
613+ Since [=scope proximity=] is measured
614+ between a [=scoped style rule=] [=subject=]
615+ and [=scoping root=] ,
616+ only the innermost ''@scope'' matters
617+ for determining [=scope proximity=] of [[#scope-scope|nested @scope rules]] .
618+
606619 <div class=example>
607620 When nesting ''@scope'' rules inside other ''@scope'' rules,
608621 or inside other selectors,
@@ -704,14 +717,29 @@ Changes</h2>
704717This appendix is <em> informative</em> .
705718
706719<h3 id="changes-2022-08">
707- Changes since the 21 December 2021 First Public Working Draft</h3>
720+ Changes since the 21 March 2023 Working Draft</h3>
708721
709722 Significant changes since the
710- <a href="https://www.w3.org/TR/2021/WD-css-cascade-6-20211221/">21 December 2021 First Public Working Draft</a> include:
723+ <a href="https://www.w3.org/TR/2023/WD-css-cascade-6-20230321/">21 March 2023 Working Draft</a> include:
724+
725+ * Clarified that [=scope proximity=] is a single measurement of the steps
726+ between a single [=scoping root=] and [=scoped style rule=] [=subject=] .
711727
712- * Removed strong scoping proximity.
728+ * Removed strong scope proximity.
713729 (<a href="https://github.com/w3c/csswg-drafts/issues/6790">Issue 6790</a> )
714730
731+ * Removed the scoped descendant combinator (deferred).
732+ (<a href="https://github.com/w3c/csswg-drafts/issues/8628">Issue 8628</a> )
733+
734+ * Added the {{CSSScopeRule}} interface.
735+ (<a href="https://github.com/w3c/csswg-drafts/issues/8626">Issue 8626</a> )
736+
737+ <h3 id="changes-2022-08">
738+ Changes since the 21 December 2021 First Public Working Draft</h3>
739+
740+ Significant changes since the
741+ <a href="https://www.w3.org/TR/2021/WD-css-cascade-6-20211221/">21 December 2021 First Public Working Draft</a> include:
742+
715743 * Clarified ''@scope'' effects on nested '':scope'' and ''&'' selectors.
716744 (<a href="https://github.com/w3c/csswg-drafts/issues/8377">Issue 8377</a> )
717745
@@ -721,18 +749,12 @@ Changes since the 21 December 2021 First Public Working Draft</h3>
721749 * Specified how name-defining [=at-rules=] behave in ''@scope'' .
722750 (<a href="https://github.com/w3c/csswg-drafts/issues/6895">Issue 6895</a> )
723751
724- * Added the {{CSSScopeRule}} interface.
725- (<a href="https://github.com/w3c/csswg-drafts/issues/8626">Issue 8626</a> )
726-
727752 * Added implicit scopes by making ''<<scope-start>>'' optional.
728753 (<a href="https://github.com/w3c/csswg-drafts/issues/6606">Issue 6606</a> )
729754
730755 * Disallowed [=pseudo-elements=] in the ''@scope'' prelude.
731756 (<a href="https://github.com/w3c/csswg-drafts/issues/7382">Issue 7382</a> )
732757
733- * Removed the scoped descendant combinator (deferred).
734- (<a href="https://github.com/w3c/csswg-drafts/issues/8628">Issue 8628</a> )
735-
736758 * Removed selector scoping notation.
737759 (<a href="https://github.com/w3c/csswg-drafts/issues/7709">Issue 7709</a> )
738760
0 commit comments