-
Notifications
You must be signed in to change notification settings - Fork 709
/
Copy pathOverview.bs
143 lines (115 loc) · 6.19 KB
/
Overview.bs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<pre class='metadata'>
Title: CSS Scoping Module Level 2
Level: 2
Shortname: css-scoping
Group: CSSWG
Status: ED
Work Status: Exploring
TR: https://www.w3.org/TR/css-scoping-1/
ED: https://drafts.csswg.org/css-scoping/
Editor: Tab Atkins Jr., Google, http://xanthir.com/contact/, w3cid 42199
Editor: Miriam E. Suzanne, Invited Expert, http://miriamsuzanne.com/contact, w3cid 117151
Abstract: This specification defines scoping/encapsulation mechanisms for CSS.
Ignored Terms: inherit, slot, custom elements, stylesheets
Ignored Vars: root elements
</pre>
<pre class="link-defaults">
spec:dom; type:dfn;
text:host
text:shadow root; for:/
text:root; for:tree
text:find slottables
text:find flattened slottables
text:element; for:/
spec:html; type:element; text:style
spec:selectors-4; type:dfn;
text: static profile
text: dynamic profile
spec:css-pseudo-4; type:selector;
text:::before
text:::after
spec:cascade-4; type:dfn; text: inherit
</pre>
<h2 id="intro">
Introduction</h2>
Issue: This is a diff spec over <a href="https://www.w3.org/TR/css-scoping-1/">CSS Scoping Module Level 1</a>.
It is currently an Exploratory Working Draft:
if you are implementing anything, please use Level 1 as a reference.
We will merge the Level 1 text into this draft once it reaches CR.
<!--
████████ ████████ ████████ ███ ██ ██ ██ ████████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ██ ██████ ██████ ██ ██ ██ ██ ██ ██
██ ██ ██ ██ █████████ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ██
████████ ████████ ██ ██ ██ ███████ ████████ ██
-->
<h2 id='default-element-styles'>
Default Styles for Custom Elements</h2>
Issue: [[css-scoping-1#default-element-styles]]
<!--
██████ ██ ██ ███ ████████ ███████ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██████ █████████ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ██ ██ █████████ ██ ██ ██ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██████ ██ ██ ██ ██ ████████ ███████ ███ ███
-->
<h2 id='shadow-dom'>
Shadow Encapsulation</h2>
Issue: [[css-scoping-1#shadow-dom]]
<!--
██████ ██████ ███████ ████████ ████ ██ ██ ██████
██ ██ ██ ██ ██ ██ ██ ██ ██ ███ ██ ██ ██
██ ██ ██ ██ ██ ██ ██ ████ ██ ██
██████ ██ ██ ██ ████████ ██ ██ ██ ██ ██ ████
██ ██ ██ ██ ██ ██ ██ ████ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ███ ██ ██
██████ ██████ ███████ ██ ████ ██ ██ ██████
-->
<h2 id='scope'>
Scoped Styles</h2>
Issue: Introduce scoped styles
<!--
███████ ██████ ██████ ███████ ████████ ████████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ███ ██ ██ ██ ██ ██ ██ ██ ██
██ ███ ██ ██████ ██ ██ ██ ████████ ██████
██ █████ ██ ██ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ██
███████ ██████ ██████ ███████ ██ ████████
-->
<h3 id='scope-atrule'>
Scoping Styles in CSS: the ''@scope'' rule</h3>
The <dfn>@scope</dfn> at-rule allows authors to create scoped style rules using CSS syntax.
The syntax of the ''@scope'' rule is:
<pre class='prod'>
@scope (<<selector-list>>) [to (<<selector-list>>)]? {
<<stylesheet>>
}
</pre>
Issue: Define the ''@scope'' rule
Issue: Define scope proximity in the cascade (cross-reference css-cascade)
<h3 id='in-scope-selector'>
Selecting inside a scope: the '':in-scope'' pseudo-class</h3>
The <dfn>:in-scope</dfn> pseudo-class allows authors to
select elements that are within a given scope.
Issue: Define an '':in-scope'' selector (cross-reference css-selectors)
<h2 id="changes">
Changes</h2>
<h3 id="additions-l">
Additions Since Level 1</h3>
The following features have been added since
<a href="https://www.w3.org/TR/css-scoping-1/">Level 1</a>:
* The ''@scope'' rule
* The '':in-scope()'' pseudo-class
Privacy and Security Considerations {#priv-sec}
===============================================
This specification introduces Shadow DOM and some shadow-piercing capabilities,
but this does not introduce any privacy or security issues--
shadow DOM, as currently specified, is intentionally not a privacy/security boundary
(and the parts of the UA that use shadow DOM and <em>do</em> have a privacy/security boundary
implicitly rely on protections not yet specified,
which protect them from the things defined in this specification).