114 points · by timdorr · 16y ago · 58 comments
Microsoft has a hodge podge of several attempts at the same, and because none is truly core and universally available, it's quite easy to be ignorant of what's available and roll your own crappy, limited data structures.
I agree with you, though I think I'd prefer this to hint at the reason over it being an entirely arbitrary descision. Making such a choice for a bad reason is still preferable to making it for no reason.
Of course, you should avoid doing this in production anyway, and just asset package your stylesheets into very few stylesheets. I've made a fork of the asset_packager project to support this behavior after 31 stylesheets: http://github.com/jamesyu/asset_packager_ie_css_limit
It's annoying to have to run the stylesheet combine when testing as when I find problems, I have to sort through a mass of css and rerun the combiner in order to test fixes.
OR
http://www.i-marco.nl/weblog/archive/2006/06/24/time_breakdo...
(But without the red section).
Has anyone here actually run into this in practice? If so, how? Just curious.
Every stylesheet is an extra (blocking) HTTP request. 5 is already too many, but 30 is seriously impacting your user's experience.
development mode
There's apparently a setting to merge them but at least in that case something like this issue cropping up makes sense.
These days, I might dynamically generate a CSS file in that situation.
Drupal has a performance feature, which will take these CSS files and automatically aggregate them together. This can make for difficult debugging because problems will disappear when you move from a development to a production environment.
When you would write an application (your FBML is put into their layout) and use even more, you'd eventually run into this limit.
I think they fixed it by combining all style tags in applications into one, since they had to parse them for security reasons anyway.
Fortunately, I do all my testing in Firefox so I've never even noticed this limitation :)
PageStyleTagsW tags[
Thinks for 5 seconds
PageStyleTagsW tags[30]; /* should be enough for any page /
Goes and gets a free soda*Sometimes imposing arbitrary limits in C is a lot easier than manually managing dynamic memory in the heap..
How do you deal with 25 different structure types with nothing different but the name and buffer size? Why, a switch statement of course...
/* Just a quick static array to get it
* working. Should be enough for all the
* usual tests so we can work on core
* functionality.
*
* TODO: change it to a linked list or
* something to dynamically track style
* tags.
*
* Update: Changed from 16 to 30 because Alex
* tossed in a new test that breaks this
* build. This really ought to be updated
* next major release, but for now we just
* need to get it working.
*/Um... don't they mean multiple styles into a single class tag?
<style>
.class1 { .. }
</style>
<style>
.class2 { .. }
</style>
into <style>
.class1 { .. }
.class2 { .. }
</style>Genghis Khan might have had far worse faults than picking his nose at the dinner table, but that still doesn't excuse the behavior.
I've personally bumped into this limit in IE in development mode. My solution was to build a dynamic method that concatenated all the stylesheets on the fly if the IE user agent was detected.