<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[206750] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/206750">206750</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-10-03 14:32:47 -0700 (Mon, 03 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add support for KeyboardEvent.key attribute
https://bugs.webkit.org/show_bug.cgi?id=36267

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline because that the tests are failing differently now that we support
the key attribute on KeyboardEvent but are still missing other standard API
on this interface.

* web-platform-tests/dom/events/Event-init-while-dispatching-expected.txt:
* web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt:

Source/WebCore:

Add support for KeyboardEvent.key attribute:
- https://w3c.github.io/uievents/#dom-keyboardevent-key

This is behind a compile time flag that is only enabled on Mac and
iOS and the implementation is still missing for other platforms.

Test: fast/events/keyboardevent-key.html

* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
* platform/PlatformKeyboardEvent.h:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
(WebCore::PlatformKeyboardEvent::key):
* platform/cocoa/KeyEventCocoa.h:
* platform/cocoa/KeyEventCocoa.mm:
(WebCore::keyForCharCode):
* platform/ios/PlatformEventFactoryIOS.h:
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::keyForKeyEvent):
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
* platform/mac/PlatformEventFactoryMac.h:
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::keyForKeyEvent):
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
(WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder): Deleted.
* replay/SerializationMethods.cpp:
(JSC::EncodingTraits&lt;PlatformKeyboardEvent&gt;::encodeValue):
(JSC::EncodingTraits&lt;PlatformKeyboardEvent&gt;::decodeValue):

Source/WebKit2:

Add support for KeyboardEvent.key attribute.

* Shared/WebEvent.h:
(WebKit::WebKeyboardEvent::key):
(WebKit::WebKeyboardEvent::unmodifiedText): Deleted.
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
* Shared/WebKeyboardEvent.cpp:
(WebKit::WebKeyboardEvent::WebKeyboardEvent):
(WebKit::WebKeyboardEvent::encode):
(WebKit::WebKeyboardEvent::decode):
* Shared/mac/WebEventFactory.mm:
(WebKit::WebEventFactory::createWebKeyboardEvent):

Source/WTF:

Add compile time flag for the key attribute on KeyboardEvent and enable
it on Cocoa only.

* wtf/FeatureDefines.h:

LayoutTests:

Extend layout test coverage.

* fast/events/constructors/keyboard-event-constructor-expected.txt:
* fast/events/constructors/keyboard-event-constructor.html:
* fast/events/key-events-in-input-button-expected.txt:
* fast/events/key-events-in-input-button.html:
* fast/events/key-events-in-input-text-expected.txt:
* fast/events/key-events-in-input-text.html:
* fast/events/keyboardevent-key-expected.txt: Added.
* fast/events/keyboardevent-key.html: Added.
* fast/events/special-key-events-in-input-text-expected.txt:
* fast/events/special-key-events-in-input-text.html:
* platform/ios-simulator/TestExpectations:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfasteventsconstructorskeyboardeventconstructorexpectedtxt">trunk/LayoutTests/fast/events/constructors/keyboard-event-constructor-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventsconstructorskeyboardeventconstructorhtml">trunk/LayoutTests/fast/events/constructors/keyboard-event-constructor.html</a></li>
<li><a href="#trunkLayoutTestsfasteventskeyeventsininputbuttonexpectedtxt">trunk/LayoutTests/fast/events/key-events-in-input-button-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventskeyeventsininputbuttonhtml">trunk/LayoutTests/fast/events/key-events-in-input-button.html</a></li>
<li><a href="#trunkLayoutTestsfasteventskeyeventsininputtextexpectedtxt">trunk/LayoutTests/fast/events/key-events-in-input-text-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventskeyeventsininputtexthtml">trunk/LayoutTests/fast/events/key-events-in-input-text.html</a></li>
<li><a href="#trunkLayoutTestsfasteventsspecialkeyeventsininputtextexpectedtxt">trunk/LayoutTests/fast/events/special-key-events-in-input-text-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventsspecialkeyeventsininputtexthtml">trunk/LayoutTests/fast/events/special-key-events-in-input-text.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsdomeventsEventinitwhiledispatchingexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-init-while-dispatching-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsdomeventsEventsubclassesconstructorsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorTestExpectations">trunk/LayoutTests/platform/ios-simulator/TestExpectations</a></li>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfFeatureDefinesh">trunk/Source/WTF/wtf/FeatureDefines.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomKeyboardEventcpp">trunk/Source/WebCore/dom/KeyboardEvent.cpp</a></li>
<li><a href="#trunkSourceWebCoredomKeyboardEventh">trunk/Source/WebCore/dom/KeyboardEvent.h</a></li>
<li><a href="#trunkSourceWebCoredomKeyboardEventidl">trunk/Source/WebCore/dom/KeyboardEvent.idl</a></li>
<li><a href="#trunkSourceWebCoreplatformPlatformKeyboardEventh">trunk/Source/WebCore/platform/PlatformKeyboardEvent.h</a></li>
<li><a href="#trunkSourceWebCoreplatformcocoaKeyEventCocoah">trunk/Source/WebCore/platform/cocoa/KeyEventCocoa.h</a></li>
<li><a href="#trunkSourceWebCoreplatformcocoaKeyEventCocoamm">trunk/Source/WebCore/platform/cocoa/KeyEventCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosPlatformEventFactoryIOSh">trunk/Source/WebCore/platform/ios/PlatformEventFactoryIOS.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosPlatformEventFactoryIOSmm">trunk/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacPlatformEventFactoryMach">trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacPlatformEventFactoryMacmm">trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm</a></li>
<li><a href="#trunkSourceWebCorereplaySerializationMethodscpp">trunk/Source/WebCore/replay/SerializationMethods.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebEventh">trunk/Source/WebKit2/Shared/WebEvent.h</a></li>
<li><a href="#trunkSourceWebKit2SharedWebEventConversioncpp">trunk/Source/WebKit2/Shared/WebEventConversion.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedWebKeyboardEventcpp">trunk/Source/WebKit2/Shared/WebKeyboardEvent.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedmacWebEventFactorymm">trunk/Source/WebKit2/Shared/mac/WebEventFactory.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfasteventskeyboardeventkeyexpectedtxt">trunk/LayoutTests/fast/events/keyboardevent-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventskeyboardeventkeyhtml">trunk/LayoutTests/fast/events/keyboardevent-key.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/LayoutTests/ChangeLog        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -1,3 +1,45 @@
</span><ins>+2016-10-03  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Add support for KeyboardEvent.key attribute
+        https://bugs.webkit.org/show_bug.cgi?id=36267
+
+        Reviewed by Darin Adler.
+
+        Extend layout test coverage.
+
+        * fast/events/constructors/keyboard-event-constructor-expected.txt:
+        * fast/events/constructors/keyboard-event-constructor.html:
+        * fast/events/key-events-in-input-button-expected.txt:
+        * fast/events/key-events-in-input-button.html:
+        * fast/events/key-events-in-input-text-expected.txt:
+        * fast/events/key-events-in-input-text.html:
+        * fast/events/keyboardevent-key-expected.txt: Added.
+        * fast/events/keyboardevent-key.html: Added.
+        * fast/events/special-key-events-in-input-text-expected.txt:
+        * fast/events/special-key-events-in-input-text.html:
+        * platform/ios-simulator/TestExpectations:
+
+2016-10-03  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Add support for KeyboardEvent.key attribute
+        https://bugs.webkit.org/show_bug.cgi?id=36267
+
+        Reviewed by Darin Adler.
+
+        Extend layout test coverage.
+
+        * fast/events/constructors/keyboard-event-constructor-expected.txt:
+        * fast/events/constructors/keyboard-event-constructor.html:
+        * fast/events/key-events-in-input-button-expected.txt:
+        * fast/events/key-events-in-input-button.html:
+        * fast/events/key-events-in-input-text-expected.txt:
+        * fast/events/key-events-in-input-text.html:
+        * fast/events/keyboardevent-key-expected.txt: Added.
+        * fast/events/keyboardevent-key.html: Added.
+        * fast/events/special-key-events-in-input-text-expected.txt:
+        * fast/events/special-key-events-in-input-text.html:
+        * platform/ios-simulator/TestExpectations:
+
</ins><span class="cx"> 2016-10-03  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Marking storage/indexeddb/index-cursor.html as flaky on mac-wk2.
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventsconstructorskeyboardeventconstructorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/constructors/keyboard-event-constructor-expected.txt (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/constructors/keyboard-event-constructor-expected.txt        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/LayoutTests/fast/events/constructors/keyboard-event-constructor-expected.txt        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -103,16 +103,17 @@
</span><span class="cx"> PASS new KeyboardEvent('eventType', { shiftKey: true }).shiftKey is true
</span><span class="cx"> PASS new KeyboardEvent('eventType', { metaKey: false }).metaKey is false
</span><span class="cx"> PASS new KeyboardEvent('eventType', { metaKey: true }).metaKey is true
</span><del>-PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).bubbles is true
-PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).cancelable is true
-PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).view is window
-PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).detail is 111
-PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).keyIdentifier is &quot;chocolate&quot;
-PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).location is 222
-PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).ctrlKey is true
-PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).altKey is true
-PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).shiftKey is true
-PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).metaKey is true
</del><ins>+PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).bubbles is true
+PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).cancelable is true
+PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).view is window
+PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).detail is 111
+PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).key is &quot;a&quot;
+PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).keyIdentifier is &quot;chocolate&quot;
+PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).location is 222
+PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).ctrlKey is true
+PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).altKey is true
+PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).shiftKey is true
+PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).metaKey is true
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventsconstructorskeyboardeventconstructorhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/constructors/keyboard-event-constructor.html (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/constructors/keyboard-event-constructor.html        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/LayoutTests/fast/events/constructors/keyboard-event-constructor.html        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -117,16 +117,17 @@
</span><span class="cx"> });
</span><span class="cx"> 
</span><span class="cx"> // All initializers are passed.
</span><del>-shouldBe(&quot;new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).bubbles&quot;, &quot;true&quot;);
-shouldBe(&quot;new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).cancelable&quot;, &quot;true&quot;);
-shouldBe(&quot;new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).view&quot;, &quot;window&quot;);
-shouldBe(&quot;new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).detail&quot;, &quot;111&quot;);
-shouldBeEqualToString(&quot;new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).keyIdentifier&quot;, &quot;chocolate&quot;);
-shouldBe(&quot;new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).location&quot;, &quot;222&quot;);
-shouldBe(&quot;new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).ctrlKey&quot;, &quot;true&quot;);
-shouldBe(&quot;new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).altKey&quot;, &quot;true&quot;);
-shouldBe(&quot;new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).shiftKey&quot;, &quot;true&quot;);
-shouldBe(&quot;new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).metaKey&quot;, &quot;true&quot;);
</del><ins>+shouldBe(&quot;new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).bubbles&quot;, &quot;true&quot;);
+shouldBe(&quot;new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).cancelable&quot;, &quot;true&quot;);
+shouldBe(&quot;new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).view&quot;, &quot;window&quot;);
+shouldBe(&quot;new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).detail&quot;, &quot;111&quot;);
+shouldBeEqualToString(&quot;new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).key&quot;, &quot;a&quot;);
+shouldBeEqualToString(&quot;new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).keyIdentifier&quot;, &quot;chocolate&quot;);
+shouldBe(&quot;new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).location&quot;, &quot;222&quot;);
+shouldBe(&quot;new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).ctrlKey&quot;, &quot;true&quot;);
+shouldBe(&quot;new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).altKey&quot;, &quot;true&quot;);
+shouldBe(&quot;new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).shiftKey&quot;, &quot;true&quot;);
+shouldBe(&quot;new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).metaKey&quot;, &quot;true&quot;);
</ins><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;/body&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventskeyeventsininputbuttonexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/key-events-in-input-button-expected.txt (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/key-events-in-input-button-expected.txt        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/LayoutTests/fast/events/key-events-in-input-button-expected.txt        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -1,19 +1,19 @@
</span><span class="cx"> To test manually, press keys and compare results to other browsers.
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-target - type - ctrlKey,altKey,shiftKey,metaKey - keyIdentifier - keyCode - charCode
</del><ins>+target - type - ctrlKey,altKey,shiftKey,metaKey - key - keyIdentifier - keyCode - charCode
</ins><span class="cx"> Space:
</span><del>-INPUT - keydown - false,false,false,false - U+0020 - 32 - 0
-INPUT - keypress - false,false,false,false - - 32 - 32
-INPUT - keyup - false,false,false,false - U+0020 - 32 - 0
</del><ins>+INPUT - keydown - false,false,false,false - - U+0020 - 32 - 0
+INPUT - keypress - false,false,false,false - - - 32 - 32
+INPUT - keyup - false,false,false,false - - U+0020 - 32 - 0
</ins><span class="cx"> INPUT - click
</span><span class="cx"> Enter:
</span><del>-INPUT - keydown - false,false,false,false - Enter - 13 - 0
-INPUT - keypress - false,false,false,false - - 13 - 13
</del><ins>+INPUT - keydown - false,false,false,false - Enter - Enter - 13 - 0
+INPUT - keypress - false,false,false,false - Enter - - 13 - 13
</ins><span class="cx"> INPUT - click
</span><del>-INPUT - keyup - false,false,false,false - Enter - 13 - 0
</del><ins>+INPUT - keyup - false,false,false,false - Enter - Enter - 13 - 0
</ins><span class="cx"> A:
</span><del>-INPUT - keydown - false,false,true,false - U+0041 - 65 - 0
-INPUT - keypress - false,false,true,false - - 65 - 65
-INPUT - keyup - false,false,true,false - U+0041 - 65 - 0
</del><ins>+INPUT - keydown - false,false,true,false - A - U+0041 - 65 - 0
+INPUT - keypress - false,false,true,false - A - - 65 - 65
+INPUT - keyup - false,false,true,false - A - U+0041 - 65 - 0
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventskeyeventsininputbuttonhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/key-events-in-input-button.html (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/key-events-in-input-button.html        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/LayoutTests/fast/events/key-events-in-input-button.html        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -23,6 +23,7 @@
</span><span class="cx">     else if (event.type == &quot;keydown&quot; || event.type == &quot;keypress&quot; || event.type == &quot;keyup&quot;) 
</span><span class="cx">         return (where ? &quot;(&quot; + where + &quot;) &quot; : &quot;&quot;) + target.tagName + &quot; - &quot; + event.type
</span><span class="cx">             + ' - ' + [event.ctrlKey, event.altKey, event.shiftKey, event.metaKey]
</span><ins>+            + ' - ' + event.key
</ins><span class="cx">             + ' - ' + event.keyIdentifier
</span><span class="cx">             + ' - ' + event.keyCode
</span><span class="cx">             + ' - ' + event.charCode;
</span><span class="lines">@@ -34,6 +35,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> log(&quot;target - type - &quot; + [&quot;ctrlKey&quot;, &quot;altKey&quot;, &quot;shiftKey&quot;, &quot;metaKey&quot;]
</span><ins>+        + ' - ' + &quot;key&quot;
</ins><span class="cx">         + ' - ' + &quot;keyIdentifier&quot;
</span><span class="cx">         + ' - ' + &quot;keyCode&quot;
</span><span class="cx">         + ' - ' + &quot;charCode&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventskeyeventsininputtextexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/key-events-in-input-text-expected.txt (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/key-events-in-input-text-expected.txt        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/LayoutTests/fast/events/key-events-in-input-text-expected.txt        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -1,18 +1,18 @@
</span><span class="cx"> To test manually, press keys and compare results to other browsers.
</span><span class="cx"> 
</span><span class="cx">   
</span><del>-target - type - ctrlKey,altKey,shiftKey,metaKey - keyIdentifier - keyCode - charCode
</del><ins>+target - type - ctrlKey,altKey,shiftKey,metaKey - key - keyIdentifier - keyCode - charCode
</ins><span class="cx"> Space:
</span><del>-INPUT - keydown - false,false,false,false - U+0020 - 32 - 0. Value: &quot;&quot;.
-INPUT - keypress - false,false,false,false - - 32 - 32. Value: &quot;&quot;.
</del><ins>+INPUT - keydown - false,false,false,false - - U+0020 - 32 - 0. Value: &quot;&quot;.
+INPUT - keypress - false,false,false,false - - - 32 - 32. Value: &quot;&quot;.
</ins><span class="cx"> INPUT - textInput - . Value: &quot;&quot;.
</span><del>-INPUT - keyup - false,false,false,false - U+0020 - 32 - 0. Value: &quot; &quot;.
</del><ins>+INPUT - keyup - false,false,false,false - - U+0020 - 32 - 0. Value: &quot; &quot;.
</ins><span class="cx"> Backspace:
</span><del>-INPUT - keydown - false,false,false,false - U+0008 - 8 - 0. Value: &quot; &quot;.
-INPUT - keyup - false,false,false,false - U+0008 - 8 - 0. Value: &quot;&quot;.
</del><ins>+INPUT - keydown - false,false,false,false - Backspace - U+0008 - 8 - 0. Value: &quot; &quot;.
+INPUT - keyup - false,false,false,false - Backspace - U+0008 - 8 - 0. Value: &quot;&quot;.
</ins><span class="cx"> Left Arrow:
</span><del>-INPUT - keydown - false,false,false,false - Left - 37 - 0. Value: &quot;&quot;.
-INPUT - keyup - false,false,false,false - Left - 37 - 0. Value: &quot;&quot;.
</del><ins>+INPUT - keydown - false,false,false,false - ArrowLeft - Left - 37 - 0. Value: &quot;&quot;.
+INPUT - keyup - false,false,false,false - ArrowLeft - Left - 37 - 0. Value: &quot;&quot;.
</ins><span class="cx"> Tab:
</span><del>-INPUT - keydown - false,false,false,false - U+0009 - 9 - 0. Value: &quot;&quot;.
</del><ins>+INPUT - keydown - false,false,false,false - Tab - U+0009 - 9 - 0. Value: &quot;&quot;.
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventskeyeventsininputtexthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/key-events-in-input-text.html (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/key-events-in-input-text.html        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/LayoutTests/fast/events/key-events-in-input-text.html        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx">     else if (event.type == &quot;keydown&quot; || event.type == &quot;keypress&quot; || event.type == &quot;keyup&quot;) 
</span><span class="cx">         return (where ? &quot;(&quot; + where + &quot;) &quot; : &quot;&quot;) + target.tagName + &quot; - &quot; + event.type
</span><span class="cx">             + ' - ' + [event.ctrlKey, event.altKey, event.shiftKey, event.metaKey]
</span><ins>+            + ' - ' + event.key
</ins><span class="cx">             + ' - ' + event.keyIdentifier
</span><span class="cx">             + ' - ' + event.keyCode
</span><span class="cx">             + ' - ' + event.charCode
</span><span class="lines">@@ -38,6 +39,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> log(&quot;target - type - &quot; + [&quot;ctrlKey&quot;, &quot;altKey&quot;, &quot;shiftKey&quot;, &quot;metaKey&quot;]
</span><ins>+        + ' - ' + &quot;key&quot;
</ins><span class="cx">         + ' - ' + &quot;keyIdentifier&quot;
</span><span class="cx">         + ' - ' + &quot;keyCode&quot;
</span><span class="cx">         + ' - ' + &quot;charCode&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventskeyboardeventkeyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/events/keyboardevent-key-expected.txt (0 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/keyboardevent-key-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/events/keyboardevent-key-expected.txt        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -0,0 +1,200 @@
</span><ins>+Test the key attribute on KeyboardEvent.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+
+* keydown
+PASS keyboardEvent.key is &quot; &quot;
+* keyup
+PASS keyboardEvent.key is &quot; &quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;a&quot;
+* keyup
+PASS keyboardEvent.key is &quot;a&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;Backspace&quot;
+* keyup
+PASS keyboardEvent.key is &quot;Backspace&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;Escape&quot;
+* keyup
+PASS keyboardEvent.key is &quot;Escape&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;ArrowLeft&quot;
+* keyup
+PASS keyboardEvent.key is &quot;ArrowLeft&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;ArrowRight&quot;
+* keyup
+PASS keyboardEvent.key is &quot;ArrowRight&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;ArrowUp&quot;
+* keyup
+PASS keyboardEvent.key is &quot;ArrowUp&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;ArrowDown&quot;
+* keyup
+PASS keyboardEvent.key is &quot;ArrowDown&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;PageUp&quot;
+* keyup
+PASS keyboardEvent.key is &quot;PageUp&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;PageDown&quot;
+* keyup
+PASS keyboardEvent.key is &quot;PageDown&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;Home&quot;
+* keyup
+PASS keyboardEvent.key is &quot;Home&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;End&quot;
+* keyup
+PASS keyboardEvent.key is &quot;End&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;Insert&quot;
+* keyup
+PASS keyboardEvent.key is &quot;Insert&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;Delete&quot;
+* keyup
+PASS keyboardEvent.key is &quot;Delete&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;PrintScreen&quot;
+* keyup
+PASS keyboardEvent.key is &quot;PrintScreen&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;Control&quot;
+* keyup
+PASS keyboardEvent.key is &quot;Control&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;Shift&quot;
+* keyup
+PASS keyboardEvent.key is &quot;Shift&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;Alt&quot;
+* keyup
+PASS keyboardEvent.key is &quot;Alt&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;Control&quot;
+* keyup
+PASS keyboardEvent.key is &quot;Control&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;Shift&quot;
+* keyup
+PASS keyboardEvent.key is &quot;Shift&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;Alt&quot;
+* keyup
+PASS keyboardEvent.key is &quot;Alt&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;F1&quot;
+* keyup
+PASS keyboardEvent.key is &quot;F1&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;F2&quot;
+* keyup
+PASS keyboardEvent.key is &quot;F2&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;F3&quot;
+* keyup
+PASS keyboardEvent.key is &quot;F3&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;F4&quot;
+* keyup
+PASS keyboardEvent.key is &quot;F4&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;F5&quot;
+* keyup
+PASS keyboardEvent.key is &quot;F5&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;F6&quot;
+* keyup
+PASS keyboardEvent.key is &quot;F6&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;F7&quot;
+* keyup
+PASS keyboardEvent.key is &quot;F7&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;F8&quot;
+* keyup
+PASS keyboardEvent.key is &quot;F8&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;F9&quot;
+* keyup
+PASS keyboardEvent.key is &quot;F9&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;F10&quot;
+* keyup
+PASS keyboardEvent.key is &quot;F10&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;F11&quot;
+* keyup
+PASS keyboardEvent.key is &quot;F11&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;F12&quot;
+* keyup
+PASS keyboardEvent.key is &quot;F12&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;Enter&quot;
+* keyup
+PASS keyboardEvent.key is &quot;Enter&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;A&quot;
+* keyup
+PASS keyboardEvent.key is &quot;A&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;a&quot;
+* keyup
+PASS keyboardEvent.key is &quot;a&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;a&quot;
+* keyup
+PASS keyboardEvent.key is &quot;a&quot;
+
+* keydown
+PASS keyboardEvent.key is &quot;1&quot;
+* keyup
+PASS keyboardEvent.key is &quot;1&quot;
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfasteventskeyboardeventkeyhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/events/keyboardevent-key.html (0 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/keyboardevent-key.html                                (rev 0)
+++ trunk/LayoutTests/fast/events/keyboardevent-key.html        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;input type=&quot;text&quot; id=&quot;testInput&quot;&gt;
+&lt;script&gt;
+description(&quot;Test the key attribute on KeyboardEvent.&quot;);
+
+var expectedKey;
+
+function testEvent(event)
+{
+    keyboardEvent = event;
+    debug(&quot;* &quot; + event.type);
+    shouldBeEqualToString(&quot;keyboardEvent.key&quot;, &quot;&quot; + expectedKey);
+}
+
+var input = document.getElementById(&quot;testInput&quot;);
+input.onkeydown = testEvent;
+input.onkeyup = testEvent;
+input.focus();
+
+function sendKeyAndTest(key, modifiers, expected)
+{
+    debug(&quot;&quot;);
+    expectedKey = expected;
+    eventSender.keyDown(key, []);
+}
+
+sendKeyAndTest(&quot; &quot;, [], &quot; &quot;);
+sendKeyAndTest(&quot;a&quot;, [], &quot;a&quot;);
+sendKeyAndTest(&quot;\x08&quot;, [], &quot;Backspace&quot;);
+sendKeyAndTest(&quot;\x1B&quot;, [], &quot;Escape&quot;);
+sendKeyAndTest(&quot;leftArrow&quot;, [], &quot;ArrowLeft&quot;);
+sendKeyAndTest(&quot;rightArrow&quot;, [], &quot;ArrowRight&quot;);
+sendKeyAndTest(&quot;upArrow&quot;, [], &quot;ArrowUp&quot;);
+sendKeyAndTest(&quot;downArrow&quot;, [], &quot;ArrowDown&quot;);
+sendKeyAndTest(&quot;pageUp&quot;, [], &quot;PageUp&quot;);
+sendKeyAndTest(&quot;pageDown&quot;, [], &quot;PageDown&quot;);
+sendKeyAndTest(&quot;home&quot;, [], &quot;Home&quot;);
+sendKeyAndTest(&quot;end&quot;, [], &quot;End&quot;);
+sendKeyAndTest(&quot;insert&quot;, [], &quot;Insert&quot;);
+sendKeyAndTest(&quot;delete&quot;, [], &quot;Delete&quot;);
+sendKeyAndTest(&quot;printScreen&quot;, [], &quot;PrintScreen&quot;);
+sendKeyAndTest(&quot;leftControl&quot;, [&quot;ctrlKey&quot;], &quot;Control&quot;);
+sendKeyAndTest(&quot;leftShift&quot;, [&quot;shiftKey&quot;], &quot;Shift&quot;);
+sendKeyAndTest(&quot;leftAlt&quot;, [&quot;altKey&quot;], &quot;Alt&quot;);
+sendKeyAndTest(&quot;rightControl&quot;, [&quot;ctrlKey&quot;], &quot;Control&quot;);
+sendKeyAndTest(&quot;rightShift&quot;, [&quot;shiftKey&quot;], &quot;Shift&quot;);
+sendKeyAndTest(&quot;rightAlt&quot;, [&quot;altKey&quot;], &quot;Alt&quot;);
+for (var i = 1; i &lt;= 12; i++)
+    sendKeyAndTest(&quot;F&quot; + i, [], &quot;F&quot; + i);
+sendKeyAndTest(&quot;\n&quot;, [], &quot;Enter&quot;);
+sendKeyAndTest(&quot;A&quot;, [], &quot;A&quot;);
+sendKeyAndTest(&quot;a&quot;, [&quot;ctrlKey&quot;], &quot;a&quot;);
+sendKeyAndTest(&quot;a&quot;, [&quot;metaKey&quot;], &quot;a&quot;);
+sendKeyAndTest(&quot;1&quot;, ['altKey'], &quot;1&quot;);
+
+debug(&quot;&quot;);
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfasteventsspecialkeyeventsininputtextexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/special-key-events-in-input-text-expected.txt (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/special-key-events-in-input-text-expected.txt        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/LayoutTests/fast/events/special-key-events-in-input-text-expected.txt        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -1,49 +1,49 @@
</span><span class="cx"> This test verifies that the correct sequence of keyboard events is generated for a keypress for certain special keys. To test manually, press keys and compare results to other browsers.
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-target - type - ctrlKey,altKey,shiftKey,metaKey - keyIdentifier - keyCode - charCode
</del><ins>+target - type - ctrlKey,altKey,shiftKey,metaKey - key - keyIdentifier - keyCode - charCode
</ins><span class="cx"> 
</span><span class="cx"> Ampersand:
</span><del>-INPUT - keydown - false,false,true,false - U+0037 - 55 - 0. Value: &quot;&quot;.
-INPUT - keypress - false,false,true,false - - 55 - 55. Value: &quot;&quot;.
</del><ins>+INPUT - keydown - false,false,true,false - 7 - U+0037 - 55 - 0. Value: &quot;&quot;.
+INPUT - keypress - false,false,true,false - 7 - - 55 - 55. Value: &quot;&quot;.
</ins><span class="cx"> INPUT - textInput - 7. Value: &quot;&quot;.
</span><del>-INPUT - keyup - false,false,true,false - U+0037 - 55 - 0. Value: &quot;7&quot;.
</del><ins>+INPUT - keyup - false,false,true,false - 7 - U+0037 - 55 - 0. Value: &quot;7&quot;.
</ins><span class="cx"> 
</span><span class="cx"> Backspace:
</span><del>-INPUT - keydown - false,false,false,false - U+0008 - 8 - 0. Value: &quot;7&quot;.
-INPUT - keyup - false,false,false,false - U+0008 - 8 - 0. Value: &quot;&quot;.
</del><ins>+INPUT - keydown - false,false,false,false - Backspace - U+0008 - 8 - 0. Value: &quot;7&quot;.
+INPUT - keyup - false,false,false,false - Backspace - U+0008 - 8 - 0. Value: &quot;&quot;.
</ins><span class="cx"> 
</span><span class="cx"> Percent:
</span><del>-INPUT - keydown - false,false,true,false - U+0035 - 53 - 0. Value: &quot;&quot;.
-INPUT - keypress - false,false,true,false - - 53 - 53. Value: &quot;&quot;.
</del><ins>+INPUT - keydown - false,false,true,false - 5 - U+0035 - 53 - 0. Value: &quot;&quot;.
+INPUT - keypress - false,false,true,false - 5 - - 53 - 53. Value: &quot;&quot;.
</ins><span class="cx"> INPUT - textInput - 5. Value: &quot;&quot;.
</span><del>-INPUT - keyup - false,false,true,false - U+0035 - 53 - 0. Value: &quot;5&quot;.
</del><ins>+INPUT - keyup - false,false,true,false - 5 - U+0035 - 53 - 0. Value: &quot;5&quot;.
</ins><span class="cx"> 
</span><span class="cx"> Backspace:
</span><del>-INPUT - keydown - false,false,false,false - U+0008 - 8 - 0. Value: &quot;5&quot;.
-INPUT - keyup - false,false,false,false - U+0008 - 8 - 0. Value: &quot;&quot;.
</del><ins>+INPUT - keydown - false,false,false,false - Backspace - U+0008 - 8 - 0. Value: &quot;5&quot;.
+INPUT - keyup - false,false,false,false - Backspace - U+0008 - 8 - 0. Value: &quot;&quot;.
</ins><span class="cx"> 
</span><span class="cx"> Left parenthesis:
</span><del>-INPUT - keydown - false,false,true,false - U+0039 - 57 - 0. Value: &quot;&quot;.
-INPUT - keypress - false,false,true,false - - 57 - 57. Value: &quot;&quot;.
</del><ins>+INPUT - keydown - false,false,true,false - 9 - U+0039 - 57 - 0. Value: &quot;&quot;.
+INPUT - keypress - false,false,true,false - 9 - - 57 - 57. Value: &quot;&quot;.
</ins><span class="cx"> INPUT - textInput - 9. Value: &quot;&quot;.
</span><del>-INPUT - keyup - false,false,true,false - U+0039 - 57 - 0. Value: &quot;9&quot;.
</del><ins>+INPUT - keyup - false,false,true,false - 9 - U+0039 - 57 - 0. Value: &quot;9&quot;.
</ins><span class="cx"> 
</span><span class="cx"> Backspace:
</span><del>-INPUT - keydown - false,false,false,false - U+0008 - 8 - 0. Value: &quot;9&quot;.
-INPUT - keyup - false,false,false,false - U+0008 - 8 - 0. Value: &quot;&quot;.
</del><ins>+INPUT - keydown - false,false,false,false - Backspace - U+0008 - 8 - 0. Value: &quot;9&quot;.
+INPUT - keyup - false,false,false,false - Backspace - U+0008 - 8 - 0. Value: &quot;&quot;.
</ins><span class="cx"> 
</span><span class="cx"> Right parenthesis:
</span><del>-INPUT - keydown - false,false,true,false - U+0030 - 48 - 0. Value: &quot;&quot;.
-INPUT - keypress - false,false,true,false - - 48 - 48. Value: &quot;&quot;.
</del><ins>+INPUT - keydown - false,false,true,false - 0 - U+0030 - 48 - 0. Value: &quot;&quot;.
+INPUT - keypress - false,false,true,false - 0 - - 48 - 48. Value: &quot;&quot;.
</ins><span class="cx"> INPUT - textInput - 0. Value: &quot;&quot;.
</span><del>-INPUT - keyup - false,false,true,false - U+0030 - 48 - 0. Value: &quot;0&quot;.
</del><ins>+INPUT - keyup - false,false,true,false - 0 - U+0030 - 48 - 0. Value: &quot;0&quot;.
</ins><span class="cx"> 
</span><span class="cx"> Backspace:
</span><del>-INPUT - keydown - false,false,false,false - U+0008 - 8 - 0. Value: &quot;0&quot;.
-INPUT - keyup - false,false,false,false - U+0008 - 8 - 0. Value: &quot;&quot;.
</del><ins>+INPUT - keydown - false,false,false,false - Backspace - U+0008 - 8 - 0. Value: &quot;0&quot;.
+INPUT - keyup - false,false,false,false - Backspace - U+0008 - 8 - 0. Value: &quot;&quot;.
</ins><span class="cx"> 
</span><span class="cx"> Print screen:
</span><del>-INPUT - keydown - false,false,false,false - PrintScreen - 44 - 0. Value: &quot;&quot;.
-INPUT - keyup - false,false,false,false - PrintScreen - 44 - 0. Value: &quot;&quot;.
</del><ins>+INPUT - keydown - false,false,false,false - PrintScreen - PrintScreen - 44 - 0. Value: &quot;&quot;.
+INPUT - keyup - false,false,false,false - PrintScreen - PrintScreen - 44 - 0. Value: &quot;&quot;.
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventsspecialkeyeventsininputtexthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/special-key-events-in-input-text.html (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/special-key-events-in-input-text.html        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/LayoutTests/fast/events/special-key-events-in-input-text.html        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -18,6 +18,7 @@
</span><span class="cx">      info += e.data;
</span><span class="cx">    } else if (type == &quot;keydown&quot; || type == &quot;keypress&quot; || type == &quot;keyup&quot;) {
</span><span class="cx">      info += [e.ctrlKey, e.altKey, e.shiftKey, e.metaKey] +
</span><ins>+         ' - ' + e.key +
</ins><span class="cx">          ' - ' + e.keyIdentifier +
</span><span class="cx">          ' - ' + e.keyCode +
</span><span class="cx">          ' - ' + e.charCode;
</span><span class="lines">@@ -27,6 +28,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> log(&quot;target - type - &quot; + [&quot;ctrlKey&quot;, &quot;altKey&quot;, &quot;shiftKey&quot;, &quot;metaKey&quot;]
</span><ins>+       + ' - ' + &quot;key&quot;
</ins><span class="cx">        + ' - ' + &quot;keyIdentifier&quot;
</span><span class="cx">        + ' - ' + &quot;keyCode&quot;
</span><span class="cx">        + ' - ' + &quot;charCode&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -1,5 +1,33 @@
</span><span class="cx"> 2016-10-03  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Add support for KeyboardEvent.key attribute
+        https://bugs.webkit.org/show_bug.cgi?id=36267
+
+        Reviewed by Darin Adler.
+
+        Rebaseline because that the tests are failing differently now that we support
+        the key attribute on KeyboardEvent but are still missing other standard API
+        on this interface.
+
+        * web-platform-tests/dom/events/Event-init-while-dispatching-expected.txt:
+        * web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt:
+
+2016-10-03  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Add support for KeyboardEvent.key attribute
+        https://bugs.webkit.org/show_bug.cgi?id=36267
+
+        Reviewed by Darin Adler.
+
+        Rebaseline because that the tests are failing differently now that we support
+        the key attribute on KeyboardEvent but are still missing other standard API
+        on this interface.
+
+        * web-platform-tests/dom/events/Event-init-while-dispatching-expected.txt:
+        * web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt:
+
+2016-10-03  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         td.scope should only return known values
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=162755
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsdomeventsEventinitwhiledispatchingexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-init-while-dispatching-expected.txt (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-init-while-dispatching-expected.txt        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-init-while-dispatching-expected.txt        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> 
</span><del>-FAIL Calling initKeyboardEvent while dispatching. assert_equals: initKeyboardEvent key setter should short-circuit expected (string) &quot;A&quot; but got (undefined) undefined
</del><ins>+PASS Calling initKeyboardEvent while dispatching. 
</ins><span class="cx"> PASS Calling initMouseEvent while dispatching. 
</span><span class="cx"> PASS Calling initCustomEvent while dispatching. 
</span><span class="cx"> PASS Calling initUIEvent while dispatching. 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsdomeventsEventsubclassesconstructorsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -29,12 +29,12 @@
</span><span class="cx"> FAIL WheelEvent constructor (empty argument) assert_true: Event object &quot;[object WheelEvent]&quot; should have a buttons property expected true got false
</span><span class="cx"> FAIL WheelEvent constructor (argument with default values) assert_true: Event object &quot;[object WheelEvent]&quot; should have a buttons property expected true got false
</span><span class="cx"> FAIL WheelEvent constructor (argument with non-default values) assert_true: Event object &quot;[object WheelEvent]&quot; should have a buttons property expected true got false
</span><del>-FAIL KeyboardEvent constructor (no argument) assert_true: Event object &quot;[object KeyboardEvent]&quot; should have a key property expected true got false
-FAIL KeyboardEvent constructor (undefined argument) assert_true: Event object &quot;[object KeyboardEvent]&quot; should have a key property expected true got false
-FAIL KeyboardEvent constructor (null argument) assert_true: Event object &quot;[object KeyboardEvent]&quot; should have a key property expected true got false
-FAIL KeyboardEvent constructor (empty argument) assert_true: Event object &quot;[object KeyboardEvent]&quot; should have a key property expected true got false
-FAIL KeyboardEvent constructor (argument with default values) assert_true: Event object &quot;[object KeyboardEvent]&quot; should have a key property expected true got false
-FAIL KeyboardEvent constructor (argument with non-default values) assert_true: Event object &quot;[object KeyboardEvent]&quot; should have a key property expected true got false
</del><ins>+FAIL KeyboardEvent constructor (no argument) assert_true: Event object &quot;[object KeyboardEvent]&quot; should have a code property expected true got false
+FAIL KeyboardEvent constructor (undefined argument) assert_true: Event object &quot;[object KeyboardEvent]&quot; should have a code property expected true got false
+FAIL KeyboardEvent constructor (null argument) assert_true: Event object &quot;[object KeyboardEvent]&quot; should have a code property expected true got false
+FAIL KeyboardEvent constructor (empty argument) assert_true: Event object &quot;[object KeyboardEvent]&quot; should have a code property expected true got false
+FAIL KeyboardEvent constructor (argument with default values) assert_true: Event object &quot;[object KeyboardEvent]&quot; should have a code property expected true got false
+FAIL KeyboardEvent constructor (argument with non-default values) assert_true: Event object &quot;[object KeyboardEvent]&quot; should have a code property expected true got false
</ins><span class="cx"> PASS CompositionEvent constructor (no argument) 
</span><span class="cx"> PASS CompositionEvent constructor (undefined argument) 
</span><span class="cx"> PASS CompositionEvent constructor (null argument) 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -336,6 +336,7 @@
</span><span class="cx"> webkit.org/b/155233 fast/events/max-tabindex-focus.html [ Skip ]
</span><span class="cx"> fast/shadow-dom/shadow-host-removal-crash.html [ Skip ]
</span><span class="cx"> fast/shadow-dom/input-element-in-shadow.html [ Skip ]
</span><ins>+fast/events/keyboardevent-key.html [ Skip ]
</ins><span class="cx"> 
</span><span class="cx"> # The file-wrapper part of &lt;attachment&gt; is not yet working on iOS
</span><span class="cx"> fast/attachment/attachment-type-attribute.html [ Skip ]
</span></span></pre></div>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/Source/WTF/ChangeLog        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-10-03  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Add support for KeyboardEvent.key attribute
+        https://bugs.webkit.org/show_bug.cgi?id=36267
+
+        Reviewed by Darin Adler.
+
+        Add compile time flag for the key attribute on KeyboardEvent and enable
+        it on Cocoa only.
+
+        * wtf/FeatureDefines.h:
+
</ins><span class="cx"> 2016-09-29  Sam Weinig  &lt;sam@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Add initial support for IDL union conversion
</span></span></pre></div>
<a id="trunkSourceWTFwtfFeatureDefinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/FeatureDefines.h (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/FeatureDefines.h        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/Source/WTF/wtf/FeatureDefines.h        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -255,6 +255,10 @@
</span><span class="cx"> #define ENABLE_DATA_DETECTION 1
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if !defined(ENABLE_KEYBOARD_KEY_ATTRIBUTE)
+#define ENABLE_KEYBOARD_KEY_ATTRIBUTE 1
+#endif
+
</ins><span class="cx"> #endif /* PLATFORM(COCOA) */
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(COCOA)
</span><span class="lines">@@ -769,6 +773,10 @@
</span><span class="cx"> #define ENABLE_XSLT 1
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if !defined(ENABLE_KEYBOARD_KEY_ATTRIBUTE)
+#define ENABLE_KEYBOARD_KEY_ATTRIBUTE 0
+#endif
+
</ins><span class="cx"> /* Asserts, invariants for macro definitions */
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK) &amp;&amp; !ENABLE(VIDEO)
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/Source/WebCore/ChangeLog        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -1,3 +1,79 @@
</span><ins>+2016-10-03  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Add support for KeyboardEvent.key attribute
+        https://bugs.webkit.org/show_bug.cgi?id=36267
+
+        Reviewed by Darin Adler.
+
+        Add support for KeyboardEvent.key attribute:
+        - https://w3c.github.io/uievents/#dom-keyboardevent-key
+
+        This is behind a compile time flag that is only enabled on Mac and
+        iOS and the implementation is still missing for other platforms.
+
+        Test: fast/events/keyboardevent-key.html
+
+        * dom/KeyboardEvent.cpp:
+        (WebCore::KeyboardEvent::KeyboardEvent):
+        * dom/KeyboardEvent.h:
+        * dom/KeyboardEvent.idl:
+        * platform/PlatformKeyboardEvent.h:
+        (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
+        (WebCore::PlatformKeyboardEvent::key):
+        * platform/cocoa/KeyEventCocoa.h:
+        * platform/cocoa/KeyEventCocoa.mm:
+        (WebCore::keyForCharCode):
+        * platform/ios/PlatformEventFactoryIOS.h:
+        * platform/ios/PlatformEventFactoryIOS.mm:
+        (WebCore::keyForKeyEvent):
+        (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
+        * platform/mac/PlatformEventFactoryMac.h:
+        * platform/mac/PlatformEventFactoryMac.mm:
+        (WebCore::keyForKeyEvent):
+        (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
+        (WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder): Deleted.
+        * replay/SerializationMethods.cpp:
+        (JSC::EncodingTraits&lt;PlatformKeyboardEvent&gt;::encodeValue):
+        (JSC::EncodingTraits&lt;PlatformKeyboardEvent&gt;::decodeValue):
+
+2016-10-03  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Add support for KeyboardEvent.key attribute
+        https://bugs.webkit.org/show_bug.cgi?id=36267
+
+        Reviewed by Darin Adler.
+
+        Add support for KeyboardEvent.key attribute:
+        - https://w3c.github.io/uievents/#dom-keyboardevent-key
+
+        This is behind a compile time flag that is only enabled on Mac and
+        iOS and the implementation is still missing for other platforms.
+
+        Test: fast/events/keyboardevent-key.html
+
+        * dom/KeyboardEvent.cpp:
+        (WebCore::KeyboardEvent::KeyboardEvent):
+        * dom/KeyboardEvent.h:
+        * dom/KeyboardEvent.idl:
+        * platform/PlatformKeyboardEvent.h:
+        (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
+        (WebCore::PlatformKeyboardEvent::key):
+        * platform/cocoa/KeyEventCocoa.h:
+        * platform/cocoa/KeyEventCocoa.mm:
+        (WebCore::keyForCharCode):
+        * platform/ios/PlatformEventFactoryIOS.h:
+        * platform/ios/PlatformEventFactoryIOS.mm:
+        (WebCore::keyForKeyEvent):
+        (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
+        * platform/mac/PlatformEventFactoryMac.h:
+        * platform/mac/PlatformEventFactoryMac.mm:
+        (WebCore::keyForKeyEvent):
+        (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
+        (WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder): Deleted.
+        * replay/SerializationMethods.cpp:
+        (JSC::EncodingTraits&lt;PlatformKeyboardEvent&gt;::encodeValue):
+        (JSC::EncodingTraits&lt;PlatformKeyboardEvent&gt;::decodeValue):
+
</ins><span class="cx"> 2016-10-03  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         URLParser: fragment-only URLs relative to file URLs should just add a fragment
</span></span></pre></div>
<a id="trunkSourceWebCoredomKeyboardEventcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/KeyboardEvent.cpp (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/KeyboardEvent.cpp        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/Source/WebCore/dom/KeyboardEvent.cpp        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -104,6 +104,9 @@
</span><span class="cx">     : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()),
</span><span class="cx">                           true, true, key.timestamp(), view, 0, key.ctrlKey(), key.altKey(), key.shiftKey(), key.metaKey())
</span><span class="cx">     , m_keyEvent(std::make_unique&lt;PlatformKeyboardEvent&gt;(key))
</span><ins>+#if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
+    , m_key(key.key())
+#endif
</ins><span class="cx">     , m_keyIdentifier(key.keyIdentifier())
</span><span class="cx">     , m_location(keyLocationCode(key))
</span><span class="cx">     , m_repeat(key.isAutoRepeat())
</span><span class="lines">@@ -127,6 +130,9 @@
</span><span class="cx"> 
</span><span class="cx"> KeyboardEvent::KeyboardEvent(const AtomicString&amp; eventType, const KeyboardEventInit&amp; initializer)
</span><span class="cx">     : UIEventWithKeyState(eventType, initializer)
</span><ins>+#if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
+    , m_key(initializer.key)
+#endif
</ins><span class="cx">     , m_keyIdentifier(initializer.keyIdentifier)
</span><span class="cx">     , m_location(initializer.location)
</span><span class="cx">     , m_repeat(initializer.repeat)
</span></span></pre></div>
<a id="trunkSourceWebCoredomKeyboardEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/KeyboardEvent.h (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/KeyboardEvent.h        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/Source/WebCore/dom/KeyboardEvent.h        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -34,6 +34,9 @@
</span><span class="cx"> class PlatformKeyboardEvent;
</span><span class="cx"> 
</span><span class="cx"> struct KeyboardEventInit : public UIEventWithKeyStateInit {
</span><ins>+#if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
+    String key;
+#endif
</ins><span class="cx">     String keyIdentifier;
</span><span class="cx">     unsigned location { 0 };
</span><span class="cx">     bool repeat { false };
</span><span class="lines">@@ -46,9 +49,6 @@
</span><span class="cx">         DOM_KEY_LOCATION_LEFT       = 0x01,
</span><span class="cx">         DOM_KEY_LOCATION_RIGHT      = 0x02,
</span><span class="cx">         DOM_KEY_LOCATION_NUMPAD     = 0x03
</span><del>-        // FIXME: The following values are not supported yet (crbug.com/265446)
-        // DOM_KEY_LOCATION_MOBILE     = 0x04,
-        // DOM_KEY_LOCATION_JOYSTICK   = 0x05
</del><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     static Ref&lt;KeyboardEvent&gt; create(const PlatformKeyboardEvent&amp; platformEvent, DOMWindow* view)
</span><span class="lines">@@ -79,6 +79,10 @@
</span><span class="cx">         const String&amp; keyIdentifier, unsigned location,
</span><span class="cx">         bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool altGraphKey = false);
</span><span class="cx">     
</span><ins>+#if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
+    const String&amp; key() const { return m_key; }
+#endif
+
</ins><span class="cx">     const String&amp; keyIdentifier() const { return m_keyIdentifier; }
</span><span class="cx">     unsigned location() const { return m_location; }
</span><span class="cx">     bool repeat() const { return m_repeat; }
</span><span class="lines">@@ -108,11 +112,14 @@
</span><span class="cx">     WEBCORE_EXPORT KeyboardEvent();
</span><span class="cx">     WEBCORE_EXPORT KeyboardEvent(const PlatformKeyboardEvent&amp;, DOMWindow*);
</span><span class="cx">     KeyboardEvent(const AtomicString&amp;, const KeyboardEventInit&amp;);
</span><del>-    // FIXME: This method should be get ride of in the future.
</del><ins>+    // FIXME: This method should be get rid of in the future.
</ins><span class="cx">     // DO NOT USE IT!
</span><span class="cx">     KeyboardEvent(WTF::HashTableDeletedValueType);
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;PlatformKeyboardEvent&gt; m_keyEvent;
</span><ins>+#if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
+    String m_key;
+#endif
</ins><span class="cx">     String m_keyIdentifier;
</span><span class="cx">     unsigned m_location;
</span><span class="cx">     bool m_repeat : 1;
</span></span></pre></div>
<a id="trunkSourceWebCoredomKeyboardEventidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/KeyboardEvent.idl (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/KeyboardEvent.idl        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/Source/WebCore/dom/KeyboardEvent.idl        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -28,19 +28,29 @@
</span><span class="cx">     const unsigned long DOM_KEY_LOCATION_RIGHT = 0x02;
</span><span class="cx">     const unsigned long DOM_KEY_LOCATION_NUMPAD = 0x03;
</span><span class="cx"> 
</span><del>-    [InitializedByEventConstructor] readonly attribute DOMString keyIdentifier;
</del><ins>+    [InitializedByEventConstructor, Conditional=KEYBOARD_KEY_ATTRIBUTE] readonly attribute DOMString key;
+
+    // FIXME: We should support this.
+    // [InitializedByEventConstructor] readonly attribute DOMString code;
+
</ins><span class="cx">     [InitializedByEventConstructor] readonly attribute unsigned long location;
</span><del>-    [InitializedByEventConstructor, ImplementedAs=location] readonly attribute unsigned long keyLocation; // Deprecated.
</del><ins>+
</ins><span class="cx">     [InitializedByEventConstructor] readonly attribute boolean ctrlKey;
</span><span class="cx">     [InitializedByEventConstructor] readonly attribute boolean shiftKey;
</span><span class="cx">     [InitializedByEventConstructor] readonly attribute boolean altKey;
</span><span class="cx">     [InitializedByEventConstructor] readonly attribute boolean metaKey;
</span><del>-    readonly attribute boolean altGraphKey;
-
</del><span class="cx">     [InitializedByEventConstructor] readonly attribute boolean repeat;
</span><span class="cx"> 
</span><ins>+    // FIXME: We should support this.
+    // readonly attribute boolean isComposing;
+
</ins><span class="cx">     boolean getModifierState(DOMString keyArg);
</span><span class="cx"> 
</span><ins>+    // Everything below is legacy.
+    [InitializedByEventConstructor] readonly attribute DOMString keyIdentifier;
+    [InitializedByEventConstructor, ImplementedAs=location] readonly attribute unsigned long keyLocation;
+    readonly attribute boolean altGraphKey;
+
</ins><span class="cx">     // FIXME: this does not match the version in the DOM spec.
</span><span class="cx">     // FIXME: Using &quot;undefined&quot; as default parameter value is wrong.
</span><span class="cx">     void initKeyboardEvent(optional DOMString type = &quot;undefined&quot;, optional boolean canBubble = false, optional boolean cancelable = false,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformPlatformKeyboardEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/PlatformKeyboardEvent.h (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/PlatformKeyboardEvent.h        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/Source/WebCore/platform/PlatformKeyboardEvent.h        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -70,10 +70,17 @@
</span><span class="cx">         {
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        PlatformKeyboardEvent(Type type, const String&amp; text, const String&amp; unmodifiedText, const String&amp; keyIdentifier, int windowsVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet&lt;Modifier&gt; modifiers, double timestamp)
</del><ins>+        PlatformKeyboardEvent(Type type, const String&amp; text, const String&amp; unmodifiedText,
+#if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
+        const String&amp; key,
+#endif
+        const String&amp; keyIdentifier, int windowsVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet&lt;Modifier&gt; modifiers, double timestamp)
</ins><span class="cx">             : PlatformEvent(type, modifiers, timestamp)
</span><span class="cx">             , m_text(text)
</span><span class="cx">             , m_unmodifiedText(unmodifiedText)
</span><ins>+#if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
+            , m_key(key)
+#endif
</ins><span class="cx">             , m_keyIdentifier(keyIdentifier)
</span><span class="cx">             , m_windowsVirtualKeyCode(windowsVirtualKeyCode)
</span><span class="cx"> #if USE(APPKIT) || PLATFORM(GTK)
</span><span class="lines">@@ -102,6 +109,10 @@
</span><span class="cx"> 
</span><span class="cx">         String keyIdentifier() const { return m_keyIdentifier; }
</span><span class="cx"> 
</span><ins>+#if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
+        const String&amp; key() const { return m_key; }
+#endif
+
</ins><span class="cx">         // Most compatible Windows virtual key code associated with the event.
</span><span class="cx">         // Zero for Char events.
</span><span class="cx">         int windowsVirtualKeyCode() const { return m_windowsVirtualKeyCode; }
</span><span class="lines">@@ -154,6 +165,9 @@
</span><span class="cx">     protected:
</span><span class="cx">         String m_text;
</span><span class="cx">         String m_unmodifiedText;
</span><ins>+#if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
+        String m_key;
+#endif
</ins><span class="cx">         String m_keyIdentifier;
</span><span class="cx">         int m_windowsVirtualKeyCode;
</span><span class="cx"> #if USE(APPKIT) || PLATFORM(GTK)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcocoaKeyEventCocoah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cocoa/KeyEventCocoa.h (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cocoa/KeyEventCocoa.h        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/Source/WebCore/platform/cocoa/KeyEventCocoa.h        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+String keyForCharCode(unichar charCode);
</ins><span class="cx"> String keyIdentifierForCharCode(unichar charCode);
</span><span class="cx"> 
</span><span class="cx"> int windowsKeyCodeForKeyCode(uint16_t keyCode);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcocoaKeyEventCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cocoa/KeyEventCocoa.mm (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cocoa/KeyEventCocoa.mm        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/Source/WebCore/platform/cocoa/KeyEventCocoa.mm        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -39,6 +39,161 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+// https://w3c.github.io/uievents-key/
+String keyForCharCode(unichar charCode)
+{
+    switch (charCode) {
+    case NSUpArrowFunctionKey:
+        return ASCIILiteral(&quot;ArrowUp&quot;);
+    case NSDownArrowFunctionKey:
+        return ASCIILiteral(&quot;ArrowDown&quot;);
+    case NSLeftArrowFunctionKey:
+        return ASCIILiteral(&quot;ArrowLeft&quot;);
+    case NSRightArrowFunctionKey:
+        return ASCIILiteral(&quot;ArrowRight&quot;);
+    case NSF1FunctionKey:
+        return ASCIILiteral(&quot;F1&quot;);
+    case NSF2FunctionKey:
+        return ASCIILiteral(&quot;F2&quot;);
+    case NSF3FunctionKey:
+        return ASCIILiteral(&quot;F3&quot;);
+    case NSF4FunctionKey:
+        return ASCIILiteral(&quot;F4&quot;);
+    case NSF5FunctionKey:
+        return ASCIILiteral(&quot;F5&quot;);
+    case NSF6FunctionKey:
+        return ASCIILiteral(&quot;F6&quot;);
+    case NSF7FunctionKey:
+        return ASCIILiteral(&quot;F7&quot;);
+    case NSF8FunctionKey:
+        return ASCIILiteral(&quot;F8&quot;);
+    case NSF9FunctionKey:
+        return ASCIILiteral(&quot;F9&quot;);
+    case NSF10FunctionKey:
+        return ASCIILiteral(&quot;F10&quot;);
+    case NSF11FunctionKey:
+        return ASCIILiteral(&quot;F11&quot;);
+    case NSF12FunctionKey:
+        return ASCIILiteral(&quot;F12&quot;);
+    case NSF13FunctionKey:
+        return ASCIILiteral(&quot;F13&quot;);
+    case NSF14FunctionKey:
+        return ASCIILiteral(&quot;F14&quot;);
+    case NSF15FunctionKey:
+        return ASCIILiteral(&quot;F15&quot;);
+    case NSF16FunctionKey:
+        return ASCIILiteral(&quot;F16&quot;);
+    case NSF17FunctionKey:
+        return ASCIILiteral(&quot;F17&quot;);
+    case NSF18FunctionKey:
+        return ASCIILiteral(&quot;F18&quot;);
+    case NSF19FunctionKey:
+        return ASCIILiteral(&quot;F19&quot;);
+    case NSF20FunctionKey:
+        return ASCIILiteral(&quot;F20&quot;);
+    case NSF21FunctionKey:
+        return ASCIILiteral(&quot;F21&quot;);
+    case NSF22FunctionKey:
+        return ASCIILiteral(&quot;F22&quot;);
+    case NSF23FunctionKey:
+        return ASCIILiteral(&quot;F23&quot;);
+    case NSF24FunctionKey:
+        return ASCIILiteral(&quot;F24&quot;);
+    case NSF25FunctionKey:
+        return ASCIILiteral(&quot;F25&quot;);
+    case NSF26FunctionKey:
+        return ASCIILiteral(&quot;F26&quot;);
+    case NSF27FunctionKey:
+        return ASCIILiteral(&quot;F27&quot;);
+    case NSF28FunctionKey:
+        return ASCIILiteral(&quot;F28&quot;);
+    case NSF29FunctionKey:
+        return ASCIILiteral(&quot;F29&quot;);
+    case NSF30FunctionKey:
+        return ASCIILiteral(&quot;F30&quot;);
+    case NSF31FunctionKey:
+        return ASCIILiteral(&quot;F31&quot;);
+    case NSF32FunctionKey:
+        return ASCIILiteral(&quot;F32&quot;);
+    case NSF33FunctionKey:
+        return ASCIILiteral(&quot;F33&quot;);
+    case NSF34FunctionKey:
+        return ASCIILiteral(&quot;F34&quot;);
+    case NSF35FunctionKey:
+        return ASCIILiteral(&quot;F35&quot;);
+    case NSInsertFunctionKey:
+        return ASCIILiteral(&quot;Insert&quot;);
+    case NSDeleteFunctionKey:
+        return ASCIILiteral(&quot;Delete&quot;);
+    case NSHomeFunctionKey:
+        return ASCIILiteral(&quot;Home&quot;);
+    case NSEndFunctionKey:
+        return ASCIILiteral(&quot;End&quot;);
+    case NSPageUpFunctionKey:
+        return ASCIILiteral(&quot;PageUp&quot;);
+    case NSPageDownFunctionKey:
+        return ASCIILiteral(&quot;PageDown&quot;);
+    case NSPrintScreenFunctionKey:
+        return ASCIILiteral(&quot;PrintScreen&quot;);
+    case NSScrollLockFunctionKey:
+        return ASCIILiteral(&quot;ScrollLock&quot;);
+    case NSPauseFunctionKey:
+        return ASCIILiteral(&quot;Pause&quot;);
+    case NSMenuFunctionKey:
+        return ASCIILiteral(&quot;ContextMenu&quot;);
+    case NSPrintFunctionKey:
+        return ASCIILiteral(&quot;Print&quot;);
+    case NSClearLineFunctionKey:
+        return ASCIILiteral(&quot;Clear&quot;);
+    case NSSelectFunctionKey:
+        return ASCIILiteral(&quot;Select&quot;);
+    case NSExecuteFunctionKey:
+        return ASCIILiteral(&quot;Execute&quot;);
+    case NSUndoFunctionKey:
+        return ASCIILiteral(&quot;Undo&quot;);
+    case NSRedoFunctionKey:
+        return ASCIILiteral(&quot;Redo&quot;);
+    case NSFindFunctionKey:
+        return ASCIILiteral(&quot;Find&quot;);
+    case NSHelpFunctionKey:
+        return ASCIILiteral(&quot;Help&quot;);
+    case NSModeSwitchFunctionKey:
+        return ASCIILiteral(&quot;ModeChange&quot;);
+    case NSEnterCharacter:
+    case NSNewlineCharacter:
+    case NSCarriageReturnCharacter:
+        return ASCIILiteral(&quot;Enter&quot;);
+    case NSDeleteCharacter:
+    case NSBackspaceCharacter:
+        return ASCIILiteral(&quot;Backspace&quot;);
+    case NSBackTabCharacter:
+    case NSTabCharacter:
+        return ASCIILiteral(&quot;Tab&quot;);
+    case 0x1B:
+        return ASCIILiteral(&quot;Escape&quot;);
+    case NSFormFeedCharacter:
+    case NSParagraphSeparatorCharacter:
+    case NSLineSeparatorCharacter:
+    case NSBeginFunctionKey:
+    case NSSysReqFunctionKey:
+    case NSBreakFunctionKey:
+    case NSResetFunctionKey:
+    case NSStopFunctionKey:
+    case NSUserFunctionKey:
+    case NSSystemFunctionKey:
+    case NSClearDisplayFunctionKey:
+    case NSInsertLineFunctionKey:
+    case NSDeleteLineFunctionKey:
+    case NSInsertCharFunctionKey:
+    case NSDeleteCharFunctionKey:
+    case NSPrevFunctionKey:
+    case NSNextFunctionKey:
+        return ASCIILiteral(&quot;Unidentified&quot;);
+    default:
+        return String(&amp;charCode, 1);
+    }
+}
+
</ins><span class="cx"> String keyIdentifierForCharCode(unichar charCode)
</span><span class="cx"> {
</span><span class="cx">     switch (charCode) {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosPlatformEventFactoryIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/PlatformEventFactoryIOS.h (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/PlatformEventFactoryIOS.h        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/Source/WebCore/platform/ios/PlatformEventFactoryIOS.h        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -49,6 +49,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+WEBCORE_EXPORT String keyForKeyEvent(WebEvent *);
</ins><span class="cx"> WEBCORE_EXPORT String keyIdentifierForKeyEvent(WebEvent *);
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosPlatformEventFactoryIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -129,6 +129,23 @@
</span><span class="cx">     return keyIdentifierForCharCode(CFStringGetCharacterAtIndex((CFStringRef)s, 0));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String keyForKeyEvent(WebEvent *event)
+{
+    NSString *characters = event.characters;
+    auto length = [characters length];
+
+    // characters return an empty string for dead keys.
+    // https://developer.apple.com/reference/appkit/nsevent/1534183-characters
+    // &quot;Dead&quot; is defined here https://w3c.github.io/uievents-key/#keys-composition.
+    if (!length)
+        return ASCIILiteral(&quot;Dead&quot;);
+
+    if (length &gt; 1)
+        return characters;
+
+    return keyForCharCode([characters characterAtIndex:0]);
+}
+
</ins><span class="cx"> class PlatformKeyboardEventBuilder : public PlatformKeyboardEvent {
</span><span class="cx"> public:
</span><span class="cx">     PlatformKeyboardEventBuilder(WebEvent *event)
</span><span class="lines">@@ -141,6 +158,7 @@
</span><span class="cx"> 
</span><span class="cx">         m_text = event.characters;
</span><span class="cx">         m_unmodifiedText = event.charactersIgnoringModifiers;
</span><ins>+        m_key = keyForKeyEvent(event);
</ins><span class="cx">         m_keyIdentifier = keyIdentifierForKeyEvent(event);
</span><span class="cx">         m_windowsVirtualKeyCode = event.keyCode;
</span><span class="cx">         m_autoRepeat = event.isKeyRepeating;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacPlatformEventFactoryMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.h (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.h        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.h        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx"> // FIXME: WebKit2 has a lot of code copied and pasted from PlatformEventFactoryMac in WebEventFactory. More of it should be shared with WebCore.
</span><span class="cx"> WEBCORE_EXPORT int windowsKeyCodeForKeyEvent(NSEvent *);
</span><span class="cx"> WEBCORE_EXPORT String keyIdentifierForKeyEvent(NSEvent *);
</span><ins>+WEBCORE_EXPORT String keyForKeyEvent(NSEvent *);
</ins><span class="cx"> WEBCORE_EXPORT double eventTimeStampSince1970(NSEvent *);
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacPlatformEventFactoryMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #import &quot;Scrollbar.h&quot;
</span><span class="cx"> #import &quot;WebCoreSystemInterface.h&quot;
</span><span class="cx"> #import &quot;WindowsKeyboardCodes.h&quot;
</span><ins>+#import &lt;HIToolbox/Events.h&gt;
</ins><span class="cx"> #import &lt;mach/mach_time.h&gt;
</span><span class="cx"> #import &lt;wtf/ASCIICType.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -220,10 +221,11 @@
</span><span class="cx"> 
</span><span class="cx"> static inline String textFromEvent(NSEvent* event)
</span><span class="cx"> {
</span><del>-#pragma clang diagnostic push
-#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
</del><ins>+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200
+    if ([event type] == NSEventTypeFlagsChanged)
+#else
</ins><span class="cx">     if ([event type] == NSFlagsChanged)
</span><del>-#pragma clang diagnostic pop
</del><ins>+#endif
</ins><span class="cx">         return emptyString();
</span><span class="cx">     return String([event characters]);
</span><span class="cx"> }
</span><span class="lines">@@ -230,20 +232,67 @@
</span><span class="cx"> 
</span><span class="cx"> static inline String unmodifiedTextFromEvent(NSEvent* event)
</span><span class="cx"> {
</span><del>-#pragma clang diagnostic push
-#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
</del><ins>+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200
+    if ([event type] == NSEventTypeFlagsChanged)
+#else
</ins><span class="cx">     if ([event type] == NSFlagsChanged)
</span><del>-#pragma clang diagnostic pop
</del><ins>+#endif
</ins><span class="cx">         return emptyString();
</span><span class="cx">     return String([event charactersIgnoringModifiers]);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String keyForKeyEvent(NSEvent *event)
+{
+    // This constant was missing before OS X Sierra.
+#ifndef kVK_RightCommand
+#define kVK_RightCommand 0x36
+#endif
+    switch ([event keyCode]) {
+    case kVK_RightCommand:
+    case kVK_Command:
+        return ASCIILiteral(&quot;Meta&quot;);
+    case kVK_Shift:
+    case kVK_RightShift:
+        return ASCIILiteral(&quot;Shift&quot;);
+    case kVK_CapsLock:
+        return ASCIILiteral(&quot;CapsLock&quot;);
+    case kVK_Option: // Left Alt.
+    case kVK_RightOption: // Right Alt.
+        return ASCIILiteral(&quot;Alt&quot;);
+    case kVK_Control:
+    case kVK_RightControl:
+        return ASCIILiteral(&quot;Control&quot;);
+    }
+
+    // If more than one key is being pressed and the key combination includes one or more modifier keys
+    // that result in the key no longer producing a printable character (e.g., Control + a), then the
+    // key value should be the printable key value that would have been produced if the key had been
+    // typed with the default keyboard layout with no modifier keys except for Shift and AltGr applied.
+    // https://w3c.github.io/uievents/#keys-guidelines
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200
+    bool isControlDown = ([event modifierFlags] &amp; NSEventModifierFlagControl);
+#else
+    bool isControlDown = ([event modifierFlags] &amp; NSControlKeyMask);
+#endif
+    NSString *s = isControlDown ? [event charactersIgnoringModifiers] : [event characters];
+    auto length = [s length];
+    // characters / charactersIgnoringModifiers return an empty string for dead keys.
+    // https://developer.apple.com/reference/appkit/nsevent/1534183-characters
+    if (!length)
+        return ASCIILiteral(&quot;Dead&quot;);
+    // High unicode codepoints are coded with a character sequence in Mac OS X.
+    if (length &gt; 1)
+        return s;
+    return keyForCharCode([s characterAtIndex:0]);
+}
+
</ins><span class="cx"> String keyIdentifierForKeyEvent(NSEvent* event)
</span><span class="cx"> {
</span><del>-#pragma clang diagnostic push
-#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
-    if ([event type] == NSFlagsChanged)
-#pragma clang diagnostic pop
</del><ins>+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200
+    if ([event type] == NSEventTypeFlagsChanged) {
+#else
+    if ([event type] == NSFlagsChanged) {
+#endif
</ins><span class="cx">         switch ([event keyCode]) {
</span><span class="cx">             case 54: // Right Command
</span><span class="cx">             case 55: // Left Command
</span><span class="lines">@@ -268,6 +317,7 @@
</span><span class="cx">                 ASSERT_NOT_REACHED();
</span><span class="cx">                 return emptyString();
</span><span class="cx">         }
</span><ins>+    }
</ins><span class="cx">     
</span><span class="cx">     NSString *s = [event charactersIgnoringModifiers];
</span><span class="cx">     if ([s length] != 1) {
</span><span class="lines">@@ -561,6 +611,7 @@
</span><span class="cx">         m_text = textFromEvent(event);
</span><span class="cx">         m_unmodifiedText = unmodifiedTextFromEvent(event);
</span><span class="cx">         m_keyIdentifier = keyIdentifierForKeyEvent(event);
</span><ins>+        m_key = keyForKeyEvent(event);
</ins><span class="cx">         m_windowsVirtualKeyCode = windowsKeyCodeForKeyEvent(event);
</span><span class="cx"> #pragma clang diagnostic push
</span><span class="cx"> #pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
</span></span></pre></div>
<a id="trunkSourceWebCorereplaySerializationMethodscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/replay/SerializationMethods.cpp (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/replay/SerializationMethods.cpp        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/Source/WebCore/replay/SerializationMethods.cpp        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -256,6 +256,9 @@
</span><span class="cx">     ENCODE_TYPE_WITH_KEY(encodedValue, PlatformEvent::Modifier, modifiers, input.modifiers());
</span><span class="cx">     ENCODE_TYPE_WITH_KEY(encodedValue, String, text, input.text());
</span><span class="cx">     ENCODE_TYPE_WITH_KEY(encodedValue, String, unmodifiedText, input.unmodifiedText());
</span><ins>+#if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
+    ENCODE_TYPE_WITH_KEY(encodedValue, String, key, input.key());
+#endif
</ins><span class="cx">     ENCODE_TYPE_WITH_KEY(encodedValue, String, keyIdentifier, input.keyIdentifier());
</span><span class="cx">     ENCODE_TYPE_WITH_KEY(encodedValue, int, windowsVirtualKeyCode, input.windowsVirtualKeyCode());
</span><span class="cx">     ENCODE_TYPE_WITH_KEY(encodedValue, bool, autoRepeat, input.isAutoRepeat());
</span><span class="lines">@@ -275,6 +278,9 @@
</span><span class="cx">     DECODE_TYPE_WITH_KEY(encodedValue, PlatformEvent::Modifier, modifiers);
</span><span class="cx">     DECODE_TYPE_WITH_KEY(encodedValue, String, text);
</span><span class="cx">     DECODE_TYPE_WITH_KEY(encodedValue, String, unmodifiedText);
</span><ins>+#if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
+    DECODE_TYPE_WITH_KEY(encodedValue, String, key);
+#endif
</ins><span class="cx">     DECODE_TYPE_WITH_KEY(encodedValue, String, keyIdentifier);
</span><span class="cx">     DECODE_TYPE_WITH_KEY(encodedValue, int, windowsVirtualKeyCode);
</span><span class="cx">     DECODE_TYPE_WITH_KEY(encodedValue, bool, autoRepeat);
</span><span class="lines">@@ -285,7 +291,12 @@
</span><span class="cx">     DECODE_TYPE_WITH_KEY(encodedValue, Vector&lt;KeypressCommand&gt;, commands);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    PlatformKeyboardEvent platformEvent = PlatformKeyboardEvent(type, text, unmodifiedText, keyIdentifier, WTF::safeCast&lt;int&gt;(windowsVirtualKeyCode), autoRepeat, keypad, systemKey, modifiers, timestamp);
</del><ins>+    PlatformKeyboardEvent platformEvent = PlatformKeyboardEvent(type, text, unmodifiedText,
+#if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
+        key,
+#endif
+        keyIdentifier, WTF::safeCast&lt;int&gt;(windowsVirtualKeyCode), autoRepeat, keypad, systemKey, modifiers, timestamp);
+
</ins><span class="cx"> #if USE(APPKIT)
</span><span class="cx">     input = std::make_unique&lt;PlatformKeyboardEventAppKit&gt;(platformEvent, handledByInputMethod, commands);
</span><span class="cx"> #else
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/Source/WebKit2/ChangeLog        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -1,3 +1,45 @@
</span><ins>+2016-10-03  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Add support for KeyboardEvent.key attribute
+        https://bugs.webkit.org/show_bug.cgi?id=36267
+
+        Reviewed by Darin Adler.
+
+        Add support for KeyboardEvent.key attribute.
+
+        * Shared/WebEvent.h:
+        (WebKit::WebKeyboardEvent::key):
+        (WebKit::WebKeyboardEvent::unmodifiedText): Deleted.
+        * Shared/WebEventConversion.cpp:
+        (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
+        * Shared/WebKeyboardEvent.cpp:
+        (WebKit::WebKeyboardEvent::WebKeyboardEvent):
+        (WebKit::WebKeyboardEvent::encode):
+        (WebKit::WebKeyboardEvent::decode):
+        * Shared/mac/WebEventFactory.mm:
+        (WebKit::WebEventFactory::createWebKeyboardEvent):
+
+2016-10-03  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Add support for KeyboardEvent.key attribute
+        https://bugs.webkit.org/show_bug.cgi?id=36267
+
+        Reviewed by Darin Adler.
+
+        Add support for KeyboardEvent.key attribute.
+
+        * Shared/WebEvent.h:
+        (WebKit::WebKeyboardEvent::key):
+        (WebKit::WebKeyboardEvent::unmodifiedText): Deleted.
+        * Shared/WebEventConversion.cpp:
+        (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
+        * Shared/WebKeyboardEvent.cpp:
+        (WebKit::WebKeyboardEvent::WebKeyboardEvent):
+        (WebKit::WebKeyboardEvent::encode):
+        (WebKit::WebKeyboardEvent::decode):
+        * Shared/mac/WebEventFactory.mm:
+        (WebKit::WebEventFactory::createWebKeyboardEvent):
+
</ins><span class="cx"> 2016-10-03  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [SOUP] Cleanup persistent credential storage code
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebEvent.h (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebEvent.h        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/Source/WebKit2/Shared/WebEvent.h        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -244,7 +244,7 @@
</span><span class="cx">     ~WebKeyboardEvent();
</span><span class="cx"> 
</span><span class="cx"> #if USE(APPKIT)
</span><del>-    WebKeyboardEvent(Type, const String&amp; text, const String&amp; unmodifiedText, const String&amp; keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool handledByInputMethod, const Vector&lt;WebCore::KeypressCommand&gt;&amp;, bool isAutoRepeat, bool isKeypad, bool isSystemKey, Modifiers, double timestamp);
</del><ins>+    WebKeyboardEvent(Type, const String&amp; text, const String&amp; unmodifiedText, const String&amp; key, const String&amp; keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool handledByInputMethod, const Vector&lt;WebCore::KeypressCommand&gt;&amp;, bool isAutoRepeat, bool isKeypad, bool isSystemKey, Modifiers, double timestamp);
</ins><span class="cx"> #elif PLATFORM(GTK)
</span><span class="cx">     WebKeyboardEvent(Type, const String&amp; text, const String&amp; keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool handledByInputMethod, Vector&lt;String&gt;&amp;&amp; commands, bool isKeypad, Modifiers, double timestamp);
</span><span class="cx"> #else
</span><span class="lines">@@ -253,6 +253,9 @@
</span><span class="cx"> 
</span><span class="cx">     const String&amp; text() const { return m_text; }
</span><span class="cx">     const String&amp; unmodifiedText() const { return m_unmodifiedText; }
</span><ins>+#if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
+    const String&amp; key() const { return m_key; }
+#endif
</ins><span class="cx">     const String&amp; keyIdentifier() const { return m_keyIdentifier; }
</span><span class="cx">     int32_t windowsVirtualKeyCode() const { return m_windowsVirtualKeyCode; }
</span><span class="cx">     int32_t nativeVirtualKeyCode() const { return m_nativeVirtualKeyCode; }
</span><span class="lines">@@ -277,6 +280,9 @@
</span><span class="cx"> private:
</span><span class="cx">     String m_text;
</span><span class="cx">     String m_unmodifiedText;
</span><ins>+#if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
+    String m_key;
+#endif
</ins><span class="cx">     String m_keyIdentifier;
</span><span class="cx">     int32_t m_windowsVirtualKeyCode;
</span><span class="cx">     int32_t m_nativeVirtualKeyCode;
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebEventConversioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebEventConversion.cpp (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebEventConversion.cpp        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/Source/WebKit2/Shared/WebEventConversion.cpp        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -191,6 +191,9 @@
</span><span class="cx">         // PlatformKeyboardEvent
</span><span class="cx">         m_text = webEvent.text();
</span><span class="cx">         m_unmodifiedText = webEvent.unmodifiedText();
</span><ins>+#if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
+        m_key = webEvent.key();
+#endif
</ins><span class="cx">         m_keyIdentifier = webEvent.keyIdentifier();
</span><span class="cx">         m_windowsVirtualKeyCode = webEvent.windowsVirtualKeyCode();
</span><span class="cx"> #if USE(APPKIT) || PLATFORM(GTK)
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebKeyboardEventcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebKeyboardEvent.cpp (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebKeyboardEvent.cpp        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/Source/WebKit2/Shared/WebKeyboardEvent.cpp        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -37,10 +37,11 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(APPKIT)
</span><span class="cx"> 
</span><del>-WebKeyboardEvent::WebKeyboardEvent(Type type, const String&amp; text, const String&amp; unmodifiedText, const String&amp; keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool handledByInputMethod, const Vector&lt;WebCore::KeypressCommand&gt;&amp; commands, bool isAutoRepeat, bool isKeypad, bool isSystemKey, Modifiers modifiers, double timestamp)
</del><ins>+WebKeyboardEvent::WebKeyboardEvent(Type type, const String&amp; text, const String&amp; unmodifiedText, const String&amp; key, const String&amp; keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool handledByInputMethod, const Vector&lt;WebCore::KeypressCommand&gt;&amp; commands, bool isAutoRepeat, bool isKeypad, bool isSystemKey, Modifiers modifiers, double timestamp)
</ins><span class="cx">     : WebEvent(type, modifiers, timestamp)
</span><span class="cx">     , m_text(text)
</span><span class="cx">     , m_unmodifiedText(unmodifiedText)
</span><ins>+    , m_key(key)
</ins><span class="cx">     , m_keyIdentifier(keyIdentifier)
</span><span class="cx">     , m_windowsVirtualKeyCode(windowsVirtualKeyCode)
</span><span class="cx">     , m_nativeVirtualKeyCode(nativeVirtualKeyCode)
</span><span class="lines">@@ -102,6 +103,9 @@
</span><span class="cx"> 
</span><span class="cx">     encoder &lt;&lt; m_text;
</span><span class="cx">     encoder &lt;&lt; m_unmodifiedText;
</span><ins>+#if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
+    encoder &lt;&lt; m_key;
+#endif
</ins><span class="cx">     encoder &lt;&lt; m_keyIdentifier;
</span><span class="cx">     encoder &lt;&lt; m_windowsVirtualKeyCode;
</span><span class="cx">     encoder &lt;&lt; m_nativeVirtualKeyCode;
</span><span class="lines">@@ -124,6 +128,10 @@
</span><span class="cx">         return false;
</span><span class="cx">     if (!decoder.decode(result.m_unmodifiedText))
</span><span class="cx">         return false;
</span><ins>+#if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
+    if (!decoder.decode(result.m_key))
+        return false;
+#endif
</ins><span class="cx">     if (!decoder.decode(result.m_keyIdentifier))
</span><span class="cx">         return false;
</span><span class="cx">     if (!decoder.decode(result.m_windowsVirtualKeyCode))
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacWebEventFactorymm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/WebEventFactory.mm (206749 => 206750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/WebEventFactory.mm        2016-10-03 21:31:15 UTC (rev 206749)
+++ trunk/Source/WebKit2/Shared/mac/WebEventFactory.mm        2016-10-03 21:32:47 UTC (rev 206750)
</span><span class="lines">@@ -466,6 +466,7 @@
</span><span class="cx">     WebEvent::Type type             = isKeyUpEvent(event) ? WebEvent::KeyUp : WebEvent::KeyDown;
</span><span class="cx">     String text                     = textFromEvent(event, replacesSoftSpace);
</span><span class="cx">     String unmodifiedText           = unmodifiedTextFromEvent(event, replacesSoftSpace);
</span><ins>+    String key                      = keyForKeyEvent(event);
</ins><span class="cx">     String keyIdentifier            = keyIdentifierForKeyEvent(event);
</span><span class="cx">     int windowsVirtualKeyCode       = windowsKeyCodeForKeyEvent(event);
</span><span class="cx">     int nativeVirtualKeyCode        = [event keyCode];
</span><span class="lines">@@ -497,7 +498,7 @@
</span><span class="cx">         unmodifiedText = &quot;\x9&quot;;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return WebKeyboardEvent(type, text, unmodifiedText, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, macCharCode, handledByInputMethod, commands, autoRepeat, isKeypad, isSystemKey, modifiers, timestamp);
</del><ins>+    return WebKeyboardEvent(type, text, unmodifiedText, key, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, macCharCode, handledByInputMethod, commands, autoRepeat, isKeypad, isSystemKey, modifiers, timestamp);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre>
</div>
</div>

</body>
</html>