<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Fix typo in -[WebDefaultUIKitDelegate deleteFromInputwithFlags:]"
   href="https://bugs.webkit.org/show_bug.cgi?id=158323">158323</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Fix typo in -[WebDefaultUIKitDelegate deleteFromInputwithFlags:]
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>WebKit Misc.
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ddkilzer&#64;webkit.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>enrica&#64;apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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 <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Remove unused initializer for WebEvent on iOS"
   href="show_bug.cgi?id=157689">Bug 157689</a> 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:&#64;selector(deleteFromInputWithFlags:)])
                [[webView _UIKitDelegateForwarder] deleteFromInputWithFlags:event.keyboardFlags];
            else
                [[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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>