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

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

Issue 1955963002: [Autofill] Send events to fields being autofilled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/HTMLSelectElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp b/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
index c1b513711c3747b6df2204199d5be67d57f4eaf1..adf6b0ad4f5aa0e14e6b3fc75f6714a7d745c723 100644
--- a/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
@@ -1103,27 +1103,6 @@ int HTMLSelectElement::listToOptionIndex(int listIndex) const
return optionIndex;
}
-void HTMLSelectElement::dispatchFocusEvent(Element* oldFocusedElement, WebFocusType type, InputDeviceCapabilities* sourceCapabilities)
-{
- // Save the selection so it can be compared to the new selection when
- // dispatching change events during blur event dispatch.
- if (usesMenuList())
- saveLastSelection();
- HTMLFormControlElementWithState::dispatchFocusEvent(oldFocusedElement, type, sourceCapabilities);
-}
-
-void HTMLSelectElement::dispatchBlurEvent(Element* newFocusedElement, WebFocusType type, InputDeviceCapabilities* sourceCapabilities)
-{
- m_typeAhead.resetSession();
- // We only need to fire change events here for menu lists, because we fire
- // change events for list boxes whenever the selection change is actually
- // made. This matches other browsers' behavior.
- if (usesMenuList())
- dispatchInputAndChangeEventForMenuList();
- m_lastOnChangeSelection.clear();
- HTMLFormControlElementWithState::dispatchBlurEvent(newFocusedElement, type, sourceCapabilities);
-}
-
void HTMLSelectElement::deselectItemsWithoutValidation(HTMLElement* excludeElement)
{
for (auto& element : listItems()) {
@@ -1989,4 +1968,25 @@ void HTMLSelectElement::resetTypeAheadSessionForTesting()
m_typeAhead.resetSession();
}
+void HTMLSelectElement::dispatchFocusEvent(Element* oldFocusedElement, WebFocusType type, InputDeviceCapabilities* sourceCapabilities)
+{
+ // Save the selection so it can be compared to the new selection when
+ // dispatching change events during blur event dispatch.
+ if (usesMenuList())
+ saveLastSelection();
+ HTMLFormControlElementWithState::dispatchFocusEvent(oldFocusedElement, type, sourceCapabilities);
+}
+
+void HTMLSelectElement::dispatchBlurEvent(Element* newFocusedElement, WebFocusType type, InputDeviceCapabilities* sourceCapabilities)
+{
+ m_typeAhead.resetSession();
+ // We only need to fire change events here for menu lists, because we fire
+ // change events for list boxes whenever the selection change is actually
+ // made. This matches other browsers' behavior.
+ if (usesMenuList())
+ dispatchInputAndChangeEventForMenuList();
+ m_lastOnChangeSelection.clear();
+ HTMLFormControlElementWithState::dispatchBlurEvent(newFocusedElement, type, sourceCapabilities);
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698