Bug 16746 - Acid3 expects different traversal order from NodeIterator
Summary: Acid3 expects different traversal order from NodeIterator
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords: NeedsReduction
Depends on:
Blocks: Acid3
  Show dependency treegraph
 
Reported: 2008-01-05 14:06 PST by Eric Seidel (no email)
Modified: 2019-02-06 09:03 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2008-01-05 14:06:33 PST
Acid3 expects different traversal order from DOMIterator

I expect that we're adding a text nod or something.  We'll need to reduce:

    function () {
      // test 8: ignoring whitespace text nodes with node iterators
      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 i = document.createNodeIterator(document.body, 0x01 | 0x04 | 0x08 | 0x10 | 0x20, allButWS, true);
      // now walk the document body and make sure everything is in the right place
      expect(i.nextNode(), document.body); // 1
      expect(i.nextNode(), document.getElementsByTagName('h1')[0]);
      expect(i.nextNode(), document.getElementsByTagName('h1')[0].firstChild);
      expect(i.nextNode(), document.getElementsByTagName('div')[0]);
      expect(i.nextNode(), document.getElementById('bucket1'));
      expect(i.nextNode(), document.getElementById('bucket2'));
      expect(i.nextNode(), document.getElementById('bucket3'));
      expect(i.nextNode(), document.getElementById('bucket4'));
      expect(i.nextNode(), document.getElementById('bucket5'));
      expect(i.nextNode(), document.getElementById('bucket6')); // 10
      expect(i.nextNode(), document.getElementById('result'));
      expect(i.nextNode(), document.getElementById('score'));
      expect(i.nextNode(), document.getElementById('score').firstChild);
      expect(i.nextNode(), document.getElementById('percent'));
      expect(i.nextNode(), document.getElementById('percent').firstChild);
      expect(i.nextNode(), document.getElementById('percent').nextSibling);
      expect(i.nextNode(), document.getElementById('percent').nextSibling.firstChild);
      expect(i.nextNode(), document.getElementsByTagName('map')[0]);
      expect(i.nextNode(), document.getElementsByTagName('area')[0]);
      expect(i.nextNode(), document.getElementsByTagName('iframe')[0]); // 20
      expect(i.nextNode(), document.getElementsByTagName('iframe')[0].firstChild);
      expect(i.nextNode(), document.getElementsByTagName('iframe')[1]);
      expect(i.nextNode(), document.getElementsByTagName('iframe')[1].firstChild);
      expect(i.nextNode(), document.getElementsByTagName('iframe')[2]);
      expect(i.nextNode(), document.forms[0]);
      expect(i.nextNode(), document.forms.form.elements[0]);
      expect(i.nextNode(), document.getElementsByTagName('table')[0]);
      expect(i.nextNode(), document.getElementsByTagName('tbody')[0]);
      expect(i.nextNode(), document.getElementsByTagName('tr')[0]);
      expect(i.nextNode(), document.getElementsByTagName('td')[0]);
      expect(i.nextNode(), document.getElementsByTagName('td')[0].getElementsByTagName('p')[0]);
      expect(i.nextNode(), document.getElementById('instructions'));
      expect(i.nextNode(), document.getElementById('instructions').firstChild);
      expect(i.nextNode(), document.links[0]);
      expect(i.nextNode(), document.links[0].firstChild);
      expect(i.nextNode(), document.getElementById('instructions').lastChild);
      expect(i.nextNode(), null);
      // walk it backwards for good measure
      expect(i.previousNode(), document.getElementById('instructions').lastChild);
      expect(i.previousNode(), document.links[0].firstChild);
      expect(i.previousNode(), document.links[0]);
      expect(i.previousNode(), document.getElementById('instructions').firstChild);
      expect(i.previousNode(), document.getElementById('instructions'));
      expect(i.previousNode(), document.getElementsByTagName('td')[0].getElementsByTagName('p')[0]);
      expect(i.previousNode(), document.getElementsByTagName('td')[0]);
      expect(i.previousNode(), document.getElementsByTagName('tr')[0]);
      expect(i.previousNode(), document.getElementsByTagName('tbody')[0]);
      expect(i.previousNode(), document.getElementsByTagName('table')[0]);
      expect(i.previousNode(), document.forms.form.elements[0]);
      expect(i.previousNode(), document.forms[0]);
      expect(i.previousNode(), document.getElementsByTagName('iframe')[2]);
      expect(i.previousNode(), document.getElementsByTagName('iframe')[1].firstChild);
      expect(i.previousNode(), document.getElementsByTagName('iframe')[1]);
      expect(i.previousNode(), document.getElementsByTagName('iframe')[0].firstChild);
      expect(i.previousNode(), document.getElementsByTagName('iframe')[0]); // 20
      expect(i.previousNode(), document.getElementsByTagName('area')[0]);
      expect(i.previousNode(), document.getElementsByTagName('map')[0]);
      expect(i.previousNode(), document.getElementById('percent').nextSibling.firstChild);
      expect(i.previousNode(), document.getElementById('percent').nextSibling);
      expect(i.previousNode(), document.getElementById('percent').firstChild);
      expect(i.previousNode(), document.getElementById('percent'));
      expect(i.previousNode(), document.getElementById('score').firstChild);
      expect(i.previousNode(), document.getElementById('score'));
      expect(i.previousNode(), document.getElementById('result'));
      expect(i.previousNode(), document.getElementById('bucket6'));
      expect(i.previousNode(), document.getElementById('bucket5'));
      expect(i.previousNode(), document.getElementById('bucket4'));
      expect(i.previousNode(), document.getElementById('bucket3'));
      expect(i.previousNode(), document.getElementById('bucket2'));
      expect(i.previousNode(), document.getElementById('bucket1'));
      expect(i.previousNode(), document.getElementsByTagName('div')[0]);
      expect(i.previousNode(), document.getElementsByTagName('h1')[0].firstChild);
      expect(i.previousNode(), document.getElementsByTagName('h1')[0]);
      expect(i.previousNode(), document.body);
      expect(i.previousNode(), null);
      return 1;
    },
Comment 1 Lucas Forschler 2019-02-06 09:03:04 PST
Mass moving XML DOM bugs to the "DOM" Component.