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

Unified Diff: third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp

Issue 1412713003: Reland 'Use FrameSelection::selectedText where possible.' Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use SelectionEditor::setWithoutValidation. Created 5 years, 2 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/Source/core/html/forms/TextFieldInputType.cpp
diff --git a/third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp b/third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp
index 62ab5cfddfcc974b1760a5dcce07b6c0a671167a..1cf07fb32ad22a96369565bebfd49187bbf97f87 100644
--- a/third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp
@@ -419,8 +419,7 @@ void TextFieldInputType::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*
// that case, and nothing in the text field will be removed.
unsigned selectionLength = 0;
if (element().focused()) {
- const VisibleSelection& selection = element().document().frame()->selection().selection();
- selectionLength = plainText(selection.toNormalizedEphemeralRange()).length();
+ selectionLength = element().document().frame()->selection().selectedText().length();
}
ASSERT(oldLength >= selectionLength);

Powered by Google App Engine
This is Rietveld 408576698