Thu, 15 Jan 2015 15:55:04 +0100
Back out 97036ab72558 which inappropriately compared turds to third parties.
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6 <title>http://www.w3.org/2001/DOM-Test-Suite/level2/core/importNode07</title>
7 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
8 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
9 <script type="text/javascript" src="DOMTestCase.js"></script>
10 <script type="text/javascript" src="exclusions.js"></script>
11 <script type="text/javascript">
12 // expose test function names
13 function exposeTestFunctionNames()
14 {
15 return ['importNode07'];
16 }
18 var docsLoaded = -1000000;
19 var builder = null;
21 //
22 // This function is called by the testing framework before
23 // running the test suite.
24 //
25 // If there are no configuration exceptions, asynchronous
26 // document loading is started. Otherwise, the status
27 // is set to complete and the exception is immediately
28 // raised when entering the body of the test.
29 //
30 function setUpPage() {
31 setUpPageStatus = 'running';
32 try {
33 //
34 // creates test document builder, may throw exception
35 //
36 builder = createConfiguredBuilder();
37 setImplementationAttribute("namespaceAware", true);
38 setImplementationAttribute("validating", true);
40 docsLoaded = 0;
42 var docRef = null;
43 if (typeof(this.doc) != 'undefined') {
44 docRef = this.doc;
45 }
46 docsLoaded += preload(docRef, "doc", "staffNS");
48 var aNewDocRef = null;
49 if (typeof(this.aNewDoc) != 'undefined') {
50 aNewDocRef = this.aNewDoc;
51 }
52 docsLoaded += preload(aNewDocRef, "aNewDoc", "staff");
54 if (docsLoaded == 2) {
55 setUpPage = 'complete';
56 }
57 } catch(ex) {
58 catchInitializationError(builder, ex);
59 setUpPage = 'complete';
60 }
61 }
63 //
64 // This method is called on the completion of
65 // each asychronous load started in setUpTests.
66 //
67 // When every synchronous loaded document has completed,
68 // the page status is changed which allows the
69 // body of the test to be executed.
70 function loadComplete() {
71 if (++docsLoaded == 2) {
72 setUpPageStatus = 'complete';
73 runJSUnitTests();
74 markTodos();
75 SimpleTest.finish();
76 }
77 }
79 var docName = 'importNode07';
82 /**
83 *
84 The "importNode(importedNode,deep)" method for a
85 Document should import the given importedNode into that Document.
86 The importedNode is of type Element.
87 If this document defines default attributes for this element name (importedNode),
88 those default attributes are assigned.
90 Create an element whose name is "emp:employee" in a different document.
91 Invoke method importNode(importedNode,deep) on this document which
92 defines default attribute for the element name "emp:employee".
93 Method should return an the imported element with an assigned default attribute.
95 * @author NIST
96 * @author Mary Brady
97 * @see http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode
98 * @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=238
99 */
100 function importNode07() {
101 var success;
102 if(checkInitialization(builder, "importNode07") != null) return;
103 var doc;
104 var aNewDoc;
105 var element;
106 var aNode;
107 var attributes;
108 var name;
109 var attr;
110 var lname;
111 var namespaceURI = "http://www.nist.gov";
112 var qualifiedName = "emp:employee";
114 var docRef = null;
115 if (typeof(this.doc) != 'undefined') {
116 docRef = this.doc;
117 }
118 doc = load(docRef, "doc", "staffNS");
120 var aNewDocRef = null;
121 if (typeof(this.aNewDoc) != 'undefined') {
122 aNewDocRef = this.aNewDoc;
123 }
124 aNewDoc = load(aNewDocRef, "aNewDoc", "staff");
125 element = aNewDoc.createElementNS(namespaceURI,qualifiedName);
126 aNode = doc.importNode(element,false);
127 attributes = aNode.attributes;
129 assertSize("throw_Size",1,attributes);
130 name = aNode.nodeName;
132 assertEquals("nodeName","emp:employee",name);
133 attr = attributes.item(0);
134 lname = attr.localName;
136 assertEquals("lname","defaultAttr",lname);
138 }
140 </script>
141 </head>
142 <body>
143 <h2>Test http://www.w3.org/2001/DOM-Test-Suite/level2/core/importNode07</h2>
144 <p></p>
145 <p>
146 Copyright (c) 2001-2004 World Wide Web Consortium,
147 (Massachusetts Institute of Technology, European Research Consortium
148 for Informatics and Mathematics, Keio University). All
149 Rights Reserved. This work is distributed under the <a href="http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231">W3C(r) Software License</a> in the
150 hope that it will be useful, but WITHOUT ANY WARRANTY; without even
151 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
152 </p>
153 </body>
154 </html>