| 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 return true; |
| 249 } |
| 250 |
| 246 if (m_originalIndex != m_selectedIndex) { | 251 if (m_originalIndex != m_selectedIndex) { |
| 247 // Keyboard events should update the selection immediately (but we don't | 252 // 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 | 253 // 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 | 254 // IE). We change the original index so we revert to that when the |
| 250 // popup is closed. | 255 // popup is closed. |
| 251 m_acceptedIndexOnAbandon = m_selectedIndex; | 256 m_acceptedIndexOnAbandon = m_selectedIndex; |
| 252 | 257 |
| 253 setOriginalIndex(m_selectedIndex); | 258 setOriginalIndex(m_selectedIndex); |
| 254 m_popupClient->setTextFromItem(m_selectedIndex); | 259 m_popupClient->setTextFromItem(m_selectedIndex); |
| 255 } | 260 } |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 { | 824 { |
| 820 return numItems() && IntRect(0, 0, width(), height()).contains(point); | 825 return numItems() && IntRect(0, 0, width(), height()).contains(point); |
| 821 } | 826 } |
| 822 | 827 |
| 823 int PopupListBox::popupContentHeight() const | 828 int PopupListBox::popupContentHeight() const |
| 824 { | 829 { |
| 825 return height(); | 830 return height(); |
| 826 } | 831 } |
| 827 | 832 |
| 828 } // namespace blink | 833 } // namespace blink |
| OLD | NEW |