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/collapse-null.html

Issue 546703003: Editing: Let Selection.collapse with null clears selection. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add tests Created 6 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/collapse-null-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/editing/selection/collapse-null.html
diff --git a/LayoutTests/editing/selection/collapse-null.html b/LayoutTests/editing/selection/collapse-null.html
new file mode 100644
index 0000000000000000000000000000000000000000..10aec6a013515dc0fd1e6533e966643ed5de9080
--- /dev/null
+++ b/LayoutTests/editing/selection/collapse-null.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+<script src="../../resources/js-test.js"></script>
+
+<div id="div" contenteditable="true">hello</div>
+<script>
+description("Ensure that collapse with null clears selection");
+
+var selection = getSelection();
+selection.selectAllChildren(div);
+ selection.rangeCount
+ shouldBe("selection.rangeCount", "1");
+ selection.collapse(null);
+ shouldBe("selection.rangeCount", "0");
+ selection.collapse(div.firstChild, 2);
+ shouldBe("selection.rangeCount", "1");
+ selection.collapse(null);
+ shouldBe("selection.rangeCount", "0");
+</script>
+
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/editing/selection/collapse-null-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698