<?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>3330</bug_id>
          
          <creation_ts>2005-06-07 20:42:30 -0700</creation_ts>
          <short_desc>REGRESSION (125-300): JavaScript &quot;children&quot; array includes all descendants, not just immediate children</short_desc>
          <delta_ts>2005-07-03 07:36:12 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>412</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://colloquy.info/test/children.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Timothy Hatcher">timothy</reporter>
          <assigned_to name="Maciej Stachowiak">mjs</assigned_to>
          <cc>hyatt</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>10842</commentid>
    <comment_count>0</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2005-06-07 20:42:30 -0700</bug_when>
    <thetext>Radar: 4063841

Summary:
The &quot;children&quot; array on nodes returns children&apos;s children in on flattened array. This is a regression from 
Safari 1.2 and from the DOM specs.

A test case is setup here. It &quot;children.length&quot; should return 5 for the number of div elements.

http://colloquy.info/test/children.html

Steps to Reproduce:
1) Access the children array on a DOM node with JavaScript.

Expected Results:
Only immediate children should be in the array, not the children&apos;s children, etc.

Actual Results:
The array has more elements than expected if the immediate children have children elements also. They 
all get flattened out into the main array (a recursive behavior).

Regression:
This is a regression from Safari 1.2 builds.

Notes:
Test case at: http://colloquy.info/test/children.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10846</commentid>
    <comment_count>1</comment_count>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2005-06-07 20:45:35 -0700</bug_when>
    <thetext>This is actually a bug with collections in general.  traverseNextItem begins by calling traverseNextNode, 
but traverseNextNode is a deep traversal.  This means that shallow traversals like children are deep when 
they should not be when you make repeated calls to traverseNextItem to iterate (as calcLength does).  

The same is true of some of the other collections that should not be deep, and so this bug could be the 
cause of other HTML collection DOM bugs.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11130</commentid>
    <comment_count>2</comment_count>
      <attachid>2168</attachid>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2005-06-08 22:35:51 -0700</bug_when>
    <thetext>Created attachment 2168
Fix</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11131</commentid>
    <comment_count>3</comment_count>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2005-06-08 23:33:21 -0700</bug_when>
    <thetext>I sent review comment to Timothy by email.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12685</commentid>
    <comment_count>4</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2005-06-20 07:55:59 -0700</bug_when>
    <thetext>This was fixed with the attached patch, and landed by Maciej. Thought I would close this and help out.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>2168</attachid>
            <date>2005-06-08 22:35:51 -0700</date>
            <delta_ts>2005-06-08 22:35:51 -0700</delta_ts>
            <desc>Fix</desc>
            <filename>3330.patch</filename>
            <type>text/plain</type>
            <size>1385</size>
            <attacher name="Timothy Hatcher">timothy</attacher>
            
              <data encoding="base64">SW5kZXg6IENoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09P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C1yMS4yNSBodG1sX21pc2NpbXBsLmNwcAotLS0gaHRt
bF9taXNjaW1wbC5jcHAJMjAwNS8wNS8xMSAwMDo1ODoyOAkxLjI1CisrKyBodG1sX21pc2NpbXBs
LmNwcAkyMDA1LzA2LzA5IDA0OjUwOjI2CkBAIC0xMjksNyArMTI5LDkgQEAgTm9kZUltcGwgKkhU
TUxDb2xsZWN0aW9uSW1wbDo6dHJhdmVyc2VOZQogewogICAgIGFzc2VydChjdXJyZW50KTsKIAot
ICAgIGN1cnJlbnQgPSBjdXJyZW50LT50cmF2ZXJzZU5leHROb2RlKG1fYmFzZS5nZXQoKSk7Cisg
ICAgaWYgKHR5cGUgPT0gTk9ERV9DSElMRFJFTiAmJiBtX2Jhc2UuZ2V0KCkgIT0gY3VycmVudCkK
KyAgICAgICAgY3VycmVudCA9IGN1cnJlbnQgLT4gbmV4dFNpYmxpbmcoKTsKKyAgICBlbHNlIGN1
cnJlbnQgPSBjdXJyZW50LT50cmF2ZXJzZU5leHROb2RlKG1fYmFzZS5nZXQoKSk7CiAKICAgICB3
aGlsZSAoY3VycmVudCkgewogICAgICAgICBpZihjdXJyZW50LT5ub2RlVHlwZSgpID09IE5vZGU6
OkVMRU1FTlRfTk9ERSkgewo=
</data>

          </attachment>
      

    </bug>

</bugzilla>