Hi guys,
Thanks again for all your hard work on HtmlUnit!
When using HtmlUnit against my production system I am encountering StackOverflowError (trace below). Looking at the code, it would appear that ComputedCSSStyleDeclaration.getTop is quite prone to this. For every sibling (not parent), it recursively calls .getTop. So in my case, where I have a couple of SELECT boxes with 2,000 OPTIONs in them (silly I know) this requires over 4,000 stack calls.
Could perhaps this code be rewritten as a loop? Or at least taught to ignore those elements (such as OPTION) that have no vertical displacement (it already tries this for elements that are absolutely positioned)?
Regards,
Richard.
Please also see http://old.nabble.com/ComputedCSSStyleDeclaration.getTop-prone-to-StackOverflowError--td30593445.html
Stack trace showing StackOverflow
Hi,
I have also encountered such issue.
In attachment you will find patch for ComputedCSSStyleDeclaration and testcase based on HTMLElement2Test.offsetTopWithPreviousSiblings.
Thanks a lot for the patch, slightly modified and committed.
Next time, please run 'mvn checkstyle:checkstyle' as hinted in http://htmlunit.sourceforge.net/submittingPatches.html