Certain CSS-related scripting objects display inconsistent behavior when attempting to convert them to strings. See the attached testcase: alert(document.styleSheets) --> works as expected alert(""+document.styleSheets) --> "No default value" exception alert(document.styleSheets.toString()) --> "Value undefined" exception (there is no toString method). Clearly, there is code to render the object as a string because the first case works. It is just not getting invoked properly in the other cases. Some related CSS objects have the same bug: document.styleSheets[i] --> correct document.styleSheets[i].cssRules --> buggy document.styleSheets[i].cssRules[j] --> buggy
Created attachment 7254 [details] Testcase for document.styleSheets
This bug also happens for document.scripts
Although this bug has been filed earlier, bug 8131 shows more progress towards being fixed, so I'm closing this one as a duplicate. *** This bug has been marked as a duplicate of 8131 ***