Skip to content

Commit

Permalink
Set some MessageEvent's isTrusted attributes to true
Browse files Browse the repository at this point in the history
Closes #1602. Browsers already behave this way, and it is more
consistent with how the rest of the spec almost always fires trusted
events. See also #1912.

In terms of spec mechanics, this is done by using the new "create an
event" hook from DOM, which sets isTrusted to true for us.
  • Loading branch information
domenic committed Oct 25, 2016
1 parent 6bf5e44 commit 78d8aff
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -55409,7 +55409,7 @@ fur
data-x="concept-form-reset">reset</dfn>, run these steps:</p>

<ol>
<li><p>Let <var>isTrusted</var> false, if this algorithm is invoked by the <code
<li><p>Let <var>isTrusted</var> be false, if this algorithm is invoked by the <code
data-x="dom-form-reset">reset()</code> method, and true otherwise.</p></li>

<li><p>Let <var>reset</var> be the result of <span data-x="concept-event-fire">firing an
Expand Down Expand Up @@ -93076,13 +93076,15 @@ any-char = %x0000-0009 / %x000B-000C / %x000E-10FFFF
<li><p>If the <var>data</var> buffer's last character is a U+000A LINE FEED (LF)
character, then remove the last character from the <var>data</var> buffer.</p></li>

<li><p>Let <var>event</var> be a new <code>MessageEvent</code> object, with its <code
data-x="dom-Event-type">type</code> attribute initialized to <code
data-x="event-message">message</code>, <code data-x="dom-MessageEvent-data">data</code> attribute
initialized to <var>data</var>, <code data-x="dom-MessageEvent-origin">origin</code> attribute
initialized to the <span data-x="Unicode serialization of an origin">Unicode serialization</span>
<li><p>Let <var>event</var> be the result of <span>creating an event</span> using
<code>MessageEvent</code>.</p></li>

<li><p>Initialize <var>event</var>'s <code data-x="dom-Event-type">type</code> attribute to <code
data-x="event-message">message</code>, its <code data-x="dom-MessageEvent-data">data</code>
attribute to <var>data</var>, its <code data-x="dom-MessageEvent-origin">origin</code> attribute
to the <span data-x="Unicode serialization of an origin">Unicode serialization</span>
of the <span>origin</span> of the event stream's final URL (i.e. the URL after redirects), and
<code data-x="dom-MessageEvent-lastEventId">lastEventId</code> attribute initialized to the <span
its <code data-x="dom-MessageEvent-lastEventId">lastEventId</code> attribute to the <span
data-x="concept-event-stream-last-event-id">last event ID string</span> of the event
source.</p></li>

Expand Down Expand Up @@ -94817,11 +94819,13 @@ interface <dfn>MessagePort</dfn> : <span>EventTarget</span> {
algorithm runs scripts). We don't throw an exception for 'doomed' being true, because this can't
necessarily be detected right now every time -->

<li><p>Let <var>e</var> be a new <code>MessageEvent</code> object, with its <code
data-x="dom-Event-type">type</code> attribute initialized to <code
data-x="event-message">message</code>, <code data-x="dom-MessageEvent-data">data</code> attribute
initialized to <var>messageClone</var>, and <code data-x="dom-MessageEvent-ports">ports</code>
attribute initialized to <var>newPorts</var>.</p></li>
<li><p>Let <var>e</var> be the result of <span>creating an event</span> using
<code>MessageEvent</code>.</p></li>

<li><p>Initialize <var>e</var>'s <code data-x="dom-Event-type">type</code> attribute to <code
data-x="event-message">message</code>, its <code data-x="dom-MessageEvent-data">data</code>
attribute to <var>messageClone</var>, and its <code data-x="dom-MessageEvent-ports">ports</code>
attribute to <var>newPorts</var>.</p></li>

<li>
<p>Add a <span data-x="concept-task">task</span> that runs the following steps to the <span>port
Expand Down

0 comments on commit 78d8aff

Please sign in to comment.