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

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

Issue 368023003: Popup open and hide using Alt+KeyDown (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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: Source/core/html/HTMLSelectElement.cpp
diff --git a/Source/core/html/HTMLSelectElement.cpp b/Source/core/html/HTMLSelectElement.cpp
index b0dc747ff14ab9cee6caa8a9264b2d0c2834ad1f..4dba84477b94982d7c189067946d7a7c0bcb7736 100644
--- a/Source/core/html/HTMLSelectElement.cpp
+++ b/Source/core/html/HTMLSelectElement.cpp
@@ -1184,6 +1184,16 @@ void HTMLSelectElement::menuListDefaultEventHandler(Event* event)
else
handled = false;
+ if (keyIdentifier == "Down" && event->isKeyboardEvent() && toKeyboardEvent(event)->altKey()) {
keishi 2014/07/03 07:13:38 We already open the popup on alt+down/up. It is im
Habib Virji 2014/07/03 08:17:34 @keishi: What about linux? It does not work for li
keishi 2014/07/03 08:38:47 I think we want this shortcut for Windows and Linu
Habib Virji 2014/07/03 17:24:04 Done.
+ focus();
+ if (!renderer() || !renderer()->isMenuList() || isDisabledFormControl())
+ return;
+ saveLastSelection();
+ if (RenderMenuList* menuList = toRenderMenuList(renderer()))
+ menuList->showPopup();
+ event->setDefaultHandled();
+ }
+
if (handled && static_cast<size_t>(listIndex) < listItems.size())
selectOption(listToOptionIndex(listIndex), DeselectOtherOptions | DispatchInputAndChangeEvent | UserDriven);

Powered by Google App Engine
This is Rietveld 408576698