<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 - REGRESSION (Safari 10-Safari Technology Preview 15): Crash when pressing Caps Lock if “Use the Caps Lock key to switch to and from U.S.” is selected in Input Sources preferences"
   href="https://bugs.webkit.org/show_bug.cgi?id=163506">163506</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>REGRESSION (Safari 10-Safari Technology Preview 15): Crash when pressing Caps Lock if “Use the Caps Lock key to switch to and from U.S.” is selected in Input Sources preferences
          </td>
        </tr>

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

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

        <tr>
          <th>Version</th>
          <td>Safari Technology Preview
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>macOS 10.12
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>Blocker
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Event Handling
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>mitz&#64;webkit.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>&lt;rdar://problem/28792483&gt;

To reproduce:
1. In System Preferences &gt; Keyboard &gt; Input Sources, select “Use the Caps Lock key to switch to and from U.S.”
2. In Safari or in MiniBrowser, focus the webpage and press the Caps Lock key

Result:
An Objective-C exception (Invalid message sent to event &quot;NSEvent: type=FlagsChanged loc=(-307.102,1057.25) time=1336829.1 flags=0x100 win=0x6080001e0900 winNum=34673 ctxt=0x0 keyCode=255&quot;) is raised:

#0    0x00007fffcbd1dc7d in objc_exception_throw ()
#1    0x00007fffb764a232 in +[NSException raise:format:arguments:] ()
#2    0x00007fffb907d390 in -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] ()
#3    0x00007fffb53e678c in -[NSEvent characters] ()
#4    0x0000000108f8480a in WebCore::keyForKeyEvent(NSEvent*) at Source/WebCore/platform/mac/PlatformEventFactoryMac.mm:277
#5    0x0000000100730fac in WebKit::WebEventFactory::createWebKeyboardEvent(NSEvent*, bool, bool, WTF::Vector&lt;WebCore::KeypressCommand, 0ul, WTF::CrashOnOverflow, 16ul&gt; const&amp;) at Source/WebKit2/Shared/mac/WebEventFactory.mm:481
#6    0x00000001002b0458 in WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent(NSEvent*, bool, bool, WTF::Vector&lt;WebCore::KeypressCommand, 0ul, WTF::CrashOnOverflow, 16ul&gt; const&amp;) at Source/WebKit2/Shared/mac/NativeWebKeyboardEventMac.mm:39
#7    0x00000001002b070b in WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent(NSEvent*, bool, bool, WTF::Vector&lt;WebCore::KeypressCommand, 0ul, WTF::CrashOnOverflow, 16ul&gt; const&amp;) at Source/WebKit2/Shared/mac/NativeWebKeyboardEventMac.mm:41
#8    0x0000000100bbd1ca in ::___ZN6WebKit11WebViewImpl12flagsChangedEP7NSEvent_block_invoke(BOOL, const WTF::Vector&lt;WebCore::KeypressCommand, 0, WTF::CrashOnOverflow, 16&gt; &amp;) at Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm:3945
#9    0x0000000100bba080 in WebKit::WebViewImpl::interpretKeyEvent(NSEvent*, void (signed char, WTF::Vector&lt;WebCore::KeypressCommand, 0ul, WTF::CrashOnOverflow, 16ul&gt; const&amp;) block_pointer) at Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm:3512
#10    0x0000000100bbd0f4 in WebKit::WebViewImpl::flagsChanged(NSEvent*) at Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm:3944
#11    0x0000000100ca8016 in ::-[WKWebView flagsChanged:](NSEvent *) at Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:2699

In WebKit1 MiniBrowser windows, this is preceded by an assertion failure:

#0    0x0000000104d14e64 in ::WTFCrash() at /Projects/Safari/OpenSource/Source/WTF/wtf/Assertions.cpp:323
#1    0x0000000108f85ff6 in WebCore::keyIdentifierForKeyEvent(NSEvent*) at /Projects/Safari/OpenSource/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm:529
#2    0x0000000108f87b6c in WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder(NSEvent*) at /Projects/Safari/OpenSource/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm:839
#3    0x0000000108f8666d in WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder(NSEvent*) at /Projects/Safari/OpenSource/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm:830
#4    0x0000000108f86600 in WebCore::PlatformEventFactory::createPlatformKeyboardEvent(NSEvent*) at /Projects/Safari/OpenSource/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm:875
#5    0x0000000103228174 in ::-[WebHTMLView flagsChanged:](NSEvent *) at /Projects/Safari/OpenSource/Source/WebKit/mac/WebView/WebHTMLView.mm:5300</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>