We had some more problems with the DOM generated by the HTMLParser.
For example multiple forms inside a table with both forms containing all elements in the table instead of only their own.
While trying to fix these problems I broke some more of our tests and at the end decided to emulate the behaviour of Firefox. The result I now have closely emulates it but is neither complete ("col" and "colgroup" not tested) nor 100% correct (DOM, but the one from Firefox is also incorrect).
I added seven tests for which HU and FF generate the same alerts with the exception being MalformedHtmlTest.formInTable4() which has a small difference.
The code I added is not the best as it has a lot of hardcoded Strings and no comments.
But I wanted to make you aware of the problem and the tests can be used regardless of any changes to HTMLParser. If you want to use this fix, I can add a cleaner version of the changes in HTMLParser in the next days.
Patch with changes to HTMLParser and the tests is attached.
Hi Carsten,
will have a look at this during the next days. But as general answer:
the building of the right dom is one of the most important things for HtmlUnit and the part witch introduces the most problems at the moment
have planned to switch to the nu html parser; but implementing this requires some time so this will happen later this year
any patches that improving the current situation are welcome; so yes we want the cleaner version
Thanks a lot
RBRi
Here is a cleaner version which includes some improvements and another two tests.
Patch applied with commit 9452. Can we close this?
Yes you can close this.