In case the target URL of an anchor ends with "#" and the anchor is clicked, the target page is not loaded even though the URL of the current page is different from the target URL. If there is no hash or a proper hash ("#aaa"), everything works as expected. Test case attached.
The reason could be that HtmlAnchor gives a wrong hint to WebClient about whether or not we have a hash jump:
htmlPage.getWebClient().download(htmlPage.getEnclosingWindow(),
htmlPage.getResolvedTarget(getTargetAttribute()),
webRequest, href.endsWith("#"), "Link click");
Maybe the expression 'href.endsWith("#")' is not sufficient/correct.
Thanks,
J.
According to the JavaDoc of WebClient#download() regarding the parameter isHashJump:
the proper code in HtmlAnchor#doClickStateUpdate should read
instead of
The "spec" defines the correct handling of fragment identifiers here at step 8.
Sch..., i really forgot this case while writing all the cases in PageReloadTest. Sorry for that.
Interesting that nobody notice that during the last year.
Fix is on the way, and as usual please review and report back.
The test is green now, thanks.
I have a couple of remarks regarding your changes:
What do you think?
Best,
J.
Seems like you are right here. The info about the empty ref is dropped somewhere else. Will try to fix this. Hopefully we can get rid of this nasty parameter.
Will check your other points also.
Ok, updated version is in SVN. Please check
Looks really good. Cheers!