Skip to content

Commit

Permalink
[css-cascade-6] Remove strong scoping proximity
Browse files Browse the repository at this point in the history
  • Loading branch information
andruud committed Apr 14, 2023
1 parent 119d25e commit cb006d6
Showing 1 changed file with 8 additions and 30 deletions.
38 changes: 8 additions & 30 deletions css-cascade-6/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -140,35 +140,22 @@ Cascade Sorting Order</h3>
Note: This follows the same logic used for precedence of [=normal=] and [=important=] [=origins=],
thus the ''!important'' flag maintains the same “override” purpose in both settings.

<dt id='cascade-proximity-strong'><dfn>Strong Scoping Proximity</dfn>
<dd>
If two declarations both have elements
selected by scoped descendant relationships
applying [=strong scoping proximity=],
then the declaration with the fewest generational hops
between the ancestor/descendant element pair wins.

If multiple such pairs are represented,
their [=strong scoping proximity=] weights are compared
from innermost scoping relationship to outermost scoping relationship
(with any missing pairs weighted as infinity).

<dt id='cascade-specificity'>Specificity
<dd>
The <a href="https://www.w3.org/TR/selectors/#specificity">Selectors module</a> [[!SELECT]] describes how to compute the specificity of a selector.
Each declaration has the same specificity as the style rule it appears in.
The declaration with the highest specificity wins.

<dt id='cascade-proximity-weak'><dfn>Weak Scoping Proximity</dfn>
<dt id='cascade-proximity'><dfn>Scoping Proximity</dfn>
<dd>
If two declarations both have elements
selected by scoped descendant relationships
applying [=weak scoping proximity=],
applying [=scoping proximity=],
then the declaration with the fewest generational hops
between the ancestor/descendant element pair wins.

If multiple such pairs are represented,
their [=weak scoping proximity=] weights are compared
their [=scoping proximity=] weights are compared
from innermost scoping relationship to outermost scoping relationship
(with any missing pairs weighted as infinity).

Expand All @@ -191,8 +178,6 @@ Cascade Sorting Order</h3>
</ul>
</dl>

Issue(6790): Does <dfn>scope proximity</dfn> belong above or below specificity in the cascade?

The <dfn export>output of the cascade</dfn>
is a (potentially empty) sorted list of <a>declared values</a> for each property on each element.

Expand Down Expand Up @@ -328,20 +313,10 @@ Effects of ''@scope''</h4>
* The [=cascade=] prioritizes declarations
with a [=scope proximity|more proximate=] [=scoping root=],
regardless of specificity or source order
by applying [=weak scoping proximity=]
by applying [=scoping proximity=]
between the [=scoping root=] and the [=subject=] of each [=scoped style rule=].
<!-- This causes declarations [insert appropriate sentence from issue below]. -->

Issue(6790): Should ''@scope'' use strong or weak scoping proximity?
[=Strong scoping proximity=] causes declarations to be weighted more strongly
by scope proximity than by their selector’s specificity.
[=Weak scoping proximity=] causes declarations of the same specificity
to be weighted by proximity to their scoping root
before falling back to source ordering,
but declarations of higher specificity win over more tightly-scoped declarations.
The Working Group currently leans towards weak proximity,
and recommends that as a starting point for prototypes.

Note: Unlike <a href="https://www.w3.org/TR/css-nesting/">Nesting</a>,
selectors within an ''@scope'' rule
do not acquire the specificity of any parent selector(s) in the ''@scope'' prelude.
Expand All @@ -361,7 +336,7 @@ Effects of ''@scope''</h4>
is not applied to the specificity of the scoped selector.
However, since one <{img}> selector is scoped,
that selector is weighted more strongly in the cascade
with the application of [=weak scoping proximity=].
with the application of [=scoping proximity=].
</div>

<div class=example>
Expand Down Expand Up @@ -794,6 +769,9 @@ Changes since the 21 December 2021 First Public Working Draft</h3>
Significant changes since the
<a href="https://www.w3.org/TR/2021/WD-css-cascade-6-20211221/">21 December 2021 First Public Working Draft</a> include:

* Removed strong scoping proximity.
(<a href="https://github.com/w3c/csswg-drafts/issues/6790">Issue 6790</a>)

* Clarified ''@scope'' effects on nested '':scope'' and ''&'' selectors.
(<a href="https://github.com/w3c/csswg-drafts/issues/8377">Issue 8377</a>)

Expand Down

0 comments on commit cb006d6

Please sign in to comment.