OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 Copyright © 2001-2004 World Wide Web Consortium, | 3 Copyright © 2001-2004 World Wide Web Consortium, |
4 (Massachusetts Institute of Technology, European Research Consortium | 4 (Massachusetts Institute of Technology, European Research Consortium |
5 for Informatics and Mathematics, Keio University). All | 5 for Informatics and Mathematics, Keio University). All |
6 Rights Reserved. This work is distributed under the W3C® Software License [1] i
n the | 6 Rights Reserved. This work is distributed under the W3C® Software License [1] i
n the |
7 hope that it will be useful, but WITHOUT ANY WARRANTY; without even | 7 hope that it will be useful, but WITHOUT ANY WARRANTY; without even |
8 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 8 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
9 | 9 |
10 [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 | 10 [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 |
11 */ | 11 */ |
12 | 12 |
13 | 13 |
14 | 14 |
15 /** | 15 /** |
16 * Gets URI that identifies the test. | 16 * Gets URI that identifies the test. |
17 * @return uri identifier of test | 17 * @return uri identifier of test |
18 */ | 18 */ |
19 function getTargetURI() { | 19 function getTargetURI() { |
20 return "http://www.w3.org/2001/DOM-Test-Suite/level3/core/nodeisequalnode1
6"; | 20 return "http://www.w3.org/2001/DOM-Test-Suite/level3/core/nodeisequalnode1
5"; |
21 } | 21 } |
22 | 22 |
23 var docsLoaded = -1000000; | 23 var docsLoaded = -1000000; |
24 var builder = null; | 24 var builder = null; |
25 | 25 |
26 // | 26 // |
27 // This function is called by the testing framework before | 27 // This function is called by the testing framework before |
28 // running the test suite. | 28 // running the test suite. |
29 // | 29 // |
30 // If there are no configuration exceptions, asynchronous | 30 // If there are no configuration exceptions, asynchronous |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 // body of the test to be executed. | 68 // body of the test to be executed. |
69 function loadComplete() { | 69 function loadComplete() { |
70 if (++docsLoaded == 1) { | 70 if (++docsLoaded == 1) { |
71 setUpPageStatus = 'complete'; | 71 setUpPageStatus = 'complete'; |
72 } | 72 } |
73 } | 73 } |
74 | 74 |
75 | 75 |
76 /** | 76 /** |
77 * | 77 * |
78 | 78 » Using isEqualNode check if 2 Attr nodes having the same nodeName and a n
ull namespaceURI |
79 » | 79 » attribute, one created using createAttributeNS and the other retreived f
rom this document |
80 » Using isEqualNode check if a default attribute node and a cloned default
attribute | 80 » are equal. |
81 » node are equal. | |
82 | 81 |
83 * @author IBM | 82 * @author IBM |
84 * @author Neil Delima | 83 * @author Neil Delima |
85 * @see http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Node3-isEqua
lNode | 84 * @see http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Node3-isEqua
lNode |
86 */ | 85 */ |
87 function nodeisequalnode16() { | 86 function nodeisequalnode15() { |
88 var success; | 87 var success; |
89 if(checkInitialization(builder, "nodeisequalnode16") != null) return; | 88 if(checkInitialization(builder, "nodeisequalnode15") != null) return; |
90 var doc; | 89 var doc; |
91 var attr1; | 90 var attr1; |
92 var attr2; | 91 var attr2; |
93 var addrElement; | 92 var addrElement; |
94 var elementList; | 93 var elementList; |
95 var isEqual; | 94 var isEqual; |
96 var nullNSURI = null; | 95 var nullNS = null; |
97 | 96 |
98 | 97 |
99 var docRef = null; | 98 var docRef = null; |
100 if (typeof(this.doc) != 'undefined') { | 99 if (typeof(this.doc) != 'undefined') { |
101 docRef = this.doc; | 100 docRef = this.doc; |
102 } | 101 } |
103 doc = load(docRef, "doc", "hc_staff"); | 102 doc = load(docRef, "doc", "hc_staff"); |
104 elementList = doc.getElementsByTagName("p"); | 103 elementList = doc.getElementsByTagName("acronym"); |
105 addrElement = elementList.item(3); | 104 addrElement = elementList.item(3); |
106 attr1 = addrElement.getAttributeNodeNS(nullNSURI,"dir"); | 105 attr1 = addrElement.getAttributeNodeNS(nullNS,"title"); |
107 attr2 = attr1.cloneNode(true); | 106 |
| 107 » if( |
| 108 » (getImplementationAttribute("namespaceAware") == true) |
| 109 » ) { |
| 110 » attr2 = doc.createAttributeNS(nullNS,"title"); |
| 111 |
| 112 » } |
| 113 » |
| 114 » » else { |
| 115 » » » attr2 = doc.createAttribute("title"); |
| 116 |
| 117 » » } |
| 118 » attr2.value = "Yes"; |
| 119 |
108 isEqual = attr1.isEqualNode(attr2); | 120 isEqual = attr1.isEqualNode(attr2); |
109 assertTrue("nodeisequalnode16",isEqual); | 121 assertTrue("nodeisequalnode15",isEqual); |
110 | 122 |
111 } | 123 } |
112 | 124 |
113 | 125 |
114 | 126 |
115 | 127 |
116 function runTest() { | 128 function runTest() { |
117 nodeisequalnode16(); | 129 nodeisequalnode15(); |
118 } | 130 } |
OLD | NEW |