blob: d98293a7f442ac83e8055c878829b4c68e07917e [file] [log] [blame]
Test that different ways of changing an element's id all work properly.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
1. Check id after parsing.
PASS document.getElementById("a") is document.body
PASS document.body.id is "a"
PASS document.body.getAttributeNode("id").textContent is "a"
2. Change Attr.value.
PASS document.getElementById("a") is null
PASS document.getElementById("b") is document.body
PASS document.body.getAttributeNode("id").textContent is "b"
3. Change HTMLElement.id.
PASS document.getElementById("b") is null
PASS document.getElementById("c") is document.body
PASS document.body.getAttributeNode("id").textContent is "c"
4. Change id attribute via setAttribute().
PASS document.getElementById("c") is null
PASS document.getElementById("d") is document.body
PASS document.body.getAttributeNode("id").textContent is "d"
5. Change id attribute via setAttributeNS().
PASS document.getElementById("d") is null
PASS document.getElementById("e") is document.body
PASS document.body.getAttributeNode("id").textContent is "e"
6. Change Attr.nodeValue.
PASS document.getElementById("e") is null
PASS document.getElementById("f") is document.body
PASS document.body.id is "f"
PASS document.body.getAttribute("id") is "f"
PASS attrNode.textContent is "f"
PASS attrNode.childNodes.length is 0
7. Changing Attr.textContent.
PASS document.getElementById("i") is null
PASS document.getElementById("hi") is document.body
PASS document.body.id is "hi"
PASS document.body.getAttribute("id") is "hi"
PASS attrNode.textContent is "hi"
PASS attrNode.childNodes.length is 0
8. Node.normalize(), joining text nodes.
PASS document.getElementById("hi") is document.body
PASS document.body.id is "hi"
PASS document.body.getAttribute("id") is "hi"
PASS document.body.getAttributeNode("id").textContent is "hi"
PASS document.body.getAttributeNode("id").childNodes.length is 0
9. Remove an Attr node.
PASS document.body.id is ""
PASS document.getElementById("mn") is null
PASS document.body.getAttribute("id") is null
PASS document.body.getAttributeNode("id") is null
10. Add an Attr node.
PASS document.getElementById("o") is document.body
PASS document.body.id is "o"
PASS document.body.getAttribute("id") is "o"
11. Add an Attr node over an existing one.
PASS document.getElementById("o") is null
PASS document.getElementById("p") is document.body
PASS document.body.id is "p"
PASS document.body.getAttribute("id") is "p"
PASS successfullyParsed is true
TEST COMPLETE