[Webkit-unassigned] [Bug 158323] New: Fix typo in -[WebDefaultUIKitDelegate deleteFromInputwithFlags:]

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 2 15:50:06 PDT 2016


            Bug ID: 158323
           Summary: Fix typo in -[WebDefaultUIKitDelegate
    Classification: Unclassified
           Product: WebKit
           Version: Other
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit Misc.
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: ddkilzer at webkit.org
                CC: enrica at apple.com

In Source/WebKit/ios/DefaultDelegates/WebDefaultUIKitDelegate.m, this method is defined as:

- (void)deleteFromInputwithFlags:(NSUInteger)flags

However, in Source/WebKit/ios/WebView/WebUIKitDelegate.h, it's defined in a category (not a protocol) as:

- (void)deleteFromInputWithFlags:(NSUInteger)flags;

This causes problems in Source/WebKit/mac/WebView/WebHTMLView.mm in -_handleEditingKeyEvent: where we use -_UIKitDelegateForwarder to forward the method:

        switch ([s characterAtIndex:0]) {
        case kWebBackspaceKey:
        case kWebDeleteKey:
            [[webView _UIKitDelegateForwarder] deleteFromInputWithFlags:event.keyboardFlags];
            return YES;

This was recently changed for Bug 157689 in r200979 from this:

        switch ([s characterAtIndex:0]) {
        case kWebBackspaceKey:
        case kWebDeleteKey:
            // FIXME: remove the call to deleteFromInput when UIKit implements deleteFromInputWithFlags.
            if ([webView respondsToSelector:@selector(deleteFromInputWithFlags:)])
                [[webView _UIKitDelegateForwarder] deleteFromInputWithFlags:event.keyboardFlags];
                [[webView _UIKitDelegateForwarder] deleteFromInput];
            return YES;

Finally, since the _UIKitDelegateForwarded always uses the WebDefaultUIKitDelegate to check whether the method exists, -[_WebSafeForwarder methodSignatureForSelector:] in Source/WebKit/mac/WebView/WebView.mm would return NO, which results in the NSException being thrown, leading to the crash:

- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector
    return [defaultTarget methodSignatureForSelector:aSelector];

The fix is trivial--fix the typo in WebDefaultUIKitDelegate.m.

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160602/0dbb8cb5/attachment-0001.html>

More information about the webkit-unassigned mailing list