All style tags after the first 30 style tags are not applied in IE (4-8)
support.microsoft.com
support.microsoft.com
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.
struct Element {
// Update: apparently 16 wasn't enough. Raised to 30 to pass test #452
StyleData styles[30]; // No one uses more than 16 style parameters anyway.
}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.
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.
I'm hesitant to call this a bug.
More seriously, I was once treated VERY skeptically by an old-school programmer (not at MS, never worked there) when I replaced some of his fixed-sized buffers with resizeable ones. "If our customers are running workloads that create more than 256 frooble node objects, I want to hear about it." Via a bug report? Really? And then get a new bug report next year when the new limit is reached? But he was adamant, and if it was up to him we wouldn't have made the change at all. The way he worked, you knew how many frooble node objects the customer needed, and if you were wrong then you fixed the code.
Of course you can concat them together, but that adds a maintenance burden in the future whose size can vary wildly.
At the very least, there is a documentation bug here. The reason for this seemingly arbitrary limit should be documented by MS.
and that isnt mentioning the boundary situations for things like web page builders with the ability to user define styles in which having a "lot" of style tags is architecturally a good idea.
I am quite tired of this "your doing it wrong" meme when its used instead of "you arent doing the same thing I am doing"
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.
Fortunately, I do all my testing in Firefox so I've never even noticed this limitation :)
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.
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...
But he has made some of the dumbest use of C++ I have ever seen. Verbs as classes, sometimes making it obvious that inheritance escapes him, and an entire cpp file over 10k lines long that does nothing but assert the mass amount of assumptions his code makes. The one method is literally called 'check_assumptions.'
I'm not bitter though.
/* 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.