File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
src/test/java/org/htmlunit/javascript/host/dom Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,31 @@ public void createContextualFragment2() throws Exception {
147147 loadPageVerifyTitle2 (html );
148148 }
149149
150+ /**
151+ * @throws Exception if the test fails
152+ */
153+ @ Test
154+ @ Alerts ("<div id=\" myDiv2\" ></div>hello:<div id=\" myDiv3\" ></div>" )
155+ public void createContextualStrangeCode () throws Exception {
156+ final String html = DOCTYPE_HTML
157+ + "<html><head>\n "
158+ + "<script>\n "
159+ + LOG_TITLE_FUNCTION
160+ + " function test() {\n "
161+ + " var element = document.getElementById('myDiv2');\n "
162+ + " var range = element.ownerDocument.createRange();\n "
163+ + " range.setStartAfter(element);\n "
164+ + " var fragment = range.createContextualFragment('hello:<world');\n "
165+ + " element.parentNode.insertBefore(fragment, element.nextSibling);\n "
166+ + " log(element.parentNode.innerHTML);\n "
167+ + " }\n "
168+ + "</script></head><body onload='test()'>\n "
169+ + " <div id='myDiv'><div id='myDiv2'></div><div id='myDiv3'></div></div>\n "
170+ + "</body></html>" ;
171+
172+ loadPageVerifyTitle2 (html );
173+ }
174+
150175 /**
151176 * @throws Exception if the test fails
152177 */
You can’t perform that action at this time.
0 commit comments