Changeset 19790 in webkit


Ignore:
Timestamp:
Feb 22, 2007 7:45:40 AM (17 years ago)
Author:
weinig
Message:

Reviewed by Maciej.

This patch also fixes a bug where using the arrow keys while
the suggestion popup is open moves the caret instead of changing the
selection in the popup (for up/down) or accepting the selection and
closing the popup (for left/right).

  • WebView/WebHTMLView.mm: (-[WebHTMLView keyDown:]): Changed to close the popup only if it was open before the current event, so that the Option-Esc that opens the popup will not close it immediately. (-[WebHTMLView _interceptEditingKeyEvent:]): Give the completion popup a chance to intercept keydown events. (-[WebTextCompleteController popupWindowIsOpen]): Added. Returns whether the suggestion popup is open.
Location:
trunk/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/ChangeLog

    r19789 r19790  
     12007-02-22  Mitz Pettel  <mitz@webkit.org>
     2
     3        Reviewed by Maciej.
     4
     5        - fix http://bugs.webkit.org/show_bug.cgi?id=12804
     6          REGRESSION (r19043-r19063): suggestion popup doesn't work after pressing Option+Esc
     7
     8        This patch also fixes a bug where using the arrow keys while
     9        the suggestion popup is open moves the caret instead of changing the
     10        selection in the popup (for up/down) or accepting the selection and
     11        closing the popup (for left/right).
     12
     13        * WebView/WebHTMLView.mm:
     14        (-[WebHTMLView keyDown:]): Changed to close the popup only if it was open
     15        before the current event, so that the Option-Esc that opens the popup will
     16        not close it immediately.
     17        (-[WebHTMLView _interceptEditingKeyEvent:]): Give the completion popup a
     18        chance to intercept keydown events.
     19        (-[WebTextCompleteController popupWindowIsOpen]): Added. Returns whether the
     20        suggestion popup is open.
     21
    1222007-02-22  Mitz Pettel  <mitz@webkit.org>
    223
  • trunk/WebKit/WebView/WebHTMLView.mm

    r19789 r19790  
    270270- (void)doCompletion;
    271271- (void)endRevertingChange:(BOOL)revertChange moveLeft:(BOOL)goLeft;
     272- (BOOL)popupWindowIsOpen;
    272273- (BOOL)filterKeyDown:(NSEvent *)event;
    273274- (void)_reflectSelection;
     
    33833384    _private->keyDownEvent = [event retain];
    33843385
     3386    BOOL completionPopupWasOpen = _private->compController && [_private->compController popupWindowIsOpen];
    33853387    if (!eventWasSentToWebCore && core([self _frame])->eventHandler()->keyEvent(event)) {
    3386         // WebCore processed a key event, bail on any outstanding complete: UI
    3387         [_private->compController endRevertingChange:YES moveLeft:NO];
    3388     } else if (_private->compController && [_private->compController filterKeyDown:event]) {
    3389         // Consumed by complete: popup window
    3390     } else {
     3388        // WebCore processed a key event, bail on any preexisting complete: UI
     3389        if (completionPopupWasOpen)
     3390            [_private->compController endRevertingChange:YES moveLeft:NO];
     3391    } else if (!_private->compController || ![_private->compController filterKeyDown:event]) {
     3392        // Not consumed by complete: popup window
    33913393        [_private->compController endRevertingChange:YES moveLeft:NO];
    33923394        callSuper = YES;
     
    52325234    parameters.eventWasHandled = false;
    52335235    if (const PlatformKeyboardEvent* platformEvent = event->keyEvent()) {
     5236        NSEvent *macEvent = platformEvent->macEvent();
     5237        if ([macEvent type] == NSKeyDown && [_private->compController filterKeyDown:macEvent])
     5238            return true;
    52345239        parameters.event = event;
    52355240        _private->interpretKeyEventsParameters = &parameters;
    5236         [self interpretKeyEvents:[NSArray arrayWithObject:platformEvent->macEvent()]];
     5241        [self interpretKeyEvents:[NSArray arrayWithObject:macEvent]];
    52375242        _private->interpretKeyEventsParameters = 0;
    52385243    }
     
    57665771    }
    57675772    // else there is no state to abort if the window was not up
     5773}
     5774
     5775- (BOOL)popupWindowIsOpen
     5776{
     5777    return _popupWindow != nil;
    57685778}
    57695779
Note: See TracChangeset for help on using the changeset viewer.