DomNode.replace() fails to connect the previousSibling
pointer for newNode, which later causes an
IllegalArgumentException to be thrown at the beginning
of the method if the child is replaced later.
The attached patch fixes this issue.
Failing unit tests will be uploaded tomorrow.
Fix DomNode.replace() to set previousSibling on newNode
Logged In: YES
user_id=84089
Here is a group of tests to demonstrate the problems with
DomNode.replace().
I managed to reduce the HTML for the test case, but didn't
have time to reduce the JavaScript.
I will upload the actual JavaScript files and the HTML file
next.
Tests to demonstrate bug in DomNode.replace()
First JavaScript file
Second Javascript file
HTML test file
Logged In: YES
user_id=402164
Can the js be - strongly - reduced?
If not, we have to look for a solution adding the js files
as it and loading them for the classpath because such a js
code in java string is quite unreadable and makes difficult
to use it for tests in a real browser.
Logged In: YES
user_id=402164
I can reproduce the bug with a small unit test and solve it
as proposed in your patch.
I've found many other bugs related to the DomNode and it may
take a few days before I can commit all the fixes.
Logged In: YES
user_id=402164
Should be now fixed in CVS. Thanks.
Logged In: YES
user_id=84089
Thanks for writing a new test case, Mark.
When I wrote the original, I tried to reduce the voluminous JavaScript we
were using to swap table rows using the DOM, but (as you saw) I was
not very successful. :)
Logged In: YES
user_id=84089
Thanks, MARC! Sorry for mispelling your name.