Changeset 83697 in webkit


Ignore:
Timestamp:
Apr 12, 2011 9:35:33 PM (13 years ago)
Author:
ap@apple.com
Message:

2011-04-12 Alexey Proskuryakov <ap@apple.com>

Reviewed by Oliver Hunt.

REGRESSION (WebKit2): Input methods are active in non-editable content
https://bugs.webkit.org/show_bug.cgi?id=58404
<rdar://problem/9275940>

  • UIProcess/API/mac/WKView.mm: (-[WKView insertText:]): Re-add the old variant of this function, because it's not only part of deprecated NSTextInput protocol, but it's also part of NSResponder, and it's called when the input context in nil. (-[WKView inputContext]): Return nil when not in editable content.
Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r83687 r83697  
     12011-04-12  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        REGRESSION (WebKit2): Input methods are active in non-editable content
     6        https://bugs.webkit.org/show_bug.cgi?id=58404
     7        <rdar://problem/9275940>
     8
     9        * UIProcess/API/mac/WKView.mm:
     10        (-[WKView insertText:]): Re-add the old variant of this function, because it's not only part
     11        of deprecated NSTextInput protocol, but it's also part of NSResponder, and it's called when
     12        the input context in nil.
     13        (-[WKView inputContext]): Return nil when not in editable content.
     14
    1152011-04-12  Brady Eidson  <beidson@apple.com>
    216
  • trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm

    r83665 r83697  
    10711071}
    10721072
     1073- (void)insertText:(id)string
     1074{
     1075    // Unlike and NSTextInputClient variant with replacementRange, this NSResponder method is called when there is no input context,
     1076    // so text input processing isn't performed. We are not going to actually insert any text in that case, but saving an insertText
     1077    // command ensures that a keypress event is dispatched as appropriate.
     1078    [self insertText:string replacementRange:NSMakeRange(NSNotFound, 0)];
     1079}
     1080
    10731081- (void)insertText:(id)string replacementRange:(NSRange)replacementRange
    10741082{
     
    12331241- (NSTextInputContext *)inputContext
    12341242{
    1235     if (_data->_pluginComplexTextInputIdentifier && !_data->_interpretKeyEventsParameters)
     1243    WKViewInterpretKeyEventsParameters* parameters = _data->_interpretKeyEventsParameters;
     1244
     1245    if (_data->_pluginComplexTextInputIdentifier && !parameters)
    12361246        return [[WKTextInputWindowController sharedTextInputWindowController] inputContext];
     1247
     1248    // Disable text input machinery when in non-editable content. An invisible inline input area affects performance, and can prevent Expose from working.
     1249    if (parameters && !parameters->cachedTextInputState.selectionIsEditable)
     1250        return nil;
     1251    if (!_data->_page->selectionState().isContentEditable)
     1252        return nil;
    12371253
    12381254    return [super inputContext];
Note: See TracChangeset for help on using the changeset viewer.