[whatwg] Accept full CSS colors in the legacy color parsing algorithm

Ian Hickson ian at hixie.ch
Fri Jul 15 13:18:04 PDT 2011


On Fri, 15 Jul 2011, Tab Atkins Jr. wrote:
> 
> I'll note, though, that the spec algorithm seems to be Firefox's 
> behavior, which differs in a few significant points from IE's.  In 
> particular, IE doesn't strip whitespace from the color, doesn't have the 
> same "truncate at 128 bytes" behavior, and doesn't recognize a 3-digit 
> hex color as a CSS color (instead parsing it with legacy rules).
> 
> I doubt it matters too much, but was there any particular reason you 
> went with Firefox over IE here?

See:

http://www.w3.org/Bugs/Public/show_bug.cgi?id=9847
http://www.w3.org/Bugs/Public/show_bug.cgi?id=12372

Basically, it looks like IE does strip whitespace in some cases, the main 
difference is that it doesn't handle #123 the same as #112233. Since that 
would introduce an incompatibility with CSS, and since there was no 
interop on that case, I figured (based on input from Aryeh and dbaron) we 
might as well go with the sane behaviour.

Interop isn't perfect here so there's not really any winning whatever we do.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list