OLD | NEW |
1 description("Test creation of each type of Node and check intial values") | 1 description("Test creation of each type of Node and check intial values") |
2 | 2 |
3 var xmlDoc = document.implementation.createDocument("http://www.w3.org/1999/xhtm
l", "html", null); | 3 var xmlDoc = document.implementation.createDocument("http://www.w3.org/1999/xhtm
l", "html", null); |
4 | 4 |
5 debug("Attribute creation using createElement on an HTML doc:") | 5 debug("Attribute creation using createElement on an HTML doc:") |
6 var attr = document.createAttribute("foo"); | 6 var attr = document.createAttribute("foo"); |
7 shouldBe("attr.nodeName", "'foo'"); | 7 shouldBe("attr.nodeName", "'foo'"); |
8 shouldBe("attr.name", "'foo'"); | 8 shouldBe("attr.name", "'foo'"); |
9 // Spec: http://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-create
Attribute | 9 // Spec: http://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-create
Attribute |
10 // Both FF and WebKit return "foo" for Attribute.localName, even though the spec
says null | 10 // Both FF and WebKit return "foo" for Attribute.localName, even though the spec
says null |
11 shouldBe("attr.localName", "null"); | 11 shouldBe("attr.localName", "null"); |
12 shouldBe("attr.namespaceURI", "null"); | 12 shouldBe("attr.namespaceURI", "null"); |
13 shouldBe("attr.prefix", "null"); | 13 shouldBe("attr.prefix", "null"); |
14 shouldBe("attr.nodeValue", "''"); | |
15 shouldBe("attr.value", "''"); | 14 shouldBe("attr.value", "''"); |
16 | 15 |
17 debug("Attribute creation using createElement on an XHTML doc:") | 16 debug("Attribute creation using createElement on an XHTML doc:") |
18 attr = xmlDoc.createAttribute("foo"); | 17 attr = xmlDoc.createAttribute("foo"); |
19 shouldBe("attr.nodeName", "'foo'"); | 18 shouldBe("attr.nodeName", "'foo'"); |
20 shouldBe("attr.name", "'foo'"); | 19 shouldBe("attr.name", "'foo'"); |
21 // Spec: http://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-create
Attribute | 20 // Spec: http://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-create
Attribute |
22 // Both FF and WebKit return "foo" for Attribute.localName, even though the spec
says null | 21 // Both FF and WebKit return "foo" for Attribute.localName, even though the spec
says null |
23 shouldBe("attr.localName", "null"); | 22 shouldBe("attr.localName", "null"); |
24 shouldBe("attr.namespaceURI", "null"); | 23 shouldBe("attr.namespaceURI", "null"); |
25 shouldBe("attr.prefix", "null"); | 24 shouldBe("attr.prefix", "null"); |
26 shouldBe("attr.nodeValue", "''"); | |
27 shouldBe("attr.value", "''"); | 25 shouldBe("attr.value", "''"); |
28 | 26 |
29 var comment = document.createComment("foo"); | 27 var comment = document.createComment("foo"); |
30 shouldBe("comment.nodeName", "'#comment'"); | 28 shouldBe("comment.nodeName", "'#comment'"); |
31 shouldBe("comment.localName", "null"); | 29 shouldBe("comment.localName", "null"); |
32 shouldBe("comment.namespaceURI", "null"); | 30 shouldBe("comment.namespaceURI", "null"); |
33 shouldBe("comment.nodeValue", "'foo'"); | 31 shouldBe("comment.nodeValue", "'foo'"); |
34 shouldBe("comment.data", "'foo'"); | 32 shouldBe("comment.data", "'foo'"); |
35 | 33 |
36 shouldThrow("document.createCDATASection('foo')"); | 34 shouldThrow("document.createCDATASection('foo')"); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 shouldBe("processingInstruction.target", "'xml-stylesheet'"); | 151 shouldBe("processingInstruction.target", "'xml-stylesheet'"); |
154 shouldBe("processingInstruction.data", "'type=\"text/xsl\" href=\"missing.xsl\"'
"); | 152 shouldBe("processingInstruction.data", "'type=\"text/xsl\" href=\"missing.xsl\"'
"); |
155 | 153 |
156 debug("Text node creation using createTextNode on an HTML doc:") | 154 debug("Text node creation using createTextNode on an HTML doc:") |
157 var text = document.createTextNode("foo"); | 155 var text = document.createTextNode("foo"); |
158 shouldBe("text.nodeName", "'#text'"); | 156 shouldBe("text.nodeName", "'#text'"); |
159 shouldBe("text.localName", "null"); | 157 shouldBe("text.localName", "null"); |
160 shouldBe("text.namespaceURI", "null"); | 158 shouldBe("text.namespaceURI", "null"); |
161 shouldBe("text.nodeValue", "'foo'"); | 159 shouldBe("text.nodeValue", "'foo'"); |
162 shouldBe("text.data", "'foo'"); | 160 shouldBe("text.data", "'foo'"); |
OLD | NEW |