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

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

Issue 20572005: Allow selection to skip over contenteditable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Work around minor platform differences in test Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/editing/selection/skip-over-contenteditable-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/editing/selection/skip-over-contenteditable.html
diff --git a/LayoutTests/editing/selection/skip-over-contenteditable.html b/LayoutTests/editing/selection/skip-over-contenteditable.html
new file mode 100644
index 0000000000000000000000000000000000000000..d8e7435afd9941c95bee1ab6398fc5613f9680fa
--- /dev/null
+++ b/LayoutTests/editing/selection/skip-over-contenteditable.html
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+
+<p id="before">Before the contenteditable</p>
+<div contentEditable></div>
+<p id="after">After the contenteditable</p>
+
+<div id="console"></div>
+<script>
+description("Ensure that extending a selection skips past a contentEditable.");
+
+var before = document.getElementById("before");
+var after = document.getElementById("after");
+
+var sel = window.getSelection();
+sel.setBaseAndExtent(before, 0, before, 6);
+sel.modify("extend", "forward", "character");
+shouldBe("sel.focusNode", "after");
+
+sel.setBaseAndExtent(after, 5, after, 0);
+sel.modify("extend", "backward", "character");
+shouldBe("sel.focusNode.parentElement", "before");
+
+sel.setBaseAndExtent(before, 0, before, 6);
+sel.modify("extend", "forward", "word");
+shouldBe("sel.focusNode.parentElement", "after");
+
+sel.setBaseAndExtent(after, 5, after, 0);
+sel.modify("extend", "backward", "word");
+shouldBe("sel.focusNode.parentElement", "before");
+
+sel.setBaseAndExtent(before, 0, before, 6);
+sel.modify("extend", "forward", "line");
+shouldBe("sel.focusNode.parentElement", "after");
+
+sel.setBaseAndExtent(after, 5, after, 0);
+sel.modify("extend", "backward", "line");
+shouldBe("sel.focusNode.parentElement", "before");
+</script>
+
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/editing/selection/skip-over-contenteditable-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698