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

Side by Side 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, 5 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
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 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 listIndex = nextValidIndex(listIndex, SkipForwards, 3); 1177 listIndex = nextValidIndex(listIndex, SkipForwards, 3);
1178 else if (keyIdentifier == "PageUp") 1178 else if (keyIdentifier == "PageUp")
1179 listIndex = nextValidIndex(listIndex, SkipBackwards, 3); 1179 listIndex = nextValidIndex(listIndex, SkipBackwards, 3);
1180 else if (keyIdentifier == "Home") 1180 else if (keyIdentifier == "Home")
1181 listIndex = nextValidIndex(-1, SkipForwards, 1); 1181 listIndex = nextValidIndex(-1, SkipForwards, 1);
1182 else if (keyIdentifier == "End") 1182 else if (keyIdentifier == "End")
1183 listIndex = nextValidIndex(listItems.size(), SkipBackwards, 1); 1183 listIndex = nextValidIndex(listItems.size(), SkipBackwards, 1);
1184 else 1184 else
1185 handled = false; 1185 handled = false;
1186 1186
1187 if (keyIdentifier == "Down" && event->isKeyboardEvent() && toKeyboardEve nt(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.
1188 focus();
1189 if (!renderer() || !renderer()->isMenuList() || isDisabledFormContro l())
1190 return;
1191 saveLastSelection();
1192 if (RenderMenuList* menuList = toRenderMenuList(renderer()))
1193 menuList->showPopup();
1194 event->setDefaultHandled();
1195 }
1196
1187 if (handled && static_cast<size_t>(listIndex) < listItems.size()) 1197 if (handled && static_cast<size_t>(listIndex) < listItems.size())
1188 selectOption(listToOptionIndex(listIndex), DeselectOtherOptions | Di spatchInputAndChangeEvent | UserDriven); 1198 selectOption(listToOptionIndex(listIndex), DeselectOtherOptions | Di spatchInputAndChangeEvent | UserDriven);
1189 1199
1190 if (handled) 1200 if (handled)
1191 event->setDefaultHandled(); 1201 event->setDefaultHandled();
1192 } 1202 }
1193 1203
1194 // Use key press event here since sending simulated mouse events 1204 // Use key press event here since sending simulated mouse events
1195 // on key down blocks the proper sending of the key press event. 1205 // on key down blocks the proper sending of the key press event.
1196 if (event->type() == EventTypeNames::keypress) { 1206 if (event->type() == EventTypeNames::keypress) {
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
1658 1668
1659 void HTMLSelectElement::trace(Visitor* visitor) 1669 void HTMLSelectElement::trace(Visitor* visitor)
1660 { 1670 {
1661 #if ENABLE(OILPAN) 1671 #if ENABLE(OILPAN)
1662 visitor->trace(m_listItems); 1672 visitor->trace(m_listItems);
1663 #endif 1673 #endif
1664 HTMLFormControlElementWithState::trace(visitor); 1674 HTMLFormControlElementWithState::trace(visitor);
1665 } 1675 }
1666 1676
1667 } // namespace 1677 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698