Changeset 51832 in webkit


Ignore:
Timestamp:
Dec 7, 2009 8:55:46 PM (14 years ago)
Author:
eric@webkit.org
Message:

2009-12-07 Zhe Su <suzhe@chromium.org>

Reviewed by Darin Fisher.

[Chromium] accesskey is not supported on Chromium Mac.
https://bugs.webkit.org/show_bug.cgi?id=32213

This change fixes (partially) the accesskey issue by decoupling the
code for handling accesskeys and system keys. Because on Mac,
the modifiers of accesskeys are ctrl+alt, which are not marked as
system keys.
In order to fully fix this issue, some changes in Chromium code is
also required.

  • src/WebViewImpl.cpp: (WebKit::WebViewImpl::keyEvent): (WebKit::WebViewImpl::charEvent):
Location:
trunk/WebKit/chromium
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/chromium/ChangeLog

    r51827 r51832  
     12009-12-07  Zhe Su  <suzhe@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        [Chromium] accesskey is not supported on Chromium Mac.
     6        https://bugs.webkit.org/show_bug.cgi?id=32213
     7
     8        This change fixes (partially) the accesskey issue by decoupling the
     9        code for handling accesskeys and system keys. Because on Mac,
     10        the modifiers of accesskeys are ctrl+alt, which are not marked as
     11        system keys.
     12        In order to fully fix this issue, some changes in Chromium code is
     13        also required.
     14
     15        * src/WebViewImpl.cpp:
     16        (WebKit::WebViewImpl::keyEvent):
     17        (WebKit::WebViewImpl::charEvent):
     18
    1192009-12-07  Evan Martin  <evan@chromium.org>
    220
  • trunk/WebKit/chromium/src/WebViewImpl.cpp

    r51827 r51832  
    465465
    466466    if (handler->keyEvent(evt)) {
    467         if (WebInputEvent::RawKeyDown == event.type && !evt.isSystemKey())
     467        if (WebInputEvent::RawKeyDown == event.type)
    468468            m_suppressNextKeypressEvent = true;
    469469        return true;
     
    530530    // keyPress(char) event and a keyUp event. We reset this flag here as it
    531531    // only applies to the current keyPress event.
    532     if (m_suppressNextKeypressEvent) {
    533         m_suppressNextKeypressEvent = false;
    534         return true;
    535     }
     532    bool suppress = m_suppressNextKeypressEvent;
     533    m_suppressNextKeypressEvent = false;
    536534
    537535    Frame* frame = focusedWebCoreFrame();
    538536    if (!frame)
    539         return false;
     537        return suppress;
    540538
    541539    EventHandler* handler = frame->eventHandler();
    542540    if (!handler)
    543         return keyEventDefault(event);
     541        return suppress || keyEventDefault(event);
    544542
    545543    PlatformKeyboardEventBuilder evt(event);
    546544    if (!evt.isCharacterKey())
     545        return true;
     546
     547    // Accesskeys are triggered by char events and can't be suppressed.
     548    if (handler->handleAccessKey(evt))
    547549        return true;
    548550
     
    552554    // events.
    553555    if (evt.isSystemKey())
    554         return handler->handleAccessKey(evt);
    555 
    556     if (!handler->keyEvent(evt))
     556        return false;
     557
     558    if (!suppress && !handler->keyEvent(evt))
    557559        return keyEventDefault(event);
    558560
Note: See TracChangeset for help on using the changeset viewer.