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

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

Issue 2268243002: Remove SelectionOption argument of HTMLTextFormControlElement::setSelectionRange(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove SelectionOption argument of HTMLTextFormControlElement::setSelectionRange(). Created 4 years, 4 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
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLTextFormControlElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 012ad100525437c0b9eda85ecf398b855162b703..80514425502d354c84c85db764df903bbdfe8ee0 100644
--- a/third_party/WebKit/Source/core/html/HTMLTextFormControlElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLTextFormControlElement.cpp
@@ -189,8 +189,8 @@ void HTMLTextFormControlElement::setSelectionDirection(const String& direction)
void HTMLTextFormControlElement::select(NeedToDispatchSelectEvent eventBehaviour)
{
- document().updateStyleAndLayoutIgnorePendingStylesheets();
- setSelectionRange(0, std::numeric_limits<int>::max(), SelectionHasNoDirection, eventBehaviour, isFocusable() ? ChangeSelectionAndFocus : NotChangeSelection);
+ setSelectionRange(0, std::numeric_limits<int>::max(), SelectionHasNoDirection, eventBehaviour);
+ focus();
}
bool HTMLTextFormControlElement::shouldDispatchFormControlChangeEvent(String& oldValue, String& newValue)
@@ -343,7 +343,7 @@ static int indexForPosition(HTMLElement* innerEditor, const Position& passedPosi
return index;
}
-void HTMLTextFormControlElement::setSelectionRange(int start, int end, TextFieldSelectionDirection direction, NeedToDispatchSelectEvent eventBehaviour, SelectionOption selectionOption)
+void HTMLTextFormControlElement::setSelectionRange(int start, int end, TextFieldSelectionDirection direction, NeedToDispatchSelectEvent eventBehaviour)
{
if (openShadowRoot() || !isTextFormControl())
return;
@@ -353,7 +353,7 @@ void HTMLTextFormControlElement::setSelectionRange(int start, int end, TextField
start = std::min(std::max(start, 0), end);
cacheSelection(start, end, direction);
- if (selectionOption == NotChangeSelection || (selectionOption == ChangeSelectionIfFocused && document().focusedElement() != this) || !isConnected()) {
+ if (document().focusedElement() != this) {
if (eventBehaviour == DispatchSelectEvent)
scheduleSelectEvent();
return;
@@ -385,7 +385,7 @@ void HTMLTextFormControlElement::setSelectionRange(int start, int end, TextField
newSelection.setWithoutValidation(startPosition, endPosition);
newSelection.setIsDirectional(direction != SelectionHasNoDirection);
- frame->selection().setSelection(newSelection, FrameSelection::DoNotAdjustInFlatTree | FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle | (selectionOption == ChangeSelectionAndFocus ? 0 : FrameSelection::DoNotSetFocus));
+ frame->selection().setSelection(newSelection, FrameSelection::DoNotAdjustInFlatTree | FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle | FrameSelection::DoNotSetFocus);
if (eventBehaviour == DispatchSelectEvent)
scheduleSelectEvent();
}
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLTextFormControlElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698