[Webkit-unassigned] [Bug 17076] New: Document Tree isn't surviving long enough (Acid3 bug)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 29 14:40:36 PST 2008


http://bugs.webkit.org/show_bug.cgi?id=17076

           Summary: Document Tree isn't surviving long enough (Acid3 bug)
           Product: WebKit
           Version: 525+ (Nightly build)
          Platform: Macintosh
        OS/Version: Mac OS X 10.5
            Status: NEW
          Keywords: NeedsReduction
          Severity: Normal
          Priority: P2
         Component: New Bugs
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: eric at webkit.org
                CC: mjs at apple.com


Document Tree isn'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's in a document
      d = document.implementation.createDocument(null, null, null);
      var e1 = d.createElement('test');
      d.appendChild(d.createElement('root'));
      d.documentElement.appendChild(e1);
      assert(e1.parentNode, "e1 - parent element doesn't exist");
      assert(e1.parentNode.ownerDocument, "e1 - document doesn't exist");
      // e2 - an element that's not in a document
      d = document.implementation.createDocument(null, null, null);
      var e2 = d.createElement('test');
      d.createElement('root').appendChild(e2);
      assert(e2.parentNode, "e2 - parent element doesn't exist");
      assert(e2.parentNode.ownerDocument, "e2 - document doesn't exist");
      // now try to decouple them
      d = null;
      kungFuDeathGrip = [e1, e2];
      assert(e1.parentNode, "e1 - parent element doesn't exist after dropping
reference to document");
      assert(e1.parentNode.ownerDocument, "e1 - document doesn't exist after
dropping reference to document");
      assert(e2.parentNode, "e2 - parent element doesn't exist after dropping
reference to document");
      assert(e2.parentNode.ownerDocument, "e2 - document doesn't exist after
dropping reference to document");
      var loops = ((new Date().valueOf() - 1.1e12) / 32e9) * 0x500; //
increases linearly over time
      for (var i = 0; i < 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("iteration " + i + " at " + d);
        document.createElement('a').appendChild(d);
        d = d.parentNode;
        document.body.insertBefore(d,
document.getElementById('bucket1').parentNode);
       
assert(document.getElementById('bucket2').nextSibling.parentNode.previousSibling.firstChild.data.match(/AT\W/i),
"iteration " + i + " failed");
        d.setAttribute('class', d.textContent);
        document.body.removeChild(d);
      }
      assert(e1.parentNode, "e1 - parent element doesn't exist after looping");
      assert(e1.parentNode.ownerDocument, "e1 - document doesn't exist after
looping");
      assertEquals(e1.parentNode.ownerDocument.nodeType, 9, "e1 - document node
type has wrong node type");
      assert(e2.parentNode, "e2 - parent element doesn't exist after looping");
      assert(e2.parentNode.ownerDocument, "e2 - document doesn't exist after
looping");
      assertEquals(e2.parentNode.ownerDocument.nodeType, 9, "e2 - document node
type has wrong node type");
      return 2;
    },
    function () {
      // test 27: a continuation of the previous test
      var e1 = kungFuDeathGrip[0];
      var e2 = kungFuDeathGrip[1];
      kungFuDeathGrip = null;
      assert(e1, "e1 - element itself didn't survive across tests");
      assert(e1.parentNode, "e1 - parent element doesn't exist after waiting");
      assert(e1.parentNode.ownerDocument, "e1 - document doesn't exist after
waiting");
      assertEquals(e1.parentNode.ownerDocument.nodeType, 9, "e1 - document node
type has wrong node type after waiting");
      assert(e2, "e2 - element itself didn't survive across tests");
      assert(e2.parentNode, "e2 - parent element doesn't exist after waiting");
      assert(e2.parentNode.ownerDocument, "e2 - document doesn't exist after
waiting");
      assertEquals(e2.parentNode.ownerDocument.nodeType, 9, "e2 - document node
type has wrong node type after waiting");
      return 2;
    },


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list