Skip to content

Commit 2541254

Browse files
committed
[shadow-styling] Move the Cascade section.
1 parent d6049b3 commit 2541254

2 files changed

Lines changed: 101 additions & 95 deletions

File tree

shadow-styling/Overview.bs

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,42 @@ Host Elements in a Shadow Tree</h3>
129129

130130

131131

132+
<h2 id='cascading'>
133+
Changes to the Cascading Model</h2>
134+
135+
To address the desired cascading behavior of rules targetting elements in shadow roots,
136+
this specification extends the <a href="http://dev.w3.org/csswg/css-cascade/#cascading">cascade order</a>
137+
defined in the Cascade specification. [[!CSS3CASCADE]]
138+
139+
An additional cascade criteria must be added,
140+
between Origin and Scope,
141+
called Shadow Tree.
142+
143+
<ul>
144+
<li>
145+
When comparing two declarations,
146+
if one of them is in a <a>shadow tree</a>
147+
and the other is in a document that contains that <a>shadow tree</a>,
148+
then for normal rules the declaration from the outer document wins,
149+
and for important rules the declaration from the <a>shadow tree</a> wins.
150+
151+
Note: This is the <em>opposite</em> of how scoped styles work.
152+
153+
<li>
154+
When comparing two declarations,
155+
if both are in <a>shadow trees</a> with the same <a>host element</a>,
156+
then for normal rules the declaration from the <a>shadow tree</a> that was created most recently wins,
157+
and for important rules the declaration from the <a>shadow tree</a> that was created less recently wins.
158+
</ul>
159+
160+
When calculating <a href="http://dev.w3.org/csswg/css-cascade/#cascade-order">Order of Appearance</a>,
161+
the tree of trees,
162+
defined by the Shadow DOM specification,
163+
is used to calculate ordering.
164+
165+
166+
167+
132168
<h2 id='inheritance'>
133169
Shadow DOM Combinators</h2>
134170

@@ -398,36 +434,3 @@ Selecting the Shadow Root Itself: the ''::shadow'' pseudo-element</h3>
398434
like ''x-foo /shadow/ span'',
399435
to select all the elements of some type in the <a>shadow tree</a>.
400436
</div>
401-
402-
<h2 id='cascading'>
403-
Changes to the Cascading Model</h2>
404-
405-
To address the desired cascading behavior of rules targetting elements in shadow roots,
406-
this specification extends the <a href="http://dev.w3.org/csswg/css-cascade/#cascading">cascade order</a>
407-
defined in the Cascade specification. [[!CSS3CASCADE]]
408-
409-
An additional cascade criteria must be added,
410-
between Origin and Scope,
411-
called Shadow Tree.
412-
413-
<ul>
414-
<li>
415-
When comparing two declarations,
416-
if one of them is in a <a>shadow tree</a>
417-
and the other is in a document that contains that <a>shadow tree</a>,
418-
then for normal rules the declaration from the outer document wins,
419-
and for important rules the declaration from the <a>shadow tree</a> wins.
420-
421-
Note: This is the <em>opposite</em> of how scoped styles work.
422-
423-
<li>
424-
When comparing two declarations,
425-
if both are in <a>shadow trees</a> with the same <a>host element</a>,
426-
then for normal rules the declaration from the <a>shadow tree</a> that was created most recently wins,
427-
and for important rules the declaration from the <a>shadow tree</a> that was created less recently wins.
428-
</ul>
429-
430-
When calculating <a href="http://dev.w3.org/csswg/css-cascade/#cascade-order">Order of Appearance</a>,
431-
the tree of trees,
432-
defined by the Shadow DOM specification,
433-
is used to calculate ordering.

0 commit comments

Comments
 (0)