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

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 UTC