<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>17137</bug_id>
          
          <creation_ts>2008-02-01 08:18:43 -0800</creation_ts>
          <short_desc>Iterating over document.styleSheets omits numeric indices</short_desc>
          <delta_ts>2008-02-01 08:29:36 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>8080</dup_id>
          
          <bug_file_loc>javascript:for (var i in document.sytleSheets) { alert(i); }</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mike Walters">mikel.walters</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>mikel.walters</cc>
    
    <cc>mrowe</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>69050</commentid>
    <comment_count>0</comment_count>
    <who name="Mike Walters">mikel.walters</who>
    <bug_when>2008-02-01 08:18:43 -0800</bug_when>
    <thetext>for(var i in document.styleSheets) &lt;-- doesnt work
{
  document.styleSheets[i] is undefined always
}

for(var i=0; i&lt;document.styleSheets.length; i++)
{
  document.styleSheets[i] works!
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69051</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2008-02-01 08:19:55 -0800</bug_when>
    <thetext>The problem is that iterating over document.styleSheets only returns &quot;item&quot; and &quot;length&quot;, not the numeric indices.  In Firefox it returns the numeric indices followed by &quot;item&quot; and &quot;length&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69053</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2008-02-01 08:26:20 -0800</bug_when>
    <thetext>It seems this affects HTMLCollection along with StyleSheetList.  There are probably others.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69055</commentid>
    <comment_count>3</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2008-02-01 08:29:36 -0800</bug_when>
    <thetext>This is the same as bug 8080.

*** This bug has been marked as a duplicate of 8080 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>