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
9"; |
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
79 | 79 |
80 » Using isEqualNode check if a default attribute node and a cloned default
attribute | 80 » Using isEqualNode check if 2 Attr nodes having the same nodeName but dif
ferent namespaceURIs |
81 » node are equal. | 81 » are not equal. |
82 | 82 |
83 * @author IBM | 83 * @author IBM |
84 * @author Neil Delima | 84 * @author Neil Delima |
85 * @see http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Node3-isEqua
lNode | 85 * @see http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Node3-isEqua
lNode |
86 */ | 86 */ |
87 function nodeisequalnode16() { | 87 function nodeisequalnode19() { |
88 var success; | 88 var success; |
89 if(checkInitialization(builder, "nodeisequalnode16") != null) return; | 89 if(checkInitialization(builder, "nodeisequalnode19") != null) return; |
90 var doc; | 90 var doc; |
91 var attr1; | 91 var attr1; |
92 var attr2; | 92 var attr2; |
93 var addrElement; | |
94 var elementList; | |
95 var isEqual; | 93 var isEqual; |
96 var nullNSURI = null; | 94 var nullNSURI = null; |
97 | 95 |
98 | 96 |
99 var docRef = null; | 97 var docRef = null; |
100 if (typeof(this.doc) != 'undefined') { | 98 if (typeof(this.doc) != 'undefined') { |
101 docRef = this.doc; | 99 docRef = this.doc; |
102 } | 100 } |
103 doc = load(docRef, "doc", "hc_staff"); | 101 doc = load(docRef, "doc", "hc_staff"); |
104 elementList = doc.getElementsByTagName("p"); | 102 attr1 = doc.createAttributeNS("http://www.w3.org/XML/1998/namespace","lang
"); |
105 addrElement = elementList.item(3); | 103 attr2 = doc.createAttributeNS(nullNSURI,"lang"); |
106 attr1 = addrElement.getAttributeNodeNS(nullNSURI,"dir"); | |
107 attr2 = attr1.cloneNode(true); | |
108 isEqual = attr1.isEqualNode(attr2); | 104 isEqual = attr1.isEqualNode(attr2); |
109 assertTrue("nodeisequalnode16",isEqual); | 105 assertFalse("nodeisequalnode19",isEqual); |
110 | 106 |
111 } | 107 } |
112 | 108 |
113 | 109 |
114 | 110 |
115 | 111 |
116 function runTest() { | 112 function runTest() { |
117 nodeisequalnode16(); | 113 nodeisequalnode19(); |
118 } | 114 } |
OLD | NEW |