<!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>[206971] 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/206971">206971</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-10-09 16:11:56 -0700 (Sun, 09 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Update KeyboardEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163176

Reviewed by Darin Adler.

Source/WebCore:

Update KeyboardEvent to stop using legacy [ConstructorTemplate=Event]
and use a proper constructor instead, like in the specification:
- https://www.w3.org/TR/uievents/#interface-keyboardevent

Also add support for passing modifierAltGraph / modifierCapsLock
in the inialization dictionary as we support those modifiers via
getModifierState().

No new tests, extended existing test.

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/EventModifierInit.h: Added.
(WebCore::EventModifierInit::EventModifierInit):
* dom/EventModifierInit.idl: Added.
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
(WebCore::KeyboardEvent::getModifierState):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
* dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::MouseRelatedEvent):
* dom/MouseRelatedEvent.h:
* dom/UIEvent.cpp:
(WebCore::UIEvent::UIEvent):
* dom/UIEvent.h:
(WebCore::UIEvent::create): Deleted.
* dom/UIEventInit.h: Added.
(WebCore::UIEventInit::UIEventInit):
* dom/UIEventInit.idl: Added.
* dom/UIEventWithKeyState.h:
(WebCore::UIEventWithKeyState::altGraphKey):
(WebCore::UIEventWithKeyState::capsLockKey):
(WebCore::UIEventWithKeyState::UIEventWithKeyState):
(WebCore::UIEventWithKeyState::ctrlKey): Deleted.
(WebCore::UIEventWithKeyState::shiftKey): Deleted.
(WebCore::UIEventWithKeyState::altKey): Deleted.
(WebCore::UIEventWithKeyState::metaKey): Deleted.

LayoutTests:

Rebaseline existing test now that the exception message is slightly
different in some cases. Also add test coverage for passing
modifierAltGraph / modifierCapsLock in initialization dictionary.

* fast/events/constructors/keyboard-event-constructor-expected.txt:
* fast/events/constructors/keyboard-event-constructor.html:</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="#trunkLayoutTestsplatformiossimulatorfasteventsconstructorskeyboardeventconstructorexpectedtxt">trunk/LayoutTests/platform/ios-simulator/fast/events/constructors/keyboard-event-constructor-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcescpp">trunk/Source/WebCore/DerivedSources.cpp</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</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="#trunkSourceWebCoredomMouseRelatedEventcpp">trunk/Source/WebCore/dom/MouseRelatedEvent.cpp</a></li>
<li><a href="#trunkSourceWebCoredomMouseRelatedEventh">trunk/Source/WebCore/dom/MouseRelatedEvent.h</a></li>
<li><a href="#trunkSourceWebCoredomUIEventcpp">trunk/Source/WebCore/dom/UIEvent.cpp</a></li>
<li><a href="#trunkSourceWebCoredomUIEventh">trunk/Source/WebCore/dom/UIEvent.h</a></li>
<li><a href="#trunkSourceWebCoredomUIEventWithKeyStateh">trunk/Source/WebCore/dom/UIEventWithKeyState.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoredomEventModifierInith">trunk/Source/WebCore/dom/EventModifierInit.h</a></li>
<li><a href="#trunkSourceWebCoredomEventModifierInitidl">trunk/Source/WebCore/dom/EventModifierInit.idl</a></li>
<li><a href="#trunkSourceWebCoredomUIEventInith">trunk/Source/WebCore/dom/UIEventInit.h</a></li>
<li><a href="#trunkSourceWebCoredomUIEventInitidl">trunk/Source/WebCore/dom/UIEventInit.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (206970 => 206971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-10-09 22:47:57 UTC (rev 206970)
+++ trunk/LayoutTests/ChangeLog        2016-10-09 23:11:56 UTC (rev 206971)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2016-10-09  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Update KeyboardEvent to stop using legacy [ConstructorTemplate=Event]
+        https://bugs.webkit.org/show_bug.cgi?id=163176
+
+        Reviewed by Darin Adler.
+
+        Rebaseline existing test now that the exception message is slightly
+        different in some cases. Also add test coverage for passing
+        modifierAltGraph / modifierCapsLock in initialization dictionary.
+
+        * fast/events/constructors/keyboard-event-constructor-expected.txt:
+        * fast/events/constructors/keyboard-event-constructor.html:
+
</ins><span class="cx"> 2016-10-09  Michael Catanzaro  &lt;mcatanzaro@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Miscellaneous unreviewed test gardening
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventsconstructorskeyboardeventconstructorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/constructors/keyboard-event-constructor-expected.txt (206970 => 206971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/constructors/keyboard-event-constructor-expected.txt        2016-10-09 22:47:57 UTC (rev 206970)
+++ trunk/LayoutTests/fast/events/constructors/keyboard-event-constructor-expected.txt        2016-10-09 23:11:56 UTC (rev 206971)
</span><span class="lines">@@ -25,23 +25,23 @@
</span><span class="cx"> PASS new KeyboardEvent('eventType', { }).isComposing is false
</span><span class="cx"> PASS new KeyboardEvent('eventType', { isComposing: false }).isComposing is false
</span><span class="cx"> PASS new KeyboardEvent('eventType', { isComposing: true }).isComposing is true
</span><del>-PASS new KeyboardEvent('eventType', { view: testObject }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new KeyboardEvent('eventType', { view: document }).view threw exception TypeError: Dictionary member is not of type Window.
</del><ins>+PASS new KeyboardEvent('eventType', { view: testObject }).view threw exception TypeError: Type error.
+PASS new KeyboardEvent('eventType', { view: document }).view threw exception TypeError: Type error.
</ins><span class="cx"> PASS new KeyboardEvent('eventType', { view: undefined }).view is null
</span><span class="cx"> PASS new KeyboardEvent('eventType', { view: null }).view is null
</span><del>-PASS new KeyboardEvent('eventType', { view: false }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new KeyboardEvent('eventType', { view: true }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new KeyboardEvent('eventType', { view: '' }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new KeyboardEvent('eventType', { view: 'chocolate' }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new KeyboardEvent('eventType', { view: 12345 }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new KeyboardEvent('eventType', { view: 18446744073709551615 }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new KeyboardEvent('eventType', { view: NaN }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new KeyboardEvent('eventType', { view: {valueOf: function () { return window; } } }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new KeyboardEvent('eventType', { get view() { return 123; } }).view threw exception TypeError: Dictionary member is not of type Window.
</del><ins>+PASS new KeyboardEvent('eventType', { view: false }).view threw exception TypeError: Type error.
+PASS new KeyboardEvent('eventType', { view: true }).view threw exception TypeError: Type error.
+PASS new KeyboardEvent('eventType', { view: '' }).view threw exception TypeError: Type error.
+PASS new KeyboardEvent('eventType', { view: 'chocolate' }).view threw exception TypeError: Type error.
+PASS new KeyboardEvent('eventType', { view: 12345 }).view threw exception TypeError: Type error.
+PASS new KeyboardEvent('eventType', { view: 18446744073709551615 }).view threw exception TypeError: Type error.
+PASS new KeyboardEvent('eventType', { view: NaN }).view threw exception TypeError: Type error.
+PASS new KeyboardEvent('eventType', { view: {valueOf: function () { return window; } } }).view threw exception TypeError: Type error.
+PASS new KeyboardEvent('eventType', { get view() { return 123; } }).view threw exception TypeError: Type error.
</ins><span class="cx"> PASS new KeyboardEvent('eventType', { get view() { throw 'KeyboardEvent Error'; } }) threw exception KeyboardEvent Error.
</span><span class="cx"> PASS new KeyboardEvent('eventType', { keyIdentifier: 'koakuma' }).keyIdentifier is &quot;koakuma&quot;
</span><span class="cx"> PASS new KeyboardEvent('eventType', { keyIdentifier: '' }).keyIdentifier is &quot;&quot;
</span><del>-PASS new KeyboardEvent('eventType', { keyIdentifier: undefined }).keyIdentifier is &quot;undefined&quot;
</del><ins>+PASS new KeyboardEvent('eventType', { keyIdentifier: undefined }).keyIdentifier is &quot;&quot;
</ins><span class="cx"> PASS new KeyboardEvent('eventType', { keyIdentifier: null }).keyIdentifier is &quot;null&quot;
</span><span class="cx"> PASS new KeyboardEvent('eventType', { keyIdentifier: false }).keyIdentifier is &quot;false&quot;
</span><span class="cx"> PASS new KeyboardEvent('eventType', { keyIdentifier: true }).keyIdentifier is &quot;true&quot;
</span><span class="lines">@@ -106,6 +106,8 @@
</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><ins>+PASS new KeyboardEvent('eventType', { modifierAltGraph: true }).getModifierState('AltGraph') is true
+PASS new KeyboardEvent('eventType', { modifierCapsLock: true }).getModifierState('CapsLock') is true
</ins><span class="cx"> PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).bubbles is true
</span><span class="cx"> PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).cancelable is true
</span><span class="cx"> PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).view is window
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventsconstructorskeyboardeventconstructorhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/constructors/keyboard-event-constructor.html (206970 => 206971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/constructors/keyboard-event-constructor.html        2016-10-09 22:47:57 UTC (rev 206970)
+++ trunk/LayoutTests/fast/events/constructors/keyboard-event-constructor.html        2016-10-09 23:11:56 UTC (rev 206971)
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx"> shouldBeEqualToString(&quot;new KeyboardEvent('eventType', { keyIdentifier: '' }).keyIdentifier&quot;, &quot;&quot;);
</span><span class="cx"> 
</span><span class="cx"> // Non-strings.
</span><del>-shouldBeEqualToString(&quot;new KeyboardEvent('eventType', { keyIdentifier: undefined }).keyIdentifier&quot;, &quot;undefined&quot;);
</del><ins>+shouldBeEqualToString(&quot;new KeyboardEvent('eventType', { keyIdentifier: undefined }).keyIdentifier&quot;, &quot;&quot;);
</ins><span class="cx"> shouldBeEqualToString(&quot;new KeyboardEvent('eventType', { keyIdentifier: null }).keyIdentifier&quot;, &quot;null&quot;);
</span><span class="cx"> shouldBeEqualToString(&quot;new KeyboardEvent('eventType', { keyIdentifier: false }).keyIdentifier&quot;, &quot;false&quot;);
</span><span class="cx"> shouldBeEqualToString(&quot;new KeyboardEvent('eventType', { keyIdentifier: true }).keyIdentifier&quot;, &quot;true&quot;);
</span><span class="lines">@@ -121,6 +121,9 @@
</span><span class="cx">     shouldBe(&quot;new KeyboardEvent('eventType', { &quot; + attr + &quot;: true }).&quot; + attr, &quot;true&quot;);
</span><span class="cx"> });
</span><span class="cx"> 
</span><ins>+shouldBeTrue(&quot;new KeyboardEvent('eventType', { modifierAltGraph: true }).getModifierState('AltGraph')&quot;);
+shouldBeTrue(&quot;new KeyboardEvent('eventType', { modifierCapsLock: true }).getModifierState('CapsLock')&quot;);
+
</ins><span class="cx"> // All initializers are passed.
</span><span class="cx"> shouldBe(&quot;new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).bubbles&quot;, &quot;true&quot;);
</span><span class="cx"> shouldBe(&quot;new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).cancelable&quot;, &quot;true&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorfasteventsconstructorskeyboardeventconstructorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/fast/events/constructors/keyboard-event-constructor-expected.txt (206970 => 206971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/fast/events/constructors/keyboard-event-constructor-expected.txt        2016-10-09 22:47:57 UTC (rev 206970)
+++ trunk/LayoutTests/platform/ios-simulator/fast/events/constructors/keyboard-event-constructor-expected.txt        2016-10-09 23:11:56 UTC (rev 206971)
</span><span class="lines">@@ -25,23 +25,23 @@
</span><span class="cx"> PASS new KeyboardEvent('eventType', { }).isComposing is false
</span><span class="cx"> PASS new KeyboardEvent('eventType', { isComposing: false }).isComposing is false
</span><span class="cx"> PASS new KeyboardEvent('eventType', { isComposing: true }).isComposing is true
</span><del>-PASS new KeyboardEvent('eventType', { view: testObject }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new KeyboardEvent('eventType', { view: document }).view threw exception TypeError: Dictionary member is not of type Window.
</del><ins>+PASS new KeyboardEvent('eventType', { view: testObject }).view threw exception TypeError: Type error.
+PASS new KeyboardEvent('eventType', { view: document }).view threw exception TypeError: Type error.
</ins><span class="cx"> PASS new KeyboardEvent('eventType', { view: undefined }).view is null
</span><span class="cx"> PASS new KeyboardEvent('eventType', { view: null }).view is null
</span><del>-PASS new KeyboardEvent('eventType', { view: false }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new KeyboardEvent('eventType', { view: true }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new KeyboardEvent('eventType', { view: '' }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new KeyboardEvent('eventType', { view: 'chocolate' }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new KeyboardEvent('eventType', { view: 12345 }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new KeyboardEvent('eventType', { view: 18446744073709551615 }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new KeyboardEvent('eventType', { view: NaN }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new KeyboardEvent('eventType', { view: {valueOf: function () { return window; } } }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new KeyboardEvent('eventType', { get view() { return 123; } }).view threw exception TypeError: Dictionary member is not of type Window.
</del><ins>+PASS new KeyboardEvent('eventType', { view: false }).view threw exception TypeError: Type error.
+PASS new KeyboardEvent('eventType', { view: true }).view threw exception TypeError: Type error.
+PASS new KeyboardEvent('eventType', { view: '' }).view threw exception TypeError: Type error.
+PASS new KeyboardEvent('eventType', { view: 'chocolate' }).view threw exception TypeError: Type error.
+PASS new KeyboardEvent('eventType', { view: 12345 }).view threw exception TypeError: Type error.
+PASS new KeyboardEvent('eventType', { view: 18446744073709551615 }).view threw exception TypeError: Type error.
+PASS new KeyboardEvent('eventType', { view: NaN }).view threw exception TypeError: Type error.
+PASS new KeyboardEvent('eventType', { view: {valueOf: function () { return window; } } }).view threw exception TypeError: Type error.
+PASS new KeyboardEvent('eventType', { get view() { return 123; } }).view threw exception TypeError: Type error.
</ins><span class="cx"> PASS new KeyboardEvent('eventType', { get view() { throw 'KeyboardEvent Error'; } }) threw exception KeyboardEvent Error.
</span><span class="cx"> PASS new KeyboardEvent('eventType', { keyIdentifier: 'koakuma' }).keyIdentifier is &quot;koakuma&quot;
</span><span class="cx"> PASS new KeyboardEvent('eventType', { keyIdentifier: '' }).keyIdentifier is &quot;&quot;
</span><del>-PASS new KeyboardEvent('eventType', { keyIdentifier: undefined }).keyIdentifier is &quot;undefined&quot;
</del><ins>+PASS new KeyboardEvent('eventType', { keyIdentifier: undefined }).keyIdentifier is &quot;&quot;
</ins><span class="cx"> PASS new KeyboardEvent('eventType', { keyIdentifier: null }).keyIdentifier is &quot;null&quot;
</span><span class="cx"> PASS new KeyboardEvent('eventType', { keyIdentifier: false }).keyIdentifier is &quot;false&quot;
</span><span class="cx"> PASS new KeyboardEvent('eventType', { keyIdentifier: true }).keyIdentifier is &quot;true&quot;
</span><span class="lines">@@ -106,6 +106,8 @@
</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><ins>+PASS new KeyboardEvent('eventType', { modifierAltGraph: true }).getModifierState('AltGraph') is true
+PASS new KeyboardEvent('eventType', { modifierCapsLock: true }).getModifierState('CapsLock') is true
</ins><span class="cx"> PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).bubbles is true
</span><span class="cx"> PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).cancelable is true
</span><span class="cx"> PASS new KeyboardEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, key: 'a', code: 'KeyA', keyIdentifier: 'chocolate', location: 222, ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }).view is window
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (206970 => 206971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-10-09 22:47:57 UTC (rev 206970)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-10-09 23:11:56 UTC (rev 206971)
</span><span class="lines">@@ -399,6 +399,7 @@
</span><span class="cx">     dom/ErrorEvent.idl
</span><span class="cx">     dom/Event.idl
</span><span class="cx">     dom/EventInit.idl
</span><ins>+    dom/EventModifierInit.idl
</ins><span class="cx">     dom/EventTarget.idl
</span><span class="cx">     dom/FocusEvent.idl
</span><span class="cx">     dom/GlobalEventHandlers.idl
</span><span class="lines">@@ -439,6 +440,7 @@
</span><span class="cx">     dom/TransitionEvent.idl
</span><span class="cx">     dom/TreeWalker.idl
</span><span class="cx">     dom/UIEvent.idl
</span><ins>+    dom/UIEventInit.idl
</ins><span class="cx">     dom/WebKitAnimationEvent.idl
</span><span class="cx">     dom/WebKitNamedFlow.idl
</span><span class="cx">     dom/WebKitTransitionEvent.idl
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (206970 => 206971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-09 22:47:57 UTC (rev 206970)
+++ trunk/Source/WebCore/ChangeLog        2016-10-09 23:11:56 UTC (rev 206971)
</span><span class="lines">@@ -1,3 +1,51 @@
</span><ins>+2016-10-09  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Update KeyboardEvent to stop using legacy [ConstructorTemplate=Event]
+        https://bugs.webkit.org/show_bug.cgi?id=163176
+
+        Reviewed by Darin Adler.
+
+        Update KeyboardEvent to stop using legacy [ConstructorTemplate=Event]
+        and use a proper constructor instead, like in the specification:
+        - https://www.w3.org/TR/uievents/#interface-keyboardevent
+
+        Also add support for passing modifierAltGraph / modifierCapsLock
+        in the inialization dictionary as we support those modifiers via
+        getModifierState().
+
+        No new tests, extended existing test.
+
+        * CMakeLists.txt:
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/EventModifierInit.h: Added.
+        (WebCore::EventModifierInit::EventModifierInit):
+        * dom/EventModifierInit.idl: Added.
+        * dom/KeyboardEvent.cpp:
+        (WebCore::KeyboardEvent::KeyboardEvent):
+        (WebCore::KeyboardEvent::getModifierState):
+        * dom/KeyboardEvent.h:
+        * dom/KeyboardEvent.idl:
+        * dom/MouseRelatedEvent.cpp:
+        (WebCore::MouseRelatedEvent::MouseRelatedEvent):
+        * dom/MouseRelatedEvent.h:
+        * dom/UIEvent.cpp:
+        (WebCore::UIEvent::UIEvent):
+        * dom/UIEvent.h:
+        (WebCore::UIEvent::create): Deleted.
+        * dom/UIEventInit.h: Added.
+        (WebCore::UIEventInit::UIEventInit):
+        * dom/UIEventInit.idl: Added.
+        * dom/UIEventWithKeyState.h:
+        (WebCore::UIEventWithKeyState::altGraphKey):
+        (WebCore::UIEventWithKeyState::capsLockKey):
+        (WebCore::UIEventWithKeyState::UIEventWithKeyState):
+        (WebCore::UIEventWithKeyState::ctrlKey): Deleted.
+        (WebCore::UIEventWithKeyState::shiftKey): Deleted.
+        (WebCore::UIEventWithKeyState::altKey): Deleted.
+        (WebCore::UIEventWithKeyState::metaKey): Deleted.
+
</ins><span class="cx"> 2016-10-09  Youenn Fablet  &lt;youenn@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Promise attribute getters should reject promises in case of casted-this errors
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.cpp (206970 => 206971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.cpp        2016-10-09 22:47:57 UTC (rev 206970)
+++ trunk/Source/WebCore/DerivedSources.cpp        2016-10-09 23:11:56 UTC (rev 206971)
</span><span class="lines">@@ -190,6 +190,7 @@
</span><span class="cx"> #include &quot;JSErrorEvent.cpp&quot;
</span><span class="cx"> #include &quot;JSEvent.cpp&quot;
</span><span class="cx"> #include &quot;JSEventInit.cpp&quot;
</span><ins>+#include &quot;JSEventModifierInit.cpp&quot;
</ins><span class="cx"> #include &quot;JSEventSource.cpp&quot;
</span><span class="cx"> #include &quot;JSEventTarget.cpp&quot;
</span><span class="cx"> #include &quot;JSFetchBody.cpp&quot;
</span><span class="lines">@@ -630,6 +631,7 @@
</span><span class="cx"> #include &quot;JSTransitionEvent.cpp&quot;
</span><span class="cx"> #include &quot;JSTreeWalker.cpp&quot;
</span><span class="cx"> #include &quot;JSUIEvent.cpp&quot;
</span><ins>+#include &quot;JSUIEventInit.cpp&quot;
</ins><span class="cx"> #include &quot;JSUIRequestEvent.cpp&quot;
</span><span class="cx"> #include &quot;JSURLUtils.cpp&quot;
</span><span class="cx"> #if ENABLE(USER_MESSAGE_HANDLERS)
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (206970 => 206971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2016-10-09 22:47:57 UTC (rev 206970)
+++ trunk/Source/WebCore/DerivedSources.make        2016-10-09 23:11:56 UTC (rev 206971)
</span><span class="lines">@@ -310,6 +310,7 @@
</span><span class="cx">     $(WebCore)/dom/Event.idl \
</span><span class="cx">     $(WebCore)/dom/EventInit.idl \
</span><span class="cx">     $(WebCore)/dom/EventListener.idl \
</span><ins>+    $(WebCore)/dom/EventModifierInit.idl \
</ins><span class="cx">     $(WebCore)/dom/EventTarget.idl \
</span><span class="cx">     $(WebCore)/dom/FocusEvent.idl \
</span><span class="cx">     $(WebCore)/dom/GlobalEventHandlers.idl \
</span><span class="lines">@@ -348,6 +349,7 @@
</span><span class="cx">     $(WebCore)/dom/TransitionEvent.idl \
</span><span class="cx">     $(WebCore)/dom/TreeWalker.idl \
</span><span class="cx">     $(WebCore)/dom/UIEvent.idl \
</span><ins>+    $(WebCore)/dom/UIEventInit.idl \
</ins><span class="cx">     $(WebCore)/dom/WebKitAnimationEvent.idl \
</span><span class="cx">     $(WebCore)/dom/WebKitNamedFlow.idl \
</span><span class="cx">     $(WebCore)/dom/WebKitTransitionEvent.idl \
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (206970 => 206971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-09 22:47:57 UTC (rev 206970)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-09 23:11:56 UTC (rev 206971)
</span><span class="lines">@@ -2931,6 +2931,8 @@
</span><span class="cx">                 83E359A21BB1031D002CEB98 /* JSHTMLTimeElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E359A01BB1031D002CEB98 /* JSHTMLTimeElement.h */; };
</span><span class="cx">                 83E359A31BB1031D002CEB98 /* JSHTMLTimeElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83E359A11BB1031D002CEB98 /* JSHTMLTimeElement.cpp */; };
</span><span class="cx">                 83F1206B1B8C104700D75F63 /* JSNodeFilterCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83F1206A1B8C103600D75F63 /* JSNodeFilterCustom.cpp */; };
</span><ins>+                83FE7CA71DA9F1A70037237C /* UIEventInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 83FE7CA41DA9F1660037237C /* UIEventInit.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                83FE7CA81DA9F1B60037237C /* EventModifierInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 83FE7CA31DA9F1650037237C /* EventModifierInit.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 8419D2A7120D92D000141F8F /* SVGPathByteStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 8419D2A4120D92D000141F8F /* SVGPathByteStream.h */; };
</span><span class="cx">                 8419D2A8120D92D000141F8F /* SVGPathByteStreamBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8419D2A5120D92D000141F8F /* SVGPathByteStreamBuilder.cpp */; };
</span><span class="cx">                 8419D2A9120D92D000141F8F /* SVGPathByteStreamBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 8419D2A6120D92D000141F8F /* SVGPathByteStreamBuilder.h */; };
</span><span class="lines">@@ -10065,6 +10067,10 @@
</span><span class="cx">                 83D35AEB1C7187ED00F70D5A /* XMLHttpRequestEventTarget.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XMLHttpRequestEventTarget.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 83D35AEF1C718D8400F70D5A /* JSXMLHttpRequestEventTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSXMLHttpRequestEventTarget.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 83D35AF01C718D8400F70D5A /* JSXMLHttpRequestEventTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSXMLHttpRequestEventTarget.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                83E045EC1DAA104F00B0D8B9 /* JSEventModifierInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEventModifierInit.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                83E045ED1DAA104F00B0D8B9 /* JSEventModifierInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEventModifierInit.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                83E045EE1DAA104F00B0D8B9 /* JSUIEventInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSUIEventInit.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                83E045EF1DAA104F00B0D8B9 /* JSUIEventInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSUIEventInit.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 83E359A01BB1031D002CEB98 /* JSHTMLTimeElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHTMLTimeElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 83E359A11BB1031D002CEB98 /* JSHTMLTimeElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLTimeElement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 83E959E11B8BC22B004D9385 /* NativeNodeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeNodeFilter.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -10073,6 +10079,10 @@
</span><span class="cx">                 83F1206A1B8C103600D75F63 /* JSNodeFilterCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNodeFilterCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 83F570AD1C53268E007FD6CB /* JSXMLDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSXMLDocument.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 83F570AE1C53268E007FD6CB /* JSXMLDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSXMLDocument.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                83FE7CA31DA9F1650037237C /* EventModifierInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventModifierInit.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                83FE7CA41DA9F1660037237C /* UIEventInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIEventInit.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                83FE7CA51DA9F1660037237C /* UIEventInit.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = UIEventInit.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
+                83FE7CA61DA9F1660037237C /* EventModifierInit.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EventModifierInit.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 8419D2A4120D92D000141F8F /* SVGPathByteStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathByteStream.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 8419D2A5120D92D000141F8F /* SVGPathByteStreamBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathByteStreamBuilder.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 8419D2A6120D92D000141F8F /* SVGPathByteStreamBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathByteStreamBuilder.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -19699,6 +19709,8 @@
</span><span class="cx">                                 14E8378D09F85D4F00B85AE4 /* JSEvent.h */,
</span><span class="cx">                                 836D032B1DA8A13200FFD96B /* JSEventInit.cpp */,
</span><span class="cx">                                 836D032C1DA8A13200FFD96B /* JSEventInit.h */,
</span><ins>+                                83E045EC1DAA104F00B0D8B9 /* JSEventModifierInit.cpp */,
+                                83E045ED1DAA104F00B0D8B9 /* JSEventModifierInit.h */,
</ins><span class="cx">                                 C6A703325C9D0B6CDCBC4D78 /* JSEventTarget.cpp */,
</span><span class="cx">                                 5FC7DC26CFE2563200B85AE5 /* JSEventTarget.h */,
</span><span class="cx">                                 B6D9D27A14EAC0860090D75E /* JSFocusEvent.cpp */,
</span><span class="lines">@@ -19741,6 +19753,8 @@
</span><span class="cx">                                 E17B491F16A9B8FF001C8839 /* JSTransitionEvent.h */,
</span><span class="cx">                                 A86629CA09DA2B47009633A5 /* JSUIEvent.cpp */,
</span><span class="cx">                                 A86629C909DA2B47009633A5 /* JSUIEvent.h */,
</span><ins>+                                83E045EE1DAA104F00B0D8B9 /* JSUIEventInit.cpp */,
+                                83E045EF1DAA104F00B0D8B9 /* JSUIEventInit.h */,
</ins><span class="cx">                                 31C0FF390E4CEFAC007D6FE5 /* JSWebKitAnimationEvent.cpp */,
</span><span class="cx">                                 31C0FF3A0E4CEFAC007D6FE5 /* JSWebKitAnimationEvent.h */,
</span><span class="cx">                                 31C0FF3B0E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.cpp */,
</span><span class="lines">@@ -23124,6 +23138,8 @@
</span><span class="cx">                                 85AFA7410AAF298400E84305 /* EventListener.idl */,
</span><span class="cx">                                 AD4495F1141FC08900541EDF /* EventListenerMap.cpp */,
</span><span class="cx">                                 AD4495F2141FC08900541EDF /* EventListenerMap.h */,
</span><ins>+                                83FE7CA31DA9F1650037237C /* EventModifierInit.h */,
+                                83FE7CA61DA9F1660037237C /* EventModifierInit.idl */,
</ins><span class="cx">                                 939885C108B7E3D100E707C4 /* EventNames.cpp */,
</span><span class="cx">                                 939885C208B7E3D100E707C4 /* EventNames.h */,
</span><span class="cx">                                 BC9A6142146859D9006057FD /* EventNames.in */,
</span><span class="lines">@@ -23350,6 +23366,8 @@
</span><span class="cx">                                 85031B370A44EFC700F992E0 /* UIEvent.cpp */,
</span><span class="cx">                                 85031B380A44EFC700F992E0 /* UIEvent.h */,
</span><span class="cx">                                 141B94EE09EC425A000E9413 /* UIEvent.idl */,
</span><ins>+                                83FE7CA41DA9F1660037237C /* UIEventInit.h */,
+                                83FE7CA51DA9F1660037237C /* UIEventInit.idl */,
</ins><span class="cx">                                 93354A3B0B24F8C9003F6DEA /* UIEventWithKeyState.cpp */,
</span><span class="cx">                                 85031B390A44EFC700F992E0 /* UIEventWithKeyState.h */,
</span><span class="cx">                                 A769E96916689D0C005D4529 /* UserActionElementSet.cpp */,
</span><span class="lines">@@ -24208,6 +24226,7 @@
</span><span class="cx">                                 BCEA4790097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h in Headers */,
</span><span class="cx">                                 9DAC7C551AF2CAA200437C44 /* CSSContentDistributionValue.h in Headers */,
</span><span class="cx">                                 2D8FEBDD143E3EF70072502B /* CSSCrossfadeValue.h in Headers */,
</span><ins>+                                83FE7CA71DA9F1A70037237C /* UIEventInit.h in Headers */,
</ins><span class="cx">                                 AA21ECCD0ABF0FC6002B834C /* CSSCursorImageValue.h in Headers */,
</span><span class="cx">                                 BC779E141BB215BB00CAA8BF /* CSSCustomPropertyValue.h in Headers */,
</span><span class="cx">                                 4A9CC81816BB9AC600EC645A /* CSSDefaultStyleSheets.h in Headers */,
</span><span class="lines">@@ -24366,6 +24385,7 @@
</span><span class="cx">                                 26A517FE1AB92238006335DF /* DFAMinimizer.h in Headers */,
</span><span class="cx">                                 267725FF1A5B3AD9003C24DD /* DFANode.h in Headers */,
</span><span class="cx">                                 CD19A2681A13E700008D650E /* DiagnosticLoggingClient.h in Headers */,
</span><ins>+                                83FE7CA81DA9F1B60037237C /* EventModifierInit.h in Headers */,
</ins><span class="cx">                                 46FCB6181A70820E00C5A21E /* DiagnosticLoggingKeys.h in Headers */,
</span><span class="cx">                                 8372DB311A6780A800C697C5 /* DiagnosticLoggingResultType.h in Headers */,
</span><span class="cx">                                 CECADFC7153778FF00E37068 /* DictationAlternative.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventModifierInith"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/dom/EventModifierInit.h (0 => 206971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/EventModifierInit.h                                (rev 0)
+++ trunk/Source/WebCore/dom/EventModifierInit.h        2016-10-09 23:11:56 UTC (rev 206971)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include &quot;UIEventInit.h&quot;
+
+namespace WebCore {
+
+struct EventModifierInit : public UIEventInit {
+    EventModifierInit() = default;
+
+    EventModifierInit(bool bubbles, bool cancelable, bool composed, RefPtr&lt;DOMWindow&gt;&amp;&amp; view, int detail,
+        bool ctrlKey, bool shiftKey, bool altKey, bool metaKey, bool modifierAltGraph, bool modifierCapsLock)
+            : UIEventInit(bubbles, cancelable, composed, WTFMove(view), detail)
+            , ctrlKey(ctrlKey)
+            , shiftKey(shiftKey)
+            , altKey(altKey)
+            , metaKey(metaKey)
+            , modifierAltGraph(modifierAltGraph)
+            , modifierCapsLock(modifierCapsLock)
+        { }
+
+    bool ctrlKey { false };
+    bool shiftKey { false };
+    bool altKey { false };
+    bool metaKey { false };
+
+    bool modifierAltGraph { false };
+    bool modifierCapsLock { false };
+};
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoredomEventModifierInitidl"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/dom/EventModifierInit.idl (0 => 206971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/EventModifierInit.idl                                (rev 0)
+++ trunk/Source/WebCore/dom/EventModifierInit.idl        2016-10-09 23:11:56 UTC (rev 206971)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+dictionary EventModifierInit : UIEventInit {
+    boolean ctrlKey = false;
+    boolean shiftKey = false;
+    boolean altKey = false;
+    boolean metaKey = false;
+
+    boolean modifierAltGraph = false;
+    boolean modifierCapsLock = false;
+
+    // FIXME: The following members are in the specification but are not implemented.
+    // boolean modifierFn = false;
+    // boolean modifierFnLock = false;
+    // boolean modifierHyper = false;
+    // boolean modifierNumLock = false;
+    // boolean modifierScrollLock = false;
+    // boolean modifierSuper = false;
+    // boolean modifierSymbol = false;
+    // boolean modifierSymbolLock = false;
+};
</ins></span></pre></div>
<a id="trunkSourceWebCoredomKeyboardEventcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/KeyboardEvent.cpp (206970 => 206971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/KeyboardEvent.cpp        2016-10-09 22:47:57 UTC (rev 206970)
+++ trunk/Source/WebCore/dom/KeyboardEvent.cpp        2016-10-09 23:11:56 UTC (rev 206971)
</span><span class="lines">@@ -95,8 +95,9 @@
</span><span class="cx"> KeyboardEvent::KeyboardEvent() = default;
</span><span class="cx"> 
</span><span class="cx"> KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent&amp; key, DOMWindow* view)
</span><del>-    : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()),
-                          true, true, key.timestamp(), view, 0, key.ctrlKey(), key.altKey(), key.shiftKey(), key.metaKey())
</del><ins>+    : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type())
+        , true, true, key.timestamp(), view, 0, key.ctrlKey(), key.altKey(), key.shiftKey()
+        , key.metaKey(), false, key.modifiers().contains(PlatformEvent::Modifier::CapsLockKey))
</ins><span class="cx">     , m_keyEvent(std::make_unique&lt;PlatformKeyboardEvent&gt;(key))
</span><span class="cx"> #if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
</span><span class="cx">     , m_key(key.key())
</span><span class="lines">@@ -107,8 +108,6 @@
</span><span class="cx">     , m_keyIdentifier(key.keyIdentifier())
</span><span class="cx">     , m_location(keyLocationCode(key))
</span><span class="cx">     , m_repeat(key.isAutoRepeat())
</span><del>-    , m_altGraphKey(false)
-    , m_capsLockKey(key.modifiers().contains(PlatformEvent::Modifier::CapsLockKey))
</del><span class="cx">     , m_isComposing(view &amp;&amp; view-&gt;frame() &amp;&amp; view-&gt;frame()-&gt;editor().hasComposition())
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> #if USE(APPKIT)
</span><span class="lines">@@ -127,8 +126,8 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-KeyboardEvent::KeyboardEvent(const AtomicString&amp; eventType, const KeyboardEventInit&amp; initializer)
-    : UIEventWithKeyState(eventType, initializer)
</del><ins>+KeyboardEvent::KeyboardEvent(const AtomicString&amp; eventType, const Init&amp; initializer, IsTrusted isTrusted)
+    : UIEventWithKeyState(eventType, initializer, isTrusted)
</ins><span class="cx"> #if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
</span><span class="cx">     , m_key(initializer.key)
</span><span class="cx"> #endif
</span><span class="lines">@@ -138,8 +137,6 @@
</span><span class="cx">     , m_keyIdentifier(initializer.keyIdentifier)
</span><span class="cx">     , m_location(initializer.location)
</span><span class="cx">     , m_repeat(initializer.repeat)
</span><del>-    , m_altGraphKey(false) // FIXME: should be initialized from initializer.modifierAltGraph.
-    , m_capsLockKey(false) // FIXME: should be initialized from initializer.modifierCapsLock.
</del><span class="cx">     , m_isComposing(initializer.isComposing)
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     , m_handledByInputMethod(false)
</span><span class="lines">@@ -182,7 +179,7 @@
</span><span class="cx">     if (keyIdentifier == &quot;AltGraph&quot;)
</span><span class="cx">         return altGraphKey();
</span><span class="cx">     if (keyIdentifier == &quot;CapsLock&quot;)
</span><del>-        return m_capsLockKey;
</del><ins>+        return capsLockKey();
</ins><span class="cx">     // FIXME: The specification also has Fn, FnLock, Hyper, NumLock, Super, ScrollLock, Symbol, SymbolLock.
</span><span class="cx">     return false;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoredomKeyboardEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/KeyboardEvent.h (206970 => 206971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/KeyboardEvent.h        2016-10-09 22:47:57 UTC (rev 206970)
+++ trunk/Source/WebCore/dom/KeyboardEvent.h        2016-10-09 23:11:56 UTC (rev 206971)
</span><span class="lines">@@ -23,6 +23,7 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#include &quot;EventModifierInit.h&quot;
</ins><span class="cx"> #include &quot;KeypressCommand.h&quot;
</span><span class="cx"> #include &quot;UIEventWithKeyState.h&quot;
</span><span class="cx"> #include &lt;memory&gt;
</span><span class="lines">@@ -33,19 +34,6 @@
</span><span class="cx"> class Node;
</span><span class="cx"> class PlatformKeyboardEvent;
</span><span class="cx"> 
</span><del>-struct KeyboardEventInit : public UIEventWithKeyStateInit {
-#if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
-    String key;
-#endif
-#if ENABLE(KEYBOARD_CODE_ATTRIBUTE)
-    String code;
-#endif
-    String keyIdentifier;
-    unsigned location { 0 };
-    bool repeat { false };
-    bool isComposing { false };
-};
-
</del><span class="cx"> class KeyboardEvent final : public UIEventWithKeyState {
</span><span class="cx"> public:
</span><span class="cx">     enum KeyLocationCode {
</span><span class="lines">@@ -65,9 +53,33 @@
</span><span class="cx">         return adoptRef(*new KeyboardEvent);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    static Ref&lt;KeyboardEvent&gt; createForBindings(const AtomicString&amp; type, const KeyboardEventInit&amp; initializer)
</del><ins>+    struct Init : public EventModifierInit {
+        Init(bool bubbles, bool cancelable, bool composed, RefPtr&lt;DOMWindow&gt;&amp;&amp; view, int detail,
+            bool ctrlKey, bool shiftKey, bool altKey, bool metaKey, bool modifierAltGraph, bool modifierCapsLock,
+            String key, String code, Optional&lt;unsigned&gt; location, bool repeat, bool isComposing, String keyIdentifier,
+            Optional&lt;unsigned&gt; keyLocation)
+                : EventModifierInit(bubbles, cancelable, composed, WTFMove(view), detail, ctrlKey, shiftKey, altKey, metaKey, modifierAltGraph, modifierCapsLock)
+                , key(key)
+                , code(code)
+                , location(location ? *location : keyLocation.valueOr(DOM_KEY_LOCATION_STANDARD))
+                , repeat(repeat)
+                , isComposing(isComposing)
+                , keyIdentifier(keyIdentifier)
+            { }
+
+        String key;
+        String code;
+        unsigned location;
+        bool repeat;
+        bool isComposing;
+
+        // Legacy.
+        String keyIdentifier;
+    };
+
+    static Ref&lt;KeyboardEvent&gt; create(const AtomicString&amp; type, const Init&amp; initializer, IsTrusted isTrusted = IsTrusted::No)
</ins><span class="cx">     {
</span><del>-        return adoptRef(*new KeyboardEvent(type, initializer));
</del><ins>+        return adoptRef(*new KeyboardEvent(type, initializer, isTrusted));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // FIXME: This method should be get ride of in the future.
</span><span class="lines">@@ -95,8 +107,6 @@
</span><span class="cx">     bool repeat() const { return m_repeat; }
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT bool getModifierState(const String&amp; keyIdentifier) const;
</span><del>-
-    bool altGraphKey() const { return m_altGraphKey; }
</del><span class="cx">     
</span><span class="cx">     const PlatformKeyboardEvent* keyEvent() const { return m_keyEvent.get(); }
</span><span class="cx"> 
</span><span class="lines">@@ -120,7 +130,7 @@
</span><span class="cx"> private:
</span><span class="cx">     WEBCORE_EXPORT KeyboardEvent();
</span><span class="cx">     WEBCORE_EXPORT KeyboardEvent(const PlatformKeyboardEvent&amp;, DOMWindow*);
</span><del>-    KeyboardEvent(const AtomicString&amp;, const KeyboardEventInit&amp;);
</del><ins>+    KeyboardEvent(const AtomicString&amp;, const Init&amp;, IsTrusted);
</ins><span class="cx">     // FIXME: This method should be get rid of in the future.
</span><span class="cx">     // DO NOT USE IT!
</span><span class="cx">     KeyboardEvent(WTF::HashTableDeletedValueType);
</span><span class="lines">@@ -135,8 +145,6 @@
</span><span class="cx">     String m_keyIdentifier;
</span><span class="cx">     unsigned m_location { DOM_KEY_LOCATION_STANDARD };
</span><span class="cx">     bool m_repeat { false };
</span><del>-    bool m_altGraphKey { false };
-    bool m_capsLockKey { false };
</del><span class="cx">     bool m_isComposing { false };
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span></span></pre></div>
<a id="trunkSourceWebCoredomKeyboardEventidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/KeyboardEvent.idl (206970 => 206971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/KeyboardEvent.idl        2016-10-09 22:47:57 UTC (rev 206970)
+++ trunk/Source/WebCore/dom/KeyboardEvent.idl        2016-10-09 23:11:56 UTC (rev 206971)
</span><span class="lines">@@ -19,8 +19,7 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> [
</span><del>-    ConstructorConditional=DOM4_EVENTS_CONSTRUCTOR,
-    ConstructorTemplate=Event,
</del><ins>+    Constructor(DOMString type, optional KeyboardEventInit eventInitDict),
</ins><span class="cx"> ] interface KeyboardEvent : UIEvent {
</span><span class="cx"> 
</span><span class="cx">     const unsigned long DOM_KEY_LOCATION_STANDARD = 0x00;
</span><span class="lines">@@ -28,23 +27,23 @@
</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, Conditional=KEYBOARD_KEY_ATTRIBUTE] readonly attribute DOMString key;
-    [InitializedByEventConstructor, Conditional=KEYBOARD_CODE_ATTRIBUTE] readonly attribute DOMString code;
-    [InitializedByEventConstructor] readonly attribute unsigned long location;
</del><ins>+    [Conditional=KEYBOARD_KEY_ATTRIBUTE] readonly attribute DOMString key;
+    [Conditional=KEYBOARD_CODE_ATTRIBUTE] readonly attribute DOMString code;
+    readonly attribute unsigned long location;
</ins><span class="cx"> 
</span><del>-    [InitializedByEventConstructor] readonly attribute boolean ctrlKey;
-    [InitializedByEventConstructor] readonly attribute boolean shiftKey;
-    [InitializedByEventConstructor] readonly attribute boolean altKey;
-    [InitializedByEventConstructor] readonly attribute boolean metaKey;
-    [InitializedByEventConstructor] readonly attribute boolean repeat;
</del><ins>+    readonly attribute boolean ctrlKey;
+    readonly attribute boolean shiftKey;
+    readonly attribute boolean altKey;
+    readonly attribute boolean metaKey;
+    readonly attribute boolean repeat;
</ins><span class="cx"> 
</span><del>-    [InitializedByEventConstructor] readonly attribute boolean isComposing;
</del><ins>+    readonly attribute boolean isComposing;
</ins><span class="cx"> 
</span><span class="cx">     boolean getModifierState(DOMString keyArg);
</span><span class="cx"> 
</span><span class="cx">     // Everything below is legacy.
</span><del>-    [InitializedByEventConstructor] readonly attribute DOMString keyIdentifier;
-    [InitializedByEventConstructor, ImplementedAs=location] readonly attribute unsigned long keyLocation;
</del><ins>+    readonly attribute DOMString keyIdentifier;
+    [ImplementedAs=location] readonly attribute unsigned long keyLocation;
</ins><span class="cx">     readonly attribute boolean altGraphKey;
</span><span class="cx"> 
</span><span class="cx">     // FIXME: this does not match the version in the DOM spec.
</span><span class="lines">@@ -53,3 +52,16 @@
</span><span class="cx">         optional DOMWindow? view = null, optional DOMString keyIdentifier = &quot;undefined&quot;, optional unsigned long location = 0,
</span><span class="cx">         optional boolean ctrlKey = false, optional boolean altKey = false, optional boolean shiftKey = false, optional boolean metaKey = false, optional boolean altGraphKey = false);
</span><span class="cx"> };
</span><ins>+
+dictionary KeyboardEventInit : EventModifierInit {
+    DOMString key = &quot;&quot;;
+    DOMString code = &quot;&quot;;
+    unsigned long location;
+    boolean repeat = false;
+    boolean isComposing = false;
+
+    // This members are not in the specification but are needed to initialize the corresponding legacy
+    // attributes we still support on KeyboardEvent for backward compatibility.
+    DOMString keyIdentifier = &quot;&quot;;
+    unsigned long keyLocation;
+};
</ins></span></pre></div>
<a id="trunkSourceWebCoredomMouseRelatedEventcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/MouseRelatedEvent.cpp (206970 => 206971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/MouseRelatedEvent.cpp        2016-10-09 22:47:57 UTC (rev 206970)
+++ trunk/Source/WebCore/dom/MouseRelatedEvent.cpp        2016-10-09 23:11:56 UTC (rev 206971)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx">                                      const IntPoint&amp; movementDelta,
</span><span class="cx"> #endif
</span><span class="cx">                                      bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool isSimulated)
</span><del>-    : UIEventWithKeyState(eventType, canBubble, cancelable, timestamp, DOMWindow, detail, ctrlKey, altKey, shiftKey, metaKey)
</del><ins>+    : UIEventWithKeyState(eventType, canBubble, cancelable, timestamp, DOMWindow, detail, ctrlKey, altKey, shiftKey, metaKey, false, false)
</ins><span class="cx">     , m_screenLocation(screenLocation)
</span><span class="cx"> #if ENABLE(POINTER_LOCK)
</span><span class="cx">     , m_movementDelta(movementDelta)
</span></span></pre></div>
<a id="trunkSourceWebCoredomMouseRelatedEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/MouseRelatedEvent.h (206970 => 206971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/MouseRelatedEvent.h        2016-10-09 22:47:57 UTC (rev 206970)
+++ trunk/Source/WebCore/dom/MouseRelatedEvent.h        2016-10-09 23:11:56 UTC (rev 206971)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-struct MouseRelatedEventInit : public UIEventWithKeyStateInit {
</del><ins>+struct MouseRelatedEventInit : public EventModifierInit {
</ins><span class="cx">     int screenX { 0 };
</span><span class="cx">     int screenY { 0 };
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoredomUIEventcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/UIEvent.cpp (206970 => 206971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/UIEvent.cpp        2016-10-09 22:47:57 UTC (rev 206970)
+++ trunk/Source/WebCore/dom/UIEvent.cpp        2016-10-09 23:11:56 UTC (rev 206971)
</span><span class="lines">@@ -46,8 +46,8 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-UIEvent::UIEvent(const AtomicString&amp; eventType, const UIEventInit&amp; initializer)
-    : Event(eventType, initializer)
</del><ins>+UIEvent::UIEvent(const AtomicString&amp; eventType, const UIEventInit&amp; initializer, IsTrusted isTrusted)
+    : Event(eventType, initializer, isTrusted)
</ins><span class="cx">     , m_view(initializer.view.get())
</span><span class="cx">     , m_detail(initializer.detail)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoredomUIEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/UIEvent.h (206970 => 206971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/UIEvent.h        2016-10-09 22:47:57 UTC (rev 206970)
+++ trunk/Source/WebCore/dom/UIEvent.h        2016-10-09 23:11:56 UTC (rev 206971)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;DOMWindow.h&quot;
</span><span class="cx"> #include &quot;Event.h&quot;
</span><ins>+#include &quot;UIEventInit.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -31,11 +32,6 @@
</span><span class="cx"> // FIXME: Remove this when no one is depending on it anymore.
</span><span class="cx"> typedef DOMWindow AbstractView;
</span><span class="cx"> 
</span><del>-struct UIEventInit : public EventInit {
-    RefPtr&lt;DOMWindow&gt; view;
-    int detail { 0 };
-};
-
</del><span class="cx"> class UIEvent : public Event {
</span><span class="cx"> public:
</span><span class="cx">     static Ref&lt;UIEvent&gt; create(const AtomicString&amp; type, bool canBubble, bool cancelable, DOMWindow* view, int detail)
</span><span class="lines">@@ -74,7 +70,7 @@
</span><span class="cx">     UIEvent();
</span><span class="cx">     UIEvent(const AtomicString&amp; type, bool canBubble, bool cancelable, DOMWindow*, int detail);
</span><span class="cx">     UIEvent(const AtomicString&amp; type, bool canBubble, bool cancelable, double timestamp, DOMWindow*, int detail);
</span><del>-    UIEvent(const AtomicString&amp;, const UIEventInit&amp;);
</del><ins>+    UIEvent(const AtomicString&amp;, const UIEventInit&amp;, IsTrusted = IsTrusted::No);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     bool isUIEvent() const final;
</span></span></pre></div>
<a id="trunkSourceWebCoredomUIEventInith"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/dom/UIEventInit.h (0 => 206971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/UIEventInit.h                                (rev 0)
+++ trunk/Source/WebCore/dom/UIEventInit.h        2016-10-09 23:11:56 UTC (rev 206971)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include &quot;DOMWindow.h&quot;
+#include &quot;EventInit.h&quot;
+#include &lt;wtf/RefPtr.h&gt;
+
+namespace WebCore {
+
+struct UIEventInit : public EventInit {
+    UIEventInit() = default;
+    UIEventInit(bool bubbles, bool cancelable, bool composed, RefPtr&lt;DOMWindow&gt;&amp;&amp; view, int detail)
+        : EventInit(bubbles, cancelable, composed)
+        , view(WTFMove(view))
+        , detail(detail)
+    { }
+
+    RefPtr&lt;DOMWindow&gt; view;
+    int detail { 0 };
+};
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoredomUIEventInitidl"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/dom/UIEventInit.idl (0 => 206971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/UIEventInit.idl                                (rev 0)
+++ trunk/Source/WebCore/dom/UIEventInit.idl        2016-10-09 23:11:56 UTC (rev 206971)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+dictionary UIEventInit : EventInit {
+    DOMWindow? view = null;
+    long detail = 0;
+};
</ins></span></pre></div>
<a id="trunkSourceWebCoredomUIEventWithKeyStateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/UIEventWithKeyState.h (206970 => 206971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/UIEventWithKeyState.h        2016-10-09 22:47:57 UTC (rev 206970)
+++ trunk/Source/WebCore/dom/UIEventWithKeyState.h        2016-10-09 23:11:56 UTC (rev 206971)
</span><span class="lines">@@ -24,17 +24,11 @@
</span><span class="cx"> #ifndef UIEventWithKeyState_h
</span><span class="cx"> #define UIEventWithKeyState_h
</span><span class="cx"> 
</span><ins>+#include &quot;EventModifierInit.h&quot;
</ins><span class="cx"> #include &quot;UIEvent.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-struct UIEventWithKeyStateInit : public UIEventInit {
-    bool ctrlKey { false };
-    bool altKey { false };
-    bool shiftKey { false };
-    bool metaKey { false };
-};
-
</del><span class="cx"> class UIEventWithKeyState : public UIEvent {
</span><span class="cx"> public:
</span><span class="cx">     bool ctrlKey() const { return m_ctrlKey; }
</span><span class="lines">@@ -41,15 +35,11 @@
</span><span class="cx">     bool shiftKey() const { return m_shiftKey; }
</span><span class="cx">     bool altKey() const { return m_altKey; }
</span><span class="cx">     bool metaKey() const { return m_metaKey; }
</span><ins>+    bool altGraphKey() const { return m_altGraphKey; }
+    bool capsLockKey() const { return m_capsLockKey; }
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><del>-    UIEventWithKeyState()
-        : m_ctrlKey(false)
-        , m_altKey(false)
-        , m_shiftKey(false)
-        , m_metaKey(false)
-    {
-    }
</del><ins>+    UIEventWithKeyState() = default;
</ins><span class="cx"> 
</span><span class="cx">     UIEventWithKeyState(const AtomicString&amp; type, bool canBubble, bool cancelable, DOMWindow* view, int detail, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
</span><span class="cx">         : UIEvent(type, canBubble, cancelable, view, detail)
</span><span class="lines">@@ -60,29 +50,36 @@
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    UIEventWithKeyState(const AtomicString&amp; type, bool canBubble, bool cancelable, double timestamp, DOMWindow* view, int detail, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
-        : UIEvent(type, canBubble, cancelable, timestamp, view, detail)
-        , m_ctrlKey(ctrlKey)
-        , m_altKey(altKey)
-        , m_shiftKey(shiftKey)
-        , m_metaKey(metaKey)
</del><ins>+    UIEventWithKeyState(const AtomicString&amp; type, bool canBubble, bool cancelable, double timestamp, DOMWindow* view,
+        int detail, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool altGraphKey, bool capsLockKey)
+            : UIEvent(type, canBubble, cancelable, timestamp, view, detail)
+            , m_ctrlKey(ctrlKey)
+            , m_altKey(altKey)
+            , m_shiftKey(shiftKey)
+            , m_metaKey(metaKey)
+            , m_altGraphKey(altGraphKey)
+            , m_capsLockKey(capsLockKey)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    UIEventWithKeyState(const AtomicString&amp; type, const UIEventWithKeyStateInit&amp; initializer)
-        : UIEvent(type, initializer)
</del><ins>+    UIEventWithKeyState(const AtomicString&amp; type, const EventModifierInit&amp; initializer, IsTrusted isTrusted = IsTrusted::No)
+        : UIEvent(type, initializer, isTrusted)
</ins><span class="cx">         , m_ctrlKey(initializer.ctrlKey)
</span><span class="cx">         , m_altKey(initializer.altKey)
</span><span class="cx">         , m_shiftKey(initializer.shiftKey)
</span><span class="cx">         , m_metaKey(initializer.metaKey)
</span><ins>+        , m_altGraphKey(initializer.modifierAltGraph)
+        , m_capsLockKey(initializer.modifierCapsLock)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Expose these so init functions can set them.
</span><del>-    bool m_ctrlKey : 1;
-    bool m_altKey : 1;
-    bool m_shiftKey : 1;
-    bool m_metaKey : 1;
</del><ins>+    bool m_ctrlKey { false };
+    bool m_altKey { false };
+    bool m_shiftKey { false };
+    bool m_metaKey { false };
+    bool m_altGraphKey { false };
+    bool m_capsLockKey { false };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WEBCORE_EXPORT UIEventWithKeyState* findEventWithKeyState(Event*);
</span></span></pre>
</div>
</div>

</body>
</html>