insertAdjacentHTML in HTML

Summary

Harness status: OK

Found 30 tests

Details

ResultTest NameMessage
PassbeforeBegin content without next sibling
Asserts run
Pass
assert_equals("i", "i", "Should have had <i> as previous sibling")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:18:5)
Pass
assert_equals("script", "script", "Should have had <script> as second previous child")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:19:5)
Pass
assert_false(false, "script should not have run")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:20:5)
PassAfterbegin content without next sibling
Asserts run
Pass
assert_equals("b", "b", "Should have had <b> as first child")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:26:5)
Pass
assert_equals("script", "script", "Should have had <script> as second child")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:27:5)
Pass
assert_false(false, "script should not have run")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:28:5)
PassBeforeEnd content without next sibling
Asserts run
Pass
assert_equals("u", "u", "Should have had <u> as last child")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:34:5)
Pass
assert_equals("script", "script", "Should have had <script> as penultimate child")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:35:5)
Pass
assert_false(false, "script should not have run")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:36:5)
Passafterend content without next sibling
Asserts run
Pass
assert_equals("a", "a", "Should have had <a> as next sibling")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:42:5)
Pass
assert_equals("script", "script", "Should have had <script> as second next sibling")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:43:5)
Pass
assert_false(false, "script should not have run")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:44:5)
PassbeforeBegin content again, with next sibling
Asserts run
Pass
assert_equals("i", "i", "Should have had <i> as previous sibling")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:18:5)
Pass
assert_equals("script", "script", "Should have had <script> as second previous child")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:19:5)
Pass
assert_false(false, "script should not have run")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:20:5)
PassAfterbegin content again, with next sibling
Asserts run
Pass
assert_equals("b", "b", "Should have had <b> as first child")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:26:5)
Pass
assert_equals("script", "script", "Should have had <script> as second child")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:27:5)
Pass
assert_false(false, "script should not have run")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:28:5)
PassBeforeEnd content again, with next sibling
Asserts run
Pass
assert_equals("u", "u", "Should have had <u> as last child")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:34:5)
Pass
assert_equals("script", "script", "Should have had <script> as penultimate child")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:35:5)
Pass
assert_false(false, "script should not have run")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:36:5)
Passafterend content again, with next sibling
Asserts run
Pass
assert_equals("a", "a", "Should have had <a> as next sibling")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:42:5)
Pass
assert_equals("script", "script", "Should have had <script> as second next sibling")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:43:5)
Pass
assert_false(false, "script should not have run")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:44:5)
PassShould throw when inserting with invalid position string
Asserts run
Pass
assert_throws_dom("SYNTAX_ERR", function "function() {content.insertAdjacentHTML("bar", "foo")}")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:53:3)
Pass
assert_throws_dom("SYNTAX_ERR", function "function() {content.insertAdjacentHTML("beforebegÄ°n", "foo")}")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:54:3)
Pass
assert_throws_dom("SYNTAX_ERR", function "function() {content.insertAdjacentHTML("beforebegın", "foo")}")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:55:3)
PassWhen the parent node is null, insertAdjacentHTML should throw for beforebegin and afterend (text)
Asserts run
Pass
assert_throws_dom("NO_MODIFICATION_ALLOWED_ERR", function "function() { element.insertAdjacentHTML("afterend", "") }")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.js:3:5)
Pass
assert_throws_dom("NO_MODIFICATION_ALLOWED_ERR", function "function() { element.insertAdjacentHTML("beforebegin", "") }")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.js:6:5)
Pass
assert_throws_dom("NO_MODIFICATION_ALLOWED_ERR", function "function() { element.insertAdjacentHTML("afterend", "foo") }")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.js:9:5)
Pass
assert_throws_dom("NO_MODIFICATION_ALLOWED_ERR", function "function() { element.insertAdjacentHTML("beforebegin", "foo") }")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.js:12:5)
PassWhen the parent node is null, insertAdjacentHTML should throw for beforebegin and afterend (comments)
Asserts run
Pass
assert_throws_dom("NO_MODIFICATION_ALLOWED_ERR", function "function() { element.insertAdjacentHTML("afterend", "<!-- fail -->") }")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.js:17:5)
Pass
assert_throws_dom("NO_MODIFICATION_ALLOWED_ERR", function "function() { element.insertAdjacentHTML("beforebegin", "<!-- fail -->") }")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.js:20:5)
PassWhen the parent node is null, insertAdjacentHTML should throw for beforebegin and afterend (elements)
Asserts run
Pass
assert_throws_dom("NO_MODIFICATION_ALLOWED_ERR", function "function() { element.insertAdjacentHTML("afterend", "<div></div>") }")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.js:25:5)
Pass
assert_throws_dom("NO_MODIFICATION_ALLOWED_ERR", function "function() { element.insertAdjacentHTML("beforebegin", "<div></div>") }")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.js:28:5)
PassWhen the parent node is a document, insertAdjacentHTML should throw for beforebegin and afterend (text)
Asserts run
Pass
assert_throws_dom("NO_MODIFICATION_ALLOWED_ERR", function "function() { element.insertAdjacentHTML("afterend", "") }")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.js:3:5)
Pass
assert_throws_dom("NO_MODIFICATION_ALLOWED_ERR", function "function() { element.insertAdjacentHTML("beforebegin", "") }")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.js:6:5)
Pass
assert_throws_dom("NO_MODIFICATION_ALLOWED_ERR", function "function() { element.insertAdjacentHTML("afterend", "foo") }")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.js:9:5)
Pass
assert_throws_dom("NO_MODIFICATION_ALLOWED_ERR", function "function() { element.insertAdjacentHTML("beforebegin", "foo") }")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.js:12:5)
PassWhen the parent node is a document, insertAdjacentHTML should throw for beforebegin and afterend (comments)
Asserts run
Pass
assert_throws_dom("NO_MODIFICATION_ALLOWED_ERR", function "function() { element.insertAdjacentHTML("afterend", "<!-- fail -->") }")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.js:17:5)
Pass
assert_throws_dom("NO_MODIFICATION_ALLOWED_ERR", function "function() { element.insertAdjacentHTML("beforebegin", "<!-- fail -->") }")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.js:20:5)
PassWhen the parent node is a document, insertAdjacentHTML should throw for beforebegin and afterend (elements)
Asserts run
Pass
assert_throws_dom("NO_MODIFICATION_ALLOWED_ERR", function "function() { element.insertAdjacentHTML("afterend", "<div></div>") }")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.js:25:5)
Pass
assert_throws_dom("NO_MODIFICATION_ALLOWED_ERR", function "function() { element.insertAdjacentHTML("beforebegin", "<div></div>") }")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.js:28:5)
PassInserting after being and before end should order things correctly
Asserts run
Pass
assert_equals("foobar", "foobar")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:68:3)
PassbeforeBegin child node not in tree but has parent
Asserts run
Pass
assert_equals("i", "i", "Should have had <i> as previous sibling")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:18:5)
Pass
assert_equals("script", "script", "Should have had <script> as second previous child")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:19:5)
Pass
assert_false(false, "script should not have run")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:20:5)
PassAfterbegin child node not in tree but has parent
Asserts run
Pass
assert_equals("b", "b", "Should have had <b> as first child")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:26:5)
Pass
assert_equals("script", "script", "Should have had <script> as second child")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:27:5)
Pass
assert_false(false, "script should not have run")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:28:5)
PassBeforeEnd child node not in tree but has parent
Asserts run
Pass
assert_equals("u", "u", "Should have had <u> as last child")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:34:5)
Pass
assert_equals("script", "script", "Should have had <script> as penultimate child")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:35:5)
Pass
assert_false(false, "script should not have run")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:36:5)
Passafterend child node not in tree but has parent
Asserts run
Pass
assert_equals("a", "a", "Should have had <a> as next sibling")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:42:5)
Pass
assert_equals("script", "script", "Should have had <script> as second next sibling")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:43:5)
Pass
assert_false(false, "script should not have run")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:44:5)
PassShould not run script when appending things which have descendant <script> inserted via insertAdjacentHTML
Asserts run
Pass
assert_false(false, "script should not have run")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:77:3)
PassbeforeBegin content2 without next sibling
Asserts run
Pass
assert_equals("i", "i", "Should have had <i> as previous sibling")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:18:5)
Pass
assert_equals("script", "script", "Should have had <script> as second previous child")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:19:5)
Pass
assert_false(false, "script should not have run")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:20:5)
PassAfterbegin content2 without next sibling
Asserts run
Pass
assert_equals("b", "b", "Should have had <b> as first child")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:26:5)
Pass
assert_equals("script", "script", "Should have had <script> as second child")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:27:5)
Pass
assert_false(false, "script should not have run")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:28:5)
PassBeforeEnd content2 without next sibling
Asserts run
Pass
assert_equals("u", "u", "Should have had <u> as last child")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:34:5)
Pass
assert_equals("script", "script", "Should have had <script> as penultimate child")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:35:5)
Pass
assert_false(false, "script should not have run")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:36:5)
Passafterend content2 without next sibling
Asserts run
Pass
assert_equals("a", "a", "Should have had <a> as next sibling")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:42:5)
Pass
assert_equals("script", "script", "Should have had <script> as second next sibling")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:43:5)
Pass
assert_false(false, "script should not have run")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:44:5)
PassbeforeBegin content2 test again, now that there's a next sibling
Asserts run
Pass
assert_equals("i", "i", "Should have had <i> as previous sibling")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:18:5)
Pass
assert_equals("script", "script", "Should have had <script> as second previous child")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:19:5)
Pass
assert_false(false, "script should not have run")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:20:5)
PassAfterbegin content2 test again, now that there's a next sibling
Asserts run
Pass
assert_equals("b", "b", "Should have had <b> as first child")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:26:5)
Pass
assert_equals("script", "script", "Should have had <script> as second child")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:27:5)
Pass
assert_false(false, "script should not have run")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:28:5)
PassBeforeEnd content2 test again, now that there's a next sibling
Asserts run
Pass
assert_equals("u", "u", "Should have had <u> as last child")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:34:5)
Pass
assert_equals("script", "script", "Should have had <script> as penultimate child")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:35:5)
Pass
assert_false(false, "script should not have run")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:36:5)
Passafterend content2 test again, now that there's a next sibling
Asserts run
Pass
assert_equals("a", "a", "Should have had <a> as next sibling")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:42:5)
Pass
assert_equals("script", "script", "Should have had <script> as second next sibling")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:43:5)
Pass
assert_false(false, "script should not have run")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:44:5)
PassInserting kids of the <html> element should not do weird things with implied <body>/<head> tags
Asserts run
Pass
assert_equals(1, 1, "Should still have one head")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:88:3)
Pass
assert_equals(1, 1, "Should still have one body")
    at Test.<anonymous> ( /domparsing/insert_adjacent_html.html:89:3)