- From: Arron Eicholz <Arron.Eicholz@microsoft.com>
- Date: Tue, 3 Feb 2009 08:16:56 -0800
- To: Anne van Kesteren <annevk@opera.com>, "public-css-testsuite@w3.org" <public-css-testsuite@w3.org>
Anne wrote: > http://samples.msdn.microsoft.com/ietestcenter/css/chapter_4/Rules/at-charset-039.htm > loads a style sheet that has no external character encoding metadata and > has "Big5" in the @charset declaration. Even though the text has been > encoded as UTF-8 decoding it as Big5 will still give meaningful results > and since the UA never knows the original encoding no error handling in > the form of ignoring the external style sheet should go into work here. > Therefore the first selector in the external style sheet will not match, > but the second one will, resulting in one green and one red piece of text > on the page. The test case is actually correct. The @charset does not match the encoding of the file which is UTF-8. In that case even though the @charset is parsed and is determined "as specified" it has to throw out the style sheet because the parser does not find an appropriate @charset at the beginning of the UTF-8 file. Here is some of the text from section 4.4 bullet 1 under the table. "If an encoding is detected based on one of the entries in the table above marked 'as specified'," the file is since it has '@charset "Big5"' (matches row 3 of the table). So far everything is fine... "the user agent ignore the style sheet if it does not parse an appropriate @charset rule at the beginning of the stream of characters." This is where the file needs to get thrown out because the file itself is UTF-8 and the @charset is Big5. With that mismatch the @charset is not appropriate and the file is then thrown out completely. -- Thanks, Arron Eicholz
Received on Tuesday, 3 February 2009 16:17:38 UTC