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 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 * @author NIST | 83 * @author NIST |
84 * @author Mary Brady | 84 * @author Mary Brady |
85 * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointe
r(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR']) | 85 * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointe
r(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR']) |
86 * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1359
44439 | 86 * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1359
44439 |
87 * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointe
r(id('ID-135944439')/raises/exception[@name='DOMException']/descr/p[substring-be
fore(.,':')='INVALID_CHARACTER_ERR']) | 87 * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointe
r(id('ID-135944439')/raises/exception[@name='DOMException']/descr/p[substring-be
fore(.,':')='INVALID_CHARACTER_ERR']) |
88 * @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 | 88 * @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 |
89 */ | 89 */ |
90 function documentinvalidcharacterexceptioncreatepi() { | 90 function documentinvalidcharacterexceptioncreatepi() { |
91 var success; | 91 var success; |
92 if(checkInitialization(builder, "documentinvalidcharacterexceptioncreatepi")
!= null) return; | 92 if (checkInitialization(builder, "documentinvalidcharacterexceptioncreatepi1"
) != null) return; |
93 var doc; | 93 var doc; |
94 var badPI; | 94 var badPI; |
95 | |
96 var docRef = null; | |
97 if (typeof(this.doc) != 'undefined') { | |
98 docRef = this.doc; | |
99 } | |
100 doc = load(docRef, "doc", "hc_staff"); | |
101 | |
102 » if( | |
103 » | |
104 » (builder.contentType == "text/html") | |
105 | 95 |
106 » ) { | 96 var docRef = null; |
107 » | 97 if (typeof(this.doc) != 'undefined') { |
108 » { | 98 docRef = this.doc; |
109 » » success = false; | 99 } |
110 » » try { | 100 doc = load(docRef, "doc", "hc_staff"); |
111 badPI = doc.createProcessingInstruction("foo","data"); | |
112 } | |
113 » » catch(ex) { | |
114 success = (typeof(ex.code) != 'undefined' && ex.code == 9); | |
115 » » } | |
116 » » assertTrue("throw_NOT_SUPPORTED_ERR",success); | |
117 » } | |
118 | 101 |
119 » } | 102 success = false; |
120 » | 103 try { |
121 » » else { | 104 badPI = doc.createProcessingInstruction("invalid^Name","data"); |
122 » » » | 105 } catch(ex) { |
123 » { | |
124 » » success = false; | |
125 » » try { | |
126 badPI = doc.createProcessingInstruction("invalid^Name","data"); | |
127 } | |
128 » » catch(ex) { | |
129 success = (typeof(ex.code) != 'undefined' && ex.code == 5); | 106 success = (typeof(ex.code) != 'undefined' && ex.code == 5); |
130 » » } | 107 } |
131 » » assertTrue("throw_INVALID_CHARACTER_ERR",success); | 108 assertTrue("throw_INVALID_CHARACTER_ERR",success); |
132 » } | |
133 | |
134 » » } | |
135 » | |
136 } | 109 } |
137 | 110 |
138 | 111 |
139 | 112 |
140 | 113 |
141 function runTest() { | 114 function runTest() { |
142 documentinvalidcharacterexceptioncreatepi(); | 115 documentinvalidcharacterexceptioncreatepi(); |
143 } | 116 } |
OLD | NEW |