Bug 16747
Summary: | Acid3 expects NodeWalker.currentNode to equal start node after creation | ||
---|---|---|---|
Product: | WebKit | Reporter: | Eric Seidel (no email) <eric> |
Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | cdumez |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Mac | ||
OS: | OS X 10.4 | ||
Bug Depends on: | |||
Bug Blocks: | 17064 |
Eric Seidel (no email)
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;
},
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
See also: bug 3492.
Lucas Forschler
Mass moving XML DOM bugs to the "DOM" Component.