| 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/nodelookupnamesp
aceuri06"; | 20 return "http://www.w3.org/2001/DOM-Test-Suite/level3/core/nodelookupnamesp
aceuri16"; |
| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // body of the test to be executed. | 69 // body of the test to be executed. |
| 70 function loadComplete() { | 70 function loadComplete() { |
| 71 if (++docsLoaded == 1) { | 71 if (++docsLoaded == 1) { |
| 72 setUpPageStatus = 'complete'; | 72 setUpPageStatus = 'complete'; |
| 73 } | 73 } |
| 74 } | 74 } |
| 75 | 75 |
| 76 | 76 |
| 77 /** | 77 /** |
| 78 * | 78 * |
| 79 » Invoke lookupNamespaceURI on an Element node with no prefix, which has a
namespace | 79 » Invoke lookupNamespaceURI on a new Attribute node with with a namespace
URI |
| 80 » attribute declaration with a namespace prefix and check if the value of
the namespaceURI | 80 » and prefix and verify if the namespaceURI returned is null. |
| 81 » returned by using its prefix as a parameter is valid. | |
| 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-lookup
NamespaceURI | 84 * @see http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Node3-lookup
NamespaceURI |
| 86 */ | 85 */ |
| 87 function nodelookupnamespaceuri06() { | 86 function nodelookupnamespaceuri16() { |
| 88 var success; | 87 var success; |
| 89 if(checkInitialization(builder, "nodelookupnamespaceuri06") != null) return; | 88 if(checkInitialization(builder, "nodelookupnamespaceuri16") != null) return; |
| 90 var doc; | 89 var doc; |
| 91 var elem; | 90 var elem; |
| 92 var elemList; | 91 var attr; |
| 92 var attNode; |
| 93 var namespaceURI; | 93 var namespaceURI; |
| 94 | 94 |
| 95 var docRef = null; | 95 var docRef = null; |
| 96 if (typeof(this.doc) != 'undefined') { | 96 if (typeof(this.doc) != 'undefined') { |
| 97 docRef = this.doc; | 97 docRef = this.doc; |
| 98 } | 98 } |
| 99 doc = load(docRef, "doc", "hc_staff"); | 99 doc = load(docRef, "doc", "hc_staff"); |
| 100 elemList = doc.getElementsByTagName("p"); | 100 elem = doc.createElementNS("http://www.w3.org/1999/xhtml","dom3:p"); |
| 101 elem = elemList.item(2); | 101 attr = doc.createAttributeNS("http://www.w3.org/XML/1998/namespace","xml:l
ang"); |
| 102 namespaceURI = elem.lookupNamespaceURI("dmstc"); | 102 attNode = elem.setAttributeNodeNS(attr); |
| 103 assertEquals("nodelookupnamespaceuri06","http://www.netzero.com",namespace
URI); | 103 namespaceURI = attr.lookupNamespaceURI("xml"); |
| 104 | 104 assertNull("nodelookupnamespaceuri16",namespaceURI); |
| 105 |
| 105 } | 106 } |
| 106 | 107 |
| 107 | 108 |
| 108 | 109 |
| 109 | 110 |
| 110 function runTest() { | 111 function runTest() { |
| 111 nodelookupnamespaceuri06(); | 112 nodelookupnamespaceuri16(); |
| 112 } | 113 } |
| OLD | NEW |