| 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/nodeisequalnode0
6"; | 20 return "http://www.w3.org/2001/DOM-Test-Suite/level3/core/nodeisequalnode2
0"; |
| 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 an Element and an Attr nodes having the same
nodeName |
| 79 » | 79 » and namsepaceURI are not equal. |
| 80 » Using isEqualNode check if 2 Element nodes having the same nodeName and
namespaceURI attribute | |
| 81 » are equal. | |
| 82 | 80 |
| 83 * @author IBM | 81 * @author IBM |
| 84 * @author Neil Delima | 82 * @author Neil Delima |
| 85 * @see http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Node3-isEqua
lNode | 83 * @see http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Node3-isEqua
lNode |
| 86 */ | 84 */ |
| 87 function nodeisequalnode06() { | 85 function nodeisequalnode20() { |
| 88 var success; | 86 var success; |
| 89 if(checkInitialization(builder, "nodeisequalnode06") != null) return; | 87 if(checkInitialization(builder, "nodeisequalnode20") != null) return; |
| 90 var doc; | 88 var doc; |
| 89 var attr1; |
| 91 var elem1; | 90 var elem1; |
| 92 var elem2; | |
| 93 var isEqual; | 91 var isEqual; |
| 94 | 92 |
| 95 var docRef = null; | 93 var docRef = null; |
| 96 if (typeof(this.doc) != 'undefined') { | 94 if (typeof(this.doc) != 'undefined') { |
| 97 docRef = this.doc; | 95 docRef = this.doc; |
| 98 } | 96 } |
| 99 doc = load(docRef, "doc", "hc_staff"); | 97 doc = load(docRef, "doc", "hc_staff"); |
| 100 elem1 = doc.createElementNS("http://www.w3.org/1999/xhtml","xhtml:html"); | 98 elem1 = doc.createElementNS("http://www.w3.org/1999/xhtml","xhtml:html"); |
| 101 elem2 = doc.createElementNS("http://www.w3.org/1999/xhtml","xhtml:html"); | 99 attr1 = doc.createAttributeNS("http://www.w3.org/1999/xhtml","xhtml:html")
; |
| 102 isEqual = elem1.isEqualNode(elem2); | 100 isEqual = attr1.isEqualNode(elem1); |
| 103 assertTrue("nodeisequalnode06",isEqual); | 101 assertFalse("nodeisequalnode20",isEqual); |
| 104 | 102 |
| 105 } | 103 } |
| 106 | 104 |
| 107 | 105 |
| 108 | 106 |
| 109 | 107 |
| 110 function runTest() { | 108 function runTest() { |
| 111 nodeisequalnode06(); | 109 nodeisequalnode20(); |
| 112 } | 110 } |
| OLD | NEW |