Changeset 23813 in webkit


Ignore:
Timestamp:
Jun 27, 2007 1:19:53 AM (17 years ago)
Author:
oliver
Message:

Reviewed by Maciej.

Hopefully fix remainder of the IME issues on Mac.
We now assume that the IME silently consumes any event given
to it during text composition, and only override this assumption
if the NSTextInput or NSResponder callbacks are made.

This prevents us from treating those events that the IME has
consumed internally (eg. candidate window navigation) as unhandled
events that should be bubbled.

This fixes:

<rdar://problem/5107538> Major problems handling key press event with non-english Input Methods
<rdar://problem/4196249> REGRESSION: Mail: Inputting space (U+0020) with IM deletes subsequent line breaks on Mail.app
<rdar://problem/5015544> REGRESSION: Reverse conversion keyboard command does not work in Safari.
<rdar://problem/5045121> REGRESSION: Inline is confirmed after press left/right arrow keys, happens in Mail but not in TextEdit.
<rdar://problem/5076807> REGRESSION: Can't undo conversion of inline text (by hitting ESC)
<rdar://problem/5085781> REGRESSION: Active input area lost "selected" highlight
<rdar://problem/5094200> space key pressed to close the associated words candidate window gets inserted as text
<rdar://problem/5228294> Candidate item for character matrix is sometimes skipped

  • WebKit.xcodeproj/project.pbxproj:
  • WebView/WebHTMLView.mm: (-[WebHTMLView launchKeyEvent:]): (-[WebHTMLView keyDown:]): (-[WebHTMLView keyUp:]): (-[WebHTMLView _interceptEditingKeyEvent:shouldSaveCommand:]): (-[WebHTMLView unmarkText]): (-[WebHTMLView setMarkedText:selectedRange:]): (-[WebHTMLView doCommandBySelector:]): (-[WebHTMLView insertText:]):
Location:
trunk/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/ChangeLog

    r23805 r23813  
     12007-06-26  Oliver Hunt  <oliver@apple.com>
     2
     3        Reviewed by Maciej.
     4
     5        Hopefully fix remainder of the IME issues on Mac. 
     6        We now assume that the IME silently consumes any event given
     7        to it during text composition, and only override this assumption
     8        if the NSTextInput or NSResponder callbacks are made.
     9
     10        This prevents us from treating those events that the IME has
     11        consumed internally (eg. candidate window navigation) as unhandled
     12        events that should be bubbled.
     13
     14        This fixes:
     15          <rdar://problem/5107538> Major problems handling key press event with non-english Input Methods
     16          <rdar://problem/4196249> REGRESSION: Mail: Inputting space (U+0020) with IM deletes subsequent line breaks on Mail.app
     17          <rdar://problem/5015544> REGRESSION: Reverse conversion keyboard command does not work in Safari.
     18          <rdar://problem/5045121> REGRESSION: Inline is confirmed after press left/right arrow keys, happens in Mail but not in TextEdit.
     19          <rdar://problem/5076807> REGRESSION: Can't undo conversion of inline text (by hitting ESC)
     20          <rdar://problem/5085781> REGRESSION: Active input area lost "selected" highlight
     21          <rdar://problem/5094200> space key pressed to close the associated words candidate window gets inserted as text
     22          <rdar://problem/5228294> Candidate item for character matrix is sometimes skipped
     23
     24        * WebKit.xcodeproj/project.pbxproj:
     25        * WebView/WebHTMLView.mm:
     26        (-[WebHTMLView launchKeyEvent:]):
     27        (-[WebHTMLView keyDown:]):
     28        (-[WebHTMLView keyUp:]):
     29        (-[WebHTMLView _interceptEditingKeyEvent:shouldSaveCommand:]):
     30        (-[WebHTMLView unmarkText]):
     31        (-[WebHTMLView setMarkedText:selectedRange:]):
     32        (-[WebHTMLView doCommandBySelector:]):
     33        (-[WebHTMLView insertText:]):
     34
    1352007-06-26  Jim Correia  <jim.correia@pobox.com>
    236
  • trunk/WebKit/WebKit.xcodeproj/project.pbxproj

    r23754 r23813  
    13311331                        productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
    13321332                        projectDirPath = "";
    1333                         projectRoot = "";
    13341333                        targets = (
    13351334                                9398100A0824BF01008DF038 /* WebKit */,
  • trunk/WebKit/WebView/WebHTMLView.mm

    r23774 r23813  
    302302    BOOL eventWasHandled;
    303303    BOOL shouldSaveCommand;
     304    // The Input Method may consume an event and not tell us, in
     305    // which case we should not bubble the event up the DOM
     306    BOOL consumedByIM;
    304307};
    305308
     
    32723275- (void)keyDown:(NSEvent *)event
    32733276{
     3277    RetainPtr<WebHTMLView> selfProtector = self;
    32743278    BOOL eventWasSentToWebCore = (_private->keyDownEvent == event);
    3275 
    3276     [self retain];
    32773279
    32783280    BOOL callSuper = NO;
     
    32953297    else
    32963298        [NSCursor setHiddenUntilMouseMoves:YES];
    3297 
    3298     [self release];
    32993299}
    33003300
     
    51375137    parameters.eventWasHandled = false;
    51385138    parameters.shouldSaveCommand = shouldSave;
     5139    // If we're performing input composition assume that the IM has consumed the event,
     5140    // and only change this assumption in one of the NSTextInput/Responder callbacks is used.
     5141    parameters.consumedByIM = [self hasMarkedText];
    51395142       
    51405143    if (const PlatformKeyboardEvent* platformEvent = event->keyEvent()) {
     
    51605163        _private->interpretKeyEventsParameters = 0;
    51615164    }
    5162     return parameters.eventWasHandled;
     5165    return parameters.eventWasHandled || parameters.consumedByIM;
    51635166}
    51645167
     
    53085311    _private->interpretKeyEventsParameters = 0;
    53095312
    5310     if (parameters)
     5313    if (parameters) {
    53115314        parameters->eventWasHandled = YES;
    5312 
     5315        parameters->consumedByIM = NO;
     5316    }
     5317   
    53135318    if (Frame* coreFrame = core([self _frame]))
    53145319        coreFrame->editor()->unmarkText();
     
    53615366    _private->interpretKeyEventsParameters = 0;
    53625367
    5363     if (parameters)
     5368    if (parameters) {
    53645369        parameters->eventWasHandled = YES;
    5365 
     5370        parameters->consumedByIM = NO;
     5371    }
     5372   
    53665373    Frame* coreFrame = core([self _frame]);
    53675374    if (!coreFrame)
     
    54095416- (void)doCommandBySelector:(SEL)selector
    54105417{
    5411     if (selector == @selector(noop:))
    5412         return;
    5413 
    54145418    // Use pointer to get parameters passed to us by the caller of interpretKeyEvents.
    54155419    // The same call to interpretKeyEvents can do more than one command.
    54165420    WebHTMLViewInterpretKeyEventsParameters* parameters = _private->interpretKeyEventsParameters;
     5421    if (parameters)
     5422        parameters->consumedByIM = NO;
     5423
     5424    if (selector == @selector(noop:))
     5425        return;
    54175426
    54185427    KeyboardEvent* event = parameters ? parameters->event : 0;
     
    54615470    WebHTMLViewInterpretKeyEventsParameters* parameters = _private->interpretKeyEventsParameters;
    54625471    _private->interpretKeyEventsParameters = 0;
     5472    if (parameters)
     5473        parameters->consumedByIM = NO;
    54635474
    54645475    // We don't support inserting an attributed string but input methods don't appear to require this.
Note: See TracChangeset for help on using the changeset viewer.