blob: 3c2cd12f838f58d3f612358350eb6077d5031bbd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
<html>
<head>
<script language="JavaScript">
function setBlock() {
var el = document.getElementById("block");
el.style.display="block";
}
function setOutline() {
var el = document.getElementById("outline");
el.style.outline="2px solid red";
}
function setSpan() {
var newChild = document.createElement("span");
newChild.setAttribute("id", "outline");
var aSpan = document.createElement("span");
aSpan.setAttribute("id", "block");
newChild.appendChild(aSpan);
var oldChild = document.body.firstChild;
document.body.replaceChild(newChild, oldChild);
}
</script>
</head>
<body><span id="outline">
<span id="block">A span-element</span>
</span>
<h4>Instructions</h4>
<p>Click the following buttons.</p>
<ol>
<li>Start with the outmost left one.</id>
<li>Click the middle one.</li>
<li>(The ouline will not be updated correctly.)
<li>Click the right button.</li>
<li>This will crash Safari 1.3 (v176 and v170, no other configurations tested).</li>
<li>The combination 2. 1. 3. will also crash Safari.</li>
<li>1. 3. will not crash Safari. (But the outline should vanish. Shouldn't it?)</li>
<li>2. 3. will not crash Safari either.</li>
<script>
setOutline();
</script>
<script>
setBlock();
</script>
<script>
setSpan();
</script>
<input type="button" value="1. Set outline property" onclick="setOutline()" />
<input type="button" value="2. Set display property" onclick="setBlock()" />
<input type="button" value="3. Replace span-element" onclick="setSpan()" />
</body>
</html>
|