From: Marc G. <mgu...@ya...> - 2005-08-19 06:51:00
|
Hi, I think that it is related to following issue: "Properties on Location object defined as read only" http://sourceforge.net/tracker/index.php?func=detail&aid=1238429&group_id=47038&atid=448266 You patch with the appropriate unit tests fixing the problem is welcome. Marc. Anzinger, Stefan wrote: > Hello! > > I've found a problem with handling links done with javascript: > > a.html: > ------------------------------------------------------------- > <html xmlns="http://www.w3.org/1999/xhtml"> > <head> > <title>Page A</title> > </head> > <body> > <a href="#" onclick="document.location.href='b.html'" > name="link">link</a> > </body> > </html> > ------------------------------------------------------------- > > b.html: > ------------------------------------------------------------- > <html xmlns="http://www.w3.org/1999/xhtml"> > <head> > <title>Page B</title> > </head> > <body> > <iframe src="c.html"></iframe> > </body> > </html> > ------------------------------------------------------------- > > c.html: > ------------------------------------------------------------- > <html xmlns="http://www.w3.org/1999/xhtml"> > <head> > <title>Page C</title> > </head> > <body> > test > </body> > </html> > ------------------------------------------------------------- > > Testprogram: > ------------------------------------------------------------- > WebClient client = new WebClient(); > HtmlPage p = (HtmlPage)client.getPage(new URL("http://.../a.html")); > HtmlAnchor b = p.getAnchorByName("link"); > p = (HtmlPage)b.click(); > System.out.println("We are on " + p.getTitleText()); > ------------------------------------------------------------- > > > HTMLUnit navigate to Page A. > When the href attribute is empty (href="") HTMLUnit will navigate to > Page C. > Mozilla and IE will navigate to Page B (with href="#"). > > I've fixed this problem for myself temporary. I can send the > code-changes, when needed. > > > Stefan Anzinger > GoldenSource Corporation > Development Center Austria > A-4066 Pasching, Plus-Kaufstr.7 > Phone +43 (7229) 76656-51 > Fax +43 (7229) 76656-99 > E-mail: san...@th... > http://www.thegoldensource.com > This message is for the named person's use only. It may contain > confidential, proprietary or legally privileged information. No > confidentiality or privilege is waived or lost by any erroneous > transmission. If you receive this message in error, please immediately > destroy it and notify the sender. You must not, directly or indirectly, > use, disclose, distribute, or copy any part of this message if you are > not the intended recipient. > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |