3 <title>Highlighting preformatted text after tab</title>
4 <style type="text/css">
5 #t4 { font-size: 36px; }
6 #t4:first-line { font-size:16px; }
8 <script type="text/javascript">
11 var t = document.getElementById('t1').childNodes[1];
12 window.getSelection().setBaseAndExtent(t, 1, t, 13);
17 var t = document.getElementById('t2').childNodes[0];
18 window.getSelection().setBaseAndExtent(t, 5, t, 23);
23 var t = document.getElementById('t3').childNodes[0];
24 window.getSelection().setBaseAndExtent(t, 5, t, 23);
29 var t = document.getElementById('t4').childNodes[0];
30 window.getSelection().setBaseAndExtent(t, 11, t, 29);
36 This is a test for <i>http://bugs.webkit.org/show_bug.cgi?id=6043
37 Incorrect selection highlighting in pre-formatted text with tabs</i>.
44 1. Click <a href="#" onclick="window.setTimeout(test1,1);">test 1</a>.
45 The entire word “highlighting” below should be highlighted.
47 <pre id="t1"><span>Buggy</span> highlighting</pre>
49 2. Click <a href="#" onclick="window.setTimeout(test2,1);">test 2</a>.
50 The words “buggy highlighting” below should be fully highlighted.
52 <pre id="t2" style="padding-left: 10px;">Very buggy highlighting</pre>
54 3. Click <a href="#" onclick="window.setTimeout(test3,1);">test 3</a>.
55 The words “buggy highlighting” below should be fully highlighted.
57 <pre id="t3" style="margin-left: 10px;">Very buggy highlighting</pre>
59 4. Click <a href="#" onclick="window.setTimeout(test4,1);">test 4</a>.
60 The words “buggy highlighting” below should be fully highlighted.
63 Even more buggy highlighting.