[Webkit-unassigned] [Bug 16747] New: Acid3 expects NodeWalker.currentNode to equal start node after creation

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jan 5 14:08:25 PST 2008


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

           Summary: Acid3 expects NodeWalker.currentNode to equal start node
                    after creation
           Product: WebKit
           Version: 525+ (Nightly build)
          Platform: Macintosh
        OS/Version: Mac OS X 10.4
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: XML DOM
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: eric at webkit.org


Acid3 expects NodeWalker.currentNode to equal start node after creation

Our NodeWalker implementation might just be totally broken.

    function () {
      // test 9: ignoring whitespace text nodes with tree walkers
      var count = 0;
      var expect = function(node1, node2) {
        count += 1;
        assert(node1 == node2, "expectation " + count + " failed");
      };
      var allButWS = function (node) {
        if (node.nodeType == 3 && node.data.match(/^\s*$/))
          return false;
        return true;
      };
      var w = document.createTreeWalker(document.body, 0x01 | 0x04 | 0x08 |
0x10 | 0x20, allButWS, true);
      expect(w.currentNode, document.body);
      expect(w.parentNode(), null);
      expect(w.currentNode, document.body);
      expect(w.firstChild(), document.getElementsByTagName('h1')[0]);
      expect(w.firstChild().nodeType, 3);
      expect(w.parentNode(), document.getElementsByTagName('h1')[0]);
      expect(w.nextSibling().previousSibling.nodeType, 3);
      expect(w.nextSibling(), document.getElementsByTagName('p')[6]);
      expect(w.nextSibling(), document.getElementsByTagName('map')[0]);
      expect(w.lastChild(), document.getElementsByTagName('table')[0]);
      expect(w.lastChild(), document.getElementsByTagName('tbody')[0]);
      expect(w.nextNode(), document.getElementsByTagName('tr')[0]);
      expect(w.nextNode(), document.getElementsByTagName('td')[0]);
      expect(w.nextNode(), document.getElementsByTagName('p')[7]);
      expect(w.nextNode(), document.getElementsByTagName('p')[8]);
      expect(w.previousSibling(), document.getElementsByTagName('map')[0]);
      expect(w.previousNode(), document.getElementsByTagName('p')[6]);
      expect(w.parentNode(), document.body);
      expect(w.lastChild().id, "instructions");
      expect(w.lastChild().data.substr(0,1), ".");
      expect(w.previousNode(), document.links[0].firstChild);
      return 1;
    },


-- 
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