Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(633)

Side by Side Diff: LayoutTests/editing/selection/skip-over-contenteditable.html

Issue 1195833002: Selection attributes changes from long to unsigned long (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixes offset error message Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <html> 2 <html>
3 <body> 3 <body>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 5
6 <p id="before">Before the contenteditable</p> 6 <p id="before">Before the contenteditable</p>
7 <div contentEditable></div> 7 <div contentEditable></div>
8 <p id="after">After the contenteditable</p> 8 <p id="after">After the contenteditable</p>
9 9
10 <div id="console"></div> 10 <div id="console"></div>
11 <script> 11 <script>
12 description("Ensure that extending a selection skips past a contentEditable."); 12 description("Ensure that extending a selection skips past a contentEditable.");
13 13
14 var before = document.getElementById("before"); 14 var before = document.getElementById("before");
15 var after = document.getElementById("after"); 15 var after = document.getElementById("after");
16 16
17 var sel = window.getSelection(); 17 var sel = window.getSelection();
18 sel.setBaseAndExtent(before, 0, before, 6); 18 sel.setBaseAndExtent(before, 0, before, 1);
19 sel.modify("extend", "forward", "character"); 19 sel.modify("extend", "forward", "character");
20 shouldBe("sel.focusNode", "after"); 20 shouldBe("sel.focusNode", "after");
21 21
22 sel.setBaseAndExtent(after, 5, after, 0); 22 sel.setBaseAndExtent(after, 1, after, 0);
23 sel.modify("extend", "backward", "character"); 23 sel.modify("extend", "backward", "character");
24 shouldBe("sel.focusNode.parentElement", "before"); 24 shouldBe("sel.focusNode.parentElement", "before");
25 25
26 sel.setBaseAndExtent(before, 0, before, 6); 26 sel.setBaseAndExtent(before, 0, before, 1);
27 sel.modify("extend", "forward", "word"); 27 sel.modify("extend", "forward", "word");
28 shouldBe("sel.focusNode.parentElement", "after"); 28 shouldBe("sel.focusNode.parentElement", "after");
29 29
30 sel.setBaseAndExtent(after, 5, after, 0); 30 sel.setBaseAndExtent(after, 1, after, 0);
31 sel.modify("extend", "backward", "word"); 31 sel.modify("extend", "backward", "word");
32 shouldBe("sel.focusNode.parentElement", "before"); 32 shouldBe("sel.focusNode.parentElement", "before");
33 33
34 sel.setBaseAndExtent(before, 0, before, 6); 34 sel.setBaseAndExtent(before, 0, before, 1);
35 sel.modify("extend", "forward", "line"); 35 sel.modify("extend", "forward", "line");
36 shouldBe("sel.focusNode.parentElement", "after"); 36 shouldBe("sel.focusNode.parentElement", "after");
37 37
38 sel.setBaseAndExtent(after, 5, after, 0); 38 sel.setBaseAndExtent(after, 1, after, 0);
39 sel.modify("extend", "backward", "line"); 39 sel.modify("extend", "backward", "line");
40 shouldBe("sel.focusNode.parentElement", "before"); 40 shouldBe("sel.focusNode.parentElement", "before");
41 </script> 41 </script>
42 42
43 </body> 43 </body>
44 </html> 44 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698