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

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

Issue 1420693006: Introduce a struct to store arguments of Element::focus(). (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 635a6a487ce432ca1cd2996ac698d0a7e04cb093..6c1aa8c557ee8ff6b646fd86f13520fb7d85f9af 100644
--- a/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp
@@ -241,13 +241,16 @@ bool HTMLTextAreaElement::shouldShowFocusRingOnMouseFocus() const
return true;
}
-void HTMLTextAreaElement::updateFocusAppearance(bool restorePreviousSelection)
+void HTMLTextAreaElement::updateFocusAppearance(SelectionBehaviorOnFocus selectionBehavior)
{
- if (!restorePreviousSelection)
+ switch (selectionBehavior) {
+ case SelectionBehaviorOnFocus::Reset:
setSelectionRange(0, 0, SelectionHasNoDirection, NotDispatchSelectEvent);
- else
+ break;
+ case SelectionBehaviorOnFocus::Restore:
restoreCachedSelection();
-
+ break;
+ }
if (document().frame())
document().frame()->selection().revealSelection();
}
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLTextAreaElement.h ('k') | third_party/WebKit/Source/core/html/forms/InputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698