1 description("Tests that accessing Attr after its Element has been destroyed works without crashing.");
5 var element = document.createElement("p");
6 element.setAttribute("a", "b");
7 var attributes = element.attributes;
12 shouldBe("attributes.length", "1");
13 shouldBe("attributes[0]", "attributes.item(0)");
14 shouldBe("attributes.getNamedItem('a')", "attributes.item(0)");
16 shouldBe("attributes.item(0).name", "'a'");
17 shouldBe("attributes.item(0).value", "'b'");
18 shouldBe("attributes.item(0).ownerElement.tagName", "'P'");
20 attributes.item(0).value = 'c';
22 shouldBe("attributes.item(0).value", "'c'");
24 attributes.removeNamedItem('a');
26 shouldBe("attributes.length", "0");
28 element = document.createElement("p");
29 element.setAttribute("a", "b");
30 attr = element.attributes.item(0);
35 shouldBe("attr.name", "'a'");
36 shouldBe("attr.value", "'b'");
37 shouldBe("attr.ownerElement.tagName", "'P'");
41 shouldBe("attr.value", "'c'");