4 https://bugzilla.mozilla.org/show_bug.cgi?id=675166
7 <title>Test for Bug
675166</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
12 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=675166">Mozilla Bug
675166</a>
14 <div id=
"content" style=
"display: none">
18 <script type=
"application/javascript">
20 /** Test for Bug
675166 **/
23 var dt = document.implementation.createDocumentType(
"html", null, null);
24 isnot(dt.ownerDocument, null,
"DocumentType should have ownerDocument");
26 var d = document.implementation.createDocument(null, null, dt);
27 is(dt.ownerDocument, d,
"DocumentType shouldn't have null ownerDocument");
30 document.implementation.createDocument(null, null, dt);
31 ok(true,
"Creating document using already bound document type shouldn't throw!");
33 ok(false,
"Creating document using already bound document type shouldn't throw!");
36 var d2 = document.implementation.createDocument(null, null, null);
37 var dt2 = document.implementation.createDocumentType(
"html", null, null);
39 is(dt2.ownerDocument, d2,
"DocumentType shouldn't have null ownerDocument");
41 is(document.ownerDocument, null,
"Document's ownerDocument should be null!");
42 is(document.documentElement.ownerDocument, document,
43 "Element should have ownerDocument!")
45 is(dt2.parentNode, d2,
"parentNode should be document!");
47 is(dt2.parentNode, null,
"parentNode should be null!");
52 is(dt2.parentNode, d2,
"parentNode should be document!");