Skip to content

Commit ea2b786

Browse files
committed
[css-syntax] HTML now defines <link rel=stylesheet>’s environment encoding
1 parent 6251c35 commit ea2b786

3 files changed

Lines changed: 20 additions & 58 deletions

File tree

biblio.ref

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8658,3 +8658,9 @@
86588658
%S Living Standard
86598659
%U http://encoding.spec.whatwg.org/
86608660

8661+
%L HTML
8662+
%T HTML
8663+
%A Ian Hickson
8664+
%S Living Standard
8665+
%U http://www.whatwg.org/specs/web-apps/current-work/multipage/
8666+

css-syntax/Overview.html

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
</p>
5555
<h1 class="p-name no-ref" id=title>CSS Syntax Module Level 3</h1>
5656
<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=20140116>16 January 2014</span></span></span></h2>
57+
<span class=dt-updated><span class=value-title title=20140123>23 January 2014</span></span></span></h2>
5858
<div data-fill-with=spec-metadata><dl><dt>This version:<dd><a class=u-url href=http://dev.w3.org/csswg/css-syntax/>http://dev.w3.org/csswg/css-syntax/</a><dt>Latest version:<dd><a href=http://www.w3.org/TR/css-syntax-3/>http://www.w3.org/TR/css-syntax-3/</a><dt>Editor’s Draft:<dd><a href=http://dev.w3.org/csswg/css-syntax/>http://dev.w3.org/csswg/css-syntax/</a><dt>Previous Versions:<dd><a href=http://www.w3.org/TR/2013/WD-css-syntax-3-20131105/ rel=previous>http://www.w3.org/TR/2013/WD-css-syntax-3-20131105/</a><dd><a href=http://www.w3.org/TR/2013/WD-css-syntax-3-20130919/ rel=previous>http://www.w3.org/TR/2013/WD-css-syntax-3-20130919/</a>
5959
<dt>Feedback:</dt>
6060
<dd><a href="mailto:www-style@w3.org?subject=%5Bcss-syntax%5D%20feedback">www-style@w3.org</a>
@@ -115,8 +115,7 @@ <h2 class="no-num no-toc no-ref heading settled heading" id=contents><span class
115115
Overview of the Parsing Model</a><li><a href=#input-byte-stream><span class=secno>3.2</span>
116116
The input byte stream</a><li><a href=#environment-encoding><span class=secno>3.3</span>
117117
Environment encoding</a><ul class=toc><li><a href=#environment-encoding-at-import><span class=secno>3.3.1</span>
118-
<span class=css data-link-type=maybe title=@import>@import</span> rules</a><li><a href=#environment-encoding-html><span class=secno>3.3.2</span>
119-
HTML</a><li><a href=#environment-encoding-xml><span class=secno>3.3.3</span>
118+
<span class=css data-link-type=maybe title=@import>@import</span> rules</a><li><a href=#environment-encoding-xml><span class=secno>3.3.2</span>
120119
XML</a></ul><li><a href=#input-preprocessing><span class=secno>3.4</span>
121120
Preprocessing the input stream</a></ul><li><a href=#tokenization><span class=secno>4</span>
122121
Tokenization</a><ul class=toc><li><a href=#token-diagrams><span class=secno>4.1</span>
@@ -492,6 +491,10 @@ <h3 class="heading settled heading" data-level=3.3 id=environment-encoding><span
492491
must define an <dfn data-dfn-type=dfn data-noexport="" id=environment-encoding0>environment encoding<a class=self-link href=#environment-encoding0></a></dfn> for each such stylesheet,
493492
which is used as a fallback when other encoding hints are not available or can not be used.
494493

494+
<p class=note>Note: <a data-biblio-type=informative data-link-type=biblio href=#html title=html>[HTML]</a> defines
495+
<a href=http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#link-type-stylesheet>
496+
the environment encoding for <code>&lt;link rel=stylesheet&gt;</code></a>
497+
495498
<h4 class="heading settled heading" data-level=3.3.1 id=environment-encoding-at-import><span class=secno>3.3.1 </span><span class=content>
496499
<a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-cascade-3/#at-ruledef-import title=@import>@import</a> rules</span><a class=self-link href=#environment-encoding-at-import></a></h4>
497500

@@ -500,31 +503,7 @@ <h4 class="heading settled heading" data-level=3.3.1 id=environment-encoding-at-
500503

501504
<p class=note> Note: This is expected to move to a future version of <a data-biblio-type=informative data-link-type=biblio href=#css3cascade title=css3cascade>[CSS3CASCADE]</a>.
502505

503-
<h4 class="heading settled heading" data-level=3.3.2 id=environment-encoding-html><span class=secno>3.3.2 </span><span class=content>
504-
HTML</span><a class=self-link href=#environment-encoding-html></a></h4>
505-
506-
<p> For stylesheets referred to by an HTML <a href=http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#link-type-stylesheet><code>&lt;link rel=stylesheet&gt;</code></a> element,
507-
the <a data-link-type=dfn href=#environment-encoding0 title="environment encoding">environment encoding</a> is determined as follows:
508-
509-
<p> <ul>
510-
<li>
511-
<a href=http://encoding.spec.whatwg.org/#concept-encoding-get>Get an encoding</a> <a data-biblio-type=normative data-link-type=biblio href=#encoding title=encoding>[ENCODING]</a>
512-
for the value of the <code>charset</code> attribute of the element, if any.
513-
If that does not return failure,
514-
use the return value as the environment encoding.
515-
516-
<li>
517-
Otherwise, use the encoding of the referring document.
518-
</ul>
519-
520-
<p class=note> Note: This is expected to move to the HTML spec.
521-
522-
<p class=note> Note: Even though the HTML spec marks the <code>charset</code> attribute as obsolete,
523-
implementations still consider it as of this writing (October 2013.)
524-
Should we drop it?
525-
526-
527-
<h4 class="heading settled heading" data-level=3.3.3 id=environment-encoding-xml><span class=secno>3.3.3 </span><span class=content>
506+
<h4 class="heading settled heading" data-level=3.3.2 id=environment-encoding-xml><span class=secno>3.3.2 </span><span class=content>
528507
XML</span><a class=self-link href=#environment-encoding-xml></a></h4>
529508

530509
<p> For stylesheets referred to by an <a href=http://www.w3.org/TR/xml-stylesheet/#the-xml-stylesheet-processing-instruction><code>xml-stylesheet</code></a> processing instruction <a data-biblio-type=normative data-link-type=biblio href=#xmlstyle title=xmlstyle>[XMLSTYLE]</a>,
@@ -1816,7 +1795,7 @@ <h3 class="heading settled heading" data-level=4.2 id=tokenizer-definitions><spa
18161795
<dl data-export="">
18171796
<dt><dfn data-dfn-type=dfn data-export="" id=code-point>code point<a class=self-link href=#code-point></a></dfn>
18181797
<dd>
1819-
A <a href=http://unicode.org/glossary/#code_point>Unicode code point</a>.
1798+
A <a href=http://unicode.org/glossary/#code_point>Unicode code point</a>. <a data-biblio-type=normative data-link-type=biblio href=#unicode title=unicode>[UNICODE]</a>
18201799
Any value in the Unicode codespace; that is, the range of integers from 0 to (hexadecimal) 10FFFF.
18211800

18221801
<dt><dfn data-dfn-type=dfn data-export="" id=next-input-code-point>next input code point<a class=self-link href=#next-input-code-point></a></dfn>
@@ -4985,11 +4964,11 @@ <h2 class="no-num no-ref heading settled heading" id=references><span class=cont
49854964

49864965
<h3 class="no-num no-ref heading settled heading" id=normative><span class=content>
49874966
Normative References</span><a class=self-link href=#normative></a></h3>
4988-
<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=encoding title=ENCODING><a class=self-link href=#encoding></a>[ENCODING]<dd>Anne van Kesteren; Joshua Bell. <a href=http://encoding.spec.whatwg.org/>Encoding</a>. Living Standard. URL: <a href=http://encoding.spec.whatwg.org/>http://encoding.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=select title=SELECT><a class=self-link href=#select></a>[SELECT]<dd>Tantek Çelik; et al. <a href=http://www.w3.org/TR/2011/REC-css3-selectors-20110929/>Selectors Level 3</a>. 29 September 2011. W3C Recommendation. URL: <a href=http://www.w3.org/TR/2011/REC-css3-selectors-20110929/>http://www.w3.org/TR/2011/REC-css3-selectors-20110929/</a><dt id=xmlstyle title=XMLSTYLE><a class=self-link href=#xmlstyle></a>[XMLSTYLE]<dd>James Clark. <a href=http://www.w3.org/1999/06/REC-xml-stylesheet-19990629>Associating Style Sheets with XML documents</a>. 29 June 1999. W3C Recommendation. URL: <a href=http://www.w3.org/1999/06/REC-xml-stylesheet-19990629>http://www.w3.org/1999/06/REC-xml-stylesheet-19990629</a></dl></div>
4967+
<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=encoding title=ENCODING><a class=self-link href=#encoding></a>[ENCODING]<dd>Anne van Kesteren; Joshua Bell. <a href=http://encoding.spec.whatwg.org/>Encoding</a>. Living Standard. URL: <a href=http://encoding.spec.whatwg.org/>http://encoding.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=select title=SELECT><a class=self-link href=#select></a>[SELECT]<dd>Tantek Çelik; et al. <a href=http://www.w3.org/TR/2011/REC-css3-selectors-20110929/>Selectors Level 3</a>. 29 September 2011. W3C Recommendation. URL: <a href=http://www.w3.org/TR/2011/REC-css3-selectors-20110929/>http://www.w3.org/TR/2011/REC-css3-selectors-20110929/</a><dt id=unicode title=UNICODE><a class=self-link href=#unicode></a>[UNICODE]<dd>The Unicode Consortium. <a href=http://www.unicode.org/standard/versions/enumeratedversions.html>The Unicode Standard</a>. 2012. Defined by: The Unicode Standard, Version 6.2.0 (Mountain View, CA: The Unicode Consortium, 2012. ISBN 978-1-936213-07-8), as updated from time to time by the publication of new versions URL: <a href=http://www.unicode.org/standard/versions/enumeratedversions.html>http://www.unicode.org/standard/versions/enumeratedversions.html</a><dt id=xmlstyle title=XMLSTYLE><a class=self-link href=#xmlstyle></a>[XMLSTYLE]<dd>James Clark. <a href=http://www.w3.org/1999/06/REC-xml-stylesheet-19990629>Associating Style Sheets with XML documents</a>. 29 June 1999. W3C Recommendation. URL: <a href=http://www.w3.org/1999/06/REC-xml-stylesheet-19990629>http://www.w3.org/1999/06/REC-xml-stylesheet-19990629</a></dl></div>
49894968

49904969
<h3 class="no-num no-ref heading settled heading" id=informative><span class=content>
49914970
Informative References</span><a class=self-link href=#informative></a></h3>
4992-
<div data-fill-with=informative-references><dl><dt id=css-variables title=CSS-VARIABLES><a class=self-link href=#css-variables></a>[CSS-VARIABLES]<dd>Tab Atkins Jr.; Luke Macpherson; Daniel Glazman. <a href=http://www.w3.org/TR/2013/WD-css-variables-20130620/>CSS Custom Properties for Cascading Variables Module Level 1</a>. 20 June 2013. W3C Working Draft. (Work in progress.) URL: <a href=http://www.w3.org/TR/2013/WD-css-variables-20130620/>http://www.w3.org/TR/2013/WD-css-variables-20130620/</a><dt id=css3-animations title=CSS3-ANIMATIONS><a class=self-link href=#css3-animations></a>[CSS3-ANIMATIONS]<dd>Dean Jackson; et al. <a href=http://www.w3.org/TR/2013/WD-css3-animations-20130219/>CSS Animations</a>. 19 February 2013. W3C Working Draft. (Work in progress.) URL: <a href=http://www.w3.org/TR/2013/WD-css3-animations-20130219/>http://www.w3.org/TR/2013/WD-css3-animations-20130219/</a><dt id=css3-conditional title=CSS3-CONDITIONAL><a class=self-link href=#css3-conditional></a>[CSS3-CONDITIONAL]<dd>L. David Baron. <a href=http://www.w3.org/TR/2013/CR-css3-conditional-20130404/>CSS Conditional Rules Module Level 3</a>. 4 April 2013. W3C Candidate Recommendation. (Work in progress.) URL: <a href=http://www.w3.org/TR/2013/CR-css3-conditional-20130404/>http://www.w3.org/TR/2013/CR-css3-conditional-20130404/</a><dt id=cssom title=CSSOM><a class=self-link href=#cssom></a>[CSSOM]<dd>Anne van Kesteren. <a href=http://www.w3.org/TR/2011/WD-cssom-20110712/>CSSOM</a>. 12 July 2011. W3C Working Draft. (Work in progress.) URL: <a href=http://www.w3.org/TR/2011/WD-cssom-20110712/>http://www.w3.org/TR/2011/WD-cssom-20110712/</a><dt id=mediaq title=MEDIAQ><a class=self-link href=#mediaq></a>[MEDIAQ]<dd>Florian Rivoal. <a href=http://www.w3.org/TR/2012/REC-css3-mediaqueries-20120619/>Media Queries</a>. 19 June 2012. W3C Recommendation. URL: <a href=http://www.w3.org/TR/2012/REC-css3-mediaqueries-20120619/>http://www.w3.org/TR/2012/REC-css3-mediaqueries-20120619/</a></dl></div>
4971+
<div data-fill-with=informative-references><dl><dt id=css-variables title=CSS-VARIABLES><a class=self-link href=#css-variables></a>[CSS-VARIABLES]<dd>Tab Atkins Jr.; Luke Macpherson; Daniel Glazman. <a href=http://www.w3.org/TR/2013/WD-css-variables-20130620/>CSS Custom Properties for Cascading Variables Module Level 1</a>. 20 June 2013. W3C Working Draft. (Work in progress.) URL: <a href=http://www.w3.org/TR/2013/WD-css-variables-20130620/>http://www.w3.org/TR/2013/WD-css-variables-20130620/</a><dt id=css3-animations title=CSS3-ANIMATIONS><a class=self-link href=#css3-animations></a>[CSS3-ANIMATIONS]<dd>Dean Jackson; et al. <a href=http://www.w3.org/TR/2013/WD-css3-animations-20130219/>CSS Animations</a>. 19 February 2013. W3C Working Draft. (Work in progress.) URL: <a href=http://www.w3.org/TR/2013/WD-css3-animations-20130219/>http://www.w3.org/TR/2013/WD-css3-animations-20130219/</a><dt id=css3-conditional title=CSS3-CONDITIONAL><a class=self-link href=#css3-conditional></a>[CSS3-CONDITIONAL]<dd>L. David Baron. <a href=http://www.w3.org/TR/2013/CR-css3-conditional-20130404/>CSS Conditional Rules Module Level 3</a>. 4 April 2013. W3C Candidate Recommendation. (Work in progress.) URL: <a href=http://www.w3.org/TR/2013/CR-css3-conditional-20130404/>http://www.w3.org/TR/2013/CR-css3-conditional-20130404/</a><dt id=cssom title=CSSOM><a class=self-link href=#cssom></a>[CSSOM]<dd>Anne van Kesteren. <a href=http://www.w3.org/TR/2011/WD-cssom-20110712/>CSSOM</a>. 12 July 2011. W3C Working Draft. (Work in progress.) URL: <a href=http://www.w3.org/TR/2011/WD-cssom-20110712/>http://www.w3.org/TR/2011/WD-cssom-20110712/</a><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=mediaq title=MEDIAQ><a class=self-link href=#mediaq></a>[MEDIAQ]<dd>Florian Rivoal. <a href=http://www.w3.org/TR/2012/REC-css3-mediaqueries-20120619/>Media Queries</a>. 19 June 2012. W3C Recommendation. URL: <a href=http://www.w3.org/TR/2012/REC-css3-mediaqueries-20120619/>http://www.w3.org/TR/2012/REC-css3-mediaqueries-20120619/</a></dl></div>
49934972

49944973
<h2 class="no-num no-ref heading settled heading" id=index><span class=content>
49954974
Index</span><a class=self-link href=#index></a></h2>

css-syntax/Overview.src.html

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,10 @@ <h3 id="environment-encoding">
329329
must define an <dfn>environment encoding</dfn> for each such stylesheet,
330330
which is used as a fallback when other encoding hints are not available or can not be used.
331331

332+
Note: [[HTML]] defines
333+
<a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#link-type-stylesheet">
334+
the environment encoding for <code>&lt;link rel=stylesheet></code></a>
335+
332336
<h4 id="environment-encoding-at-import">
333337
''@import'' rules</h4>
334338

@@ -337,33 +341,6 @@ <h4 id="environment-encoding-at-import">
337341

338342
Note: This is expected to move to a future version of [[CSS3CASCADE]].
339343

340-
<h4 id="environment-encoding-html">
341-
HTML</h4>
342-
343-
For stylesheets referred to by an HTML <a href=http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#link-type-stylesheet><code>&lt;link rel=stylesheet></code></a> element,
344-
the <a>environment encoding</a> is determined as follows:
345-
346-
<ul>
347-
<li>
348-
<a href="http://encoding.spec.whatwg.org/#concept-encoding-get">Get an encoding</a> [[!ENCODING]]
349-
for the value of the <code>charset</code> attribute of the element, if any.
350-
If that does not return failure,
351-
use the return value as the environment encoding.
352-
353-
<li>
354-
Otherwise, use the encoding of the referring document.
355-
</ul>
356-
357-
Note: This is expected to move to the HTML spec.
358-
359-
Note: Even though the HTML spec marks the <code>charset</code> attribute as obsolete,
360-
implementations still consider it as of this writing (October 2013.)
361-
Should we drop it?
362-
<!--
363-
Test case:
364-
data:text/html,<link%20rel=stylesheet%20href=http://test.csswg.org/suites/css2.1/20110323/html4/support/none.css><span%20class=&%23258;&%23733;&%23258;&%23164;&%23258;&%23168>Test
365-
-->
366-
367344
<h4 id="environment-encoding-xml">
368345
XML</h4>
369346

0 commit comments

Comments
 (0)