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

Unified Diff: third_party/WebKit/LayoutTests/editing/selection/select_all/select_all_with_unfocused_selection.html

Issue 2891203002: Make user-triggered SelectAll act as if there is no selection for hidden selection (Closed)
Patch Set: Created 3 years, 7 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
Index: third_party/WebKit/LayoutTests/editing/selection/select_all/select_all_with_unfocused_selection.html
diff --git a/third_party/WebKit/LayoutTests/editing/selection/select_all/select_all_with_unfocused_selection.html b/third_party/WebKit/LayoutTests/editing/selection/select_all/select_all_with_unfocused_selection.html
new file mode 100644
index 0000000000000000000000000000000000000000..66f028f71e28aba7e416770eb3e1584191d37012
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/selection/select_all/select_all_with_unfocused_selection.html
@@ -0,0 +1,57 @@
+<!doctype html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script src="../../assert_selection.js"></script>
+<script>
+// This tests interaction with user-triggered SelectAll command and selection.
+// When selection is hidden, user-triggered SelectAll should act as if there is
+// no selection at all.
+
+test(() => {
+ assert_exists(window, 'testRunner', 'This test requires testRunner');
+
+ assert_selection(
+ 'foo<textarea>bar|</textarea><a href="http://www.example.com">baz</a>',
+ selection => {
+ selection.document.querySelector('a').focus();
+ testRunner.execCommand('selectAll');
+ },
+ '^foo<textarea>bar</textarea><a href="http://www.example.com">baz|</a>')
+}, 'User-triggered SelectAll selects entire document when there is unfocused caret selection hidden in text control');
+
+test(() => {
+ assert_exists(window, 'testRunner', 'This test requires testRunner');
+
+ assert_selection(
+ 'foo<textarea>^ba|r</textarea><a href="http://www.example.com">baz</a>',
+ selection => {
+ selection.document.querySelector('a').focus();
+ testRunner.execCommand('selectAll');
+ },
+ '^foo<textarea>bar</textarea><a href="http://www.example.com">baz|</a>')
+}, 'User-triggered SelectAll selects entire document when there is unfocused range selection hidden in text control');
+
+test(() => {
+ assert_exists(window, 'testRunner', 'This test requires testRunner');
+
+ assert_selection(
+ 'foo<div contenteditable>bar|</div><a href="http://www.example.com">baz</a>',
+ selection => {
+ selection.document.querySelector('a').focus();
+ testRunner.execCommand('selectAll');
+ },
+ '^foo<div contenteditable>bar</div><a href="http://www.example.com">baz|</a>')
+}, 'User-triggered SelectAll selects entire document when there is unfocused caret selection hidden in contenteditable div');
+
+test(() => {
+ assert_exists(window, 'testRunner', 'This test requires testRunner');
+
+ assert_selection(
+ 'foo<div contenteditable>^ba|r</div><a href="http://www.example.com">baz</a>',
+ selection => {
+ selection.document.querySelector('a').focus();
+ testRunner.execCommand('selectAll');
+ },
+ 'foo<div contenteditable>^bar|</div><a href="http://www.example.com">baz</a>')
+}, 'User-triggered SelectAll selects entire document when there is unfocused range selection shown in contenteditable div');
yosin_UTC9 2017/05/19 02:19:36 I can read this description says "select entire do
Xiaocheng 2017/05/19 02:25:51 Bad copy-and-paste. Will fix.
+</script>

Powered by Google App Engine
This is Rietveld 408576698