Bug 449833 - Add platform colors -moz-mac-chrome-active and -moz-mac-chrome-inactive...
[mozilla-central.git] / layout / html / tests / TestInline2.html
blobe65b9cbfa57145769db83deca6c47b1075d08a8f
1 <BODY>
2 <STYLE>
3 DIV { border: 2px solid khaki; }
4 </STYLE>
5 <SCRIPT>
6 var nextID = 1;
7 function getIndex()
9 var it = document.getElementById("getid");
10 var index = it.value;
11 if (index == "") index = 0;
12 return index;
14 function makeInline()
16 var image = document.createElement("IMG");
17 image.setAttribute("SRC", "bluedot.gif");
18 image.setAttribute("WIDTH", "100");
19 image.setAttribute("HEIGHT", "40");
20 image.setAttribute("BORDER", "2");
21 image.setAttribute("ID", "obj" + nextID);
22 nextID++;
23 return image;
25 function makeBlock()
27 var block = document.createElement("DIV");
28 var text = document.createTextNode("Block Text");
29 block.appendChild(text);
30 block.setAttribute("ID", "obj" + nextID);
31 nextID++;
32 return block;
34 function appendInline()
36 var i = makeInline();
37 var it = document.getElementById("it");
38 it.appendChild(i);
40 function insertInline()
42 var i = makeInline();
43 var it = document.getElementById("it");
44 var kids = it.childNodes;
45 var index = getIndex();
46 if ((index < 0) || (index > kids.length)) index = 0;
47 var before = kids[index];
48 it.insertBefore(i, before);
50 function appendBlock()
52 var b = makeBlock();
53 var it = document.getElementById("it");
54 it.appendChild(b);
56 function insertBlock()
58 var b = makeBlock();
59 var it = document.getElementById("it");
60 var kids = it.childNodes;
61 var index = getIndex();
62 if ((index < 0) || (index > kids.length)) index = 0;
63 var before = kids[index];
64 it.insertBefore(b, before);
66 </SCRIPT>
67 <FORM>
68 <INPUT TYPE=button ONCLICK="appendInline();" value="Append Inline">
69 <INPUT TYPE=button ONCLICK="insertInline();" value="Insert Inline">
70 <INPUT TYPE=button ONCLICK="appendBlock();" value="Append Block">
71 <INPUT TYPE=button ONCLICK="insertBlock();" value="Insert Block"><BR>
72 <INPUT TYPE=text value="" ID="getid">
73 </FORM>
74 <HR>
75 <B ID=it></B>
76 </BODY>