forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelete-into-nested-block.html
31 lines (31 loc) · 995 Bytes
/
delete-into-nested-block.html
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
<html>
<head>
<script src="resources/text-based-repaint.js" type="text/javascript"></script>
<script type="text/javascript">
function repaintTest()
{
document.execCommand("Delete");
}
</script>
</head>
<body onload="runRepaintAndPixelTest()">
<h4>Deleting into a nested block (was Radar 4056100)</h4>
<div style="width:400px;">
The bug's symptom was that the visual result were two instances of the word "three", because the original was not erased. Resize cleared it up.
</div>
<hr>
<div contenteditable style="height: 100px;">
<div id="one">one</div>
<div id="two">
<div>two</div>
<div>three</div>
</div>
</div>
<script type="text/javascript">
var sel = window.getSelection();
var one = document.getElementById("one");
var two = document.getElementById("two");
sel.setBaseAndExtent(one, 0, two, 2);
</script>
</body>
</html>