Comment #4 on issue 2106 by MatthewAlanKane: styleSheets.cssRules[index]
with invalid index returns CSSStyleRule object instead of undefined
http://code.google.com/p/chromium/issues/detail?id=2106
Problem still exists. Makes it difficult to find and modify CSS rules.
Temporary imperfect workaround:
for (var i=0; i<document.styleSheets.length; i++) {
var styleSheet=document.styleSheets[i];
var ii=0;
var cssRule=false;
var last=false;
do {
if (styleSheet.cssRules) {
cssRule = styleSheet.cssRules[ii];
} else {
cssRule = styleSheet.rules[ii];
}
if (cssRule) {
alert(cssRule.selectorText.toLowerCase());
}
// CHROME FIX
if (cssRule == last) {
cssRule = false;
}
last=cssRule;
// END FIX
ii++;
} while (cssRule)
}
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
--~--~---------~--~----~------------~-------~--~----~
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/group/chromium-bugs
-~----------~----~----~----~------~----~------~--~---