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

Unified Diff: third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp

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 | « third_party/WebKit/LayoutTests/editing/inserting/insert-on-unfocused-element.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp
diff --git a/third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp b/third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp
index d47649377322c1c9f37b38bb215d4c18e85874b6..214d50e15e579d252f4b0d7c0bd693107681eafd 100644
--- a/third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp
+++ b/third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp
@@ -66,15 +66,10 @@ bool Editor::HandleEditingKeyboardEvent(KeyboardEvent* evt) {
// We may lose focused element by |command.execute(evt)|.
return false;
}
- if (!focused_element->ContainsIncludingHostElements(
- *frame_->Selection()
- .ComputeVisibleSelectionInDOMTreeDeprecated()
- .Start()
- .ComputeContainerNode())) {
- // We should not insert text at selection start if selection doesn't have
- // focus. See http://crbug.com/89026
+ // We should not insert text at selection start if selection doesn't have
+ // focus.
+ if (!frame_->Selection().SelectionHasFocus())
return false;
- }
// Return true to prevent default action. e.g. Space key scroll.
if (DispatchBeforeInputInsertText(evt->target()->ToNode(), key_event->text) !=
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/inserting/insert-on-unfocused-element.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698