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/documentsetstric
terrorchecking01"; | 20 return "http://www.w3.org/2001/DOM-Test-Suite/level3/core/documentsetstric
terrorchecking02"; |
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 » Set the strictErrorChecking attribute value on this documentNode to fals
e and then to true. | 78 » Set the strictErrorChecking attribute value on a new Document to true. |
79 Call the createAttribute method on this document with an illegal character i
n the qualifiedName | 79 » Call the createAttributeNS method on this document with a a null namespa
ceURI and a qualified name |
80 » and check if the INVALID_CHARACTER_ERR is thrown. | 80 » with a prefix and check if the NAMESPACE_ERR is thrown. |
81 | 81 |
82 * @author IBM | 82 * @author IBM |
83 * @author Neil Delima | 83 * @author Neil Delima |
84 * @see http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Document3-st
rictErrorChecking | 84 * @see http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Document3-st
rictErrorChecking |
85 */ | 85 */ |
86 function documentsetstricterrorchecking01() { | 86 function documentsetstricterrorchecking02() { |
87 var success; | 87 var success; |
88 if(checkInitialization(builder, "documentsetstricterrorchecking01") != null)
return; | 88 if(checkInitialization(builder, "documentsetstricterrorchecking02") != null)
return; |
89 var doc; | 89 var doc; |
90 var newAttr; | 90 var newAttr; |
| 91 var nullValue = null; |
| 92 |
91 | 93 |
92 var docRef = null; | 94 var docRef = null; |
93 if (typeof(this.doc) != 'undefined') { | 95 if (typeof(this.doc) != 'undefined') { |
94 docRef = this.doc; | 96 docRef = this.doc; |
95 } | 97 } |
96 doc = load(docRef, "doc", "hc_staff"); | 98 doc = load(docRef, "doc", "hc_staff"); |
97 doc.strictErrorChecking = false; | |
98 | |
99 doc.strictErrorChecking = true; | 99 doc.strictErrorChecking = true; |
100 | 100 |
101 | 101 |
102 { | 102 { |
103 success = false; | 103 success = false; |
104 try { | 104 try { |
105 newAttr = doc.createAttribute("@"); | 105 newAttr = doc.createAttributeNS(nullValue,"dom:test"); |
106 } | 106 } |
107 catch(ex) { | 107 catch(ex) { |
108 success = (typeof(ex.code) != 'undefined' && ex.code == 5); | 108 success = (typeof(ex.code) != 'undefined' && ex.code == 14); |
109 } | 109 } |
110 » » assertTrue("INVALID_CHARACTER_ERR_documentsetstricterrorchecking
01",success); | 110 » » assertTrue("NAMESPACE_ERR_documentsetstricterrorchecking02",succ
ess); |
111 } | 111 } |
112 | 112 |
113 } | 113 } |
114 | 114 |
115 | 115 |
116 | 116 |
117 | 117 |
118 function runTest() { | 118 function runTest() { |
119 documentsetstricterrorchecking01(); | 119 documentsetstricterrorchecking02(); |
120 } | 120 } |
OLD | NEW |