Limiting the size of the @charset byte sequence

On 27/01/2014 00:20, Henri Sivonen wrote:
> It's a terribly bad idea to define an internal character encoding
> declaration syntax in such a way that the syntax definition doesn't
> guarantee the syntax to fit within a string of bytes shorter than N
> bytes with a small value for N. For this reason, it's a bad idea to
> allow an  arbitrary number of whitespace characters between '@chaset'
> and the quote. Unfortunately, CSS still fails at making the length of
> the declaration bounded, because "get an encoding" trims white space.
> Gecko imposes a bound on the length anyway.

Gecko does for CSS like for HTML and only looks at the first 1024 bytes 
when looking for an @charset byte sequence.

I updated the spec accordingly. This spec text

> If the byte stream begins with

is now

> If the first 1024 bytes of the stream begin with

https://dvcs.w3.org/hg/csswg/rev/8dd698785f16

-- 
Simon Sapin

Received on Monday, 27 January 2014 18:44:33 UTC