Another weird IE6 (and 7 and 8) bug

Friday, August 28th, 2009

Jump to Comments

This morning I saw an email going around the LBi mailing list from one of the application developers mentioning some weird behavior noticed in IE.

In a nutshell a load of CSS modules had been concatenated into one file leading to quite a large number of selectors being used. He found that after a certain point (4096 selectors) IE would ignore everything after it. I had never heard of this before and from reading some comments I got on Twitter a few other folk hadn’t either…

My boss found this online which would hint to it being this being true - http://msdn.microsoft.com/en-us/library/aa358796%28VS.85%29.aspx but this being a DOM method I wanted to make sure the same went for the CSS parser.

After a chat with Stuart Langridge (who provided me with a useful python script to make the file) I have a use case and confirm this bug does indeed exist in IE - even in IE8.

Scroll down to the bottom of this iFrame (make sure you’re using IE) and you’ll see the final 5 ‘OK’s are in the default of black and not red as they should be styled!If you’re not a fan of iFrames it’s also availiable as an external link - IE 4096 selector usecase.

In additional news IE will also bork when presented with more than 32 @import statements (http://www.agum.com/web/2008/03/11/internet-explorer-issue-maximum-of-32-css-import/) so in many ways if you have a shed load of CSS you’re damned if you do and damned if you don’t!