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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/selection/skip-not-adjacent-contenteditable.html

Issue 2697313005: Selection API: collapse() should recreate an internal Range. (Closed)
Patch Set: Add NeedsRebaseline for platform-dependent tests Created 3 years, 10 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 <div contenteditable>Also bug if moved to here</div> 6 <div contenteditable>Also bug if moved to here</div>
7 <div contentEditable>Bug if moved to here</div> 7 <div contentEditable>Bug if moved to here</div>
8 <div id="before" contenteditable>Selection starts here, and should not go out fr om here</div> 8 <div id="before" contenteditable>Selection starts here, and should not go out fr om here</div>
9 <div contenteditable>Bug if moved to here</div> 9 <div contenteditable>Bug if moved to here</div>
10 <div contenteditable>Also bug if moved to here</div> 10 <div contenteditable>Also bug if moved to here</div>
11 11
12 <script> 12 <script>
13 description("Ensure that moving a selection does not skip adjacent contenteditab le if the current is contentEditable."); 13 description("Ensure that moving a selection does not skip adjacent contenteditab le if the current is contentEditable.");
14 14
15 var before = document.getElementById("before"); 15 var before = document.getElementById("before");
16 var selection = window.getSelection(); 16 var selection = window.getSelection();
17 selection.collapse(before, 0); 17 selection.collapse(before, 0);
18 selection.modify("move", "backward", "character"); 18 selection.modify("move", "backward", "character");
19 shouldBe("selection.focusNode.parentElement", "before"); 19 shouldBe("selection.focusNode", "before");
20 20
21 selection.collapse(before, 1); 21 selection.collapse(before, 1);
22 selection.modify("move", "forward", "character"); 22 selection.modify("move", "forward", "character");
23 shouldBe("selection.focusNode.parentElement", "before"); 23 shouldBe("selection.focusNode", "before");
24 </script> 24 </script>
25 </body> 25 </body>
26 </html> 26 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698