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

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

Issue 2315223002: Audit the use of updateStyleAndLayoutIgnorePendingStylesheets in FrameSelection::selectedText (Closed)
Patch Set: Created 4 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 cb1067fa567b165c03751ed43ef0e1947d05f34d..caa07404b1d77a104667051011be2b55ad56397a 100644
--- a/third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp
@@ -419,6 +419,10 @@ void TextFieldInputType::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*
// that case, and nothing in the text field will be removed.
unsigned selectionLength = 0;
if (element().focused()) {
+ // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
+ // needs to be audited. See http://crbug.com/590369 for more details.
+ element().document().updateStyleAndLayoutIgnorePendingStylesheets();
+
selectionLength = element().document().frame()->selection().selectedText().length();
}
DCHECK_GE(oldLength, selectionLength);

Powered by Google App Engine
This is Rietveld 408576698