El siguiente fragmento de código se puede ejecutar en la consola de Firebug en Firefox para contar el número total de selectores CSS (no sólo las reglas CSS) y comprobar si se alcanza el limit of 4095 selectors por hoja de estilo:
var
styleSheets = document.styleSheets,
totalStyleSheets = styleSheets.length;
for (var j = 0; j < totalStyleSheets; j++){
var
styleSheet = styleSheets[j],
rules = styleSheet.cssRules,
totalRulesInStylesheet = rules.length,
totalSelectorsInStylesheet = 0;
for (var i = 0; i < totalRulesInStylesheet; i++) {
if (rules[i].selectorText){
totalSelectorsInStylesheet += rules[i].selectorText.split(',').length;
}
}
console.log("Stylesheet: "+styleSheet.href);
console.log("Total rules: "+totalRulesInStylesheet);
console.log("Total selectors: "+totalSelectorsInStylesheet);
}
Did la cantidad de selectores resulta ser el problema? Si no, ¿qué fue? Me estoy encontrando con el mismo problema. De repente, IE9 y solo IE9 muestra mis sitios incorrectamente ... – hawkeye126