Changeset 52519 in webkit


Ignore:
Timestamp:
Dec 22, 2009 7:59:24 PM (14 years ago)
Author:
eric@webkit.org
Message:

2009-12-22 James Su <suzhe@chromium.org>

Reviewed by Darin Fisher.

[Chromium] Keyboard shortcut in dropdown not working.
https://bugs.webkit.org/show_bug.cgi?id=32008

Consider PlatformKeyboardEvent::Char type event as character type
event on all platforms. It fixes the "type ahead find" feature
of the popup listbox on Linux and Mac platforms.

Merge the case-sensitive type ahead find fix from
WebCore/dom/SelectElement.cpp. See
https://bugs.webkit.org/show_bug.cgi?id=29103

  • platform/chromium/PopupMenuChromium.cpp: (WebCore::isCharacterTypeEvent):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r52518 r52519  
     12009-12-22  James Su  <suzhe@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        [Chromium] Keyboard shortcut in dropdown not working.
     6        https://bugs.webkit.org/show_bug.cgi?id=32008
     7
     8        Consider PlatformKeyboardEvent::Char type event as character type
     9        event on all platforms. It fixes the "type ahead find" feature
     10        of the popup listbox on Linux and Mac platforms.
     11
     12        Merge the case-sensitive type ahead find fix from
     13        WebCore/dom/SelectElement.cpp. See
     14        https://bugs.webkit.org/show_bug.cgi?id=29103
     15
     16        * platform/chromium/PopupMenuChromium.cpp:
     17        (WebCore::isCharacterTypeEvent):
     18
    1192009-12-22  Carol Szabo  <carol.szabo@nokia.com>
    220
  • trunk/WebCore/platform/chromium/PopupMenuChromium.cpp

    r52321 r52519  
    612612{
    613613    // Check whether the event is a character-typed event or not.
    614     // In Windows, PlatformKeyboardEvent::Char (not RawKeyDown) type event
    615     // is considered as character type event. In Mac OS, KeyDown (not
    616     // KeyUp) is considered as character type event.
    617 #if PLATFORM(WIN_OS)
    618     if (event.type() == PlatformKeyboardEvent::Char)
    619         return true;
    620 #else
    621     if (event.type() == PlatformKeyboardEvent::KeyDown)
    622         return true;
    623 #endif
    624     return false;
     614    // We use RawKeyDown/Char/KeyUp event scheme on all platforms,
     615    // so PlatformKeyboardEvent::Char (not RawKeyDown) type event
     616    // is considered as character type event.
     617    return event.type() == PlatformKeyboardEvent::Char;
    625618}
    626619
     
    746739    }
    747740
     741    // Compute a case-folded copy of the prefix string before beginning the search for
     742    // a matching element. This code uses foldCase to work around the fact that
     743    // String::startWith does not fold non-ASCII characters. This code can be changed
     744    // to use startWith once that is fixed.
     745    String prefixWithCaseFolded(prefix.foldCase());
    748746    int itemCount = numItems();
    749747    int index = (max(0, m_selectedIndex) + searchStartOffset) % itemCount;
     
    752750            continue;
    753751
    754         if (stripLeadingWhiteSpace(m_items[index]->label).startsWith(prefix, false)) {
     752        if (stripLeadingWhiteSpace(m_items[index]->label).foldCase().startsWith(prefixWithCaseFolded)) {
    755753            selectIndex(index);
    756754            return;
Note: See TracChangeset for help on using the changeset viewer.