Bug 17137
| Summary: | Iterating over document.styleSheets omits numeric indices | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Mike Walters <mikel.walters> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | CC: | mikel.walters, mrowe |
| Priority: | P2 | Keywords: | HasReduction |
| Version: | 528+ (Nightly build) | ||
| Hardware: | PC | ||
| OS: | OS X 10.5 | ||
| URL: | javascript:for (var i in document.sytleSheets) { alert(i); } | ||
Mike Walters
for(var i in document.styleSheets) <-- doesnt work
{
document.styleSheets[i] is undefined always
}
for(var i=0; i<document.styleSheets.length; i++)
{
document.styleSheets[i] works!
}
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Mark Rowe (bdash)
The problem is that iterating over document.styleSheets only returns "item" and "length", not the numeric indices. In Firefox it returns the numeric indices followed by "item" and "length".
Mark Rowe (bdash)
It seems this affects HTMLCollection along with StyleSheetList. There are probably others.
Mark Rowe (bdash)
This is the same as bug 8080.
*** This bug has been marked as a duplicate of 8080 ***