Skip to content

Commit bc439ec

Browse files
committed
[css-syntax] Resolve a "must" vs. "should not" define an environment encoding.
1 parent dc732b5 commit bc439ec

2 files changed

Lines changed: 15 additions & 24 deletions

File tree

css-syntax/Overview.html

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ <h2 class="no-num no-toc no-ref heading settled heading" id=contents><span class
117117
Error Handling</a></ul><li><a href=#tokenizing-and-parsing><span class=secno>3</span>
118118
Tokenizing and Parsing CSS</a><ul class=toc><li><a href=#parsing-overview><span class=secno>3.1</span>
119119
Overview of the Parsing Model</a><li><a href=#input-byte-stream><span class=secno>3.2</span>
120-
The input byte stream</a><li><a href=#environment-encoding><span class=secno>3.3</span>
121-
Environment encoding</a><li><a href=#input-preprocessing><span class=secno>3.4</span>
120+
The input byte stream</a><li><a href=#input-preprocessing><span class=secno>3.3</span>
122121
Preprocessing the input stream</a></ul><li><a href=#tokenization><span class=secno>4</span>
123122
Tokenization</a><ul class=toc><li><a href=#token-diagrams><span class=secno>4.1</span>
124123
Token Railroad Diagrams</a><li><a href=#tokenizer-definitions><span class=secno>4.2</span>
@@ -496,14 +495,9 @@ <h3 class="heading settled heading" data-level=3.2 id=input-byte-stream><span cl
496495
and thus maximizes the likelihood of it being implemented correctly.
497496

498497
<li>
499-
Otherwise, if an <a data-link-type=dfn href=#environment-encoding0 title="environment encoding">environment encoding</a> is provided by the referring document,
498+
Otherwise, if an <a data-link-type=dfn href=#environment-encoding title="environment encoding">environment encoding</a> is provided by the referring document,
500499
use that as the fallback encoding.
501500

502-
<p> Note that the concept of <a data-link-type=dfn href=#environment-encoding0 title="environment encoding">environment encoding</a> is required for legacy purposes
503-
for HTML and XML.
504-
New types of referring documents <strong>should not</strong> provide an <a data-link-type=dfn href=#environment-encoding0 title="environment encoding">environment encoding</a>,
505-
so the stylesheet defaults to UTF-8 instead in the absence of more explicit information.
506-
507501
<li>
508502
Otherwise, use <code>utf-8</code> as the fallback encoding.
509503
</ol>
@@ -526,21 +520,22 @@ <h3 class="heading settled heading" data-level=3.2 id=input-byte-stream><span cl
526520

527521
<pre>@charset "utf-8";</pre> </div>
528522

529-
<h3 class="heading settled heading" data-level=3.3 id=environment-encoding><span class=secno>3.3 </span><span class=content>
530-
Environment encoding</span><a class=self-link href=#environment-encoding></a></h3>
531-
532523
<p> Document languages that refer to CSS stylesheets that are decoded from bytes
533-
must define an <dfn data-dfn-type=dfn data-export="" id=environment-encoding0>environment encoding<a class=self-link href=#environment-encoding0></a></dfn> for each such stylesheet,
524+
may define an <dfn data-dfn-type=dfn data-export="" id=environment-encoding>environment encoding<a class=self-link href=#environment-encoding></a></dfn> for each such stylesheet,
534525
which is used as a fallback when other encoding hints are not available or can not be used.
535526

527+
<p> The concept of <a data-link-type=dfn href=#environment-encoding title="environment encoding">environment encoding</a> only exists for compatibility with legacy content.
528+
New formats and new linking mechanisms <b>should not</b> provide an <a data-link-type=dfn href=#environment-encoding title="environment encoding">environment encoding</a>,
529+
so the stylesheet defaults to UTF-8 instead in the absence of more explicit information.
530+
536531
<p class=note> Note: <a data-biblio-type=informative data-link-type=biblio href=#html title=html>[HTML]</a> defines <a href=http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#link-type-stylesheet>the environment encoding for <code>&lt;link rel=stylesheet&gt;</code></a>.
537532

538533
<p class=note> Note: <a data-biblio-type=informative data-link-type=biblio href=#cssom title=cssom>[CSSOM]</a> defines <a href=http://dev.w3.org/csswg/cssom/#requirements-on-user-agents-implementing-the-xml-stylesheet-processing-instruction>the environment encoding for <code>&lt;xml-stylesheet?&gt;</code></a>.
539534

540535
<p class=note> Note: <a data-biblio-type=informative data-link-type=biblio href=#css3cascade title=css3cascade>[CSS3CASCADE]</a> defines <a href=http://dev.w3.org/csswg/css-cascade/#at-ruledef-import>the environment encoding for <code>@import</code></a>.
541536

542537

543-
<h3 class="heading settled heading" data-level=3.4 id=input-preprocessing><span class=secno>3.4 </span><span class=content>
538+
<h3 class="heading settled heading" data-level=3.3 id=input-preprocessing><span class=secno>3.3 </span><span class=content>
544539
Preprocessing the input stream</span><a class=self-link href=#input-preprocessing></a></h3>
545540

546541
<p> The input stream consists of the <a data-link-type=dfn href=#code-point title="code points">code points</a>
@@ -4698,7 +4693,7 @@ <h3 class="heading settled heading" data-level=10.2 id=changes-WD-20130919><span
46984693

46994694
<p> <ul>
47004695
<li>
4701-
The concept of <a data-link-type=dfn href=#environment-encoding0 title="environment encoding">environment encoding</a> was added.
4696+
The concept of <a data-link-type=dfn href=#environment-encoding title="environment encoding">environment encoding</a> was added.
47024697
The behavior does not change,
47034698
but some of the definitions should be moved to the relevant specs.
47044699
</ul>
@@ -5048,7 +5043,7 @@ <h2 class="no-num no-ref heading settled heading" id=index><span class=content>
50485043
<li>&lt;dimension-token&gt;, <a href=#typedef-dimension-token title="section 4">4</a>
50495044
<li>ending token, <a href=#ending-token title="section 5.4.7">5.4.7</a>
50505045
<li>end of the range, <a href=#unicode-range-end title="section 4">4</a>
5051-
<li>environment encoding, <a href=#environment-encoding0 title="section 3.3">3.3</a>
5046+
<li>environment encoding, <a href=#environment-encoding title="section 3.2">3.2</a>
50525047
<li>EOF code point, <a href=#eof-code-point title="section 4.2">4.2</a>
50535048
<li>&lt;EOF-token&gt;, <a href=#typedef-eof-token title="section 5.2">5.2</a>
50545049
<li>escaping, <a href=#escaping0 title="section 2.1">2.1</a>

css-syntax/Overview.src.html

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,6 @@ <h3 id="input-byte-stream">
335335
Otherwise, if an <a>environment encoding</a> is provided by the referring document,
336336
use that as the fallback encoding.
337337

338-
Note that the concept of <a>environment encoding</a> is required for legacy purposes
339-
for HTML and XML.
340-
New types of referring documents <strong>should not</strong> provide an <a>environment encoding</a>,
341-
so the stylesheet defaults to UTF-8 instead in the absence of more explicit information.
342-
343338
<li>
344339
Otherwise, use <code>utf-8</code> as the fallback encoding.
345340
</ol>
@@ -363,13 +358,14 @@ <h3 id="input-byte-stream">
363358
<pre>@charset "utf-8";</pre>
364359
</div>
365360

366-
<h3 id="environment-encoding">
367-
Environment encoding</h3>
368-
369361
Document languages that refer to CSS stylesheets that are decoded from bytes
370-
must define an <dfn export>environment encoding</dfn> for each such stylesheet,
362+
may define an <dfn export>environment encoding</dfn> for each such stylesheet,
371363
which is used as a fallback when other encoding hints are not available or can not be used.
372364

365+
The concept of <a>environment encoding</a> only exists for compatibility with legacy content.
366+
New formats and new linking mechanisms <b>should not</b> provide an <a>environment encoding</a>,
367+
so the stylesheet defaults to UTF-8 instead in the absence of more explicit information.
368+
373369
Note: [[HTML]] defines <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#link-type-stylesheet">the environment encoding for <code>&lt;link rel=stylesheet></code></a>.
374370

375371
Note: [[CSSOM]] defines <a href="http://dev.w3.org/csswg/cssom/#requirements-on-user-agents-implementing-the-xml-stylesheet-processing-instruction">the environment encoding for <code>&lt;xml-stylesheet?></code></a>.

0 commit comments

Comments
 (0)