tizen beta release
[framework/web/webkit-efl.git] / LayoutTests / fast / dom / script-tests / node-prefix-setter-namespace-exception.js
1 description("Test how Node.prefix setter raises NAMESPACE_ERR.");
2
3 var href = document.createAttribute("href");
4 href.value = "#";
5
6 // Should not throw.
7 href.prefix = null;
8
9 // Per DOM3 Core spec, setting to empty is implementation dependent.
10 // Firefox treats empty like null.
11 href.prefix = "";
12 shouldBe("href.prefix", "null");
13
14 shouldThrow("document.createAttribute('attr').prefix = 'abc'");
15 shouldThrow("document.createAttributeNS(null, 'attr').prefix = 'abc'");
16 shouldThrow("document.createElementNS(null, 'attr').prefix = 'abc'");
17 shouldThrow("document.createAttributeNS('foo', 'bar').prefix = 'xml'");
18 shouldThrow("document.createElementNS('foo', 'bar').prefix = 'xml'");
19 shouldThrow("document.createAttribute('attr').prefix = 'xmlns'");
20 shouldThrow("document.createAttributeNS('foo', 'attr').prefix = 'xmlns'");
21 shouldThrow("document.createAttribute('xmlns').prefix = 'foo'");