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.
No iFrame for you but it’s OK - check the test case here
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!










2 Comments
August 28th, 2009 at 3:24 pm
Is that 4096 selectors per file, or 4096 selectors in total?
August 28th, 2009 at 3:35 pm
If you have that much CSS surely you’re doing something wrong!? Mr Modular, baby.
Leave a Reply
cforms contact form by delicious:days