Bug 628949 - Update visible region / glass regions after we paint. r=roc a=2.0.
[mozilla-central.git] / dom / tests / js / attributes.html
blobae3bf3d6ead28c4e5ad6ace6c463ff40227f958c
1 <HTML>
2 <HEAD>
3 <TITLE>Attributes test</TITLE>
4 </HEAD>
5 <BODY bgColor="#ffffff" text="#000000">
6 <H1>Attributes test</H1>
8 <P>You should see the following in the console:</P>
9 <PRE>
10 attribute.getNamedItem == getAttributeNode: true
11 attribute BGCOLOR=#ffffff
12 changing attribute node value changes attribute value: true
13 return value of removeNamedItem is attribute node: true
14 removing attribute changes attribute count: true
15 changing disembodied attribute value works: true
16 removing attribute node removes attribute: true
17 </PRE>
19 <P>The text should turn green and then you should see
20 the following in the console:</P>
21 <PRE>
22 setting an existing attribute returns the old node: true
23 </PRE>
25 <SCRIPT>
26 a = document.body.attributes.getNamedItem("bgcolor")
27 a2 = document.body.getAttributeNode("bgcolor")
28 n = document.body.attributes.length;
29 dump("attribute.getNamedItem == getAttributeNode: " + (a == a2) + "\n");
31 dump("attribute " + a.name + "=" + a.value + "\n");
33 a.value = "#00ffff"
34 dump("changing attribute node value changes attribute value: " + (document.body.getAttribute("bgcolor") == "#00ffff") + "\n");
36 a = document.body.attributes.removeNamedItem("bgcolor")
37 dump("return value of removeNamedItem is attribute node: " + (a == a2) + "\n");
39 dump("removing attribute changes attribute count: " + (document.body.attributes.length == (n-1)) + "\n");
41 a.value = "#ff0000"
42 dump("changing disembodied attribute value works: " + (a.value == "#ff0000") + "\n");
44 dump("removing attribute node removes attribute: " + (document.body.getAttribute("bgcolor") == "") + "\n");
46 a = document.body.attributes.getNamedItem("TEXT");
47 a2 = document.createAttribute("text");
48 a2.value = "#00ff00";
49 a3 = document.body.attributes.setNamedItem(a2);
50 dump("setting an existing attribute returns the old node: " + (a == a3) + "\n");
51 </SCRIPT>
53 </BODY>
54 </HTML>