Skip to content

Commit 8f67b25

Browse files
committed
[css-scoping] Rename ::content to ::slotted per request from Shadow DOM folks
1 parent 4c0351b commit 8f67b25

1 file changed

Lines changed: 29 additions & 23 deletions

File tree

css-scoping/Overview.bs

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Work Status: Exploring
88
TR: http://www.w3.org/TR/css-scoping-1/
99
ED: http://dev.w3.org/csswg/css-scoping/
1010
Editor: Tab Atkins Jr., Google, http://xanthir.com/contact/
11-
Editor: Elika J Etemad, Invited Expert, http://fantasai.inkedblade.net/contact
11+
Editor: Elika J Etemad / fantasai, Invited Expert, http://fantasai.inkedblade.net/contact
1212
Abstract: This specification defines various scoping/encapsulation mechanisms for CSS, including scoped styles and the ''@scope'' rule, Shadow DOM selectors, and page/region-based styling.
13-
Ignored Terms: content, shadowroot, scoped
13+
Ignored Terms: slot, shadowroot, scoped
1414
Link Defaults: selectors (dfn) child combinator, html (element) style
1515
Issue Tracking: Bugzilla https://www.w3.org/Bugs/Public/buglist.cgi?component=Scoping&list_id=47685&product=CSS&resolution=---
1616
</pre>
@@ -226,7 +226,7 @@ Shadow Encapsulation</h2>
226226
This specification does not define how to mark elements as <a>distributed nodes</a>,
227227
instead leaving that to the Shadow DOM spec.
228228
At the time this spec is written, however,
229-
only <a element>content</a> elements in a <a>shadow tree</a> can be <a>insertion points</a>.
229+
only <a element>slot</a> elements in a <a>shadow tree</a> can be <a>insertion points</a>.
230230

231231
An <a>insertion point</a> must not generate any boxes.
232232
Instead, its <a>distributed nodes</a> generate boxes as normal,
@@ -382,7 +382,7 @@ Selecting Into the Light: the '':host'', '':host()'', and '':host-context()'' ps
382382
the "ancestor" of an element is:
383383

384384
: if the element is a <a>distributed node</a>
385-
:: the <a element>content</a> element it is ultimately distributed to.
385+
:: the <a element>slot</a> element it is ultimately distributed to.
386386
: if the element is a top-most element in a shadow tree
387387
:: the <a>host element</a>
388388
: otherwise
@@ -446,19 +446,16 @@ Selecting Into the Dark: the ''::shadow'' pseudo-element</h4>
446446

447447

448448
<h4 id='content-combinator'>
449-
Selecting Shadow-Projected Content: the ''::content'' pseudo-element</h4>
449+
Selecting Shadow-Projected Content: the ''::slotted'' pseudo-element</h4>
450450

451-
The <dfn selector>::content</dfn> pseudo-element matches the list of <a>distributed nodes</a> itself,
451+
The <dfn selector>::slotted</dfn> pseudo-element
452+
matches the list of <a>distributed nodes</a> itself,
452453
on elements that have them.
453454

454-
<p class="issue">
455-
''::content'' is a confusingly general name for something that is specific
456-
to the projected content of a shadow tree.
457-
458-
The ''::content'' pseudo-element must not generate boxes,
455+
The ''::slotted'' pseudo-element must not generate boxes,
459456
unless specified otherwise in another specification.
460457
However, for the purpose of Selectors,
461-
the ''::content'' pseudo-element is considered to be the parent of the <a>distributed nodes</a>.
458+
the ''::slotted'' pseudo-element is considered to be the parent of the <a>distributed nodes</a>.
462459

463460
<div class="example">
464461
For example, say you had a component with both children and a shadow tree,
@@ -480,22 +477,22 @@ Selecting Shadow-Projected Content: the ''::content'' pseudo-element</h4>
480477
</pre>
481478

482479
For a stylesheet within the <a>shadow tree</a>,
483-
a selector like ''::content div''
480+
a selector like ''::slotted div''
484481
selects ''#one'', ''#three'', and ''#four'',
485-
as they're the elements distributed by the sole <a element>content</a> element,
482+
as they're the elements distributed by the sole <a element>slot</a> element,
486483
but not ''#two''.
487484

488-
If only the <a>top-level elements</a> distributed the <a element>content</a> element are desired,
485+
If only the <a>top-level elements</a> distributed the <a element>slot</a> element are desired,
489486
a <a>child combinator</a> can be used,
490-
like ''::content > div'',
487+
like ''::slotted > div'',
491488
which will exclude ''#four''
492-
as it's not treated as a child of the ''::content'' pseudo-element.
489+
as it's not treated as a child of the ''::slotted'' pseudo-element.
493490

494-
Note: Note that a selector like ''::content div''
495-
is equivalent to ''*::content div'',
496-
where the ''*'' selects many more elements that just the <a element>content</a> element.
497-
However, since only the <a element>content</a> element has <a>distributed nodes</a>,
498-
it's the only element that has a ''::content'' pseudo-element as well.
491+
Note: Note that a selector like ''::slotted div''
492+
is equivalent to ''*::slotted div'',
493+
where the ''*'' selects many more elements that just the <a element>slot</a> element.
494+
However, since only the <a element>slot</a> element has <a>distributed nodes</a>,
495+
it's the only element that has a ''::slotted'' pseudo-element as well.
499496
</div>
500497

501498

@@ -574,7 +571,7 @@ Inheritance</h4>
574571
The <a>top-level elements</a> of a <a>shadow tree</a>
575572
inherit from their <a>host element</a>.
576573

577-
<a>Distributed nodes</a> inherit from the parent of the <a element>content</a> element they are ultimately distributed to,
574+
<a>Distributed nodes</a> inherit from the parent of the <a element>slot</a> element they are ultimately distributed to,
578575
rather than from their normal parent.
579576

580577

@@ -765,3 +762,12 @@ Region-based Styling: the ''::region'' pseudo-element</h3>
765762
<code>getComputedStyle()</code> isn't enough,
766763
because an element can exist in multiple regions, for example,
767764
with each fragment receiving different styles.
765+
766+
<h2 id="changes">
767+
Changes</h2>
768+
769+
The following significant changes were made since the
770+
<a href="http://www.w3.org/TR/2014/WD-css-scoping-1-20140403/">3 April 2014 Working Draft</a>.
771+
772+
* Renamed <css>::content</css> to ''::slotted''.
773+

0 commit comments

Comments
 (0)