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/nodegettextconte
nt12"; | 20 return "http://www.w3.org/2001/DOM-Test-Suite/level3/core/nodelookupprefix
16"; |
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 » Invoke the method getTextContent on a new Comment node and check if the
value returned | 78 » Invoke lookupPrefix on a new Attribute node with with a namespace URI |
79 » is the Comments data. | 79 » and prefix and verify if the prefix returned is null. |
80 | 80 |
81 * @author IBM | 81 * @author IBM |
82 * @author Neil Delima | 82 * @author Jenny Hsu |
83 * @see http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Node3-textCo
ntent | 83 * @see http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Node3-lookup
NamespacePrefix |
84 */ | 84 */ |
85 function nodegettextcontent12() { | 85 function nodelookupprefix16() { |
86 var success; | 86 var success; |
87 if(checkInitialization(builder, "nodegettextcontent12") != null) return; | 87 if(checkInitialization(builder, "nodelookupprefix16") != null) return; |
88 var doc; | 88 var doc; |
89 var elemList; | |
90 var elem; | 89 var elem; |
91 var comment; | 90 var attr; |
92 var textContent; | 91 var prefix; |
93 var appendedChild; | 92 var attNode; |
94 | 93 |
95 var docRef = null; | 94 var docRef = null; |
96 if (typeof(this.doc) != 'undefined') { | 95 if (typeof(this.doc) != 'undefined') { |
97 docRef = this.doc; | 96 docRef = this.doc; |
98 } | 97 } |
99 doc = load(docRef, "doc", "barfoo"); | 98 doc = load(docRef, "doc", "barfoo"); |
100 elem = doc.createElementNS("http://www.w3.org/1999/xhtml","body"); | 99 elem = doc.createElementNS("http://www.w3.org/1999/xhtml","dom3:p"); |
101 comment = doc.createComment("Comment"); | 100 attr = doc.createAttributeNS("http://www.w3.org/XML/1998/namespace","xml:l
ang"); |
102 appendedChild = elem.appendChild(comment); | 101 attNode = elem.setAttributeNodeNS(attr); |
103 textContent = comment.textContent; | 102 prefix = attr.lookupPrefix("http://www.w3.org/XML/1998/namespace"); |
104 | 103 assertNull("nodelookupprefix16",prefix); |
105 assertEquals("nodegettextcontent12","Comment",textContent); | 104 |
106 | |
107 } | 105 } |
108 | 106 |
109 | 107 |
110 | 108 |
111 | 109 |
112 function runTest() { | 110 function runTest() { |
113 nodegettextcontent12(); | 111 nodelookupprefix16(); |
114 } | 112 } |
OLD | NEW |