Re: IE compat with coords parsing

On Fri, 9 Jan 2009, Simon Pieters wrote:
> 
> We implemented HTML5's parsing rules for coords=''. Hence I was 
> interested in checking if the algorithm is compatible with IE, so I 
> implemented it in javascript:
> 
> http://simon.html5.org/tools/js/coords-parsing.html
> 
> I found that HTML5 didn't quite match IE. For instance "1,2:3,4" gives 
> "1" in HTML5 but "1,2,4" in IE (i.e. IE gives ':' the same treatment 
> that the spec gives to '.').
> 
> So I wondered which characters other than ':' that IE treated this way:
> 
> http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0D%0A%3Cmap%3E%3Carea%20shape%3D%22circle%22%3E%3C%2Fmap%3E%0D%0A%3Cscript%3E%0D%0Avar%20a%20%3D%20document.getElementsByTagName('area')%5B0%5D%3B%0D%0Afor%20(var%20i%20%3D%201%3
> B%20i%20%3C%200x3ff%3B%20%2B%2Bi)%20%7B%0D%0A%20%20a.coords%20%3D%20'1'%20%2B%20String.fromCharCode(i)%20%2B%20'2%2C3'%3B%0D%0A%20%20w('0x'%20%2B%20i.toString(16)%20%2B%20'%20('%20%2B%20String.fromCharCode(i)%20%2B%20')%3A%20'%20%2B%20a.coords)%3B%0D%0A%7
> D%0D%0A%3C%2Fscript%3E
>
> ...and it turns out to be quite a few (all lines that say "1,3,0").

Yeah, the spec actually has a precise list in comments. It actually varies 
across different versions of IE, too.


> Then I asked Philip` for a some data, and he kindly gave a list:
> 
>    http://philip.html5.org/data/coords-with-unusual-chars.txt
> 
> ...from which I found three pages that would break with HTML5:
> 
>    http://www.psu.edu/ur/GSpanier/gallery/
>    coords="157,5,233,20' href=" (apostrophe)
> 
>    http://www.motorsportforbundet.no/
>    coords="615, 0, 768, 40	" (tab)
> 
>    http://www.kipwmi.com/
>    coords="2,20', 87,38'" (apostrophe)
> 
> It's possible that there are similar pages that contain 
> coords='1,2",3,4"' or coords=1,2',3,4', but Philip` only looked at 
> double-quoted attributes.
> 
> 
> On one hand it seems reasonable to say that 3 pages out of 130k isn't a 
> big deal, but OTOH those pages work in today's browsers and changing the 
> algorithm to fix them is simple.
> 
> Doing exactly what IE does might not be necessary for Web compat. IE 
> gives different treatment to various non-ASCII characters (such as 0x3f3 
> and 0x3f4).
> 
> For the time being we'll keep the HTML5 implementation but we might 
> change to be more compatible.

I've made the spec more compatible with IE for ASCII characters.

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

Received on Wednesday, 11 February 2009 10:30:19 UTC