Commit 3c846ec9 authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Move HTMLSelectElement::HandleMouseRelease() to SelectType

This CL has no behavior changes.

Bug: 1052232
Change-Id: I9e59f2c291c216f784df57796191d87764a73f80
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2103991
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Auto-Submit: Kent Tamura <tkent@chromium.org>
Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#750462}
parent 902ab8bb
......@@ -1152,15 +1152,8 @@ LayoutBox* HTMLSelectElement::AutoscrollBox() {
}
void HTMLSelectElement::StopAutoscroll() {
if (!UsesMenuList() && !IsDisabledFormControl())
HandleMouseRelease();
}
void HTMLSelectElement::HandleMouseRelease() {
// We didn't start this click/drag on any options.
if (last_on_change_selection_.IsEmpty())
return;
ListBoxOnChange();
if (!IsDisabledFormControl())
select_type_->HandleMouseRelease();
}
void HTMLSelectElement::DefaultEventHandler(Event& event) {
......
......@@ -143,7 +143,6 @@ class CORE_EXPORT HTMLSelectElement final
void HrInsertedOrRemoved(HTMLHRElement&);
HTMLOptionElement* SpatialNavigationFocusedOption();
void HandleMouseRelease();
int ListIndexForOption(const HTMLOptionElement&);
......
......@@ -611,6 +611,7 @@ class ListBoxSelectType final : public SelectType {
void DidSetSuggestedOption(HTMLOptionElement* option) override;
void SelectAll() override;
void SaveListboxActiveSelection() override;
void HandleMouseRelease() override;
private:
HTMLOptionElement* NextSelectableOptionPageAway(HTMLOptionElement*,
......@@ -734,7 +735,7 @@ bool ListBoxSelectType::DefaultEventHandler(const Event& event) {
select_->GetLayoutBox()))
page->GetAutoscrollController().StopAutoscroll();
else
select_->HandleMouseRelease();
HandleMouseRelease();
return false;
}
......@@ -1053,6 +1054,13 @@ void ListBoxSelectType::SaveListboxActiveSelection() {
}
}
void ListBoxSelectType::HandleMouseRelease() {
// We didn't start this click/drag on any options.
if (select_->last_on_change_selection_.IsEmpty())
return;
select_->ListBoxOnChange();
}
// ============================================================================
SelectType::SelectType(HTMLSelectElement& select) : select_(select) {}
......@@ -1109,6 +1117,8 @@ void SelectType::SelectAll() {
void SelectType::SaveListboxActiveSelection() {}
void SelectType::HandleMouseRelease() {}
void SelectType::ShowPopup() {
NOTREACHED();
}
......
......@@ -46,6 +46,7 @@ class SelectType : public GarbageCollected<SelectType> {
virtual void SelectAll();
virtual void SaveListboxActiveSelection();
virtual void HandleMouseRelease();
virtual void ShowPopup();
virtual void HidePopup();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment