W3C home > Mailing lists > Public > www-style@w3.org > October 2013

Re: [css-syntax] Cross-origin fallback charset

From: Simon Sapin <simon.sapin@exyr.org>
Date: Tue, 29 Oct 2013 13:35:09 +0000
Message-ID: <526FB98D.2060607@exyr.org>
To: "www-style@w3.org list" <www-style@w3.org>
Le 29/10/2013 10:40, Simon Sapin a écrit :
> Hi,
>
> The draft specifies that a "charset" attribute on HTML <link> (or
> similar) and the encoding of the referring document are fallbacks for
> determining the encoding of a stylesheet.
>
> Issue 2 asks if we should limit this to same-origin stylesheets:
>
> http://dev.w3.org/csswg/css-syntax/#issue-ab273e4b
>
> I suggest closing the issue without change as the current draft matches
> what HTML does for the <script> element: cross-origin or same-origin
> does not affect encoding detection.
>

Gecko, Blink and Presto already do this. Test case:

data:text/html;charset=latin2,<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

(The above misinterprets a stylesheet as ISO-8859-2, with a class name 
set to the corresponding mojibake. Green means that the HTML document’s 
encoding is used for CSS.)

-- 
Simon Sapin
Received on Tuesday, 29 October 2013 13:35:33 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 29 October 2013 13:35:34 UTC