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