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

Unified Diff: third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp

Issue 1427733003: Use |FrameSelection::selectedText()| where possible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/HTMLTextAreaElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp b/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp
index fa2e1eca65f65d5a194bd55ba886595fbda41876..635a6a487ce432ca1cd2996ac698d0a7e04cb093 100644
--- a/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp
@@ -307,8 +307,7 @@ void HTMLTextAreaElement::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*
// that case, and nothing in the text field will be removed.
unsigned selectionLength = 0;
if (focused()) {
- const EphemeralRange range = document().frame()->selection().selection().toNormalizedEphemeralRange();
- selectionLength = computeLengthForSubmission(plainText(range));
+ selectionLength = computeLengthForSubmission(document().frame()->selection().selectedText());
}
ASSERT(currentLength >= selectionLength);
unsigned baseLength = currentLength - selectionLength;

Powered by Google App Engine
This is Rietveld 408576698