<?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>17076</bug_id>
          
          <creation_ts>2008-01-29 14:40:36 -0800</creation_ts>
          <short_desc>Document Tree isn&apos;t surviving long enough (Acid3 bug)</short_desc>
          <delta_ts>2008-01-30 01:08:29 -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>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>16289</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>NeedsReduction</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>17064</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Eric Seidel (no email)">eric</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>mjs</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>68713</commentid>
    <comment_count>0</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-01-29 14:40:36 -0800</bug_when>
    <thetext>Document Tree isn&apos;t surviving long enough (Acid3 bug)

This will need some reduction.

    function () {
      // test 26: check that document tree survives while still accessible
      var d;
      // e1 - an element that&apos;s in a document
      d = document.implementation.createDocument(null, null, null);
      var e1 = d.createElement(&apos;test&apos;);
      d.appendChild(d.createElement(&apos;root&apos;));
      d.documentElement.appendChild(e1);
      assert(e1.parentNode, &quot;e1 - parent element doesn&apos;t exist&quot;);
      assert(e1.parentNode.ownerDocument, &quot;e1 - document doesn&apos;t exist&quot;);
      // e2 - an element that&apos;s not in a document
      d = document.implementation.createDocument(null, null, null);
      var e2 = d.createElement(&apos;test&apos;);
      d.createElement(&apos;root&apos;).appendChild(e2);
      assert(e2.parentNode, &quot;e2 - parent element doesn&apos;t exist&quot;);
      assert(e2.parentNode.ownerDocument, &quot;e2 - document doesn&apos;t exist&quot;);
      // now try to decouple them
      d = null;
      kungFuDeathGrip = [e1, e2];
      assert(e1.parentNode, &quot;e1 - parent element doesn&apos;t exist after dropping reference to document&quot;);
      assert(e1.parentNode.ownerDocument, &quot;e1 - document doesn&apos;t exist after dropping reference to document&quot;);
      assert(e2.parentNode, &quot;e2 - parent element doesn&apos;t exist after dropping reference to document&quot;);
      assert(e2.parentNode.ownerDocument, &quot;e2 - document doesn&apos;t exist after dropping reference to document&quot;);
      var loops = ((new Date().valueOf() - 1.1e12) / 32e9) * 0x500; // increases linearly over time
      for (var i = 0; i &lt; loops; i += 1) {
        // we want to force a GC here, so we use up lots of memory
        // we take the opportunity to sneak in a perf test to make DOM and JS stuff faster...
        d = new Date();
        d = new (function (x) { return { toString: function () { return x.toString() } } })(d.valueOf());
        d = document.createTextNode(&quot;iteration &quot; + i + &quot; at &quot; + d);
        document.createElement(&apos;a&apos;).appendChild(d);
        d = d.parentNode;
        document.body.insertBefore(d, document.getElementById(&apos;bucket1&apos;).parentNode);
        assert(document.getElementById(&apos;bucket2&apos;).nextSibling.parentNode.previousSibling.firstChild.data.match(/AT\W/i), &quot;iteration &quot; + i + &quot; failed&quot;);
        d.setAttribute(&apos;class&apos;, d.textContent);
        document.body.removeChild(d);
      }
      assert(e1.parentNode, &quot;e1 - parent element doesn&apos;t exist after looping&quot;);
      assert(e1.parentNode.ownerDocument, &quot;e1 - document doesn&apos;t exist after looping&quot;);
      assertEquals(e1.parentNode.ownerDocument.nodeType, 9, &quot;e1 - document node type has wrong node type&quot;);
      assert(e2.parentNode, &quot;e2 - parent element doesn&apos;t exist after looping&quot;);
      assert(e2.parentNode.ownerDocument, &quot;e2 - document doesn&apos;t exist after looping&quot;);
      assertEquals(e2.parentNode.ownerDocument.nodeType, 9, &quot;e2 - document node type has wrong node type&quot;);
      return 2;
    },
    function () {
      // test 27: a continuation of the previous test
      var e1 = kungFuDeathGrip[0];
      var e2 = kungFuDeathGrip[1];
      kungFuDeathGrip = null;
      assert(e1, &quot;e1 - element itself didn&apos;t survive across tests&quot;);
      assert(e1.parentNode, &quot;e1 - parent element doesn&apos;t exist after waiting&quot;);
      assert(e1.parentNode.ownerDocument, &quot;e1 - document doesn&apos;t exist after waiting&quot;);
      assertEquals(e1.parentNode.ownerDocument.nodeType, 9, &quot;e1 - document node type has wrong node type after waiting&quot;);
      assert(e2, &quot;e2 - element itself didn&apos;t survive across tests&quot;);
      assert(e2.parentNode, &quot;e2 - parent element doesn&apos;t exist after waiting&quot;);
      assert(e2.parentNode.ownerDocument, &quot;e2 - document doesn&apos;t exist after waiting&quot;);
      assertEquals(e2.parentNode.ownerDocument.nodeType, 9, &quot;e2 - document node type has wrong node type after waiting&quot;);
      return 2;
    },</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68778</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-01-30 01:08:29 -0800</bug_when>
    <thetext>

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

    </bug>

</bugzilla>