Skip to content

Commit

Permalink
test case for nahsra/antisamy#453
Browse files Browse the repository at this point in the history
  • Loading branch information
rbri committed May 24, 2024
1 parent df1f86a commit ab02e8d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/test/java/org/htmlunit/html/parser/MalformedHtmlTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1419,4 +1419,27 @@ public void incompleteEntities() throws Exception {

assertEquals(getExpectedAlerts()[0], getMockWebConnection().getLastWebRequest().getUrl());
}

/**
* @throws Exception if the test fails
*/
@Test
@Alerts({"5", "3", "[object HTMLSelectElement]", "[object HTMLTableElement]", "[object HTMLScriptElement]"})
public void selectInsideEmptyTable() throws Exception {
final String html = "<html><head></head><body>\n"
+ "<table><select name='Lang'><option value='da'>Dansk</option></select></table>\n"
+ "<script>\n"
+ LOG_TITLE_FUNCTION
+ "log(document.body.childNodes.length);\n"
+ "log(document.body.children.length);\n"
+ "log(document.body.children[0]);\n"
+ "log(document.body.children[1]);\n"
+ "log(document.body.children[2]);\n"
+ "</script>\n"
+ "</body></html>";

expandExpectedAlertsVariables(URL_FIRST);

loadPageVerifyTitle2(html);
}
}

0 comments on commit ab02e8d

Please sign in to comment.