<!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>[206803] 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/206803">206803</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-10-04 20:13:35 -0700 (Tue, 04 Oct 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Implement KeyboardEvent.code from the UI Event spec
https://bugs.webkit.org/show_bug.cgi?id=149584
Reviewed by Darin Adler.
LayoutTests/imported/w3c:
Rebaseline W3C test now that more checks are passing.
* web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt:
Source/WebCore:
Add support for Keyboard.code attribute:
- https://w3c.github.io/uievents/#dom-keyboardevent-code
- https://w3c.github.io/uievents-code/
The feature is only enabled on Mac for now as the implementation is
platform-specific and Mac only.
Test: fast/events/keyboardevent-code.html
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
* platform/PlatformKeyboardEvent.h:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
(WebCore::PlatformKeyboardEvent::code):
(WebCore::PlatformKeyboardEvent::unmodifiedText): Deleted.
* platform/mac/PlatformEventFactoryMac.h:
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::codeForKeyEvent):
(WebCore::keyIdentifierForKeyEvent):
* replay/SerializationMethods.cpp:
(JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue):
(JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):
Source/WebKit2:
Add support for Keyboard.code attribute:
- https://w3c.github.io/uievents/#dom-keyboardevent-code
- https://w3c.github.io/uievents-code/
* Shared/WebEvent.h:
(WebKit::WebKeyboardEvent::code):
* 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 build time flag to toggle support for the code attribute on
KeyboardEvent and only enable it on Mac for now, given that the
implementation is missing on other platforms.
* wtf/FeatureDefines.h:
LayoutTests:
Extend layout test coverage.
* fast/events/arrow-keys-on-body-expected.txt:
* fast/events/arrow-keys-on-body.html:
* 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-code-expected.txt: Added.
* fast/events/keyboardevent-code.html: Added.
* fast/events/special-key-events-in-input-text-expected.txt:
* fast/events/special-key-events-in-input-text.html:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfasteventsarrowkeysonbodyexpectedtxt">trunk/LayoutTests/fast/events/arrow-keys-on-body-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventsarrowkeysonbodyhtml">trunk/LayoutTests/fast/events/arrow-keys-on-body.html</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="#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="#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="#trunkLayoutTestsfasteventskeyboardeventcodeexpectedtxt">trunk/LayoutTests/fast/events/keyboardevent-code-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventskeyboardeventcodehtml">trunk/LayoutTests/fast/events/keyboardevent-code.html</a></li>
<li>trunk/LayoutTests/platform/ios-simulator/fast/events/constructors/</li>
<li><a href="#trunkLayoutTestsplatformiossimulatorfasteventsconstructorskeyboardeventconstructorexpectedtxt">trunk/LayoutTests/platform/ios-simulator/fast/events/constructors/keyboard-event-constructor-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorimportedw3cwebplatformtestsdomeventsEventsubclassesconstructorsexpectedtxt">trunk/LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/LayoutTests/ChangeLog        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2016-10-04 Chris Dumez <cdumez@apple.com>
+
+ Implement KeyboardEvent.code from the UI Event spec
+ https://bugs.webkit.org/show_bug.cgi?id=149584
+
+ Reviewed by Darin Adler.
+
+ Extend layout test coverage.
+
+ * fast/events/arrow-keys-on-body-expected.txt:
+ * fast/events/arrow-keys-on-body.html:
+ * 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-code-expected.txt: Added.
+ * fast/events/keyboardevent-code.html: Added.
+ * fast/events/special-key-events-in-input-text-expected.txt:
+ * fast/events/special-key-events-in-input-text.html:
+
</ins><span class="cx"> 2016-10-04 Simon Fraser <simon.fraser@apple.com>
</span><span class="cx">
</span><span class="cx"> [iOS WK2] Make it possible for a test to describe a user gesture as a stream of events in JSON format
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventsarrowkeysonbodyexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/arrow-keys-on-body-expected.txt (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/arrow-keys-on-body-expected.txt        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/LayoutTests/fast/events/arrow-keys-on-body-expected.txt        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">
</span><span class="cx"> To test manually, press arrow keys and verify that no keypress events are logged.
</span><span class="cx">
</span><del>-target - type - ctrlKey,altKey,shiftKey,metaKey - keyIdentifier - location - keyCode - charCode
-BODY - keydown - false,false,false,false - Left - DOM_KEY_LOCATION_STANDARD - 37 - 0
-BODY - keyup - false,false,false,false - Left - DOM_KEY_LOCATION_STANDARD - 37 - 0
</del><ins>+target - type - ctrlKey,altKey,shiftKey,metaKey - key - code - keyIdentifier - location - keyCode - charCode
+BODY - keydown - false,false,false,false - ArrowLeft - ArrowLeft - Left - DOM_KEY_LOCATION_STANDARD - 37 - 0
+BODY - keyup - false,false,false,false - ArrowLeft - ArrowLeft - Left - DOM_KEY_LOCATION_STANDARD - 37 - 0
</ins><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventsarrowkeysonbodyhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/arrow-keys-on-body.html (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/arrow-keys-on-body.html        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/LayoutTests/fast/events/arrow-keys-on-body.html        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -40,6 +40,8 @@
</span><span class="cx"> + (target.tagName == "INPUT" ? " " + target.type : "")
</span><span class="cx"> + " - " + event.type
</span><span class="cx"> + ' - ' + [event.ctrlKey, event.altKey, event.shiftKey, event.metaKey]
</span><ins>+ + ' - ' + event.key
+ + ' - ' + event.code
</ins><span class="cx"> + ' - ' + event.keyIdentifier
</span><span class="cx"> + ' - ' + (event.location === undefined ? "undefined" : locationName(event.location))
</span><span class="cx"> + ' - ' + event.keyCode
</span><span class="lines">@@ -50,6 +52,8 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> log("target - type - " + ["ctrlKey", "altKey", "shiftKey", "metaKey"]
</span><ins>+ + ' - ' + "key"
+ + ' - ' + "code"
</ins><span class="cx"> + ' - ' + "keyIdentifier"
</span><span class="cx"> + ' - ' + "location"
</span><span class="cx"> + ' - ' + "keyCode"
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventsconstructorskeyboardeventconstructorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/constructors/keyboard-event-constructor-expected.txt (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/constructors/keyboard-event-constructor-expected.txt        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/LayoutTests/fast/events/constructors/keyboard-event-constructor-expected.txt        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -106,17 +106,18 @@
</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, 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 "a"
-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 "chocolate"
-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
</del><ins>+PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', 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', code: 'KeyA', 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', code: 'KeyA', 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', code: 'KeyA', 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', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).key is "a"
+PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).code is "KeyA"
+PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).keyIdentifier is "chocolate"
+PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', 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', code: 'KeyA', 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', code: 'KeyA', 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', code: 'KeyA', 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', code: 'KeyA', 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 (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/constructors/keyboard-event-constructor.html        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/LayoutTests/fast/events/constructors/keyboard-event-constructor.html        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -122,17 +122,18 @@
</span><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> // All initializers are passed.
</span><del>-shouldBe("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", "true");
-shouldBe("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", "true");
-shouldBe("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", "window");
-shouldBe("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", "111");
-shouldBeEqualToString("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", "a");
-shouldBeEqualToString("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", "chocolate");
-shouldBe("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", "222");
-shouldBe("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", "true");
-shouldBe("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", "true");
-shouldBe("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", "true");
-shouldBe("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", "true");
</del><ins>+shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).bubbles", "true");
+shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).cancelable", "true");
+shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).view", "window");
+shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).detail", "111");
+shouldBeEqualToString("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).key", "a");
+shouldBeEqualToString("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).code", "KeyA");
+shouldBeEqualToString("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).keyIdentifier", "chocolate");
+shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).location", "222");
+shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).ctrlKey", "true");
+shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).altKey", "true");
+shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).shiftKey", "true");
+shouldBe("new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).metaKey", "true");
</ins><span class="cx"> </script>
</span><span class="cx"> <script src="../../../resources/js-test-post.js"></script>
</span><span class="cx"> </body>
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventskeyeventsininputbuttonexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/key-events-in-input-button-expected.txt (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/key-events-in-input-button-expected.txt        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/LayoutTests/fast/events/key-events-in-input-button-expected.txt        2016-10-05 03:13:35 UTC (rev 206803)
</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 - key - keyIdentifier - keyCode - charCode
</del><ins>+target - type - ctrlKey,altKey,shiftKey,metaKey - key - code - 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 - - Space - U+0020 - 32 - 0
+INPUT - keypress - false,false,false,false - - Space - - 32 - 32
+INPUT - keyup - false,false,false,false - - Space - U+0020 - 32 - 0
</ins><span class="cx"> INPUT - click
</span><span class="cx"> Enter:
</span><del>-INPUT - keydown - false,false,false,false - Enter - Enter - 13 - 0
-INPUT - keypress - false,false,false,false - Enter - - 13 - 13
</del><ins>+INPUT - keydown - false,false,false,false - Enter - Enter - Enter - 13 - 0
+INPUT - keypress - false,false,false,false - Enter - Enter - - 13 - 13
</ins><span class="cx"> INPUT - click
</span><del>-INPUT - keyup - false,false,false,false - Enter - Enter - 13 - 0
</del><ins>+INPUT - keyup - false,false,false,false - Enter - Enter - Enter - 13 - 0
</ins><span class="cx"> A:
</span><del>-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
</del><ins>+INPUT - keydown - false,false,true,false - A - KeyA - U+0041 - 65 - 0
+INPUT - keypress - false,false,true,false - A - KeyA - - 65 - 65
+INPUT - keyup - false,false,true,false - A - KeyA - 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 (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/key-events-in-input-button.html        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/LayoutTests/fast/events/key-events-in-input-button.html        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -24,6 +24,7 @@
</span><span class="cx"> return (where ? "(" + where + ") " : "") + target.tagName + " - " + event.type
</span><span class="cx"> + ' - ' + [event.ctrlKey, event.altKey, event.shiftKey, event.metaKey]
</span><span class="cx"> + ' - ' + event.key
</span><ins>+ + ' - ' + event.code
</ins><span class="cx"> + ' - ' + event.keyIdentifier
</span><span class="cx"> + ' - ' + event.keyCode
</span><span class="cx"> + ' - ' + event.charCode;
</span><span class="lines">@@ -36,6 +37,7 @@
</span><span class="cx"> }
</span><span class="cx"> log("target - type - " + ["ctrlKey", "altKey", "shiftKey", "metaKey"]
</span><span class="cx"> + ' - ' + "key"
</span><ins>+ + ' - ' + "code"
</ins><span class="cx"> + ' - ' + "keyIdentifier"
</span><span class="cx"> + ' - ' + "keyCode"
</span><span class="cx"> + ' - ' + "charCode");
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventskeyeventsininputtextexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/key-events-in-input-text-expected.txt (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/key-events-in-input-text-expected.txt        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/LayoutTests/fast/events/key-events-in-input-text-expected.txt        2016-10-05 03:13:35 UTC (rev 206803)
</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 - key - keyIdentifier - keyCode - charCode
</del><ins>+target - type - ctrlKey,altKey,shiftKey,metaKey - key - code - keyIdentifier - keyCode - charCode
</ins><span class="cx"> Space:
</span><del>-INPUT - keydown - false,false,false,false - - U+0020 - 32 - 0. Value: "".
-INPUT - keypress - false,false,false,false - - - 32 - 32. Value: "".
</del><ins>+INPUT - keydown - false,false,false,false - - Space - U+0020 - 32 - 0. Value: "".
+INPUT - keypress - false,false,false,false - - Space - - 32 - 32. Value: "".
</ins><span class="cx"> INPUT - textInput - . Value: "".
</span><del>-INPUT - keyup - false,false,false,false - - U+0020 - 32 - 0. Value: " ".
</del><ins>+INPUT - keyup - false,false,false,false - - Space - U+0020 - 32 - 0. Value: " ".
</ins><span class="cx"> Backspace:
</span><del>-INPUT - keydown - false,false,false,false - Backspace - U+0008 - 8 - 0. Value: " ".
-INPUT - keyup - false,false,false,false - Backspace - U+0008 - 8 - 0. Value: "".
</del><ins>+INPUT - keydown - false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: " ".
+INPUT - keyup - false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: "".
</ins><span class="cx"> Left Arrow:
</span><del>-INPUT - keydown - false,false,false,false - ArrowLeft - Left - 37 - 0. Value: "".
-INPUT - keyup - false,false,false,false - ArrowLeft - Left - 37 - 0. Value: "".
</del><ins>+INPUT - keydown - false,false,false,false - ArrowLeft - ArrowLeft - Left - 37 - 0. Value: "".
+INPUT - keyup - false,false,false,false - ArrowLeft - ArrowLeft - Left - 37 - 0. Value: "".
</ins><span class="cx"> Tab:
</span><del>-INPUT - keydown - false,false,false,false - Tab - U+0009 - 9 - 0. Value: "".
</del><ins>+INPUT - keydown - false,false,false,false - Tab - Tab - U+0009 - 9 - 0. Value: "".
</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 (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/key-events-in-input-text.html        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/LayoutTests/fast/events/key-events-in-input-text.html        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> return (where ? "(" + where + ") " : "") + target.tagName + " - " + event.type
</span><span class="cx"> + ' - ' + [event.ctrlKey, event.altKey, event.shiftKey, event.metaKey]
</span><span class="cx"> + ' - ' + event.key
</span><ins>+ + ' - ' + event.code
</ins><span class="cx"> + ' - ' + event.keyIdentifier
</span><span class="cx"> + ' - ' + event.keyCode
</span><span class="cx"> + ' - ' + event.charCode
</span><span class="lines">@@ -40,6 +41,7 @@
</span><span class="cx"> }
</span><span class="cx"> log("target - type - " + ["ctrlKey", "altKey", "shiftKey", "metaKey"]
</span><span class="cx"> + ' - ' + "key"
</span><ins>+ + ' - ' + "code"
</ins><span class="cx"> + ' - ' + "keyIdentifier"
</span><span class="cx"> + ' - ' + "keyCode"
</span><span class="cx"> + ' - ' + "charCode");
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventskeyboardeventcodeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/events/keyboardevent-code-expected.txt (0 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/keyboardevent-code-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/events/keyboardevent-code-expected.txt        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -0,0 +1,190 @@
</span><ins>+Test the code attribute on KeyboardEvent.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+* keydown
+PASS keyboardEvent.code is "Space"
+* keyup
+PASS keyboardEvent.code is "Space"
+
+* keydown
+PASS keyboardEvent.code is "KeyA"
+* keyup
+PASS keyboardEvent.code is "KeyA"
+
+* keydown
+PASS keyboardEvent.code is "Backspace"
+* keyup
+PASS keyboardEvent.code is "Backspace"
+
+* keydown
+PASS keyboardEvent.code is "Minus"
+* keyup
+PASS keyboardEvent.code is "Minus"
+
+* keydown
+PASS keyboardEvent.code is "ArrowLeft"
+* keyup
+PASS keyboardEvent.code is "ArrowLeft"
+
+* keydown
+PASS keyboardEvent.code is "ArrowRight"
+* keyup
+PASS keyboardEvent.code is "ArrowRight"
+
+* keydown
+PASS keyboardEvent.code is "ArrowUp"
+* keyup
+PASS keyboardEvent.code is "ArrowUp"
+
+* keydown
+PASS keyboardEvent.code is "ArrowDown"
+* keyup
+PASS keyboardEvent.code is "ArrowDown"
+
+* keydown
+PASS keyboardEvent.code is "PageUp"
+* keyup
+PASS keyboardEvent.code is "PageUp"
+
+* keydown
+PASS keyboardEvent.code is "PageDown"
+* keyup
+PASS keyboardEvent.code is "PageDown"
+
+* keydown
+PASS keyboardEvent.code is "Home"
+* keyup
+PASS keyboardEvent.code is "Home"
+
+* keydown
+PASS keyboardEvent.code is "End"
+* keyup
+PASS keyboardEvent.code is "End"
+
+* keydown
+PASS keyboardEvent.code is "Delete"
+* keyup
+PASS keyboardEvent.code is "Delete"
+
+* keydown
+PASS keyboardEvent.code is "ControlLeft"
+* keyup
+PASS keyboardEvent.code is "ControlLeft"
+
+* keydown
+PASS keyboardEvent.code is "ShiftLeft"
+* keyup
+PASS keyboardEvent.code is "ShiftLeft"
+
+* keydown
+PASS keyboardEvent.code is "AltLeft"
+* keyup
+PASS keyboardEvent.code is "AltLeft"
+
+* keydown
+PASS keyboardEvent.code is "ControlRight"
+* keyup
+PASS keyboardEvent.code is "ControlRight"
+
+* keydown
+PASS keyboardEvent.code is "ShiftRight"
+* keyup
+PASS keyboardEvent.code is "ShiftRight"
+
+* keydown
+PASS keyboardEvent.code is "AltRight"
+* keyup
+PASS keyboardEvent.code is "AltRight"
+
+* keydown
+PASS keyboardEvent.code is "F1"
+* keyup
+PASS keyboardEvent.code is "F1"
+
+* keydown
+PASS keyboardEvent.code is "F2"
+* keyup
+PASS keyboardEvent.code is "F2"
+
+* keydown
+PASS keyboardEvent.code is "F3"
+* keyup
+PASS keyboardEvent.code is "F3"
+
+* keydown
+PASS keyboardEvent.code is "F4"
+* keyup
+PASS keyboardEvent.code is "F4"
+
+* keydown
+PASS keyboardEvent.code is "F5"
+* keyup
+PASS keyboardEvent.code is "F5"
+
+* keydown
+PASS keyboardEvent.code is "F6"
+* keyup
+PASS keyboardEvent.code is "F6"
+
+* keydown
+PASS keyboardEvent.code is "F7"
+* keyup
+PASS keyboardEvent.code is "F7"
+
+* keydown
+PASS keyboardEvent.code is "F8"
+* keyup
+PASS keyboardEvent.code is "F8"
+
+* keydown
+PASS keyboardEvent.code is "F9"
+* keyup
+PASS keyboardEvent.code is "F9"
+
+* keydown
+PASS keyboardEvent.code is "F10"
+* keyup
+PASS keyboardEvent.code is "F10"
+
+* keydown
+PASS keyboardEvent.code is "F11"
+* keyup
+PASS keyboardEvent.code is "F11"
+
+* keydown
+PASS keyboardEvent.code is "F12"
+* keyup
+PASS keyboardEvent.code is "F12"
+
+* keydown
+PASS keyboardEvent.code is "NumpadEnter"
+* keyup
+PASS keyboardEvent.code is "NumpadEnter"
+
+* keydown
+PASS keyboardEvent.code is "KeyA"
+* keyup
+PASS keyboardEvent.code is "KeyA"
+
+* keydown
+PASS keyboardEvent.code is "KeyA"
+* keyup
+PASS keyboardEvent.code is "KeyA"
+
+* keydown
+PASS keyboardEvent.code is "KeyA"
+* keyup
+PASS keyboardEvent.code is "KeyA"
+
+* keydown
+PASS keyboardEvent.code is "Digit1"
+* keyup
+PASS keyboardEvent.code is "Digit1"
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfasteventskeyboardeventcodehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/events/keyboardevent-code.html (0 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/keyboardevent-code.html         (rev 0)
+++ trunk/LayoutTests/fast/events/keyboardevent-code.html        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -0,0 +1,61 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<input type="text" id="testInput">
+<script>
+description("Test the code attribute on KeyboardEvent.");
+
+var expectedCode;
+
+function testEvent(event)
+{
+ keyboardEvent = event;
+ debug("* " + event.type);
+ shouldBeEqualToString("keyboardEvent.code", "" + expectedCode);
+}
+
+var input = document.getElementById("testInput");
+input.onkeydown = testEvent;
+input.onkeyup = testEvent;
+input.focus();
+
+function sendKeyAndTest(key, modifiers, expected)
+{
+ debug("");
+ expectedCode = expected;
+ eventSender.keyDown(key, []);
+}
+
+sendKeyAndTest(" ", [], "Space");
+sendKeyAndTest("a", [], "KeyA");
+sendKeyAndTest("\x08", [], "Backspace");
+sendKeyAndTest("\x1B", [], "Minus");
+sendKeyAndTest("leftArrow", [], "ArrowLeft");
+sendKeyAndTest("rightArrow", [], "ArrowRight");
+sendKeyAndTest("upArrow", [], "ArrowUp");
+sendKeyAndTest("downArrow", [], "ArrowDown");
+sendKeyAndTest("pageUp", [], "PageUp");
+sendKeyAndTest("pageDown", [], "PageDown");
+sendKeyAndTest("home", [], "Home");
+sendKeyAndTest("end", [], "End");
+sendKeyAndTest("delete", [], "Delete");
+sendKeyAndTest("leftControl", ["ctrlKey"], "ControlLeft");
+sendKeyAndTest("leftShift", ["shiftKey"], "ShiftLeft");
+sendKeyAndTest("leftAlt", ["altKey"], "AltLeft");
+sendKeyAndTest("rightControl", ["ctrlKey"], "ControlRight");
+sendKeyAndTest("rightShift", ["shiftKey"], "ShiftRight");
+sendKeyAndTest("rightAlt", ["altKey"], "AltRight");
+for (var i = 1; i <= 12; i++)
+ sendKeyAndTest("F" + i, [], "F" + i);
+sendKeyAndTest("\n", [], "NumpadEnter");
+sendKeyAndTest("A", [], "KeyA");
+sendKeyAndTest("a", ["ctrlKey"], "KeyA");
+sendKeyAndTest("a", ["metaKey"], "KeyA");
+sendKeyAndTest("1", ['altKey'], "Digit1");
+
+debug("");
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</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 (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/special-key-events-in-input-text-expected.txt        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/LayoutTests/fast/events/special-key-events-in-input-text-expected.txt        2016-10-05 03:13:35 UTC (rev 206803)
</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 - key - keyIdentifier - keyCode - charCode
</del><ins>+target - type - ctrlKey,altKey,shiftKey,metaKey - key - code - keyIdentifier - keyCode - charCode
</ins><span class="cx">
</span><span class="cx"> Ampersand:
</span><del>-INPUT - keydown - false,false,true,false - 7 - U+0037 - 55 - 0. Value: "".
-INPUT - keypress - false,false,true,false - 7 - - 55 - 55. Value: "".
</del><ins>+INPUT - keydown - false,false,true,false - 7 - Digit7 - U+0037 - 55 - 0. Value: "".
+INPUT - keypress - false,false,true,false - 7 - Digit7 - - 55 - 55. Value: "".
</ins><span class="cx"> INPUT - textInput - 7. Value: "".
</span><del>-INPUT - keyup - false,false,true,false - 7 - U+0037 - 55 - 0. Value: "7".
</del><ins>+INPUT - keyup - false,false,true,false - 7 - Digit7 - U+0037 - 55 - 0. Value: "7".
</ins><span class="cx">
</span><span class="cx"> Backspace:
</span><del>-INPUT - keydown - false,false,false,false - Backspace - U+0008 - 8 - 0. Value: "7".
-INPUT - keyup - false,false,false,false - Backspace - U+0008 - 8 - 0. Value: "".
</del><ins>+INPUT - keydown - false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: "7".
+INPUT - keyup - false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: "".
</ins><span class="cx">
</span><span class="cx"> Percent:
</span><del>-INPUT - keydown - false,false,true,false - 5 - U+0035 - 53 - 0. Value: "".
-INPUT - keypress - false,false,true,false - 5 - - 53 - 53. Value: "".
</del><ins>+INPUT - keydown - false,false,true,false - 5 - Digit5 - U+0035 - 53 - 0. Value: "".
+INPUT - keypress - false,false,true,false - 5 - Digit5 - - 53 - 53. Value: "".
</ins><span class="cx"> INPUT - textInput - 5. Value: "".
</span><del>-INPUT - keyup - false,false,true,false - 5 - U+0035 - 53 - 0. Value: "5".
</del><ins>+INPUT - keyup - false,false,true,false - 5 - Digit5 - U+0035 - 53 - 0. Value: "5".
</ins><span class="cx">
</span><span class="cx"> Backspace:
</span><del>-INPUT - keydown - false,false,false,false - Backspace - U+0008 - 8 - 0. Value: "5".
-INPUT - keyup - false,false,false,false - Backspace - U+0008 - 8 - 0. Value: "".
</del><ins>+INPUT - keydown - false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: "5".
+INPUT - keyup - false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: "".
</ins><span class="cx">
</span><span class="cx"> Left parenthesis:
</span><del>-INPUT - keydown - false,false,true,false - 9 - U+0039 - 57 - 0. Value: "".
-INPUT - keypress - false,false,true,false - 9 - - 57 - 57. Value: "".
</del><ins>+INPUT - keydown - false,false,true,false - 9 - Digit9 - U+0039 - 57 - 0. Value: "".
+INPUT - keypress - false,false,true,false - 9 - Digit9 - - 57 - 57. Value: "".
</ins><span class="cx"> INPUT - textInput - 9. Value: "".
</span><del>-INPUT - keyup - false,false,true,false - 9 - U+0039 - 57 - 0. Value: "9".
</del><ins>+INPUT - keyup - false,false,true,false - 9 - Digit9 - U+0039 - 57 - 0. Value: "9".
</ins><span class="cx">
</span><span class="cx"> Backspace:
</span><del>-INPUT - keydown - false,false,false,false - Backspace - U+0008 - 8 - 0. Value: "9".
-INPUT - keyup - false,false,false,false - Backspace - U+0008 - 8 - 0. Value: "".
</del><ins>+INPUT - keydown - false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: "9".
+INPUT - keyup - false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: "".
</ins><span class="cx">
</span><span class="cx"> Right parenthesis:
</span><del>-INPUT - keydown - false,false,true,false - 0 - U+0030 - 48 - 0. Value: "".
-INPUT - keypress - false,false,true,false - 0 - - 48 - 48. Value: "".
</del><ins>+INPUT - keydown - false,false,true,false - 0 - Digit0 - U+0030 - 48 - 0. Value: "".
+INPUT - keypress - false,false,true,false - 0 - Digit0 - - 48 - 48. Value: "".
</ins><span class="cx"> INPUT - textInput - 0. Value: "".
</span><del>-INPUT - keyup - false,false,true,false - 0 - U+0030 - 48 - 0. Value: "0".
</del><ins>+INPUT - keyup - false,false,true,false - 0 - Digit0 - U+0030 - 48 - 0. Value: "0".
</ins><span class="cx">
</span><span class="cx"> Backspace:
</span><del>-INPUT - keydown - false,false,false,false - Backspace - U+0008 - 8 - 0. Value: "0".
-INPUT - keyup - false,false,false,false - Backspace - U+0008 - 8 - 0. Value: "".
</del><ins>+INPUT - keydown - false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: "0".
+INPUT - keyup - false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: "".
</ins><span class="cx">
</span><span class="cx"> Print screen:
</span><del>-INPUT - keydown - false,false,false,false - PrintScreen - PrintScreen - 44 - 0. Value: "".
-INPUT - keyup - false,false,false,false - PrintScreen - PrintScreen - 44 - 0. Value: "".
</del><ins>+INPUT - keydown - false,false,false,false - PrintScreen - KeyA - PrintScreen - 44 - 0. Value: "".
+INPUT - keyup - false,false,false,false - PrintScreen - KeyA - PrintScreen - 44 - 0. Value: "".
</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 (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/special-key-events-in-input-text.html        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/LayoutTests/fast/events/special-key-events-in-input-text.html        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -19,6 +19,7 @@
</span><span class="cx"> } else if (type == "keydown" || type == "keypress" || type == "keyup") {
</span><span class="cx"> info += [e.ctrlKey, e.altKey, e.shiftKey, e.metaKey] +
</span><span class="cx"> ' - ' + e.key +
</span><ins>+ ' - ' + e.code +
</ins><span class="cx"> ' - ' + e.keyIdentifier +
</span><span class="cx"> ' - ' + e.keyCode +
</span><span class="cx"> ' - ' + e.charCode;
</span><span class="lines">@@ -29,6 +30,7 @@
</span><span class="cx">
</span><span class="cx"> log("target - type - " + ["ctrlKey", "altKey", "shiftKey", "metaKey"]
</span><span class="cx"> + ' - ' + "key"
</span><ins>+ + ' - ' + "code"
</ins><span class="cx"> + ' - ' + "keyIdentifier"
</span><span class="cx"> + ' - ' + "keyCode"
</span><span class="cx"> + ' - ' + "charCode");
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-10-04 Chris Dumez <cdumez@apple.com>
+
+ Implement KeyboardEvent.code from the UI Event spec
+ https://bugs.webkit.org/show_bug.cgi?id=149584
+
+ Reviewed by Darin Adler.
+
+ Rebaseline W3C test now that more checks are passing.
+
+ * web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt:
+
</ins><span class="cx"> 2016-10-04 Youenn Fablet <youenn@apple.com>
</span><span class="cx">
</span><span class="cx"> [Fetch API] ReadableStream should be errored with TypeError values
</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 (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -29,12 +29,12 @@
</span><span class="cx"> FAIL WheelEvent constructor (empty argument) assert_true: Event object "[object WheelEvent]" should have a buttons property expected true got false
</span><span class="cx"> FAIL WheelEvent constructor (argument with default values) assert_true: Event object "[object WheelEvent]" 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 "[object WheelEvent]" should have a buttons property expected true got false
</span><del>-FAIL KeyboardEvent constructor (no argument) assert_true: Event object "[object KeyboardEvent]" should have a code property expected true got false
-FAIL KeyboardEvent constructor (undefined argument) assert_true: Event object "[object KeyboardEvent]" should have a code property expected true got false
-FAIL KeyboardEvent constructor (null argument) assert_true: Event object "[object KeyboardEvent]" should have a code property expected true got false
-FAIL KeyboardEvent constructor (empty argument) assert_true: Event object "[object KeyboardEvent]" should have a code property expected true got false
-FAIL KeyboardEvent constructor (argument with default values) assert_true: Event object "[object KeyboardEvent]" should have a code property expected true got false
-FAIL KeyboardEvent constructor (argument with non-default values) assert_true: Event object "[object KeyboardEvent]" should have a code property expected true got false
</del><ins>+PASS KeyboardEvent constructor (no argument)
+PASS KeyboardEvent constructor (undefined argument)
+PASS KeyboardEvent constructor (null argument)
+PASS KeyboardEvent constructor (empty argument)
+PASS KeyboardEvent constructor (argument with default values)
+FAIL KeyboardEvent constructor (argument with non-default values) assert_equals: The value of the charCode property should be 7 expected 7 but got 0
</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 (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -337,6 +337,7 @@
</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><span class="cx"> fast/events/keyboardevent-key.html [ Skip ]
</span><ins>+fast/events/keyboardevent-code.html [ Skip ]
</ins><span class="cx">
</span><span class="cx"> # The file-wrapper part of <attachment> is not yet working on iOS
</span><span class="cx"> fast/attachment/attachment-type-attribute.html [ Skip ]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorfasteventsconstructorskeyboardeventconstructorexpectedtxtfromrev206802trunkLayoutTestsfasteventsconstructorskeyboardeventconstructorexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/platform/ios-simulator/fast/events/constructors/keyboard-event-constructor-expected.txt (from rev 206802, trunk/LayoutTests/fast/events/constructors/keyboard-event-constructor-expected.txt) (0 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/fast/events/constructors/keyboard-event-constructor-expected.txt         (rev 0)
+++ trunk/LayoutTests/platform/ios-simulator/fast/events/constructors/keyboard-event-constructor-expected.txt        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -0,0 +1,124 @@
</span><ins>+This tests the constructor for the KeyboardEvent DOM class.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS new KeyboardEvent('eventType').bubbles is false
+PASS new KeyboardEvent('eventType').cancelable is false
+PASS new KeyboardEvent('eventType').view is null
+PASS new KeyboardEvent('eventType').detail is 0
+PASS new KeyboardEvent('eventType').keyIdentifier is ""
+PASS new KeyboardEvent('eventType').location is 0
+PASS new KeyboardEvent('eventType').ctrlKey is false
+PASS new KeyboardEvent('eventType').altKey is false
+PASS new KeyboardEvent('eventType').shiftKey is false
+PASS new KeyboardEvent('eventType').metaKey is false
+PASS new KeyboardEvent('eventType', { bubbles: false }).bubbles is false
+PASS new KeyboardEvent('eventType', { bubbles: true }).bubbles is true
+PASS new KeyboardEvent('eventType', { cancelable: false }).cancelable is false
+PASS new KeyboardEvent('eventType', { cancelable: true }).cancelable is true
+PASS new KeyboardEvent('eventType', { view: window }).view is window
+PASS new KeyboardEvent('eventType', { view: this }).view is this
+PASS new KeyboardEvent('eventType', { }).repeat is false
+PASS new KeyboardEvent('eventType', { repeat: false }).repeat is false
+PASS new KeyboardEvent('eventType', { repeat: true }).repeat is true
+PASS new KeyboardEvent('eventType', { }).isComposing is false
+PASS new KeyboardEvent('eventType', { isComposing: false }).isComposing is false
+PASS new KeyboardEvent('eventType', { isComposing: true }).isComposing is true
+PASS new KeyboardEvent('eventType', { view: testObject }).view threw exception TypeError: Dictionary member is not of type Window.
+PASS new KeyboardEvent('eventType', { view: document }).view threw exception TypeError: Dictionary member is not of type Window.
+PASS new KeyboardEvent('eventType', { view: undefined }).view is null
+PASS new KeyboardEvent('eventType', { view: null }).view is null
+PASS new KeyboardEvent('eventType', { view: false }).view threw exception TypeError: Dictionary member is not of type Window.
+PASS new KeyboardEvent('eventType', { view: true }).view threw exception TypeError: Dictionary member is not of type Window.
+PASS new KeyboardEvent('eventType', { view: '' }).view threw exception TypeError: Dictionary member is not of type Window.
+PASS new KeyboardEvent('eventType', { view: 'chocolate' }).view threw exception TypeError: Dictionary member is not of type Window.
+PASS new KeyboardEvent('eventType', { view: 12345 }).view threw exception TypeError: Dictionary member is not of type Window.
+PASS new KeyboardEvent('eventType', { view: 18446744073709551615 }).view threw exception TypeError: Dictionary member is not of type Window.
+PASS new KeyboardEvent('eventType', { view: NaN }).view threw exception TypeError: Dictionary member is not of type Window.
+PASS new KeyboardEvent('eventType', { view: {valueOf: function () { return window; } } }).view threw exception TypeError: Dictionary member is not of type Window.
+PASS new KeyboardEvent('eventType', { get view() { return 123; } }).view threw exception TypeError: Dictionary member is not of type Window.
+PASS new KeyboardEvent('eventType', { get view() { throw 'KeyboardEvent Error'; } }) threw exception KeyboardEvent Error.
+PASS new KeyboardEvent('eventType', { keyIdentifier: 'koakuma' }).keyIdentifier is "koakuma"
+PASS new KeyboardEvent('eventType', { keyIdentifier: '' }).keyIdentifier is ""
+PASS new KeyboardEvent('eventType', { keyIdentifier: undefined }).keyIdentifier is "undefined"
+PASS new KeyboardEvent('eventType', { keyIdentifier: null }).keyIdentifier is "null"
+PASS new KeyboardEvent('eventType', { keyIdentifier: false }).keyIdentifier is "false"
+PASS new KeyboardEvent('eventType', { keyIdentifier: true }).keyIdentifier is "true"
+PASS new KeyboardEvent('eventType', { keyIdentifier: 12345 }).keyIdentifier is "12345"
+PASS new KeyboardEvent('eventType', { keyIdentifier: 18446744073709551615 }).keyIdentifier is "18446744073709552000"
+PASS new KeyboardEvent('eventType', { keyIdentifier: NaN }).keyIdentifier is "NaN"
+PASS new KeyboardEvent('eventType', { keyIdentifier: [] }).keyIdentifier is ""
+PASS new KeyboardEvent('eventType', { keyIdentifier: [1, 2, 3] }).keyIdentifier is "1,2,3"
+PASS new KeyboardEvent('eventType', { keyIdentifier: {koakuma: 12345} }).keyIdentifier is "[object Object]"
+PASS new KeyboardEvent('eventType', { keyIdentifier: {valueOf: function () { return 'koakuma'; } } }).keyIdentifier is "[object Object]"
+PASS new KeyboardEvent('eventType', { location: KeyboardEvent.DOM_KEY_LOCATION_STANDARD }).location is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
+PASS new KeyboardEvent('eventType', { location: KeyboardEvent.DOM_KEY_LOCATION_LEFT }).location is KeyboardEvent.DOM_KEY_LOCATION_LEFT
+PASS new KeyboardEvent('eventType', { location: 4294967294 }).location is 4294967294
+PASS new KeyboardEvent('eventType', { location: 4294967295 }).location is 4294967295
+PASS new KeyboardEvent('eventType', { location: 9007199254740991 }).location is 4294967295
+PASS new KeyboardEvent('eventType', { location: 18446744073709551615 }).location is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
+PASS new KeyboardEvent('eventType', { location: 12345678901234567890 }).location is 3944679424
+PASS new KeyboardEvent('eventType', { location: -1 }).location is 4294967295
+PASS new KeyboardEvent('eventType', { location: 123.45 }).location is 123
+PASS new KeyboardEvent('eventType', { location: NaN }).location is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
+PASS new KeyboardEvent('eventType', { location: undefined }).location is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
+PASS new KeyboardEvent('eventType', { location: null }).location is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
+PASS new KeyboardEvent('eventType', { location: '' }).location is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
+PASS new KeyboardEvent('eventType', { location: '12345' }).location is 12345
+PASS new KeyboardEvent('eventType', { location: '12345a' }).location is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
+PASS new KeyboardEvent('eventType', { location: 'abc' }).location is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
+PASS new KeyboardEvent('eventType', { location: [] }).location is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
+PASS new KeyboardEvent('eventType', { location: [12345] }).location is 12345
+PASS new KeyboardEvent('eventType', { location: [12345, 67890] }).location is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
+PASS new KeyboardEvent('eventType', { location: {} }).location is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
+PASS new KeyboardEvent('eventType', { location: {moemoe: 12345} }).location is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
+PASS new KeyboardEvent('eventType', { location: {valueOf: function () { return 12345; }} }).location is 12345
+PASS new KeyboardEvent('eventType', { keyLocation: KeyboardEvent.DOM_KEY_LOCATION_STANDARD }).keyLocation is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
+PASS new KeyboardEvent('eventType', { keyLocation: KeyboardEvent.DOM_KEY_LOCATION_LEFT }).keyLocation is KeyboardEvent.DOM_KEY_LOCATION_LEFT
+PASS new KeyboardEvent('eventType', { keyLocation: 4294967294 }).keyLocation is 4294967294
+PASS new KeyboardEvent('eventType', { keyLocation: 4294967295 }).keyLocation is 4294967295
+PASS new KeyboardEvent('eventType', { keyLocation: 9007199254740991 }).keyLocation is 4294967295
+PASS new KeyboardEvent('eventType', { keyLocation: 18446744073709551615 }).keyLocation is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
+PASS new KeyboardEvent('eventType', { keyLocation: 12345678901234567890 }).keyLocation is 3944679424
+PASS new KeyboardEvent('eventType', { keyLocation: -1 }).keyLocation is 4294967295
+PASS new KeyboardEvent('eventType', { keyLocation: 123.45 }).keyLocation is 123
+PASS new KeyboardEvent('eventType', { keyLocation: NaN }).keyLocation is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
+PASS new KeyboardEvent('eventType', { keyLocation: undefined }).keyLocation is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
+PASS new KeyboardEvent('eventType', { keyLocation: null }).keyLocation is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
+PASS new KeyboardEvent('eventType', { keyLocation: '' }).keyLocation is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
+PASS new KeyboardEvent('eventType', { keyLocation: '12345' }).keyLocation is 12345
+PASS new KeyboardEvent('eventType', { keyLocation: '12345a' }).keyLocation is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
+PASS new KeyboardEvent('eventType', { keyLocation: 'abc' }).keyLocation is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
+PASS new KeyboardEvent('eventType', { keyLocation: [] }).keyLocation is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
+PASS new KeyboardEvent('eventType', { keyLocation: [12345] }).keyLocation is 12345
+PASS new KeyboardEvent('eventType', { keyLocation: [12345, 67890] }).keyLocation is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
+PASS new KeyboardEvent('eventType', { keyLocation: {} }).keyLocation is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
+PASS new KeyboardEvent('eventType', { keyLocation: {moemoe: 12345} }).keyLocation is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
+PASS new KeyboardEvent('eventType', { keyLocation: {valueOf: function () { return 12345; }} }).keyLocation is 12345
+PASS new KeyboardEvent('eventType', { keyLocation: KeyboardEvent.DOM_KEY_LOCATION_LEFT }).location is KeyboardEvent.DOM_KEY_LOCATION_LEFT
+PASS new KeyboardEvent('eventType', { location: KeyboardEvent.DOM_KEY_LOCATION_LEFT }).keyLocation is KeyboardEvent.DOM_KEY_LOCATION_LEFT
+PASS new KeyboardEvent('eventType', { ctrlKey: false }).ctrlKey is false
+PASS new KeyboardEvent('eventType', { ctrlKey: true }).ctrlKey is true
+PASS new KeyboardEvent('eventType', { altKey: false }).altKey is false
+PASS new KeyboardEvent('eventType', { altKey: true }).altKey is true
+PASS new KeyboardEvent('eventType', { shiftKey: false }).shiftKey is false
+PASS new KeyboardEvent('eventType', { shiftKey: true }).shiftKey is true
+PASS new KeyboardEvent('eventType', { metaKey: false }).metaKey is false
+PASS new KeyboardEvent('eventType', { metaKey: true }).metaKey is true
+PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', 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', code: 'KeyA', 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', code: 'KeyA', 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', code: 'KeyA', 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', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).key is "a"
+FAIL new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).code should be KeyA (of type string). Was undefined (of type undefined).
+PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).keyIdentifier is "chocolate"
+PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', 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', code: 'KeyA', 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', code: 'KeyA', 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', code: 'KeyA', 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', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).metaKey is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorimportedw3cwebplatformtestsdomeventsEventsubclassesconstructorsexpectedtxtfromrev206802trunkLayoutTestsimportedw3cwebplatformtestsdomeventsEventsubclassesconstructorsexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt (from rev 206802, trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt) (0 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt         (rev 0)
+++ trunk/LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+
+PASS Event constructor (no argument)
+PASS Event constructor (undefined argument)
+PASS Event constructor (null argument)
+PASS Event constructor (empty argument)
+PASS Event constructor (argument with default values)
+PASS Event constructor (argument with non-default values)
+PASS UIEvent constructor (no argument)
+PASS UIEvent constructor (undefined argument)
+PASS UIEvent constructor (null argument)
+PASS UIEvent constructor (empty argument)
+PASS UIEvent constructor (argument with default values)
+PASS UIEvent constructor (argument with non-default values)
+PASS FocusEvent constructor (no argument)
+PASS FocusEvent constructor (undefined argument)
+PASS FocusEvent constructor (null argument)
+PASS FocusEvent constructor (empty argument)
+PASS FocusEvent constructor (argument with default values)
+PASS FocusEvent constructor (argument with non-default values)
+FAIL MouseEvent constructor (no argument) assert_true: Event object "[object MouseEvent]" should have a buttons property expected true got false
+FAIL MouseEvent constructor (undefined argument) assert_true: Event object "[object MouseEvent]" should have a buttons property expected true got false
+FAIL MouseEvent constructor (null argument) assert_true: Event object "[object MouseEvent]" should have a buttons property expected true got false
+FAIL MouseEvent constructor (empty argument) assert_true: Event object "[object MouseEvent]" should have a buttons property expected true got false
+FAIL MouseEvent constructor (argument with default values) assert_true: Event object "[object MouseEvent]" should have a buttons property expected true got false
+FAIL MouseEvent constructor (argument with non-default values) assert_true: Event object "[object MouseEvent]" should have a buttons property expected true got false
+FAIL WheelEvent constructor (no argument) assert_true: Event object "[object WheelEvent]" should have a buttons property expected true got false
+FAIL WheelEvent constructor (undefined argument) assert_true: Event object "[object WheelEvent]" should have a buttons property expected true got false
+FAIL WheelEvent constructor (null argument) assert_true: Event object "[object WheelEvent]" should have a buttons property expected true got false
+FAIL WheelEvent constructor (empty argument) assert_true: Event object "[object WheelEvent]" should have a buttons property expected true got false
+FAIL WheelEvent constructor (argument with default values) assert_true: Event object "[object WheelEvent]" should have a buttons property expected true got false
+FAIL WheelEvent constructor (argument with non-default values) assert_true: Event object "[object WheelEvent]" should have a buttons property expected true got false
+FAIL KeyboardEvent constructor (no argument) assert_true: Event object "[object KeyboardEvent]" should have a code property expected true got false
+FAIL KeyboardEvent constructor (undefined argument) assert_true: Event object "[object KeyboardEvent]" should have a code property expected true got false
+FAIL KeyboardEvent constructor (null argument) assert_true: Event object "[object KeyboardEvent]" should have a code property expected true got false
+FAIL KeyboardEvent constructor (empty argument) assert_true: Event object "[object KeyboardEvent]" should have a code property expected true got false
+FAIL KeyboardEvent constructor (argument with default values) assert_true: Event object "[object KeyboardEvent]" should have a code property expected true got false
+FAIL KeyboardEvent constructor (argument with non-default values) assert_true: Event object "[object KeyboardEvent]" should have a code property expected true got false
+PASS CompositionEvent constructor (no argument)
+PASS CompositionEvent constructor (undefined argument)
+PASS CompositionEvent constructor (null argument)
+PASS CompositionEvent constructor (empty argument)
+PASS CompositionEvent constructor (argument with default values)
+PASS CompositionEvent constructor (argument with non-default values)
+PASS UIEvent constructor (view argument with wrong type)
+
</ins></span></pre></div>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/Source/WTF/ChangeLog        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2016-10-04 Chris Dumez <cdumez@apple.com>
+
+ Implement KeyboardEvent.code from the UI Event spec
+ https://bugs.webkit.org/show_bug.cgi?id=149584
+
+ Reviewed by Darin Adler.
+
+ Add build time flag to toggle support for the code attribute on
+ KeyboardEvent and only enable it on Mac for now, given that the
+ implementation is missing on other platforms.
+
+ * wtf/FeatureDefines.h:
+
</ins><span class="cx"> 2016-10-03 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Add support for KeyboardEvent.key attribute
</span></span></pre></div>
<a id="trunkSourceWTFwtfFeatureDefinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/FeatureDefines.h (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/FeatureDefines.h        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/Source/WTF/wtf/FeatureDefines.h        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -247,6 +247,10 @@
</span><span class="cx"> #define ENABLE_MAC_GESTURE_EVENTS 1
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if !defined(ENABLE_KEYBOARD_CODE_ATTRIBUTE)
+#define ENABLE_KEYBOARD_CODE_ATTRIBUTE 1
+#endif
+
</ins><span class="cx"> #endif /* PLATFORM(MAC) */
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="lines">@@ -777,6 +781,10 @@
</span><span class="cx"> #define ENABLE_KEYBOARD_KEY_ATTRIBUTE 0
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if !defined(ENABLE_KEYBOARD_CODE_ATTRIBUTE)
+#define ENABLE_KEYBOARD_CODE_ATTRIBUTE 0
+#endif
+
</ins><span class="cx"> /* Asserts, invariants for macro definitions */
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO_TRACK) && !ENABLE(VIDEO)
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/Source/WebCore/ChangeLog        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2016-10-04 Chris Dumez <cdumez@apple.com>
+
+ Implement KeyboardEvent.code from the UI Event spec
+ https://bugs.webkit.org/show_bug.cgi?id=149584
+
+ Reviewed by Darin Adler.
+
+ Add support for Keyboard.code attribute:
+ - https://w3c.github.io/uievents/#dom-keyboardevent-code
+ - https://w3c.github.io/uievents-code/
+
+ The feature is only enabled on Mac for now as the implementation is
+ platform-specific and Mac only.
+
+ Test: fast/events/keyboardevent-code.html
+
+ * dom/KeyboardEvent.cpp:
+ (WebCore::KeyboardEvent::KeyboardEvent):
+ * dom/KeyboardEvent.h:
+ * dom/KeyboardEvent.idl:
+ * platform/PlatformKeyboardEvent.h:
+ (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
+ (WebCore::PlatformKeyboardEvent::code):
+ (WebCore::PlatformKeyboardEvent::unmodifiedText): Deleted.
+ * platform/mac/PlatformEventFactoryMac.h:
+ * platform/mac/PlatformEventFactoryMac.mm:
+ (WebCore::codeForKeyEvent):
+ (WebCore::keyIdentifierForKeyEvent):
+ * replay/SerializationMethods.cpp:
+ (JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue):
+ (JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):
+
</ins><span class="cx"> 2016-10-04 Said Abou-Hallawa <sabouhallawa@apple.com>
</span><span class="cx">
</span><span class="cx"> The dragged image should be the current frame only of the animated image
</span></span></pre></div>
<a id="trunkSourceWebCoredomKeyboardEventcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/KeyboardEvent.cpp (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/KeyboardEvent.cpp        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/Source/WebCore/dom/KeyboardEvent.cpp        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -101,6 +101,9 @@
</span><span class="cx"> #if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
</span><span class="cx"> , m_key(key.key())
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(KEYBOARD_CODE_ATTRIBUTE)
+ , m_code(key.code())
+#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">@@ -128,6 +131,9 @@
</span><span class="cx"> #if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
</span><span class="cx"> , m_key(initializer.key)
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(KEYBOARD_CODE_ATTRIBUTE)
+ , m_code(initializer.code)
+#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 (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/KeyboardEvent.h        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/Source/WebCore/dom/KeyboardEvent.h        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -37,6 +37,9 @@
</span><span class="cx"> #if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
</span><span class="cx"> String key;
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(KEYBOARD_CODE_ATTRIBUTE)
+ String code;
+#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">@@ -83,6 +86,9 @@
</span><span class="cx"> #if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
</span><span class="cx"> const String& key() const { return m_key; }
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(KEYBOARD_CODE_ATTRIBUTE)
+ const String& code() const { return m_code; }
+#endif
</ins><span class="cx">
</span><span class="cx"> const String& keyIdentifier() const { return m_keyIdentifier; }
</span><span class="cx"> unsigned location() const { return m_location; }
</span><span class="lines">@@ -123,6 +129,9 @@
</span><span class="cx"> #if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
</span><span class="cx"> String m_key;
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(KEYBOARD_CODE_ATTRIBUTE)
+ String m_code;
+#endif
</ins><span class="cx"> String m_keyIdentifier;
</span><span class="cx"> unsigned m_location { DOM_KEY_LOCATION_STANDARD };
</span><span class="cx"> bool m_repeat { false };
</span></span></pre></div>
<a id="trunkSourceWebCoredomKeyboardEventidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/KeyboardEvent.idl (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/KeyboardEvent.idl        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/Source/WebCore/dom/KeyboardEvent.idl        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -29,10 +29,7 @@
</span><span class="cx"> const unsigned long DOM_KEY_LOCATION_NUMPAD = 0x03;
</span><span class="cx">
</span><span class="cx"> [InitializedByEventConstructor, Conditional=KEYBOARD_KEY_ATTRIBUTE] readonly attribute DOMString key;
</span><del>-
- // FIXME: We should support this.
- // [InitializedByEventConstructor] readonly attribute DOMString code;
-
</del><ins>+ [InitializedByEventConstructor, Conditional=KEYBOARD_CODE_ATTRIBUTE] readonly attribute DOMString code;
</ins><span class="cx"> [InitializedByEventConstructor] readonly attribute unsigned long location;
</span><span class="cx">
</span><span class="cx"> [InitializedByEventConstructor] readonly attribute boolean ctrlKey;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformPlatformKeyboardEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/PlatformKeyboardEvent.h (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/PlatformKeyboardEvent.h        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/Source/WebCore/platform/PlatformKeyboardEvent.h        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -74,6 +74,9 @@
</span><span class="cx"> #if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
</span><span class="cx"> const String& key,
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(KEYBOARD_CODE_ATTRIBUTE)
+ const String& code,
+#endif
</ins><span class="cx"> const String& keyIdentifier, int windowsVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet<Modifier> modifiers, double timestamp)
</span><span class="cx"> : PlatformEvent(type, modifiers, timestamp)
</span><span class="cx"> , m_text(text)
</span><span class="lines">@@ -81,6 +84,9 @@
</span><span class="cx"> #if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
</span><span class="cx"> , m_key(key)
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(KEYBOARD_CODE_ATTRIBUTE)
+ , m_code(code)
+#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">@@ -112,6 +118,9 @@
</span><span class="cx"> #if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
</span><span class="cx"> const String& key() const { return m_key; }
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(KEYBOARD_CODE_ATTRIBUTE)
+ const String& code() const { return m_code; }
+#endif
</ins><span class="cx">
</span><span class="cx"> // Most compatible Windows virtual key code associated with the event.
</span><span class="cx"> // Zero for Char events.
</span><span class="lines">@@ -168,6 +177,9 @@
</span><span class="cx"> #if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
</span><span class="cx"> String m_key;
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(KEYBOARD_CODE_ATTRIBUTE)
+ String m_code;
+#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="trunkSourceWebCoreplatformmacPlatformEventFactoryMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.h (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.h        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.h        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx"> WEBCORE_EXPORT int windowsKeyCodeForKeyEvent(NSEvent *);
</span><span class="cx"> WEBCORE_EXPORT String keyIdentifierForKeyEvent(NSEvent *);
</span><span class="cx"> WEBCORE_EXPORT String keyForKeyEvent(NSEvent *);
</span><ins>+WEBCORE_EXPORT String codeForKeyEvent(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 (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -286,6 +286,218 @@
</span><span class="cx"> return keyForCharCode([s characterAtIndex:0]);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+// https://w3c.github.io/uievents-code/
+String codeForKeyEvent(NSEvent *event)
+{
+ switch ([event keyCode]) {
+ // Keys in the alphanumeric section.
+ case kVK_ANSI_Grave: return ASCIILiteral("Backquote");
+ case kVK_ANSI_Backslash: return ASCIILiteral("Backslash");
+ case kVK_Delete: return ASCIILiteral("Backspace");
+ case kVK_ANSI_LeftBracket: return ASCIILiteral("BracketLeft");
+ case kVK_ANSI_RightBracket: return ASCIILiteral("BracketRight");
+ case kVK_ANSI_Comma: return ASCIILiteral("Comma");
+ case kVK_ANSI_0: return ASCIILiteral("Digit0");
+ case kVK_ANSI_1: return ASCIILiteral("Digit1");
+ case kVK_ANSI_2: return ASCIILiteral("Digit2");
+ case kVK_ANSI_3: return ASCIILiteral("Digit3");
+ case kVK_ANSI_4: return ASCIILiteral("Digit4");
+ case kVK_ANSI_5: return ASCIILiteral("Digit5");
+ case kVK_ANSI_6: return ASCIILiteral("Digit6");
+ case kVK_ANSI_7: return ASCIILiteral("Digit7");
+ case kVK_ANSI_8: return ASCIILiteral("Digit8");
+ case kVK_ANSI_9: return ASCIILiteral("Digit9");
+ case kVK_ANSI_Equal: return ASCIILiteral("Equal");
+ case kVK_ISO_Section: return ASCIILiteral("IntlBackslash");
+ case kVK_JIS_Underscore: return ASCIILiteral("IntlRo");
+ case kVK_JIS_Yen: return ASCIILiteral("IntlYen");
+ case kVK_ANSI_A: return ASCIILiteral("KeyA");
+ case kVK_ANSI_B: return ASCIILiteral("KeyB");
+ case kVK_ANSI_C: return ASCIILiteral("KeyC");
+ case kVK_ANSI_D: return ASCIILiteral("KeyD");
+ case kVK_ANSI_E: return ASCIILiteral("KeyE");
+ case kVK_ANSI_F: return ASCIILiteral("KeyF");
+ case kVK_ANSI_G: return ASCIILiteral("KeyG");
+ case kVK_ANSI_H: return ASCIILiteral("KeyH");
+ case kVK_ANSI_I: return ASCIILiteral("KeyI");
+ case kVK_ANSI_J: return ASCIILiteral("KeyJ");
+ case kVK_ANSI_K: return ASCIILiteral("KeyK");
+ case kVK_ANSI_L: return ASCIILiteral("KeyL");
+ case kVK_ANSI_M: return ASCIILiteral("KeyM");
+ case kVK_ANSI_N: return ASCIILiteral("KeyN");
+ case kVK_ANSI_O: return ASCIILiteral("KeyO");
+ case kVK_ANSI_P: return ASCIILiteral("KeyP");
+ case kVK_ANSI_Q: return ASCIILiteral("KeyQ");
+ case kVK_ANSI_R: return ASCIILiteral("KeyR");
+ case kVK_ANSI_S: return ASCIILiteral("KeyS");
+ case kVK_ANSI_T: return ASCIILiteral("KeyT");
+ case kVK_ANSI_U: return ASCIILiteral("KeyU");
+ case kVK_ANSI_V: return ASCIILiteral("KeyV");
+ case kVK_ANSI_W: return ASCIILiteral("KeyW");
+ case kVK_ANSI_X: return ASCIILiteral("KeyX");
+ case kVK_ANSI_Y: return ASCIILiteral("KeyY");
+ case kVK_ANSI_Z: return ASCIILiteral("KeyZ");
+ case kVK_ANSI_Minus: return ASCIILiteral("Minus");
+ case kVK_ANSI_Period: return ASCIILiteral("Period");
+ case kVK_ANSI_Quote: return ASCIILiteral("Quote");
+ case kVK_ANSI_Semicolon: return ASCIILiteral("Semicolon");
+ case kVK_ANSI_Slash: return ASCIILiteral("Slash");
+
+ // Functional keys in alphanumeric section.
+ case kVK_Option: return ASCIILiteral("AltLeft");
+ case kVK_RightOption: return ASCIILiteral("AltRight");
+ case kVK_CapsLock: return ASCIILiteral("CapsLock");
+ // ContextMenu.
+ case kVK_Control: return ASCIILiteral("ControlLeft");
+ case kVK_RightControl: return ASCIILiteral("ControlRight");
+ case kVK_Return: return ASCIILiteral("Enter"); // Labeled Return on Apple keyboards.
+ case kVK_Command: return ASCIILiteral("MetaLeft");
+ case kVK_RightCommand: return ASCIILiteral("MetaRight");
+ case kVK_Shift: return ASCIILiteral("ShiftLeft");
+ case kVK_RightShift: return ASCIILiteral("ShiftRight");
+ case kVK_Space: return ASCIILiteral("Space");
+ case kVK_Tab: return ASCIILiteral("Tab");
+
+ // Functional keys found on Japanese and Korean keyboards.
+ // Convert.
+ case kVK_JIS_Kana: return ASCIILiteral("KanaMode");
+ // Lang1.
+ case kVK_JIS_Eisu: return ASCIILiteral("Lang2"); // Japanese (Mac keyboard): eisu.
+ // Lang3.
+ // Lang4.
+ // Lang5.
+ // NonConvert.
+
+ // Keys in the ControlPad section.
+ case kVK_ForwardDelete: return ASCIILiteral("Delete");
+ case kVK_End: return ASCIILiteral("End");
+ case kVK_Help: return ASCIILiteral("Help");
+ case kVK_Home: return ASCIILiteral("Home");
+ // Insert: Not present on Apple keyboards.
+ case kVK_PageDown: return ASCIILiteral("PageDown");
+ case kVK_PageUp: return ASCIILiteral("PageUp");
+
+ // Keys in the ArrowPad section.
+ case kVK_DownArrow: return ASCIILiteral("ArrowDown");
+ case kVK_LeftArrow: return ASCIILiteral("ArrowLeft");
+ case kVK_RightArrow: return ASCIILiteral("ArrowRight");
+ case kVK_UpArrow: return ASCIILiteral("ArrowUp");
+
+ // Keys in the Numpad section.
+ case kVK_ANSI_KeypadClear: return ASCIILiteral("NumLock"); // The specification says to use "NumLock" on Mac for the numpad Clear key.
+ case kVK_ANSI_Keypad0: return ASCIILiteral("Numpad0");
+ case kVK_ANSI_Keypad1: return ASCIILiteral("Numpad1");
+ case kVK_ANSI_Keypad2: return ASCIILiteral("Numpad2");
+ case kVK_ANSI_Keypad3: return ASCIILiteral("Numpad3");
+ case kVK_ANSI_Keypad4: return ASCIILiteral("Numpad4");
+ case kVK_ANSI_Keypad5: return ASCIILiteral("Numpad5");
+ case kVK_ANSI_Keypad6: return ASCIILiteral("Numpad6");
+ case kVK_ANSI_Keypad7: return ASCIILiteral("Numpad7");
+ case kVK_ANSI_Keypad8: return ASCIILiteral("Numpad8");
+ case kVK_ANSI_Keypad9: return ASCIILiteral("Numpad9");
+ case kVK_ANSI_KeypadPlus: return ASCIILiteral("NumpadAdd");
+ // NumpadBackspace.
+ // NumpadClear: The specification says that the numpad Clear key should always be encoded as "NumLock" on Mac.
+ // NumpadClearEntry.
+ case kVK_JIS_KeypadComma: return ASCIILiteral("NumpadComma");
+ case kVK_ANSI_KeypadDecimal: return ASCIILiteral("NumpadDecimal");
+ case kVK_ANSI_KeypadDivide: return ASCIILiteral("NumpadDivide");
+ case kVK_ANSI_KeypadEnter: return ASCIILiteral("NumpadEnter");
+ case kVK_ANSI_KeypadEquals: return ASCIILiteral("NumpadEqual");
+ // NumpadHash.
+ // NumpadMemoryAdd.
+ // NumpadMemoryClear.
+ // NumpadMemoryRecall.
+ // NumpadMemoryStore.
+ // NumpadMemorySubtract.
+ case kVK_ANSI_KeypadMultiply: return ASCIILiteral("NumpadMultiply");
+ // NumpadParenLeft.
+ // NumpadParenRight.
+ // NumpadStar: The specification says to use "NumpadMultiply" for the * key on numeric keypads.
+ case kVK_ANSI_KeypadMinus: return ASCIILiteral("NumpadSubtract");
+
+ // Keys in the Function section.
+ case kVK_Escape: return ASCIILiteral("Escape");
+ case kVK_F1: return ASCIILiteral("F1");
+ case kVK_F2: return ASCIILiteral("F2");
+ case kVK_F3: return ASCIILiteral("F3");
+ case kVK_F4: return ASCIILiteral("F4");
+ case kVK_F5: return ASCIILiteral("F5");
+ case kVK_F6: return ASCIILiteral("F6");
+ case kVK_F7: return ASCIILiteral("F7");
+ case kVK_F8: return ASCIILiteral("F8");
+ case kVK_F9: return ASCIILiteral("F9");
+ case kVK_F10: return ASCIILiteral("F10");
+ case kVK_F11: return ASCIILiteral("F11");
+ case kVK_F12: return ASCIILiteral("F12");
+ case kVK_F13: return ASCIILiteral("F13");
+ case kVK_F14: return ASCIILiteral("F14");
+ case kVK_F15: return ASCIILiteral("F15");
+ case kVK_F16: return ASCIILiteral("F16");
+ case kVK_F17: return ASCIILiteral("F17");
+ case kVK_F18: return ASCIILiteral("F18");
+ case kVK_F19: return ASCIILiteral("F19");
+ case kVK_F20: return ASCIILiteral("F20");
+ // Fn: This is typically a hardware key that does not generate a separate code.
+ // FnLock.
+ // PrintScreen.
+ // ScrollLock.
+ // Pause.
+
+ // Media keys.
+ // BrowserBack.
+ // BrowserFavorites.
+ // BrowserForward.
+ // BrowserHome.
+ // BrowserRefresh.
+ // BrowserSearch.
+ // BrowserStop.
+ // Eject.
+ // LaunchApp1.
+ // LaunchApp2.
+ // LaunchMail.
+ // MediaPlayPause.
+ // MediaSelect.
+ // MediaStop.
+ // MediaTrackNext.
+ // MediaTrackPrevious.
+ // Power.
+ // Sleep.
+ case kVK_VolumeDown: return ASCIILiteral("AudioVolumeDown");
+ case kVK_Mute: return ASCIILiteral("AudioVolumeMute");
+ case kVK_VolumeUp: return ASCIILiteral("AudioVolumeUp");
+ // WakeUp.
+
+ // Legacy modifier keys.
+ // Hyper.
+ // Super.
+ // Turbo.
+
+ // Legacy process control keys.
+ // Abort.
+ // Resume.
+ // Suspend.
+
+ // Legacy editing keys.
+ // Again.
+ // Copy.
+ // Cut.
+ // Find.
+ // Open.
+ // Paste.
+ // Props.
+ // Select.
+ // Undo.
+
+ // Keys found on international keyboards.
+ // Hiragana.
+ // Katakana.
+
+ default:
+ return ASCIILiteral("Unidentified");
+ }
+}
+
</ins><span class="cx"> String keyIdentifierForKeyEvent(NSEvent* event)
</span><span class="cx"> {
</span><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
</span><span class="lines">@@ -612,6 +824,7 @@
</span><span class="cx"> m_unmodifiedText = unmodifiedTextFromEvent(event);
</span><span class="cx"> m_keyIdentifier = keyIdentifierForKeyEvent(event);
</span><span class="cx"> m_key = keyForKeyEvent(event);
</span><ins>+ m_code = codeForKeyEvent(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 "-Wdeprecated-declarations"
</span></span></pre></div>
<a id="trunkSourceWebCorereplaySerializationMethodscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/replay/SerializationMethods.cpp (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/replay/SerializationMethods.cpp        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/Source/WebCore/replay/SerializationMethods.cpp        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -259,6 +259,9 @@
</span><span class="cx"> #if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
</span><span class="cx"> ENCODE_TYPE_WITH_KEY(encodedValue, String, key, input.key());
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(KEYBOARD_CODE_ATTRIBUTE)
+ ENCODE_TYPE_WITH_KEY(encodedValue, String, code, input.code());
+#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">@@ -281,6 +284,9 @@
</span><span class="cx"> #if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
</span><span class="cx"> DECODE_TYPE_WITH_KEY(encodedValue, String, key);
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(KEYBOARD_CODE_ATTRIBUTE)
+ DECODE_TYPE_WITH_KEY(encodedValue, String, code);
+#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">@@ -295,6 +301,9 @@
</span><span class="cx"> #if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
</span><span class="cx"> key,
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(KEYBOARD_CODE_ATTRIBUTE)
+ code,
+#endif
</ins><span class="cx"> keyIdentifier, WTF::safeCast<int>(windowsVirtualKeyCode), autoRepeat, keypad, systemKey, modifiers, timestamp);
</span><span class="cx">
</span><span class="cx"> #if USE(APPKIT)
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/Source/WebKit2/ChangeLog        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2016-10-04 Chris Dumez <cdumez@apple.com>
+
+ Implement KeyboardEvent.code from the UI Event spec
+ https://bugs.webkit.org/show_bug.cgi?id=149584
+
+ Reviewed by Darin Adler.
+
+ Add support for Keyboard.code attribute:
+ - https://w3c.github.io/uievents/#dom-keyboardevent-code
+ - https://w3c.github.io/uievents-code/
+
+ * Shared/WebEvent.h:
+ (WebKit::WebKeyboardEvent::code):
+ * 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-04 Said Abou-Hallawa <sabouhallawa@apple.com>
</span><span class="cx">
</span><span class="cx"> The dragged image should be the current frame only of the animated image
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebEvent.h (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebEvent.h        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/Source/WebKit2/Shared/WebEvent.h        2016-10-05 03:13:35 UTC (rev 206803)
</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& text, const String& unmodifiedText, const String& key, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool handledByInputMethod, const Vector<WebCore::KeypressCommand>&, bool isAutoRepeat, bool isKeypad, bool isSystemKey, Modifiers, double timestamp);
</del><ins>+ WebKeyboardEvent(Type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool handledByInputMethod, const Vector<WebCore::KeypressCommand>&, bool isAutoRepeat, bool isKeypad, bool isSystemKey, Modifiers, double timestamp);
</ins><span class="cx"> #elif PLATFORM(GTK)
</span><span class="cx"> WebKeyboardEvent(Type, const String& text, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool handledByInputMethod, Vector<String>&& commands, bool isKeypad, Modifiers, double timestamp);
</span><span class="cx"> #else
</span><span class="lines">@@ -256,6 +256,9 @@
</span><span class="cx"> #if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
</span><span class="cx"> const String& key() const { return m_key; }
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(KEYBOARD_CODE_ATTRIBUTE)
+ const String& code() const { return m_code; }
+#endif
</ins><span class="cx"> const String& 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">@@ -283,6 +286,9 @@
</span><span class="cx"> #if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
</span><span class="cx"> String m_key;
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(KEYBOARD_CODE_ATTRIBUTE)
+ String m_code;
+#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 (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebEventConversion.cpp        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/Source/WebKit2/Shared/WebEventConversion.cpp        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -194,6 +194,9 @@
</span><span class="cx"> #if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
</span><span class="cx"> m_key = webEvent.key();
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(KEYBOARD_CODE_ATTRIBUTE)
+ m_code = webEvent.code();
+#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 (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebKeyboardEvent.cpp        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/Source/WebKit2/Shared/WebKeyboardEvent.cpp        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -37,11 +37,12 @@
</span><span class="cx">
</span><span class="cx"> #if USE(APPKIT)
</span><span class="cx">
</span><del>-WebKeyboardEvent::WebKeyboardEvent(Type type, const String& text, const String& unmodifiedText, const String& key, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool handledByInputMethod, const Vector<WebCore::KeypressCommand>& commands, bool isAutoRepeat, bool isKeypad, bool isSystemKey, Modifiers modifiers, double timestamp)
</del><ins>+WebKeyboardEvent::WebKeyboardEvent(Type type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool handledByInputMethod, const Vector<WebCore::KeypressCommand>& 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><span class="cx"> , m_key(key)
</span><ins>+ , m_code(code)
</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">@@ -106,6 +107,9 @@
</span><span class="cx"> #if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
</span><span class="cx"> encoder << m_key;
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(KEYBOARD_CODE_ATTRIBUTE)
+ encoder << m_code;
+#endif
</ins><span class="cx"> encoder << m_keyIdentifier;
</span><span class="cx"> encoder << m_windowsVirtualKeyCode;
</span><span class="cx"> encoder << m_nativeVirtualKeyCode;
</span><span class="lines">@@ -132,6 +136,10 @@
</span><span class="cx"> if (!decoder.decode(result.m_key))
</span><span class="cx"> return false;
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(KEYBOARD_CODE_ATTRIBUTE)
+ if (!decoder.decode(result.m_code))
+ 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 (206802 => 206803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/WebEventFactory.mm        2016-10-05 01:52:35 UTC (rev 206802)
+++ trunk/Source/WebKit2/Shared/mac/WebEventFactory.mm        2016-10-05 03:13:35 UTC (rev 206803)
</span><span class="lines">@@ -467,6 +467,7 @@
</span><span class="cx"> String text = textFromEvent(event, replacesSoftSpace);
</span><span class="cx"> String unmodifiedText = unmodifiedTextFromEvent(event, replacesSoftSpace);
</span><span class="cx"> String key = keyForKeyEvent(event);
</span><ins>+ String code = codeForKeyEvent(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">@@ -498,7 +499,7 @@
</span><span class="cx"> unmodifiedText = "\x9";
</span><span class="cx"> }
</span><span class="cx">
</span><del>- return WebKeyboardEvent(type, text, unmodifiedText, key, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, macCharCode, handledByInputMethod, commands, autoRepeat, isKeypad, isSystemKey, modifiers, timestamp);
</del><ins>+ return WebKeyboardEvent(type, text, unmodifiedText, key, code, 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>