diff options
Diffstat (limited to 'testing/web-platform/tests/dom/nodes/DocumentFragment-constructor.html')
-rw-r--r-- | testing/web-platform/tests/dom/nodes/DocumentFragment-constructor.html | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/testing/web-platform/tests/dom/nodes/DocumentFragment-constructor.html b/testing/web-platform/tests/dom/nodes/DocumentFragment-constructor.html new file mode 100644 index 0000000000..e97a7c4836 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/DocumentFragment-constructor.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>DocumentFragment constructor</title> +<link rel="help" href="https://dom.spec.whatwg.org/#dom-documentfragment-documentfragment"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<script> +"use strict"; + +test(() => { + const fragment = new DocumentFragment(); + assert_equals(fragment.ownerDocument, document); +}, "Sets the owner document to the current global object associated document"); + +test(() => { + const fragment = new DocumentFragment(); + const text = document.createTextNode(""); + fragment.appendChild(text); + assert_equals(fragment.firstChild, text); +}, "Create a valid document DocumentFragment"); +</script> |