Summary: | ASSERT when using TreeWalker methods for a current node outside of the root (Acid3) | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Sam Weinig <sam> | ||||
Component: | DOM | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | ||||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Mac | ||||||
OS: | OS X 10.4 | ||||||
Attachments: |
|
Description
Sam Weinig
2008-01-05 16:48:05 PST
Created attachment 18291 [details]
patch
Comment on attachment 18291 [details]
patch
Looks great!
Comment on attachment 18291 [details]
patch
This is wrong.
If you read the TreeWalker documentation, you'll see that it has well defined behavior when used on nodes outside the original subtree. The code correctly implemented most of those rules before -- this patch broke it!
I have a patch that fixes it. The test case expects behavior that is incorrect, so I need to change it around.
Here is the relevant quote from the specification: "All the TreeWalker's navigation methods operate in terms of the context of the currentNode at the time they are invoked, no matter what has happened to, or around, that node since the last time the TreeWalker was accessed. This remains true even if the currentNode is moved out of its original subtree." And: "If we instead insert the currentNode into the <subtree/> element, like so: [...] we have moved the currentNode out from under the TreeWalker's root node. This does not invalidate the TreeWalker; it may still be used to navigate relative to the currentNode." The real fix here would be to remove the assertions, and I have done this in my new patch. |