WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
16747
Acid3 expects NodeWalker.currentNode to equal start node after creation
https://bugs.webkit.org/show_bug.cgi?id=16747
Summary
Acid3 expects NodeWalker.currentNode to equal start node after creation
Eric Seidel (no email)
Reported
2008-01-05 14:08:25 PST
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
Comment 1
2008-01-05 15:59:23 PST
See also:
bug 3492
.
Lucas Forschler
Comment 2
2019-02-06 09:02:39 PST
Mass moving XML DOM bugs to the "DOM" Component.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug