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

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

Issue 20572005: Allow selection to skip over contenteditable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 7 years, 4 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE HTML>
2 <html>
3 <body>
4 <script src="../../fast/js/resources/js-test-pre.js"></script>
5
6 <div contentEditable>
7 <p id="before">Before</p>
8 <p id="middle" contentEditable="false">Middle</p>
9 <p id="after">After</p>
10 </div>
11
12 <div id="console"></div>
13 <script>
14 description("Ensure that extending a selection inside a contentEditable skips pa st an uneditable region.");
15
16 window.before = document.getElementById("before");
yosin_UTC9 2013/08/31 01:00:47 Just "var before = ..." is enough.
dmazzoni 2013/09/05 17:17:21 Done.
17 window.after = document.getElementById("after");
18
19 var sel = window.getSelection();
20 sel.setBaseAndExtent(before, 0, before, 6);
21 sel.modify("extend", "forward", "character");
22 shouldBe("window.getSelection().focusNode == after", "true");
yosin_UTC9 2013/08/31 01:00:47 You can write: shouldBe("window.getSelection().foc
dmazzoni 2013/09/05 17:17:21 Done.
23
24 sel.setBaseAndExtent(after, 5, after, 0);
25 testRunner.execCommand('MoveBackwardAndModifySelection');
26 sel.modify("extend", "backward", "character");
27 shouldBe("window.getSelection().focusNode.parentElement == before", "true");
yosin_UTC9 2013/08/31 01:00:47 You can write: shouldBe("window.getSelection().foc
dmazzoni 2013/09/05 17:17:21 Done.
28 </script>
29
30 <script src="../../fast/js/resources/js-test-post.js"></script>
31 </body>
32 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698