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

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

Issue 1377963004: Use FrameSelection::selectedText where possible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check whether selection is range. Created 5 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
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 69c4a8318aa39f32b394c7b000264e0236600065..7f460d1cbd33193a2f5614bd94a902f82cca5996 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