diff options
Diffstat (limited to 'testing/web-platform/tests/html/semantics/permission-element/no-end-tag-no-contents.html')
-rw-r--r-- | testing/web-platform/tests/html/semantics/permission-element/no-end-tag-no-contents.html | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/permission-element/no-end-tag-no-contents.html b/testing/web-platform/tests/html/semantics/permission-element/no-end-tag-no-contents.html new file mode 100644 index 0000000000..5fcce1421b --- /dev/null +++ b/testing/web-platform/tests/html/semantics/permission-element/no-end-tag-no-contents.html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<body> +<!--The permission element should have no end tag or content. + Therefore the parsing should stop after the beginning tag, and the following + element and text will become part of the 'body' element's contents. +--> +<permission type="geolocation"><span>this is some text</span></permission> + +<script> + test(function(){ + assert_equals(3, document.body.childElementCount); // permission, span, script + assert_equals(document.body.innerText, "this is some text", "The text should be part of the 'body' element's text"); + + assert_true(document.body.children[0] instanceof HTMLPermissionElement, "First element should be a permission element"); + var permission = document.body.children[0]; + assert_equals(permission.innerText, "", "The permission element should have no text"); + assert_equals(permission.childElementCount, 0, "The permission element should have no children"); + + assert_true(document.body.children[1] instanceof HTMLSpanElement, "Second element should be a span element"); + var span = document.body.children[1]; + assert_equals(span.innerText, "this is some text", "The span element should contain the text"); + }, "The permission element should have no end tag or contents"); +</script> +</body>
\ No newline at end of file |