Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / selection / addRange.html
blob3490e32bbd8445fc2b49ea3184c2fcc0133f1891
1 <p>This tests Selection::addRange(). It should have no effect if the range passed to it does not intersect the currently selected range. '3456' should be selected.</p>
2 <div id="div">123456789</div>
4 <script>
5 var sel = window.getSelection();
6 var div = document.getElementById("div");
7 var text = div.firstChild;
9 var range = document.createRange();
10 range.setStart(text, 3);
11 range.setEnd(text, 5);
12 sel.addRange(range);
14 range.setStart(text, 4);
15 range.setEnd(text, 6);
16 sel.addRange(range);
18 range.setStart(text, 2);
19 range.setEnd(text, 3);
20 sel.addRange(range);
22 // This should have no effect (until we support discontiguous selections) since this range doesn't intersect the currently selected range.
23 range.setStart(text, 7);
24 range.setEnd(text, 8);
25 sel.addRange(range);
27 // Ditto.
28 range.setStart(text, 0);
29 range.setEnd(text, 1);
30 sel.addRange(range);
32 </script>