Bug 7936 - Inconsistent toString behavior for document.styleSheets, cssRules, etc.
Summary: Inconsistent toString behavior for document.styleSheets, cssRules, etc.
Status: RESOLVED DUPLICATE of bug 8131
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 417.x
Hardware: Mac Windows XP
: P3 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-23 11:13 PST by Peter Flynn
Modified: 2006-04-15 02:30 PDT (History)
0 users

See Also:


Attachments
Testcase for document.styleSheets (535 bytes, text/html)
2006-03-23 11:14 PST, Peter Flynn
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Flynn 2006-03-23 11:13:15 PST
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
Comment 1 Peter Flynn 2006-03-23 11:14:00 PST
Created attachment 7254 [details]
Testcase for document.styleSheets
Comment 2 Peter Flynn 2006-04-14 17:12:14 PDT
This bug also happens for document.scripts
Comment 3 Alexey Proskuryakov 2006-04-15 02:30:24 PDT
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 ***