OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011, Google Inc. All rights reserved. | 2 * Copyright (c) 2011, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 adjustSelectedIndex(m_items.size()); | 236 adjustSelectedIndex(m_items.size()); |
237 break; | 237 break; |
238 default: | 238 default: |
239 if (!event.ctrlKey() && !event.altKey() && !event.metaKey() | 239 if (!event.ctrlKey() && !event.altKey() && !event.metaKey() |
240 && isPrintableChar(event.windowsVirtualKeyCode()) | 240 && isPrintableChar(event.windowsVirtualKeyCode()) |
241 && isCharacterTypeEvent(event)) | 241 && isCharacterTypeEvent(event)) |
242 typeAheadFind(event); | 242 typeAheadFind(event); |
243 break; | 243 break; |
244 } | 244 } |
245 | 245 |
| 246 if (event.altKey() && (event.keyIdentifier() == "Down" || event.keyIdentifie
r() == "Up")) |
| 247 hidePopup(); |
| 248 |
246 if (m_originalIndex != m_selectedIndex) { | 249 if (m_originalIndex != m_selectedIndex) { |
247 // Keyboard events should update the selection immediately (but we don't | 250 // Keyboard events should update the selection immediately (but we don't |
248 // want to fire the onchange event until the popup is closed, to match | 251 // want to fire the onchange event until the popup is closed, to match |
249 // IE). We change the original index so we revert to that when the | 252 // IE). We change the original index so we revert to that when the |
250 // popup is closed. | 253 // popup is closed. |
251 m_acceptedIndexOnAbandon = m_selectedIndex; | 254 m_acceptedIndexOnAbandon = m_selectedIndex; |
252 | 255 |
253 setOriginalIndex(m_selectedIndex); | 256 setOriginalIndex(m_selectedIndex); |
254 m_popupClient->setTextFromItem(m_selectedIndex); | 257 m_popupClient->setTextFromItem(m_selectedIndex); |
255 } | 258 } |
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 { | 822 { |
820 return numItems() && IntRect(0, 0, width(), height()).contains(point); | 823 return numItems() && IntRect(0, 0, width(), height()).contains(point); |
821 } | 824 } |
822 | 825 |
823 int PopupListBox::popupContentHeight() const | 826 int PopupListBox::popupContentHeight() const |
824 { | 827 { |
825 return height(); | 828 return height(); |
826 } | 829 } |
827 | 830 |
828 } // namespace blink | 831 } // namespace blink |
OLD | NEW |