summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/manual-tests/pre-tab-selection-rect.html
blob: d9a98019d8b78a581c4ce802a3651254f5f147ac (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
58
59
60
61
62
63
64
65
66
<html>
<head>
<title>Highlighting preformatted text after tab</title>
<style type="text/css">
#t4 { font-size: 36px; }
#t4:first-line { font-size:16px; }
</style>
<script type="text/javascript">
function test1()
{
    var t = document.getElementById('t1').childNodes[1];
    window.getSelection().setBaseAndExtent(t, 1, t, 13);
}

function test2()
{
    var t = document.getElementById('t2').childNodes[0];
    window.getSelection().setBaseAndExtent(t, 5, t, 23);
}

function test3()
{
    var t = document.getElementById('t3').childNodes[0];
    window.getSelection().setBaseAndExtent(t, 5, t, 23);
}

function test4()
{
    var t = document.getElementById('t4').childNodes[0];
    window.getSelection().setBaseAndExtent(t, 11, t, 29);
}
</script>
</head>
<body>
<p>
This is a test for <i>http://bugs.webkit.org/show_bug.cgi?id=6043
Incorrect selection highlighting in pre-formatted text with tabs</i>.
</p>
<hr>
<p>
Instructions:
</p>
<p>
1. Click <a href="#" onclick="window.setTimeout(test1,1);">test 1</a>.
The entire word &ldquo;highlighting&rdquo; below should be highlighted.
</p>
<pre id="t1"><span>Buggy</span>	highlighting</pre>
<p>
2. Click <a href="#" onclick="window.setTimeout(test2,1);">test 2</a>.
The words &ldquo;buggy highlighting&rdquo; below should be fully highlighted.
</p>
<pre id="t2" style="padding-left: 10px;">Very buggy	highlighting</pre>
<p>
3. Click <a href="#" onclick="window.setTimeout(test3,1);">test 3</a>.
The words &ldquo;buggy highlighting&rdquo; below should be fully highlighted.
</p>
<pre id="t3" style="margin-left: 10px;">Very buggy	highlighting</pre>
<p>
4. Click <a href="#" onclick="window.setTimeout(test4,1);">test 4</a>.
The words &ldquo;buggy highlighting&rdquo; below should be fully highlighted.
</p>
<p id="t4">
Even more buggy highlighting.
</p>
</body>
</html>