W3C home > Mailing lists > Public > public-css-bugzilla@w3.org > November 2012

[Bug 19882] @charset rule logic is not case insensitive & should state ASCII interpretation for clarity

From: <bugzilla@jessica.w3.org>
Date: Tue, 06 Nov 2012 16:30:13 +0000
To: public-css-bugzilla@w3.org
Message-ID: <bug-19882-5148-SqPy6ZapIG@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=19882

--- Comment #2 from Zack Weinberg <zackw@panix.com> ---
The relevant code in Firefox is css::Loader::GetCharsetFromData, here:
https://mxr.mozilla.org/mozilla-central/source/layout/style/Loader.cpp#611
It only allows lowercase "charset", it doesn't allow single-quoted strings, the
@ must be the first character in the document, and there must be exactly one
space before the initial " character and none between the closing " and the
semicolon.  I would consider the first two of these flat-out bugs in Firefox
tbh.

I am not as familiar with Webkit, but the relevant code _appears_ to be
TextResourceDecoder::checkForCSSCharset, here:
https://trac.webkit.org/browser/trunk/Source/WebCore/loader/TextResourceDecoder.cpp#L455
 This also does case-sensitive matching as far as I can tell, but it allows
both single- and double-quoted strings, and it allows arbitrary whitespace
before and after the string.  The @ still has to be the first character in the
document.

Later today I will put together a comprehensive test case and find out what IE
and Opera do.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Tuesday, 6 November 2012 16:30:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 6 November 2012 16:30:20 GMT