|
54 | 54 | </p> |
55 | 55 | <h1 class="p-name no-ref" id=title>CSS Scoping Module Level 1</h1> |
56 | 56 | <h2 class="no-num no-toc no-ref heading settled heading" id=subtitle><span class=content>Editor’s Draft, |
57 | | - <span class=dt-updated><span class=value-title title=20140407>7 April 2014</span></span></span></h2> |
| 57 | + <span class=dt-updated><span class=value-title title=20140409>9 April 2014</span></span></span></h2> |
58 | 58 | <div data-fill-with=spec-metadata><dl><dt>This version:<dd><a class=u-url href=http://dev.w3.org/csswg/css-scoping/>http://dev.w3.org/csswg/css-scoping/</a><dt>Latest version:<dd><a href=http://www.w3.org/TR/css-scoping-1/>http://www.w3.org/TR/css-scoping-1/</a><dt>Editor’s Draft:<dd><a href=http://dev.w3.org/csswg/css-scoping/>http://dev.w3.org/csswg/css-scoping/</a> |
59 | 59 | <dt>Feedback:</dt> |
60 | 60 | <dd><a href="mailto:www-style@w3.org?subject=%5Bcss-scoping%5D%20feedback">www-style@w3.org</a> |
@@ -115,7 +115,7 @@ <h2 class="no-num no-toc no-ref heading settled heading" id=contents><span class |
115 | 115 | <li><a href=#scope-atrule><span class=secno>2.1.2</span> CSS Syntax for Scoping: the <a class=css data-link-type=maybe href=#at-ruledef-scope title=@scope>@scope</a> rule</a></ul> |
116 | 116 | <li><a href=#scoping-context><span class=secno>2.2</span> Querying the Scoping Context</a> |
117 | 117 | <ul class=toc> |
118 | | - <li><a href=#scope-pseudo><span class=secno>2.2.1</span> Selecting the Scoping Root: <a class=css data-link-type=maybe href=http://www.w3.org/TR/selectors4/#scope-pseudo title=:scope>:scope</a> pseudo-class</a> |
| 118 | + <li><a href=#scope-pseudo><span class=secno>2.2.1</span> Selecting the Scoping Root: <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/selectors-4/#scope-pseudo title=:scope>:scope</a> pseudo-class</a> |
119 | 119 | <li><a href=#scope-content-pseudo><span class=secno>2.2.2</span> Selecting Outside the Scope: <span class=css data-link-type=maybe title=:scope-context()>:scope-context()</span> pseudo-class</a></ul></ul> |
120 | 120 | <li><a href=#shadow-dom><span class=secno>3</span> Shadow Encapsulation</a> |
121 | 121 | <ul class=toc> |
@@ -177,6 +177,27 @@ <h3 class="heading settled heading" data-level=2.1 id=scoping-mechanisms><span c |
177 | 177 | <p> Style rules can be scoped using constructs defined in the document language |
178 | 178 | or using the <a class=css data-link-type=maybe href=#at-ruledef-scope title=@scope>@scope</a> rule in CSS. |
179 | 179 |
|
| 180 | +<p> “Scoping” consists of three somewhat independent concepts, |
| 181 | + which are in practice generally used together: |
| 182 | + |
| 183 | +<p> <ul> |
| 184 | + <li> |
| 185 | + A declaration can be scoped to <a data-link-type=dfn href=http://dev.w3.org/csswg/selectors-4/#scoping-root title="scoping root">scoping root</a>, |
| 186 | + which <a href=http://dev.w3.org/csswg/css-cascade/#cascade-scope>affects its cascading behavior</a>. <a data-biblio-type=normative data-link-type=biblio href=#css3cascade title=css3cascade>[CSS3CASCADE]</a> |
| 187 | + (Alternately, a style rule can be scoped to <a data-link-type=dfn href=http://dev.w3.org/csswg/selectors-4/#scoping-root title="scoping root">scoping root</a>, |
| 188 | + which scopes all of the declarations it contains to that <a data-link-type=dfn href=http://dev.w3.org/csswg/selectors-4/#scoping-root title="scoping root">scoping root</a>.) |
| 189 | + |
| 190 | + <li> |
| 191 | + A selector can be either <a data-link-type=dfn href=http://dev.w3.org/csswg/selectors-4/#scope-contained- title=scope-contained>scope-contained</a> or <a data-link-type=dfn href=http://dev.w3.org/csswg/selectors-4/#scope-filtered- title=scope-filtered>scope-filtered</a> to a <a data-link-type=dfn href=http://dev.w3.org/csswg/selectors-4/#scoping-root title="scoping root">scoping root</a>, |
| 192 | + which <a href=http://dev.w3.org/csswg/selectors/#evaluating-selectors>limits what elements it is allowed to match</a>. <a data-biblio-type=normative data-link-type=biblio href=#selectors4 title=selectors4>[SELECTORS4]</a> |
| 193 | + |
| 194 | + <li> |
| 195 | + The <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/selectors-4/#scope-pseudo title=:scope>:scope</a> pseudo-class matches whatever the context sets as the <a data-link-type=dfn title=":scope elements">:scope elements</a>, |
| 196 | + and is used by several features, such as relative selectors. |
| 197 | + In the absence of any anything explicitly setting the <a data-link-type=dfn title=":scope elements">:scope elements</a> to something, |
| 198 | + the <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/selectors-4/#scope-pseudo title=:scope>:scope</a> pseudo-class matches the selector’s <a data-link-type=dfn href=http://dev.w3.org/csswg/selectors-4/#scoping-root title="scoping root">scoping root</a>. |
| 199 | + </ul> |
| 200 | + |
180 | 201 | <h4 class="heading settled heading" data-level=2.1.1 id=scoping-markup><span class=secno>2.1.1 </span><span class=content> |
181 | 202 | Document Markup for Scoping</span><a class=self-link href=#scoping-markup></a></h4> |
182 | 203 |
|
@@ -1013,11 +1034,11 @@ <h2 class="no-num no-ref heading settled heading" id=references><span class=cont |
1013 | 1034 |
|
1014 | 1035 | <h3 class="no-num no-ref heading settled heading" id=normative><span class=content> |
1015 | 1036 | Normative References</span><a class=self-link href=#normative></a></h3> |
1016 | | -<div data-fill-with=normative-references><dl><dt id=css21 title=CSS21><a class=self-link href=#css21></a>[CSS21]<dd>Bert Bos; et al. <a href=http://www.w3.org/TR/2011/REC-CSS2-20110607>Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification</a>. 7 June 2011. W3C Recommendation. URL: <a href=http://www.w3.org/TR/2011/REC-CSS2-20110607>http://www.w3.org/TR/2011/REC-CSS2-20110607</a><dt id=css3cascade title=CSS3CASCADE><a class=self-link href=#css3cascade></a>[CSS3CASCADE]<dd>Håkon Wium Lie; Elika J. Etemad; Tab Atkins Jr.. <a href=http://www.w3.org/TR/2013/CR-css-cascade-3-20131003/>CSS Cascading and Inheritance Level 3</a>. 3 October 2013. W3C Candidate Recommendation. (Work in progress.) URL: <a href=http://www.w3.org/TR/2013/CR-css-cascade-3-20131003/>http://www.w3.org/TR/2013/CR-css-cascade-3-20131003/</a><dt id=dom title=DOM><a class=self-link href=#dom></a>[DOM]<dd>Anne van Kesteren; Aryeh Gregor; Ms2ger. <a href=http://dom.spec.whatwg.org/>DOM Living Standard</a>. WHATWG Living Standard. (Work in progress.) URL: <a href=http://dom.spec.whatwg.org/>http://dom.spec.whatwg.org/</a><dt id=rfc2119 title=RFC2119><a class=self-link href=#rfc2119></a>[RFC2119]<dd>S. Bradner. <a href=http://www.ietf.org/rfc/rfc2119.txt>Key words for use in RFCs to Indicate Requirement Levels</a>. URL: <a href=http://www.ietf.org/rfc/rfc2119.txt>http://www.ietf.org/rfc/rfc2119.txt</a></dl></div> |
| 1037 | +<div data-fill-with=normative-references><dl><dt id=css21 title=CSS21><a class=self-link href=#css21></a>[CSS21]<dd>Bert Bos; et al. <a href=http://www.w3.org/TR/2011/REC-CSS2-20110607>Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification</a>. 7 June 2011. W3C Recommendation. URL: <a href=http://www.w3.org/TR/2011/REC-CSS2-20110607>http://www.w3.org/TR/2011/REC-CSS2-20110607</a><dt id=css3cascade title=CSS3CASCADE><a class=self-link href=#css3cascade></a>[CSS3CASCADE]<dd>Håkon Wium Lie; Elika J. Etemad; Tab Atkins Jr.. <a href=http://www.w3.org/TR/2013/CR-css-cascade-3-20131003/>CSS Cascading and Inheritance Level 3</a>. 3 October 2013. W3C Candidate Recommendation. (Work in progress.) URL: <a href=http://www.w3.org/TR/2013/CR-css-cascade-3-20131003/>http://www.w3.org/TR/2013/CR-css-cascade-3-20131003/</a><dt id=dom title=DOM><a class=self-link href=#dom></a>[DOM]<dd>Anne van Kesteren; Aryeh Gregor; Ms2ger. <a href=http://dom.spec.whatwg.org/>DOM Living Standard</a>. WHATWG Living Standard. (Work in progress.) URL: <a href=http://dom.spec.whatwg.org/>http://dom.spec.whatwg.org/</a><dt id=rfc2119 title=RFC2119><a class=self-link href=#rfc2119></a>[RFC2119]<dd>S. Bradner. <a href=http://www.ietf.org/rfc/rfc2119.txt>Key words for use in RFCs to Indicate Requirement Levels</a>. URL: <a href=http://www.ietf.org/rfc/rfc2119.txt>http://www.ietf.org/rfc/rfc2119.txt</a><dt id=selectors4 title=SELECTORS4><a class=self-link href=#selectors4></a>[SELECTORS4]<dd>Elika J. Etemad; Tab Atkins Jr.. <a href=http://www.w3.org/TR/2013/WD-selectors4-20130502/>Selectors Level 4</a>. 2 May 2013. W3C Working Draft. (Work in progress.) URL: <a href=http://www.w3.org/TR/2013/WD-selectors4-20130502/>http://www.w3.org/TR/2013/WD-selectors4-20130502/</a></dl></div> |
1017 | 1038 |
|
1018 | 1039 | <h3 class="no-num no-ref heading settled heading" id=informative><span class=content> |
1019 | 1040 | Informative References</span><a class=self-link href=#informative></a></h3> |
1020 | | -<div data-fill-with=informative-references><dl><dt id=html title=HTML><a class=self-link href=#html></a>[HTML]<dd>Ian Hickson. <a href=http://www.whatwg.org/specs/web-apps/current-work/multipage/>HTML</a>. Living Standard. URL: <a href=http://www.whatwg.org/specs/web-apps/current-work/multipage/>http://www.whatwg.org/specs/web-apps/current-work/multipage/</a><dt id=selectors4 title=SELECTORS4><a class=self-link href=#selectors4></a>[SELECTORS4]<dd>Elika J. Etemad; Tab Atkins Jr.. <a href=http://www.w3.org/TR/2013/WD-selectors4-20130502/>Selectors Level 4</a>. 2 May 2013. W3C Working Draft. (Work in progress.) URL: <a href=http://www.w3.org/TR/2013/WD-selectors4-20130502/>http://www.w3.org/TR/2013/WD-selectors4-20130502/</a></dl></div> |
| 1041 | +<div data-fill-with=informative-references><dl><dt id=html title=HTML><a class=self-link href=#html></a>[HTML]<dd>Ian Hickson. <a href=http://www.whatwg.org/specs/web-apps/current-work/multipage/>HTML</a>. Living Standard. URL: <a href=http://www.whatwg.org/specs/web-apps/current-work/multipage/>http://www.whatwg.org/specs/web-apps/current-work/multipage/</a></dl></div> |
1021 | 1042 |
|
1022 | 1043 | <h2 class="no-num no-ref heading settled heading" id=index><span class=content> |
1023 | 1044 | Index</span><a class=self-link href=#index></a></h2> |
|
0 commit comments