Re: [css3-syntax][css21] More problems with determining the character encoding

On Mon, Oct 22, 2012 at 10:50 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 10/22/12 10:40 AM, Glenn Adams wrote:
>
>>      > That makes non sense There is no relationship between the
>>     encoding of a
>>      > referring document and a referenced document.
>>
>
> In practice, there often is.  And web sites depend on a web browser using
> the encoding of the linking document for scripts and stylesheets that
> document links to, and don't declare encodings for those subresources.


If the resource containing the stylesheet and the resource containing the
referencing document are both in the same domain (foo.com), then it might
be reasonable. However, if cross domain, then it would be inadvisable. For
example, say you have a referencing document encoded with JIS X 0201, which
looks like US-ASCII except for 0x5C, which, instead of REVERSE SOLIDUS
(backslash), denotes YEN SIGN. Say this JIS X 0201 document references a
common, shared ASCII stylesheet, say [1]. Now, according to the suggested
rules, if rules (1)-(3) of 4.4 [2] fail, then default.css will be decoded
as JIS X 0201, turning what would be any backslash into YEN SIGN (U+00A5).

As such, rule (4) as stated seems overly general. I would suggest it be
restricted to same domain. Also, it would be useful to point out the use of
the charset MIME type parameter on the @type attribute from the linking
element, which seems like it would be covered by rule (3), but is not
otherwise mentioned.

[1] http://dev.w3.org/csswg/default.css
[2] http://www.w3.org/TR/CSS21/syndata.html#charset


>
>
>  Really? What implementation(s)? Please provide (or reference) a test
>> file if so.
>>
>
> http://test.csswg.org/suites/**css2.1/20110323/html4/at-**charset-012.htm<http://test.csswg.org/suites/css2.1/20110323/html4/at-charset-012.htm>is passed by every implementation listed in
> http://www.w3.org/Style/CSS/**Test/CSS2.1/20110323/reports/**results.html<http://www.w3.org/Style/CSS/Test/CSS2.1/20110323/reports/results.html>
>
> -Boris
>
>

Received on Tuesday, 23 October 2012 08:07:14 UTC