Skip to content

Commit

Permalink
Merge pull request #101 from w3c/fix-eventtarget-issue-95
Browse files Browse the repository at this point in the history
Fix bugs in availablechange event
  • Loading branch information
mfoltzgoogle committed Jun 1, 2015
2 parents 183ea9b + 51660ba commit 3a1b618
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 25 deletions.
27 changes: 14 additions & 13 deletions Overview.src.html
Expand Up @@ -777,7 +777,7 @@ <h4>
<span data-anolis-spec="w3c-html">Queue a task</span>
to <span data-anolis-spec="w3c-html" title=
"concept-event-fire">fire an event</span> named
<code>statechange</code> at <em>s.onstatechange</em>.
<code>statechange</code> at <em>s</em>.
</li>
</ol>
</li>
Expand Down Expand Up @@ -1016,7 +1016,7 @@ <h4>
<p class="open-issue">
ISSUE: Do we want to distinguish the permission-denied outcome from
the no-screens-available outcome? Developers would be able to infer
it anyway from <code>onavailablechange</code>.
it anyway from <code>availablechange</code>.
</p>
</section>
<section>
Expand Down Expand Up @@ -1145,8 +1145,7 @@ <h4>
<span data-anolis-spec="w3c-html">Queue a
task</span> to <span data-anolis-spec="w3c-html"
title="concept-event-fire">fire an event</span>
named <code>statechange</code> at
<em>s.onstatechange</em>.
named <code>statechange</code> at <em>s</em>.
</li>
</ol>
</li>
Expand Down Expand Up @@ -1217,13 +1216,13 @@ <h4>
"https://github.com/w3c/presentation-api/blob/gh-pages/uc-req.md#req08-power-saving-friendly">
power saving non-functional requirement</a>, the user agent must
keep track of the number of <code>EventHandler</code>s registered
to the <code>onavailablechange</code> event. Using this
to the <code>availablechange</code> event. Using this
information, implementation specific discovery of <span title=
"presentation-display">presentation displays</span> can be resumed
or suspended, in order to save power.
</p>The user agent must keep a <dfn>list of available presentation
displays</dfn>. According to the number of event handlers for
<code>onavailablechange</code>, the user agent must also keep the
<code>availablechange</code>, the user agent must also keep the
list up to date by running the algorithm for <span title=
"algorithm-monitor-available">monitoring the list of available
presentation displays</span>.
Expand All @@ -1234,7 +1233,7 @@ <h5>
</h5>
<p>
When an event handler is added to the list of event handlers
registered for the <code>onavailablechange</code> event, the user
registered for the <code>availablechange</code> event, the user
agent must run the <span title=
"algorithm-monitor-available">algorithm to monitor the list of
available presentation displays</span>.
Expand All @@ -1246,7 +1245,7 @@ <h5>
</h5>
<p>
When an event handler is removed from the list of event handlers
registered to the <code>onavailablechange</code> event, the user
registered to the <code>availablechange</code> event, the user
agent must run the following steps:
</p>
<ul>
Expand Down Expand Up @@ -1289,7 +1288,8 @@ <h5>
<span data-anolis-spec="w3c-html">Queue a task</span> to
<span data-anolis-spec="w3c-html" title=
"concept-event-fire">fire an event</span> named
<code>availablechange</code> at with the event's
<code>availablechange</code> at
<code>NavigatorPresentation</code> with the event's
<code>available</code> property set to <code>true</code>.
</li>
</ol>
Expand All @@ -1302,7 +1302,8 @@ <h5>
<span data-anolis-spec="w3c-html">Queue a task</span> to
<span data-anolis-spec="w3c-html" title=
"concept-event-fire">fire an event</span> named
<code>availablechange</code> with the event's
<code>availablechange</code> at
<code>NavigatorPresentation</code> with the event's
<code>available</code> property set to <code>false</code>.
</li>
</ol>
Expand Down Expand Up @@ -1334,9 +1335,9 @@ <h5>
<span data-anolis-spec="w3c-html">Queue a task</span> to
<span data-anolis-spec="w3c-html" title=
"concept-event-fire">fire an event</span> named
<code>availablechange</code> at <em>E</em> (and only
<em>E</em>) with the event's <code>available</code> property
set to <code>false</code>.
<code>availablechange</code> at
<code>NavigatorPresentation</code> with the event's
<code>available</code> property set to <code>false</code>.
</li>
</ol>
</section>
Expand Down
25 changes: 13 additions & 12 deletions index.html
Expand Up @@ -639,15 +639,15 @@ <h3 id="interface-presentationsession"><span class="secno">6.3 </span>
enum <dfn id="binarytype">BinaryType</dfn> { "blob", "arraybuffer" };

interface <dfn id="presentationsession">PresentationSession</dfn> : EventTarget {
readonly <a class="external" data-anolis-spec="webidl" href="https://heycam.github.io/webidl/#idl-DOMString">DOMString</a>? <a href="#id">id</a>;
readonly <a class="external" data-anolis-spec="webidl" href="http://heycam.github.io/webidl/#idl-DOMString">DOMString</a>? <a href="#id">id</a>;
readonly attribute <a href="#presentationsessionstate">PresentationSessionState</a> <a href="#state">state</a>;
void <a href="#close">close</a>();
attribute <a class="external" data-anolis-spec="w3c-html" href="http://www.w3.org/html/wg/drafts/html/master/webappapis.html#eventhandler">EventHandler</a> <a href="#onstatechange">onstatechange</a>;

// Communication
attribute BinaryType <dfn id="binarytype-attribute" title="binarytype-attribute">binaryType</dfn>;
<a class="external" data-anolis-spec="w3c-html" href="http://www.w3.org/html/wg/drafts/html/master/webappapis.html#eventhandler">EventHandler</a> <dfn id="presentation-onmessage" title="presentation-onmessage">onmessage</dfn>;
void <dfn id="send">send</dfn> (<a class="external" data-anolis-spec="webidl" href="https://heycam.github.io/webidl/#idl-DOMString">DOMString</a> message);
void <dfn id="send">send</dfn> (<a class="external" data-anolis-spec="webidl" href="http://heycam.github.io/webidl/#idl-DOMString">DOMString</a> message);
void <dfn id="send-blob" title="send-blob">send</dfn> (<a class="external" data-anolis-spec="fileapi" href="http://dev.w3.org/2006/webapi/FileAPI/#blob">Blob</a> data);
void <dfn id="send-arraybuffer" title="send-arraybuffer">send</dfn> (<a class="external" data-anolis-spec="typedarray" href="http://www.khronos.org/registry/typedarray/specs/latest/#5">ArrayBuffer</a> data);
void <dfn id="send-arraybufferview" title="send-arraybufferview">send</dfn> (<a class="external" data-anolis-spec="typedarray" href="http://www.khronos.org/registry/typedarray/specs/latest/#6">ArrayBufferView</a> data);
Expand Down Expand Up @@ -829,7 +829,7 @@ <h4 id="closing-a-presentationsession"><span class="secno">6.3.3 </span>
<li>
<a class="external" data-anolis-spec="w3c-html" href="http://www.w3.org/html/wg/drafts/html/master/webappapis.html#queue-a-task">Queue a task</a>
to <a class="external" data-anolis-spec="w3c-html" href="http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#concept-event-fire" title="concept-event-fire">fire an event</a> named
<code>statechange</code> at <em>s.onstatechange</em>.
<code>statechange</code> at <em>s</em>.
</li>
</ol>
</li>
Expand Down Expand Up @@ -1175,8 +1175,7 @@ <h4 id="establishing-a-presentation-connection"><span class="secno">6.4.3 </span
<li>
<a class="external" data-anolis-spec="w3c-html" href="http://www.w3.org/html/wg/drafts/html/master/webappapis.html#queue-a-task">Queue a
task</a> to <a class="external" data-anolis-spec="w3c-html" href="http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#concept-event-fire" title="concept-event-fire">fire an event</a>
named <code>statechange</code> at
<em>s.onstatechange</em>.
named <code>statechange</code> at <em>s</em>.
</li>
</ol>
</li>
Expand Down Expand Up @@ -1312,7 +1311,8 @@ <h5 id="monitoring-the-list-of-available-presentation-displays"><span class="sec
<li>
<a class="external" data-anolis-spec="w3c-html" href="http://www.w3.org/html/wg/drafts/html/master/webappapis.html#queue-a-task">Queue a task</a> to
<a class="external" data-anolis-spec="w3c-html" href="http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#concept-event-fire" title="concept-event-fire">fire an event</a> named
<code>availablechange</code> at with the event's
<code>availablechange</code> at
<a href="#navigatorpresentation"><code>NavigatorPresentation</code></a> with the event's
<code>available</code> property set to <code>true</code>.
</li>
</ol>
Expand All @@ -1324,7 +1324,8 @@ <h5 id="monitoring-the-list-of-available-presentation-displays"><span class="sec
<li>
<a class="external" data-anolis-spec="w3c-html" href="http://www.w3.org/html/wg/drafts/html/master/webappapis.html#queue-a-task">Queue a task</a> to
<a class="external" data-anolis-spec="w3c-html" href="http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#concept-event-fire" title="concept-event-fire">fire an event</a> named
<code>availablechange</code> with the event's
<code>availablechange</code> at
<a href="#navigatorpresentation"><code>NavigatorPresentation</code></a> with the event's
<code>available</code> property set to <code>false</code>.
</li>
</ol>
Expand Down Expand Up @@ -1354,9 +1355,9 @@ <h5 id="monitoring-the-list-of-available-presentation-displays"><span class="sec
<li>
<a class="external" data-anolis-spec="w3c-html" href="http://www.w3.org/html/wg/drafts/html/master/webappapis.html#queue-a-task">Queue a task</a> to
<a class="external" data-anolis-spec="w3c-html" href="http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#concept-event-fire" title="concept-event-fire">fire an event</a> named
<code>availablechange</code> at <em>E</em> (and only
<em>E</em>) with the event's <code>available</code> property
set to <code>false</code>.
<code>availablechange</code> at
<a href="#navigatorpresentation"><code>NavigatorPresentation</code></a> with the event's
<code>available</code> property set to <code>false</code>.
</li>
</ol>
</section>
Expand Down Expand Up @@ -1443,7 +1444,7 @@ <h2 id="references"><span class="secno">8 </span>
<dd><cite><a href="http://www.w3.org/2001/tag/doc/promises-guide">Writing Promise-Using Specifications</a></cite>, Domenic Denicola. W3C.

<dt id="refsRFC2119">[RFC2119]
<dd><cite><a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a></cite>, Scott Bradner. IETF.
<dd><cite><a href="http://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a></cite>, Scott Bradner. IETF.

<dt id="refsTYPEDARRAY">[TYPEDARRAY]
<dd><cite><a href="http://www.khronos.org/registry/typedarray/specs/latest/">Typed Array</a></cite>, David Herman and Kenneth Russel. Khronos.
Expand All @@ -1452,7 +1453,7 @@ <h2 id="references"><span class="secno">8 </span>
<dd><cite><a href="https://url.spec.whatwg.org/">URL</a></cite>, Anne van Kesteren. WHATWG.

<dt id="refsWEBIDL">[WEBIDL]
<dd><cite><a href="https://heycam.github.io/webidl/">Web IDL</a></cite>, Cameron McCormack. W3C.
<dd><cite><a href="http://heycam.github.io/webidl/">Web IDL</a></cite>, Cameron McCormack. W3C.

</dl></div>
</section>
Expand Down

0 comments on commit 3a1b618

Please sign in to comment.