[whatwg] Maximum length of attribute values

Roger Hågensen rescator at emsai.net
Wed Mar 24 13:20:30 PDT 2010


On 2010-03-24 12:54, Henri Sivonen wrote:
> I tried to test if the top 4 browser engines have a hard limit on the length of attribute values in their HTML parsers. If they do, it's somewhere over 6.5 million characters.
>
> Does any one of the top 4 browser engines have a hard limit that is higher than what I tested?
>
> Does anyone happen to have data on how long attribute values must be allowed for Web compat?
>    

Hmm! If there is a limit (in moderm browsers) then it's probably close 
to the addressable memory limit, so that would be around 2GiB on 32bit 
(x86 and similar) systems.

I also believe a max limit is kind of silly in spesifications like this, 
it would be better to specify a minimum supported limit instead.

Obviously this minimum need to be based on the lowest common denominator 
across the major PC browsers, console, mobile and set-top boxes and 
other integrated solutions.
And basically stating that implementers must support this length as 
minimum but are encouraged to leave the max as memory limited?

Obviously it would be silly with 6.5MiB attributes as I'd certainly 
believe that to be a bug or broken tags myself if encountered.

So if a adviced minimum is stated with a note that implemetors should be 
prepared to handle ambiguously large attributes (instead of crashing or 
eating up all memory) then that should be enough right?

Roger.

-- 
Roger "Rescator" Hågensen.
Freelancer - http://EmSai.net/




More information about the whatwg mailing list