In case a page defines a <base> element with an href attribute, the resulting base URL (as provided by HtmlPage.getBaseURL()) may not always be correct. While full URLs and absolute paths in the href attribute are handled correctly, relative paths are not.
Imagine a page URL of http://host/path/to/page.html and a base element with a href of "img/" on that page. The resulting base URLs are as follows:
Looks like browsers resolve relative paths against the current "directory", whereas Htmlunit appends the relative path to the page URL.
Thanks,
J.
See also the attached patch that adds some test cases and tries to fix this issue.
fixed in svn; thanks (as always)