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

Side by Side Diff: Source/core/html/HTMLSelectElement.cpp

Issue 1309503004: Select elements should clear type-ahead session on blur. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLSelectElement.h ('k') | Source/core/html/forms/TypeAhead.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
4 * (C) 1999 Antti Koivisto (koivisto@kde.org) 4 * (C) 1999 Antti Koivisto (koivisto@kde.org)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights reserved.
7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
8 * Copyright (C) 2010 Google Inc. All rights reserved. 8 * Copyright (C) 2010 Google Inc. All rights reserved.
9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
10 * 10 *
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after
1045 { 1045 {
1046 // Save the selection so it can be compared to the new selection when 1046 // Save the selection so it can be compared to the new selection when
1047 // dispatching change events during blur event dispatch. 1047 // dispatching change events during blur event dispatch.
1048 if (usesMenuList()) 1048 if (usesMenuList())
1049 saveLastSelection(); 1049 saveLastSelection();
1050 HTMLFormControlElementWithState::dispatchFocusEvent(oldFocusedElement, type, sourceCapabilities); 1050 HTMLFormControlElementWithState::dispatchFocusEvent(oldFocusedElement, type, sourceCapabilities);
1051 } 1051 }
1052 1052
1053 void HTMLSelectElement::dispatchBlurEvent(Element* newFocusedElement, WebFocusTy pe type, InputDeviceCapabilities* sourceCapabilities) 1053 void HTMLSelectElement::dispatchBlurEvent(Element* newFocusedElement, WebFocusTy pe type, InputDeviceCapabilities* sourceCapabilities)
1054 { 1054 {
1055 m_typeAhead.resetSession();
1055 // We only need to fire change events here for menu lists, because we fire 1056 // We only need to fire change events here for menu lists, because we fire
1056 // change events for list boxes whenever the selection change is actually ma de. 1057 // change events for list boxes whenever the selection change is actually ma de.
1057 // This matches other browsers' behavior. 1058 // This matches other browsers' behavior.
1058 if (usesMenuList()) 1059 if (usesMenuList())
1059 dispatchInputAndChangeEventForMenuList(); 1060 dispatchInputAndChangeEventForMenuList();
1060 HTMLFormControlElementWithState::dispatchBlurEvent(newFocusedElement, type, sourceCapabilities); 1061 HTMLFormControlElementWithState::dispatchBlurEvent(newFocusedElement, type, sourceCapabilities);
1061 } 1062 }
1062 1063
1063 void HTMLSelectElement::deselectItemsWithoutValidation(HTMLElement* excludeEleme nt) 1064 void HTMLSelectElement::deselectItemsWithoutValidation(HTMLElement* excludeEleme nt)
1064 { 1065 {
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
1944 1945
1945 void HTMLSelectElement::detach(const AttachContext& context) 1946 void HTMLSelectElement::detach(const AttachContext& context)
1946 { 1947 {
1947 HTMLFormControlElementWithState::detach(context); 1948 HTMLFormControlElementWithState::detach(context);
1948 if (m_popup) 1949 if (m_popup)
1949 m_popup->disconnectClient(); 1950 m_popup->disconnectClient();
1950 m_popupIsVisible = false; 1951 m_popupIsVisible = false;
1951 m_popup = nullptr; 1952 m_popup = nullptr;
1952 } 1953 }
1953 1954
1955 void HTMLSelectElement::resetTypeAheadSessionForTesting()
1956 {
1957 m_typeAhead.resetSession();
1958 }
1959
1954 } // namespace blink 1960 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/HTMLSelectElement.h ('k') | Source/core/html/forms/TypeAhead.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698