<!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>[196520] 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/196520">196520</a></dd>
<dt>Author</dt> <dd>jiewen_tan@apple.com</dd>
<dt>Date</dt> <dd>2016-02-12 15:25:02 -0800 (Fri, 12 Feb 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>WebKit should expose the DOM 4 Event.isTrusted property
https://bugs.webkit.org/show_bug.cgi?id=76121
&lt;rdar://problem/22558494&gt;

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/dom/events/Event-constructors-expected.txt:
* web-platform-tests/dom/events/Event-dispatch-redispatch-expected.txt:
* web-platform-tests/dom/events/Event-initEvent-expected.txt:
* web-platform-tests/dom/events/ProgressEvent-expected.txt:
* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/dom/nodes/Document-createEvent-expected.txt:
* web-platform-tests/html/dom/interfaces-expected.txt:
* web-platform-tests/html/semantics/forms/the-button-element/button-events-expected.txt:

Source/WebCore:

Implements Event.isTrusted. The implementation here is slitely different from and better than
the DOM specification. Here Event.isTrusted will be initialized differently depending on the
callers of the constructors/create methods. If the caller is from user agent, the isTrusted
will be true. Otherwise, it will be false. Since a user agent dispatched event can be catched
and re-initialized/redispatched by the bindings, the flag will be unset at *Event::init*Event
and EventTarget::dispatchEventForBindings. As currently there is no way to let user agent to
dispatch a bindings created event, therefore we ensure that the Event.isTrusted is set for
events dispatched by user agent, and unset for those by bindings.

EventTarget::dispatchEvent(Event*, ExceptionCode&amp;) is renamed to EventTarget::dispatchEventForBindings
in this patch as well. So that, together with the improved design of the API, developers in
the future will be less likely using a wrong dispatchEvent method and setting Event.isTrusted
incorrectly comparing to the DOM design.

After this patch, all events that are created by user agent should be dispatched by
EventTarget::dispatchEvent, and those are created by bindings should be dispatched by
EventTarget::dispatchEventForBindings.

Some of the changes in this patch referred Blink <a href="http://trac.webkit.org/projects/webkit/changeset/198996">r198996</a>:
https://codereview.chromium.org/1241613004

Test: imported/blink/fast/events/event-trusted.html

* bindings/scripts/CodeGeneratorGObject.pm:
(GenerateEventTargetIface):
* dom/Event.cpp:
(WebCore::Event::Event):
(WebCore::Event::initEvent):
* dom/Event.h:
(WebCore::Event::isTrusted):
(WebCore::Event::setUntrusted):
* dom/Event.idl:
* dom/EventTarget.cpp:
(WebCore::EventTarget::dispatchEventForBindings):
(WebCore::EventTarget::dispatchEvent): Deleted.
* dom/EventTarget.h:
* dom/EventTarget.idl:
* page/DOMWindow.idl:
* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchDragEvent):
* workers/WorkerGlobalScope.idl:

Source/WebKit/win:

* DOMCoreClasses.cpp:
(DOMNode::dispatchEvent):
(DOMWindow::dispatchEvent):

LayoutTests:

* fast/dom/unforgeable-attributes-expected.txt:
* fast/xmlhttprequest/xmlhttprequest-get-expected.txt:
* http/tests/workers/worker-importScriptsOnError-expected.txt:
* imported/blink/fast/events/event-trusted-expected.txt: Added.
* imported/blink/fast/events/event-trusted.html: Added.
* platform/ios-simulator/TestExpectations:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomunforgeableattributesexpectedtxt">trunk/LayoutTests/fast/dom/unforgeable-attributes-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastxmlhttprequestxmlhttprequestgetexpectedtxt">trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-get-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsworkersworkerimportScriptsOnErrorexpectedtxt">trunk/LayoutTests/http/tests/workers/worker-importScriptsOnError-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsdomeventsEventconstructorsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-constructors-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsdomeventsEventdispatchredispatchexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-redispatch-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsdomeventsEventinitEventexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-initEvent-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsdomeventsProgressEventexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/ProgressEvent-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsdominterfacesexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsdomnodesDocumentcreateEventexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createEvent-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmldominterfacesexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlsemanticsformsthebuttonelementbuttoneventsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-button-element/button-events-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorTestExpectations">trunk/LayoutTests/platform/ios-simulator/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorGObjectpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm</a></li>
<li><a href="#trunkSourceWebCoredomEventcpp">trunk/Source/WebCore/dom/Event.cpp</a></li>
<li><a href="#trunkSourceWebCoredomEventh">trunk/Source/WebCore/dom/Event.h</a></li>
<li><a href="#trunkSourceWebCoredomEventidl">trunk/Source/WebCore/dom/Event.idl</a></li>
<li><a href="#trunkSourceWebCoredomEventTargetcpp">trunk/Source/WebCore/dom/EventTarget.cpp</a></li>
<li><a href="#trunkSourceWebCoredomEventTargeth">trunk/Source/WebCore/dom/EventTarget.h</a></li>
<li><a href="#trunkSourceWebCoredomEventTargetidl">trunk/Source/WebCore/dom/EventTarget.idl</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowidl">trunk/Source/WebCore/page/DOMWindow.idl</a></li>
<li><a href="#trunkSourceWebCorepageEventHandlercpp">trunk/Source/WebCore/page/EventHandler.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerGlobalScopeidl">trunk/Source/WebCore/workers/WorkerGlobalScope.idl</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinDOMCoreClassescpp">trunk/Source/WebKit/win/DOMCoreClasses.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsimportedblinkfasteventseventtrustedexpectedtxt">trunk/LayoutTests/imported/blink/fast/events/event-trusted-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedblinkfasteventseventtrustedhtml">trunk/LayoutTests/imported/blink/fast/events/event-trusted.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/LayoutTests/ChangeLog        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-02-12  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
+
+        WebKit should expose the DOM 4 Event.isTrusted property
+        https://bugs.webkit.org/show_bug.cgi?id=76121
+        &lt;rdar://problem/22558494&gt;
+
+        Reviewed by Darin Adler.
+
+        * fast/dom/unforgeable-attributes-expected.txt:
+        * fast/xmlhttprequest/xmlhttprequest-get-expected.txt:
+        * http/tests/workers/worker-importScriptsOnError-expected.txt:
+        * imported/blink/fast/events/event-trusted-expected.txt: Added.
+        * imported/blink/fast/events/event-trusted.html: Added.
+        * platform/ios-simulator/TestExpectations:
+
</ins><span class="cx"> 2016-02-12  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Modern IDB: Simplify the relationship between IDBObjectStore and IDBIndex.
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomunforgeableattributesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/unforgeable-attributes-expected.txt (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/unforgeable-attributes-expected.txt        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/LayoutTests/fast/dom/unforgeable-attributes-expected.txt        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -4,7 +4,10 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> Event.isTrusted
</span><del>-FAIL Unsupported property.
</del><ins>+PASS testObject.hasOwnProperty(testPropertyName) is true
+PASS testObject.__proto__.hasOwnProperty(testPropertyName) is false
+PASS Object.defineProperty(testObject, testPropertyName, { value: 'test' }) threw exception TypeError: Attempting to change access mechanism for an unconfigurable property..
+PASS Object.getOwnPropertyDescriptor(testObject, testPropertyName).configurable is false
</ins><span class="cx"> 
</span><span class="cx"> Document.location
</span><span class="cx"> PASS testObject.hasOwnProperty(testPropertyName) is true
</span></span></pre></div>
<a id="trunkLayoutTestsfastxmlhttprequestxmlhttprequestgetexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-get-expected.txt (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-get-expected.txt        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-get-expected.txt        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -53,6 +53,7 @@
</span><span class="cx"> initEvent : 'function initEvent() {
</span><span class="cx">     [native code]
</span><span class="cx"> }'
</span><ins>+isTrusted : 'true'
</ins><span class="cx"> lengthComputable : 'true'
</span><span class="cx"> loaded : '174'
</span><span class="cx"> position : '174'
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsworkersworkerimportScriptsOnErrorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/workers/worker-importScriptsOnError-expected.txt (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/workers/worker-importScriptsOnError-expected.txt        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/LayoutTests/http/tests/workers/worker-importScriptsOnError-expected.txt        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> eventPhase: 2,
</span><span class="cx"> filename: http://127.0.0.1:8000/workers/resources/worker-importScripts-error.js,
</span><span class="cx"> initEvent: function initEvent() { [native code] },
</span><ins>+isTrusted: true,
</ins><span class="cx"> lineno: 2,
</span><span class="cx"> message: Error: Script error.,
</span><span class="cx"> preventDefault: function preventDefault() { [native code] },
</span></span></pre></div>
<a id="trunkLayoutTestsimportedblinkfasteventseventtrustedexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/blink/fast/events/event-trusted-expected.txt (0 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/blink/fast/events/event-trusted-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/blink/fast/events/event-trusted-expected.txt        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+This tests that isTrusted returns the correct value under certain situations.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS document.createEvent('Event').isTrusted is false
+PASS createAndInitEvent().isTrusted is false
+PASS originalEvent.isTrusted is true
+PASS redispatched is true
+PASS originalEvent.isTrusted is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedblinkfasteventseventtrustedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/blink/fast/events/event-trusted.html (0 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/blink/fast/events/event-trusted.html                                (rev 0)
+++ trunk/LayoutTests/imported/blink/fast/events/event-trusted.html        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+&lt;input id=&quot;test-checkbox&quot; type=&quot;checkbox&quot;/&gt;
+&lt;script src=&quot;../../../../resources/js-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+description(&quot;This tests that isTrusted returns the correct value under certain situations.&quot;)
+
+var redispatched = false;
+
+function createAndInitEvent() {
+    var e = document.createEvent('Event');
+    e.initEvent(false, false, false);
+    return e;
+}
+
+shouldBeFalse(&quot;document.createEvent('Event').isTrusted&quot;);
+shouldBeFalse(&quot;createAndInitEvent().isTrusted&quot;);
+
+function originalDispatch(e) {
+    originalEvent = e;
+}
+
+function redispatch(e) {
+    redispatched = true;
+}
+
+var element = document.getElementById(&quot;test-checkbox&quot;);
+if (window.eventSender) {
+    element.addEventListener('click', originalDispatch);
+    eventSender.mouseMoveTo(element.offsetLeft, element.offsetTop);
+    eventSender.mouseDown();
+    eventSender.mouseUp();
+
+    shouldBeTrue(&quot;originalEvent.isTrusted&quot;);
+    element.removeEventListener('click', originalDispatch);
+    element.addEventListener('click', redispatch);
+
+    element.dispatchEvent(originalEvent);
+    shouldBeTrue(&quot;redispatched&quot;);
+    shouldBeFalse(&quot;originalEvent.isTrusted&quot;);
+}
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2016-02-12  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
+
+        WebKit should expose the DOM 4 Event.isTrusted property
+        https://bugs.webkit.org/show_bug.cgi?id=76121
+        &lt;rdar://problem/22558494&gt;
+
+        Reviewed by Darin Adler.
+
+        * web-platform-tests/dom/events/Event-constructors-expected.txt:
+        * web-platform-tests/dom/events/Event-dispatch-redispatch-expected.txt:
+        * web-platform-tests/dom/events/Event-initEvent-expected.txt:
+        * web-platform-tests/dom/events/ProgressEvent-expected.txt:
+        * web-platform-tests/dom/interfaces-expected.txt:
+        * web-platform-tests/dom/nodes/Document-createEvent-expected.txt:
+        * web-platform-tests/html/dom/interfaces-expected.txt:
+        * web-platform-tests/html/semantics/forms/the-button-element/button-events-expected.txt:
+
</ins><span class="cx"> 2016-02-11  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Web IDL] interfaces should inherit EventTarget instead of duplicating the EventTarget API
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsdomeventsEventconstructorsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-constructors-expected.txt (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-constructors-expected.txt        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-constructors-expected.txt        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -1,8 +1,8 @@
</span><span class="cx"> 
</span><span class="cx"> PASS Event constructors 
</span><span class="cx"> PASS Event constructors 1 
</span><del>-FAIL Event constructors 2 assert_equals: expected (boolean) false but got (undefined) undefined
-FAIL Event constructors 3 assert_equals: expected (boolean) false but got (undefined) undefined
</del><ins>+PASS Event constructors 2 
+PASS Event constructors 3 
</ins><span class="cx"> FAIL Event constructors 4 Constructor requires 'new' operator
</span><span class="cx"> PASS Event constructors 5 
</span><span class="cx"> PASS Event constructors 6 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsdomeventsEventdispatchredispatchexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-redispatch-expected.txt (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-redispatch-expected.txt        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-redispatch-expected.txt        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -1,3 +1,3 @@
</span><span class="cx"> 
</span><del>-FAIL EventTarget#dispatchEvent(): redispatching a native event assert_true: Should be trusted when first handled expected true got undefined
</del><ins>+PASS EventTarget#dispatchEvent(): redispatching a native event 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsdomeventsEventinitEventexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-initEvent-expected.txt (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-initEvent-expected.txt        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-initEvent-expected.txt        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -1,8 +1,8 @@
</span><span class="cx"> 
</span><del>-FAIL Properties of initEvent(type, true, true) assert_equals: isTrusted expected (boolean) false but got (undefined) undefined
-FAIL Properties of initEvent(type, true, false) assert_equals: isTrusted expected (boolean) false but got (undefined) undefined
-FAIL Properties of initEvent(type, false, true) assert_equals: isTrusted expected (boolean) false but got (undefined) undefined
-FAIL Properties of initEvent(type, false, false) assert_equals: isTrusted expected (boolean) false but got (undefined) undefined
</del><ins>+PASS Properties of initEvent(type, true, true) 
+PASS Properties of initEvent(type, true, false) 
+PASS Properties of initEvent(type, false, true) 
+PASS Properties of initEvent(type, false, false) 
</ins><span class="cx"> PASS Calling initEvent multiple times (getting type). 
</span><span class="cx"> PASS Calling initEvent multiple times (not getting type). 
</span><span class="cx"> PASS Calling initEvent must not have an effect during dispatching. 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsdomeventsProgressEventexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/ProgressEvent-expected.txt (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/ProgressEvent-expected.txt        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/ProgressEvent-expected.txt        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><span class="cx"> 
</span><del>-FAIL Default event values. assert_equals: expected (boolean) false but got (undefined) undefined
</del><ins>+PASS Default event values. 
</ins><span class="cx"> PASS document.createEvent() should not work with ProgressEvent. 
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsdominterfacesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> PASS Event interface: document.createEvent(&quot;Event&quot;) must inherit property &quot;cancelable&quot; with the proper type (11) 
</span><span class="cx"> PASS Event interface: document.createEvent(&quot;Event&quot;) must inherit property &quot;preventDefault&quot; with the proper type (12) 
</span><span class="cx"> PASS Event interface: document.createEvent(&quot;Event&quot;) must inherit property &quot;defaultPrevented&quot; with the proper type (13) 
</span><del>-FAIL Event interface: document.createEvent(&quot;Event&quot;) must have own property &quot;isTrusted&quot; assert_own_property: expected property &quot;isTrusted&quot; missing
</del><ins>+PASS Event interface: document.createEvent(&quot;Event&quot;) must have own property &quot;isTrusted&quot; 
</ins><span class="cx"> PASS Event interface: document.createEvent(&quot;Event&quot;) must inherit property &quot;timeStamp&quot; with the proper type (15) 
</span><span class="cx"> PASS Event interface: document.createEvent(&quot;Event&quot;) must inherit property &quot;initEvent&quot; with the proper type (16) 
</span><span class="cx"> FAIL Event interface: calling initEvent(DOMString,boolean,boolean) on document.createEvent(&quot;Event&quot;) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx"> PASS Event interface: new Event(&quot;foo&quot;) must inherit property &quot;cancelable&quot; with the proper type (11) 
</span><span class="cx"> PASS Event interface: new Event(&quot;foo&quot;) must inherit property &quot;preventDefault&quot; with the proper type (12) 
</span><span class="cx"> PASS Event interface: new Event(&quot;foo&quot;) must inherit property &quot;defaultPrevented&quot; with the proper type (13) 
</span><del>-FAIL Event interface: new Event(&quot;foo&quot;) must have own property &quot;isTrusted&quot; assert_own_property: expected property &quot;isTrusted&quot; missing
</del><ins>+PASS Event interface: new Event(&quot;foo&quot;) must have own property &quot;isTrusted&quot; 
</ins><span class="cx"> PASS Event interface: new Event(&quot;foo&quot;) must inherit property &quot;timeStamp&quot; with the proper type (15) 
</span><span class="cx"> PASS Event interface: new Event(&quot;foo&quot;) must inherit property &quot;initEvent&quot; with the proper type (16) 
</span><span class="cx"> FAIL Event interface: calling initEvent(DOMString,boolean,boolean) on new Event(&quot;foo&quot;) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
</span><span class="lines">@@ -99,7 +99,7 @@
</span><span class="cx"> PASS Event interface: new CustomEvent(&quot;foo&quot;) must inherit property &quot;cancelable&quot; with the proper type (11) 
</span><span class="cx"> PASS Event interface: new CustomEvent(&quot;foo&quot;) must inherit property &quot;preventDefault&quot; with the proper type (12) 
</span><span class="cx"> PASS Event interface: new CustomEvent(&quot;foo&quot;) must inherit property &quot;defaultPrevented&quot; with the proper type (13) 
</span><del>-FAIL Event interface: new CustomEvent(&quot;foo&quot;) must have own property &quot;isTrusted&quot; assert_own_property: expected property &quot;isTrusted&quot; missing
</del><ins>+PASS Event interface: new CustomEvent(&quot;foo&quot;) must have own property &quot;isTrusted&quot; 
</ins><span class="cx"> PASS Event interface: new CustomEvent(&quot;foo&quot;) must inherit property &quot;timeStamp&quot; with the proper type (15) 
</span><span class="cx"> PASS Event interface: new CustomEvent(&quot;foo&quot;) must inherit property &quot;initEvent&quot; with the proper type (16) 
</span><span class="cx"> FAIL Event interface: calling initEvent(DOMString,boolean,boolean) on new CustomEvent(&quot;foo&quot;) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsdomnodesDocumentcreateEventexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createEvent-expected.txt (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createEvent-expected.txt        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createEvent-expected.txt        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -1,34 +1,34 @@
</span><span class="cx"> 
</span><span class="cx"> PASS CustomEvent should be an alias for CustomEvent. 
</span><del>-FAIL createEvent('CustomEvent') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('CustomEvent') should be initialized correctly. 
</ins><span class="cx"> PASS customevent should be an alias for CustomEvent. 
</span><del>-FAIL createEvent('customevent') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('customevent') should be initialized correctly. 
</ins><span class="cx"> PASS CUSTOMEVENT should be an alias for CustomEvent. 
</span><del>-FAIL createEvent('CUSTOMEVENT') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('CUSTOMEVENT') should be initialized correctly. 
</ins><span class="cx"> PASS Event should be an alias for Event. 
</span><del>-FAIL createEvent('Event') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('Event') should be initialized correctly. 
</ins><span class="cx"> PASS event should be an alias for Event. 
</span><del>-FAIL createEvent('event') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('event') should be initialized correctly. 
</ins><span class="cx"> PASS EVENT should be an alias for Event. 
</span><del>-FAIL createEvent('EVENT') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('EVENT') should be initialized correctly. 
</ins><span class="cx"> PASS Events should be an alias for Event. 
</span><del>-FAIL createEvent('Events') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('Events') should be initialized correctly. 
</ins><span class="cx"> PASS events should be an alias for Event. 
</span><del>-FAIL createEvent('events') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('events') should be initialized correctly. 
</ins><span class="cx"> PASS EVENTS should be an alias for Event. 
</span><del>-FAIL createEvent('EVENTS') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('EVENTS') should be initialized correctly. 
</ins><span class="cx"> PASS HTMLEvents should be an alias for Event. 
</span><del>-FAIL createEvent('HTMLEvents') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('HTMLEvents') should be initialized correctly. 
</ins><span class="cx"> PASS htmlevents should be an alias for Event. 
</span><del>-FAIL createEvent('htmlevents') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('htmlevents') should be initialized correctly. 
</ins><span class="cx"> PASS HTMLEVENTS should be an alias for Event. 
</span><del>-FAIL createEvent('HTMLEVENTS') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('HTMLEVENTS') should be initialized correctly. 
</ins><span class="cx"> PASS KeyboardEvent should be an alias for KeyboardEvent. 
</span><del>-FAIL createEvent('KeyboardEvent') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('KeyboardEvent') should be initialized correctly. 
</ins><span class="cx"> PASS keyboardevent should be an alias for KeyboardEvent. 
</span><del>-FAIL createEvent('keyboardevent') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('keyboardevent') should be initialized correctly. 
</ins><span class="cx"> PASS KEYBOARDEVENT should be an alias for KeyboardEvent. 
</span><del>-FAIL createEvent('KEYBOARDEVENT') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('KEYBOARDEVENT') should be initialized correctly. 
</ins><span class="cx"> FAIL KeyEvents should be an alias for KeyboardEvent. NotSupportedError: DOM Exception 9
</span><span class="cx"> FAIL createEvent('KeyEvents') should be initialized correctly. undefined is not an object (evaluating 'ev.type')
</span><span class="cx"> FAIL keyevents should be an alias for KeyboardEvent. NotSupportedError: DOM Exception 9
</span><span class="lines">@@ -36,23 +36,23 @@
</span><span class="cx"> FAIL KEYEVENTS should be an alias for KeyboardEvent. NotSupportedError: DOM Exception 9
</span><span class="cx"> FAIL createEvent('KEYEVENTS') should be initialized correctly. undefined is not an object (evaluating 'ev.type')
</span><span class="cx"> PASS MessageEvent should be an alias for MessageEvent. 
</span><del>-FAIL createEvent('MessageEvent') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('MessageEvent') should be initialized correctly. 
</ins><span class="cx"> PASS messageevent should be an alias for MessageEvent. 
</span><del>-FAIL createEvent('messageevent') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('messageevent') should be initialized correctly. 
</ins><span class="cx"> PASS MESSAGEEVENT should be an alias for MessageEvent. 
</span><del>-FAIL createEvent('MESSAGEEVENT') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('MESSAGEEVENT') should be initialized correctly. 
</ins><span class="cx"> PASS MouseEvent should be an alias for MouseEvent. 
</span><del>-FAIL createEvent('MouseEvent') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('MouseEvent') should be initialized correctly. 
</ins><span class="cx"> PASS mouseevent should be an alias for MouseEvent. 
</span><del>-FAIL createEvent('mouseevent') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('mouseevent') should be initialized correctly. 
</ins><span class="cx"> PASS MOUSEEVENT should be an alias for MouseEvent. 
</span><del>-FAIL createEvent('MOUSEEVENT') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('MOUSEEVENT') should be initialized correctly. 
</ins><span class="cx"> PASS MouseEvents should be an alias for MouseEvent. 
</span><del>-FAIL createEvent('MouseEvents') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('MouseEvents') should be initialized correctly. 
</ins><span class="cx"> PASS mouseevents should be an alias for MouseEvent. 
</span><del>-FAIL createEvent('mouseevents') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('mouseevents') should be initialized correctly. 
</ins><span class="cx"> PASS MOUSEEVENTS should be an alias for MouseEvent. 
</span><del>-FAIL createEvent('MOUSEEVENTS') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('MOUSEEVENTS') should be initialized correctly. 
</ins><span class="cx"> FAIL TouchEvent should be an alias for TouchEvent. NotSupportedError: DOM Exception 9
</span><span class="cx"> FAIL createEvent('TouchEvent') should be initialized correctly. undefined is not an object (evaluating 'ev.type')
</span><span class="cx"> FAIL touchevent should be an alias for TouchEvent. NotSupportedError: DOM Exception 9
</span><span class="lines">@@ -60,16 +60,16 @@
</span><span class="cx"> FAIL TOUCHEVENT should be an alias for TouchEvent. NotSupportedError: DOM Exception 9
</span><span class="cx"> FAIL createEvent('TOUCHEVENT') should be initialized correctly. undefined is not an object (evaluating 'ev.type')
</span><span class="cx"> PASS UIEvent should be an alias for UIEvent. 
</span><del>-FAIL createEvent('UIEvent') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('UIEvent') should be initialized correctly. 
</ins><span class="cx"> PASS uievent should be an alias for UIEvent. 
</span><del>-FAIL createEvent('uievent') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('uievent') should be initialized correctly. 
</ins><span class="cx"> PASS UIEVENT should be an alias for UIEvent. 
</span><del>-FAIL createEvent('UIEVENT') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('UIEVENT') should be initialized correctly. 
</ins><span class="cx"> PASS UIEvents should be an alias for UIEvent. 
</span><del>-FAIL createEvent('UIEvents') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('UIEvents') should be initialized correctly. 
</ins><span class="cx"> PASS uievents should be an alias for UIEvent. 
</span><del>-FAIL createEvent('uievents') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('uievents') should be initialized correctly. 
</ins><span class="cx"> PASS UIEVENTS should be an alias for UIEvent. 
</span><del>-FAIL createEvent('UIEVENTS') should be initialized correctly. assert_equals: isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined
</del><ins>+PASS createEvent('UIEVENTS') should be initialized correctly. 
</ins><span class="cx"> PASS Should throw NOT_SUPPORTED_ERR for unrecognized arguments 
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmldominterfacesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -4167,7 +4167,7 @@
</span><span class="cx"> PASS Event interface: new PopStateEvent(&quot;popstate&quot;, { data: {} }) must inherit property &quot;cancelable&quot; with the proper type (11) 
</span><span class="cx"> PASS Event interface: new PopStateEvent(&quot;popstate&quot;, { data: {} }) must inherit property &quot;preventDefault&quot; with the proper type (12) 
</span><span class="cx"> PASS Event interface: new PopStateEvent(&quot;popstate&quot;, { data: {} }) must inherit property &quot;defaultPrevented&quot; with the proper type (13) 
</span><del>-FAIL Event interface: new PopStateEvent(&quot;popstate&quot;, { data: {} }) must have own property &quot;isTrusted&quot; assert_own_property: expected property &quot;isTrusted&quot; missing
</del><ins>+PASS Event interface: new PopStateEvent(&quot;popstate&quot;, { data: {} }) must have own property &quot;isTrusted&quot; 
</ins><span class="cx"> PASS Event interface: new PopStateEvent(&quot;popstate&quot;, { data: {} }) must inherit property &quot;timeStamp&quot; with the proper type (15) 
</span><span class="cx"> PASS Event interface: new PopStateEvent(&quot;popstate&quot;, { data: {} }) must inherit property &quot;initEvent&quot; with the proper type (16) 
</span><span class="cx"> FAIL Event interface: calling initEvent(DOMString,boolean,boolean) on new PopStateEvent(&quot;popstate&quot;, { data: {} }) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
</span><span class="lines">@@ -4495,7 +4495,7 @@
</span><span class="cx"> PASS Event interface: new CloseEvent(&quot;close&quot;) must inherit property &quot;cancelable&quot; with the proper type (11) 
</span><span class="cx"> PASS Event interface: new CloseEvent(&quot;close&quot;) must inherit property &quot;preventDefault&quot; with the proper type (12) 
</span><span class="cx"> PASS Event interface: new CloseEvent(&quot;close&quot;) must inherit property &quot;defaultPrevented&quot; with the proper type (13) 
</span><del>-FAIL Event interface: new CloseEvent(&quot;close&quot;) must have own property &quot;isTrusted&quot; assert_own_property: expected property &quot;isTrusted&quot; missing
</del><ins>+PASS Event interface: new CloseEvent(&quot;close&quot;) must have own property &quot;isTrusted&quot; 
</ins><span class="cx"> PASS Event interface: new CloseEvent(&quot;close&quot;) must inherit property &quot;timeStamp&quot; with the proper type (15) 
</span><span class="cx"> PASS Event interface: new CloseEvent(&quot;close&quot;) must inherit property &quot;initEvent&quot; with the proper type (16) 
</span><span class="cx"> FAIL Event interface: calling initEvent(DOMString,boolean,boolean) on new CloseEvent(&quot;close&quot;) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlsemanticsformsthebuttonelementbuttoneventsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-button-element/button-events-expected.txt (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-button-element/button-events-expected.txt        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-button-element/button-events-expected.txt        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> 
</span><del>-FAIL The submit event must be fired when click a button in submit status assert_true: The isTrusted attribute of the submit event should be true. expected true got undefined
-FAIL The reset event must be fired when click a button in reset status assert_true: The isTrusted attribute of the reset event should be true. expected true got undefined
</del><ins>+PASS The submit event must be fired when click a button in submit status 
+PASS The reset event must be fired when click a button in reset status 
</ins><span class="cx"> FAIL The show event must be fired when click a button in menu status assert_equals: The button type should be 'menu'. expected &quot;menu&quot; but got &quot;submit&quot;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -2942,3 +2942,5 @@
</span><span class="cx"> webkit.org/b/153762 fast/regions/text-break-properties.html [ Skip ]
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/153029 fast/css-generated-content/details-summary-before-after.html [ Failure ]
</span><ins>+
+webkit.org/b/76121 imported/blink/fast/events/event-trusted.html [ Skip ]
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/Source/WebCore/ChangeLog        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -1,3 +1,53 @@
</span><ins>+2016-02-12  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
+
+        WebKit should expose the DOM 4 Event.isTrusted property
+        https://bugs.webkit.org/show_bug.cgi?id=76121
+        &lt;rdar://problem/22558494&gt;
+
+        Reviewed by Darin Adler.
+
+        Implements Event.isTrusted. The implementation here is slitely different from and better than
+        the DOM specification. Here Event.isTrusted will be initialized differently depending on the
+        callers of the constructors/create methods. If the caller is from user agent, the isTrusted
+        will be true. Otherwise, it will be false. Since a user agent dispatched event can be catched
+        and re-initialized/redispatched by the bindings, the flag will be unset at *Event::init*Event
+        and EventTarget::dispatchEventForBindings. As currently there is no way to let user agent to
+        dispatch a bindings created event, therefore we ensure that the Event.isTrusted is set for
+        events dispatched by user agent, and unset for those by bindings.
+
+        EventTarget::dispatchEvent(Event*, ExceptionCode&amp;) is renamed to EventTarget::dispatchEventForBindings
+        in this patch as well. So that, together with the improved design of the API, developers in
+        the future will be less likely using a wrong dispatchEvent method and setting Event.isTrusted
+        incorrectly comparing to the DOM design.
+
+        After this patch, all events that are created by user agent should be dispatched by
+        EventTarget::dispatchEvent, and those are created by bindings should be dispatched by
+        EventTarget::dispatchEventForBindings.
+
+        Some of the changes in this patch referred Blink r198996:
+        https://codereview.chromium.org/1241613004
+
+        Test: imported/blink/fast/events/event-trusted.html
+
+        * bindings/scripts/CodeGeneratorGObject.pm:
+        (GenerateEventTargetIface):
+        * dom/Event.cpp:
+        (WebCore::Event::Event):
+        (WebCore::Event::initEvent):
+        * dom/Event.h:
+        (WebCore::Event::isTrusted):
+        (WebCore::Event::setUntrusted):
+        * dom/Event.idl:
+        * dom/EventTarget.cpp:
+        (WebCore::EventTarget::dispatchEventForBindings):
+        (WebCore::EventTarget::dispatchEvent): Deleted.
+        * dom/EventTarget.h:
+        * dom/EventTarget.idl:
+        * page/DOMWindow.idl:
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::dispatchDragEvent):
+        * workers/WorkerGlobalScope.idl:
+
</ins><span class="cx"> 2016-02-12  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Modern IDB: IDBObjectStore and IDBIndex need to be ActiveDOMObjects.
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorGObjectpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -1630,7 +1630,7 @@
</span><span class="cx">     push(@cBodyProperties, &quot;    WebCore::Event* coreEvent = WebKit::core(event);\n&quot;);
</span><span class="cx">     push(@cBodyProperties, &quot;    WebCore::${interfaceName}* coreTarget = static_cast&lt;WebCore::${interfaceName}*&gt;(WEBKIT_DOM_OBJECT(target)-&gt;coreObject);\n\n&quot;);
</span><span class="cx">     push(@cBodyProperties, &quot;    WebCore::ExceptionCode ec = 0;\n&quot;);
</span><del>-    push(@cBodyProperties, &quot;    gboolean result = coreTarget-&gt;dispatchEvent(coreEvent, ec);\n&quot;);
</del><ins>+    push(@cBodyProperties, &quot;    gboolean result = coreTarget-&gt;dispatchEventForBindings(coreEvent, ec);\n&quot;);
</ins><span class="cx">     push(@cBodyProperties, &quot;    if (ec) {\n        WebCore::ExceptionCodeDescription description(ec);\n&quot;);
</span><span class="cx">     push(@cBodyProperties, &quot;        g_set_error_literal(error, g_quark_from_string(\&quot;WEBKIT_DOM\&quot;), description.code, description.name);\n    }\n&quot;);
</span><span class="cx">     push(@cBodyProperties, &quot;    return result;\n&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Event.cpp (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Event.cpp        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/Source/WebCore/dom/Event.cpp        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx">     , m_type(eventType)
</span><span class="cx">     , m_canBubble(canBubbleArg)
</span><span class="cx">     , m_cancelable(cancelableArg)
</span><ins>+    , m_isTrusted(true)
</ins><span class="cx">     , m_createTime(convertSecondsToDOMTimeStamp(currentTime()))
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -48,6 +49,7 @@
</span><span class="cx">     , m_type(eventType)
</span><span class="cx">     , m_canBubble(canBubbleArg)
</span><span class="cx">     , m_cancelable(cancelableArg)
</span><ins>+    , m_isTrusted(true)
</ins><span class="cx">     , m_createTime(convertSecondsToDOMTimeStamp(timestamp))
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -74,6 +76,7 @@
</span><span class="cx">     m_propagationStopped = false;
</span><span class="cx">     m_immediatePropagationStopped = false;
</span><span class="cx">     m_defaultPrevented = false;
</span><ins>+    m_isTrusted = false;
</ins><span class="cx"> 
</span><span class="cx">     m_type = eventTypeArg;
</span><span class="cx">     m_canBubble = canBubbleArg;
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Event.h (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Event.h        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/Source/WebCore/dom/Event.h        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -118,6 +118,9 @@
</span><span class="cx"> 
</span><span class="cx">     void stopPropagation() { m_propagationStopped = true; }
</span><span class="cx">     void stopImmediatePropagation() { m_immediatePropagationStopped = true; }
</span><ins>+
+    bool isTrusted() const { return m_isTrusted; }
+    void setUntrusted() { m_isTrusted = false; }
</ins><span class="cx">     
</span><span class="cx">     // IE Extensions
</span><span class="cx">     EventTarget* srcElement() const { return target(); } // MSIE extension - &quot;the object that fired the event&quot;
</span><span class="lines">@@ -201,6 +204,7 @@
</span><span class="cx">     bool m_defaultPrevented { false };
</span><span class="cx">     bool m_defaultHandled { false };
</span><span class="cx">     bool m_cancelBubble { false };
</span><ins>+    bool m_isTrusted { false };
</ins><span class="cx"> 
</span><span class="cx">     unsigned short m_eventPhase { 0 };
</span><span class="cx">     EventTarget* m_currentTarget { nullptr };
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Event.idl (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Event.idl        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/Source/WebCore/dom/Event.idl        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -69,6 +69,8 @@
</span><span class="cx">     readonly attribute boolean defaultPrevented;
</span><span class="cx">     void stopImmediatePropagation();
</span><span class="cx"> 
</span><ins>+    [Unforgeable] readonly attribute boolean isTrusted;
+
</ins><span class="cx">     // IE Extensions
</span><span class="cx">     readonly attribute EventTarget      srcElement;
</span><span class="cx">     [ImplementedAs=legacyReturnValue] attribute boolean returnValue;
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventTargetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/EventTarget.cpp (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/EventTarget.cpp        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/Source/WebCore/dom/EventTarget.cpp        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -134,13 +134,15 @@
</span><span class="cx">     return removeEventListener(eventType, listener, false);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool EventTarget::dispatchEvent(Event* event, ExceptionCode&amp; ec)
</del><ins>+bool EventTarget::dispatchEventForBindings(Event* event, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     if (!event) {
</span><span class="cx">         ec = TypeError;
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    event-&gt;setUntrusted();
+
</ins><span class="cx">     if (!event-&gt;isInitialized() || event-&gt;isBeingDispatched()) {
</span><span class="cx">         ec = INVALID_STATE_ERR;
</span><span class="cx">         return false;
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventTargeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/EventTarget.h (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/EventTarget.h        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/Source/WebCore/dom/EventTarget.h        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -125,7 +125,7 @@
</span><span class="cx">     virtual bool removeEventListener(const AtomicString&amp; eventType, EventListener*, bool useCapture);
</span><span class="cx">     virtual void removeAllEventListeners();
</span><span class="cx">     virtual bool dispatchEvent(Event&amp;);
</span><del>-    bool dispatchEvent(Event*, ExceptionCode&amp;); // DOM API
</del><ins>+    bool dispatchEventForBindings(Event*, ExceptionCode&amp;); // DOM API
</ins><span class="cx">     virtual void uncaughtExceptionInEventHandler();
</span><span class="cx"> 
</span><span class="cx">     // Used for legacy &quot;onEvent&quot; attribute APIs.
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventTargetidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/EventTarget.idl (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/EventTarget.idl        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/Source/WebCore/dom/EventTarget.idl        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -28,5 +28,5 @@
</span><span class="cx"> ] interface EventTarget {
</span><span class="cx">     [ObjCLegacyUnnamedParameters] void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
</span><span class="cx">     [ObjCLegacyUnnamedParameters] void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
</span><del>-    [RaisesException] boolean dispatchEvent(Event event);
</del><ins>+    [ImplementedAs=dispatchEventForBindings, RaisesException] boolean dispatchEvent(Event event);
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.idl (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.idl        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/Source/WebCore/page/DOMWindow.idl        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -189,7 +189,7 @@
</span><span class="cx">     // EventTarget interface
</span><span class="cx">     [Custom] void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
</span><span class="cx">     [Custom] void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
</span><del>-    [RaisesException] boolean dispatchEvent(Event event);
</del><ins>+    [ImplementedAs=dispatchEventForBindings, RaisesException] boolean dispatchEvent(Event event);
</ins><span class="cx"> 
</span><span class="cx">     void captureEvents(/*in long eventFlags*/);
</span><span class="cx">     void releaseEvents(/*in long eventFlags*/);
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventHandler.cpp (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventHandler.cpp        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/Source/WebCore/page/EventHandler.cpp        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -2105,7 +2105,7 @@
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     view-&gt;disableLayerFlushThrottlingTemporarilyForInteraction();
</span><del>-    RefPtr&lt;MouseEvent&gt; me = MouseEvent::create(eventType,
</del><ins>+    Ref&lt;MouseEvent&gt; me = MouseEvent::create(eventType,
</ins><span class="cx">         true, true, event.timestamp(), m_frame.document()-&gt;defaultView(),
</span><span class="cx">         0, event.globalPosition().x(), event.globalPosition().y(), event.position().x(), event.position().y(),
</span><span class="cx"> #if ENABLE(POINTER_LOCK)
</span><span class="lines">@@ -2114,7 +2114,7 @@
</span><span class="cx">         event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(),
</span><span class="cx">         0, 0, event.force(), dataTransfer);
</span><span class="cx"> 
</span><del>-    dragTarget.dispatchEvent(me.get(), IGNORE_EXCEPTION);
</del><ins>+    dragTarget.dispatchEvent(me);
</ins><span class="cx">     return me-&gt;defaultPrevented();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerGlobalScopeidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.idl (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerGlobalScope.idl        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.idl        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx"> 
</span><span class="cx">     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
</span><span class="cx">     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
</span><del>-    [RaisesException] boolean dispatchEvent(Event event);
</del><ins>+    [ImplementedAs=dispatchEventForBindings, RaisesException] boolean dispatchEvent(Event event);
</ins><span class="cx"> 
</span><span class="cx">     // Additional constructors
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/Source/WebKit/win/ChangeLog        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-02-12  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
+
+        WebKit should expose the DOM 4 Event.isTrusted property
+        https://bugs.webkit.org/show_bug.cgi?id=76121
+        &lt;rdar://problem/22558494&gt;
+
+        Reviewed by Darin Adler.
+
+        * DOMCoreClasses.cpp:
+        (DOMNode::dispatchEvent):
+        (DOMWindow::dispatchEvent):
+
</ins><span class="cx"> 2016-02-11  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Try to fix windows build.
</span></span></pre></div>
<a id="trunkSourceWebKitwinDOMCoreClassescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/DOMCoreClasses.cpp (196519 => 196520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/DOMCoreClasses.cpp        2016-02-12 23:16:57 UTC (rev 196519)
+++ trunk/Source/WebKit/win/DOMCoreClasses.cpp        2016-02-12 23:25:02 UTC (rev 196520)
</span><span class="lines">@@ -441,7 +441,7 @@
</span><span class="cx">         return hr;
</span><span class="cx"> 
</span><span class="cx">     WebCore::ExceptionCode ec = 0;
</span><del>-    *result = m_node-&gt;dispatchEvent(domEvent-&gt;coreEvent(), ec) ? TRUE : FALSE;
</del><ins>+    *result = m_node-&gt;dispatchEventForBindings(domEvent-&gt;coreEvent(), ec) ? TRUE : FALSE;
</ins><span class="cx">     return ec ? E_FAIL : S_OK;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -938,7 +938,7 @@
</span><span class="cx">         return hr;
</span><span class="cx"> 
</span><span class="cx">     WebCore::ExceptionCode ec = 0;
</span><del>-    *result = m_window-&gt;dispatchEvent(domEvent-&gt;coreEvent(), ec) ? TRUE : FALSE;
</del><ins>+    *result = m_window-&gt;dispatchEventForBindings(domEvent-&gt;coreEvent(), ec) ? TRUE : FALSE;
</ins><span class="cx">     return ec ? E_FAIL : S_OK;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>