From: RBRi <rb...@us...> - 2018-06-30 12:55:23
|
- **status**: accepted --> closed - **assigned_to**: Ahmed Ashour --> RBRi - **Comment**: Fixed. --- ** [bugs:#1682] DOCTYPE starting with <? results in DOM without expected elements** **Status:** closed **Group:** Latest SVN **Created:** Sat May 09, 2015 06:10 AM UTC by Sebastian Cato **Last Updated:** Fri Feb 02, 2018 06:34 PM UTC **Owner:** RBRi Hello, Came across a site that didn't render the DOM I was expecting (lacking an HtmlForm node) in HtmlUnit. I isolated the problem to an incorrect doctype on the site, starting with <? instead of <!. On trunk, r10440: ~~~~~ @Test public void testDoctypeQuestionmark() throws Exception { final String content = "<?doctype html>\n" + "<html>\n" + " <head>\n" + " <title>foo</title>\n" + " </head>\n" + " <body>\n" + " <form action=\"#\" method=\"post\"> \n" + " <input type=\"text\" name=\"foo\">\n" + " <input type=\"submit\">\n" + " </form>\n" + " </body>\n" + "</html>\n"; final MockWebConnection webConnection = new MockWebConnection(); final URL url = new URL("http://www.example.com/"); webConnection.setResponse(url, content); final WebClient client = new WebClient(); client.setWebConnection(webConnection); final HtmlPage page = client.getPage(url); assertTrue(page.getForms().size() == 1); client.close(); } ~~~~~ --- Sent from sourceforge.net because htm...@li... is subscribed to https://sourceforge.net/p/htmlunit/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |