4 <script language=
"JavaScript">
6 var el
= document
.getElementById("block");
7 el
.style
.display
="block";
9 function setOutline() {
10 var el
= document
.getElementById("outline");
11 el
.style
.outline
="2px solid red";
14 var newChild
= document
.createElement("span");
15 newChild
.setAttribute("id", "outline");
16 var aSpan
= document
.createElement("span");
17 aSpan
.setAttribute("id", "block");
18 newChild
.appendChild(aSpan
);
19 var oldChild
= document
.body
.firstChild
;
20 document
.body
.replaceChild(newChild
, oldChild
);
26 <body><span id=
"outline">
27 <span id=
"block">A span-element
</span>
31 <p>Click the following buttons.
</p>
33 <li>Start with the outmost left one.
</id>
34 <li>Click the middle one.
</li>
35 <li>(The ouline will not be updated correctly.)
36 <li>Click the right button.
</li>
37 <li>This will crash Safari
1.3 (v176 and v170, no other configurations tested).
</li>
38 <li>The combination
2.
1.
3. will also crash Safari.
</li>
39 <li>1.
3. will not crash Safari. (But the outline should vanish. Shouldn't it?)
</li>
40 <li>2.
3. will not crash Safari either.
</li>
52 <input type=
"button" value=
"1. Set outline property" onclick=
"setOutline()" />
53 <input type=
"button" value=
"2. Set display property" onclick=
"setBlock()" />
54 <input type=
"button" value=
"3. Replace span-element" onclick=
"setSpan()" />