[css-syntax] Clarify the note on the @charset "XXX"; byte sequence

Fri, 03 Jan 2014 11:59:47 +0000

author
Simon Sapin <simon.sapin@exyr.org>
date
Fri, 03 Jan 2014 11:59:47 +0000
changeset 9700
6c5d1704f506
parent 9699
e2bac65f3d7b
child 9701
a067b6c20248

[css-syntax] Clarify the note on the @charset "XXX"; byte sequence

css-syntax/Overview.html file | annotate | diff | comparison | revisions
css-syntax/Overview.src.html file | annotate | diff | comparison | revisions
     1.1 --- a/css-syntax/Overview.html	Fri Jan 03 11:54:47 2014 +0000
     1.2 +++ b/css-syntax/Overview.html	Fri Jan 03 11:59:47 2014 +0000
     1.3 @@ -4490,15 +4490,19 @@
     1.4  
     1.5  <p>	The <a class=css data-link-type=maybe href=#at-ruledef-charset title=@charset>@charset</a> rule has <strong>no effect on a stylesheet</strong>.
     1.6  
     1.7 -<p class=note>	Note: However, the algorithm to <a data-link-type=dfn href=#determine-the-fallback-encoding title="determine the fallback encoding">determine the fallback encoding</a>
     1.8 -	looks at the first several bytes of the stylesheet
     1.9 -	to see if they’re a match for the ASCII characters <code>@charset "XXX";</code>,
    1.10 -	where XXX is a sequence of bytes other than 22 (ASCII for <code>"</code>).
    1.11 -	While this resembles an <a class=css data-link-type=maybe href=#at-ruledef-charset title=@charset>@charset</a> rule,
    1.12 -	it’s not actually the same thing.
    1.13 -	For example, the necessary sequence of bytes will spell out something entirely different
    1.14 -	if the stylesheet is in an encoding that’s not ASCII-compatible,
    1.15 -	such as UTF-16.
    1.16 +	<div class=note>
    1.17 +		Note: This only applies to the <a data-link-type=dfn href=#at-rule title=at-rule>at-rule</a>
    1.18 +		created by the algorithm to <a data-link-type=dfn href=#parse-a-stylesheet0 title="parse a stylesheet">parse a stylesheet</a>,
    1.19 +		not to the ASCII <code>@charset "XXX";</code> byte sequence
    1.20 +		that the algorithm to <a data-link-type=dfn href=#determine-the-fallback-encoding title="determine the fallback encoding">determine the fallback encoding</a>
    1.21 +		looks for at the beginning of a stylesheet.
    1.22 +
    1.23 +<p>		While they look similar, they are not actually the same thing.
    1.24 +		For example, a slightly different byte sequence
    1.25 +		(more whitespace, single instead of double quotes, …)
    1.26 +		will not be considered for the fallback encoding
    1.27 +		but may still generate an <a class=css data-link-type=maybe href=#at-ruledef-charset title=@charset>@charset</a> rule that shows up in <a data-biblio-type=informative data-link-type=biblio href=#cssom title=cssom>[CSSOM]</a>.
    1.28 +	</div>
    1.29  
    1.30  
    1.31  
     2.1 --- a/css-syntax/Overview.src.html	Fri Jan 03 11:54:47 2014 +0000
     2.2 +++ b/css-syntax/Overview.src.html	Fri Jan 03 11:59:47 2014 +0000
     2.3 @@ -3016,15 +3016,19 @@
     2.4  
     2.5  	The ''@charset'' rule has <strong>no effect on a stylesheet</strong>.
     2.6  
     2.7 -	Note: However, the algorithm to <a>determine the fallback encoding</a>
     2.8 -	looks at the first several bytes of the stylesheet
     2.9 -	to see if they're a match for the ASCII characters <code>@charset "XXX";</code>,
    2.10 -	where XXX is a sequence of bytes other than 22 (ASCII for <code>"</code>).
    2.11 -	While this resembles an ''@charset'' rule,
    2.12 -	it's not actually the same thing.
    2.13 -	For example, the necessary sequence of bytes will spell out something entirely different
    2.14 -	if the stylesheet is in an encoding that's not ASCII-compatible,
    2.15 -	such as UTF-16.
    2.16 +	<div class='note'>
    2.17 +		Note: This only applies to the <a>at-rule</a>
    2.18 +		created by the algorithm to <a>parse a stylesheet</a>,
    2.19 +		not to the ASCII <code>@charset "XXX";</code> byte sequence
    2.20 +		that the algorithm to <a>determine the fallback encoding</a>
    2.21 +		looks for at the beginning of a stylesheet.
    2.22 +
    2.23 +		While they look similar, they are not actually the same thing.
    2.24 +		For example, a slightly different byte sequence
    2.25 +		(more whitespace, single instead of double quotes, …)
    2.26 +		will not be considered for the fallback encoding
    2.27 +		but may still generate an ''@charset'' rule that shows up in [[CSSOM]].
    2.28 +	</div>
    2.29  
    2.30  
    2.31  

mercurial