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

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

Issue 1377963004: Use FrameSelection::selectedText where possible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update layout in HTMLTextFormControlElement::setSelectionRange. 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/HTMLTextFormControlElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLTextFormControlElement.cpp b/third_party/WebKit/Source/core/html/HTMLTextFormControlElement.cpp
index b3421b15e87f3c948e148727b9f18a554e1b5353..45d2682c14e708ffda352c0e0dfa5e971028ad78 100644
--- a/third_party/WebKit/Source/core/html/HTMLTextFormControlElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLTextFormControlElement.cpp
@@ -354,6 +354,8 @@ void HTMLTextFormControlElement::setSelectionRange(int start, int end, TextField
if (openShadowRoot() || !isTextFormControl() || !inDocument())
return;
+ document().updateLayoutIgnorePendingStylesheets();
tkent 2015/10/20 23:11:32 nit: Add a comment why we need to update layout.
+
const int editorValueLength = static_cast<int>(innerEditorValue().length());
ASSERT(editorValueLength >= 0);
end = std::max(std::min(end, editorValueLength), 0);

Powered by Google App Engine
This is Rietveld 408576698