summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/dom/Document/clone-node.html
blob: 61462bf12aab64cd021f67ba88e8751a2e464690 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html>
<link rel="help" href="https://dom.spec.whatwg.org/#dom-node-clonenode">
<script src="../../../resources/js-test.js"></script>
<script>
description('Tests cloneNode for Document.');

function className(object) {
    return Object.prototype.toString.call(object).slice(8, -1);
}

var doc = document.implementation.createDocument('', 'root', null);

shouldBe('doc.cloneNode(false).__proto__', 'XMLDocument.prototype');
shouldBeEqualToString('className(doc.cloneNode(false))', 'XMLDocument');
shouldBeEqualToString('doc.cloneNode(true).documentElement.localName', 'root');
shouldBeEqualToString('doc.cloneNode(true).contentType', 'application/xml');
shouldBeEqualToString('document.cloneNode(true).compatMode', 'CSS1Compat');
shouldBe('document.cloneNode(false).URL', 'document.URL');
shouldBe('document.cloneNode(false).baseURI', 'document.baseURI');
shouldBe('document.cloneNode(false).characterSet', 'document.characterSet');
shouldBeEqualToString('document.cloneNode(true).contentType', 'text/html');

</script>
</body>