Skip to content

Commit 264fa3a

Browse files
committed
[css-cascade-4][css-scoping-1] Move Shadow DOM cascade definition into css-cascade. #5372
1 parent 914ec82 commit 264fa3a

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

css-cascade-4/Overview.bs

+12
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,18 @@ Cascade Order</h3>
789789

790790
Declarations from <a>origins</a> earlier in this list win over declarations from later <a>origins</a>.
791791

792+
<dt id='cascade-context'>Context
793+
<dd>
794+
A document language can provide for blending declarations sourced
795+
from different <dfn>encapsulation contexts</dfn>,
796+
such as the nested [=tree contexts=] of [=shadow trees=] in the [[!DOM]].
797+
When comparing two declarations
798+
that are sourced from different [=encapsulation contexts=],
799+
then for normal rules
800+
the declaration in the outer context wins,
801+
and for [=important=] rules
802+
the declaration from the inner context wins.
803+
792804
<dt id='cascade-scope'>Scope
793805
<dd>
794806
A declaration can be <dfn export>scoped</dfn> to a subtree of the document

css-scoping-1/Overview.bs

+1-14
Original file line numberDiff line numberDiff line change
@@ -435,20 +435,7 @@ Selecting Slot-Assigned Content: the ''::slotted()'' pseudo-element</h4>
435435
<h3 id='shadow-cascading'>
436436
Shadow Trees and the Cascade</h3>
437437

438-
To address the desired cascading behavior of rules targetting elements in shadow roots,
439-
this specification extends the <a href="https://drafts.csswg.org/css-cascade/#cascading">cascade order</a>
440-
defined in the Cascade specification. [[!CSS3CASCADE]]
441-
442-
An additional cascade criteria must be added,
443-
between Origin and Scope,
444-
called Shadow Tree.
445-
446-
* When comparing two declarations
447-
that have different <a>tree contexts</a>,
448-
then for normal rules the declaration earlier in the <a>shadow-including tree order</a> wins,
449-
and for important rules the declaration coming later in the <a>shadow-including tree order</a> wins.
450-
451-
Note: This is the <em>opposite</em> of how scoped styles work.
438+
See [[css-cascade-4#cascade-context]].
452439

453440
<!--
454441
████████ ██ ███ ████████ ████████ ████████ ████████ ████████

0 commit comments

Comments
 (0)