Changeset 47150 in webkit
- Timestamp:
- Aug 12, 2009 2:49:20 PM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r47147 r47150 1 2009-08-12 Xiaomei Ji <xji@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Fix [Chromium] drop down menu letter selection, skip selections 6 https://bugs.webkit.org/show_bug.cgi?id=28205 7 8 Not auto-testable since it is chromim platform specific code, and it involves sending a keyboard 9 event to the popup, which is not possible (eventSender sends the key 10 events through webview, we want to go through the webwidget). 11 12 * manual-tests/keyboard_select_elements_with_same_beginning.html: Added. 13 * platform/chromium/PopupMenuChromium.cpp: 14 (WebCore::isCharacterTypeEvent): style change. 15 (WebCore::PopupListBox::handleKeyEvent): typeAheadFind should be called only when the event is 16 a character type event to avoid calling twice for English. 17 (WebCore::PopupListBox::typeAheadFind): remove unnecessary checking of isCharacterTypeEvent() since the whole function is only called under that condition. 18 1 19 2009-08-12 Maxime Simon <simon.maxime@gmail.com> 2 20 -
trunk/WebCore/platform/chromium/PopupMenuChromium.cpp
r46184 r47150 600 600 return false; 601 601 } 602 } 603 604 static bool isCharacterTypeEvent(const PlatformKeyboardEvent& event) 605 { 606 // Check whether the event is a character-typed event or not. 607 // In Windows, PlatformKeyboardEvent::Char (not RawKeyDown) type event 608 // is considered as character type event. In Mac OS, KeyDown (not 609 // KeyUp) is considered as character type event. 610 #if PLATFORM(WIN_OS) 611 if (event.type() == PlatformKeyboardEvent::Char) 612 return true; 613 #else 614 if (event.type() == PlatformKeyboardEvent::KeyDown) 615 return true; 616 #endif 617 return false; 602 618 } 603 619 … … 642 658 default: 643 659 if (!event.ctrlKey() && !event.altKey() && !event.metaKey() 644 && isPrintableChar(event.windowsVirtualKeyCode())) 660 && isPrintableChar(event.windowsVirtualKeyCode()) 661 && isCharacterTypeEvent(event)) 645 662 typeAheadFind(event); 646 663 break; … … 691 708 } 692 709 693 static bool isCharacterTypeEvent(const PlatformKeyboardEvent& event) {694 // Check whether the event is a character-typed event or not.695 // In Windows, PlatformKeyboardEvent::Char (not RawKeyDown) type event696 // is considered as character type event. In Mac OS, KeyDown (not697 // KeyUp) is considered as character type event.698 #if PLATFORM(WIN_OS)699 if (event.type() == PlatformKeyboardEvent::Char)700 return true;701 #else702 if (event.type() == PlatformKeyboardEvent::KeyDown)703 return true;704 #endif705 return false;706 }707 708 710 // From HTMLSelectElement.cpp, with modifications 709 711 void PopupListBox::typeAheadFind(const PlatformKeyboardEvent& event) … … 715 717 // last character and the current character is used to indicate whether 716 718 // user typed in a string or just a character as the search prefix. 717 if (isCharacterTypeEvent(event)) 718 m_lastCharTime = now; 719 m_lastCharTime = now; 719 720 720 721 UChar c = event.windowsVirtualKeyCode();
Note: See TracChangeset
for help on using the changeset viewer.