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

Unified Diff: third_party/WebKit/LayoutTests/editing/inserting/insert-on-unfocused-element.html

Issue 2889763003: Accept text input only if selection has focus. (Closed)
Patch Set: nit 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/inserting/insert-on-unfocused-element.html
diff --git a/third_party/WebKit/LayoutTests/editing/inserting/insert-on-unfocused-element.html b/third_party/WebKit/LayoutTests/editing/inserting/insert-on-unfocused-element.html
new file mode 100644
index 0000000000000000000000000000000000000000..32a8d90e609ab46a367e348c913c313cc877b71e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/inserting/insert-on-unfocused-element.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<div id="outer" tabindex="-1">
+ <div id="input" contenteditable>foo</div>
+</div>
+<script>
+test(() => {
+ assert_exists(window, 'eventSender', 'this test requires window.eventSender');
+ input.focus();
+ assert_equals(document.activeElement, input);
+ outer.focus();
+ assert_equals(document.activeElement, outer, 'outer is focued.');
+ eventSender.keyDown('a');
+ assert_equals(input.textContent, 'foo', 'Input value should not change.');
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698