| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html xmlns="http://www.w3.org/1999/xhtml"> | |
| 3 <head> | |
| 4 <title>DOM L3 Core: Node Interface prefix property setter</title> | |
| 5 </head> | |
| 6 <body> | |
| 7 <script src="../../../resources/js-test.js"></script> | |
| 8 <script> | |
| 9 description('Test for the implementation of DOM Level 3 Core API on Node Interfa
ce: prefix setter. INVALID_CHARACTER_ERR: Raised if the specified prefix contain
s an illegal character according to the XML version in use specified in the Docu
ment.xmlVersion attribute. <a href="http://www.w3.org/TR/DOM-Level-3-Core/core.
html#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-NodeNSP
refix</a>'); | |
| 10 | |
| 11 var prefixedElem = document.createElementNS("ns1", "pre1:foo"); | |
| 12 document.body.appendChild(prefixedElem); | |
| 13 | |
| 14 function test(prefix, expectedToThrow) { | |
| 15 prefixedElem.prefix = "before"; | |
| 16 if (expectedToThrow) { | |
| 17 shouldThrow('prefixedElem.prefix = ' + prefix); | |
| 18 shouldBe('prefixedElem.prefix', '"before"'); | |
| 19 } else { | |
| 20 shouldBe('prefixedElem.prefix = ' + prefix, prefix); | |
| 21 shouldBe('prefixedElem.prefix', prefix); | |
| 22 } | |
| 23 } | |
| 24 | |
| 25 test('"."', true); | |
| 26 test('"x."', false); | |
| 27 test('"0a"', true); | |
| 28 test('"a0"', false); | |
| 29 test('"_0"', false); | |
| 30 test('"\xD7"', true); | |
| 31 test('"\xB7"', true); | |
| 32 test('"aa"', false); | |
| 33 test('"\\n"', true); | |
| 34 </script> | |
| 35 </body> | |
| 36 </html> | |
| 37 | |
| OLD | NEW |