Skip to content

Commit

Permalink
define how iconUrl is resolved and what happens if that fails; also b…
Browse files Browse the repository at this point in the history
…e clearer that the icon URL concept is not always set
  • Loading branch information
annevk committed Jun 26, 2012
1 parent 3cfad2d commit 0f8a7b6
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 49 deletions.
59 changes: 33 additions & 26 deletions Overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -340,17 +340,17 @@ <h3 id="displaying-notifications"><span class="secno">4.6 </span>Displaying noti
are:

<ol>
<li><p>If the notification platform supports icons and
<var title="">notification</var>'s <a href="#icon-url">icon URL</a> has not yet been
<a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch" title="fetch">fetched</a>,
<a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch">fetch</a> it and wait for the resource to be
fully downloaded.

<li><p>If <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch" title="fetch">fetching</a>
<var title="">notification</var>'s <a href="#icon-url">icon URL</a> finished and the
image format is supported, set <var title="">notification</var>'s
<a href="#icon">icon</a> to the decoded resource. (Otherwise
<var title="">notification</var> has no <a href="#icon">icon</a>.)
<li>
<p>If the notification platform supports icons,
<var title="">notification</var>'s <a href="#icon-url">icon URL</a> is set and has not
yet been <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch" title="fetch">fetched</a>,
<a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch">fetch</a> it and wait for the resource to
be fully downloaded.

<p>Once <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch" title="fetch">fetching</a> has
finished and the image format is supported, set
<var title="">notification</var>'s <a href="#icon">icon</a> to the decoded resource.
(Otherwise <var title="">notification</var> has no <a href="#icon">icon</a>.)

<li>
<p><a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#queue-a-task">Queue a task</a> to run these substeps:
Expand Down Expand Up @@ -381,18 +381,18 @@ <h3 id="replacing-a-notification"><span class="secno">4.7 </span>Replacing a not
<var title="">new</var> one are:

<ol>
<li><p>If the notification platform supports icons and
<var title="">new</var>'s <a href="#icon-url">icon URL</a> has not yet been
<a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch" title="fetch">fetched</a>,
<a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch">fetch</a> it and wait for the resource to be
fully downloaded.

<li><p>If <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch" title="fetch">fetching</a>
<var title="">new</var>'s <a href="#icon-url">icon URL</a> finished and the image format
is supported, set <var title="">new</var>'s <a href="#icon">icon</a> to the decoded
resource. (Otherwise <var title="">new</var> has no <a href="#icon">icon</a>.)

<li><p>If <var title="">old</var> is in the
<p>If the notification platform supports icons,
<var title="">new</var>'s <a href="#icon-url">icon URL</a> is set and has not
yet been <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch" title="fetch">fetched</a>,
<a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch">fetch</a> it and wait for the resource to
be fully downloaded.

<p>Once <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch" title="fetch">fetching</a> has
finished and the image format is supported, set
<var title="">new</var>'s <a href="#icon">icon</a> to the decoded resource.
(Otherwise <var title="">new</var> has no <a href="#icon">icon</a>.)

</p><li><p>If <var title="">old</var> is in the
<a href="#list-of-pending-notifications">list of pending notifications</a>,
<a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#queue-a-task">queue a task</a> to replace
<var title="">old</var> with <var title="">new</var>, in the same position, in
Expand Down Expand Up @@ -493,15 +493,22 @@ <h2 id="api"><span class="secno">5 </span>API</h2>
<var title="">notification</var>'s <a href="#tag">tag</a> to <code title="">tag</code>.

<li><p>If <var title="">options</var>'s <code title="">iconUrl</code> is present,
set <var title="">notification</var>'s <a href="#icon-url">icon URL</a> to
<code title="">iconUrl</code>.
<a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#resolve-a-url" title="resolve a URL">resolve</a>
<code title="">iconUrl</code> against the
<a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#entry-script">entry script</a>'s
<a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#script's-base-url" title="script's base URL">base URL</a>, and
if that does not fail, set
<var title="">notification</var>'s <a href="#icon-url">icon URL</a> to the resulting
<a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#absolute-url">absolute URL</a>. (Otherwise
<a href="#icon-url">icon URL</a> is not set.)

<li><p>Return <var title="">notification</var>, but continue running these
steps asynchronouusly.

<li><p>If the notification platform supports icons, the user agent may
start <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch" title="fetch">fetching</a>
<var title="">notification</var>'s <a href="#icon-url">icon URL</a> at this point.
<var title="">notification</var>'s <a href="#icon-url">icon URL</a> at this point, if
<a href="#icon-url">icon URL</a> is set.

<li><p>Run the <a href="#show-steps">show steps</a> for <var title="">notification</var>.
</ol>
Expand Down
53 changes: 30 additions & 23 deletions Overview.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -318,17 +318,17 @@ <h3>Displaying notifications</h3>
are:

<ol>
<li><p>If the notification platform supports icons and
<var title>notification</var>'s <span>icon URL</span> has not yet been
<span data-anolis-spec=html title=fetch>fetched</span>,
<span data-anolis-spec=html>fetch</span> it and wait for the resource to be
fully downloaded.

<li><p>If <span data-anolis-spec=html title=fetch>fetching</span>
<var title>notification</var>'s <span>icon URL</span> finished and the
image format is supported, set <var title>notification</var>'s
<span>icon</span> to the decoded resource. (Otherwise
<var title>notification</var> has no <span>icon</span>.)
<li>
<p>If the notification platform supports icons,
<var title>notification</var>'s <span>icon URL</span> is set and has not
yet been <span data-anolis-spec=html title=fetch>fetched</span>,
<span data-anolis-spec=html>fetch</span> it and wait for the resource to
be fully downloaded.

<p>Once <span data-anolis-spec=html title=fetch>fetching</span> has
finished and the image format is supported, set
<var title>notification</var>'s <span>icon</span> to the decoded resource.
(Otherwise <var title>notification</var> has no <span>icon</span>.)

<li>
<p><span data-anolis-spec=html>Queue a task</span> to run these substeps:
Expand Down Expand Up @@ -359,16 +359,16 @@ <h3>Replacing a notification</h3>
<var title>new</var> one are:

<ol>
<li><p>If the notification platform supports icons and
<var title>new</var>'s <span>icon URL</span> has not yet been
<span data-anolis-spec=html title=fetch>fetched</span>,
<span data-anolis-spec=html>fetch</span> it and wait for the resource to be
fully downloaded.
<p>If the notification platform supports icons,
<var title>new</var>'s <span>icon URL</span> is set and has not
yet been <span data-anolis-spec=html title=fetch>fetched</span>,
<span data-anolis-spec=html>fetch</span> it and wait for the resource to
be fully downloaded.

<li><p>If <span data-anolis-spec=html title=fetch>fetching</span>
<var title>new</var>'s <span>icon URL</span> finished and the image format
is supported, set <var title>new</var>'s <span>icon</span> to the decoded
resource. (Otherwise <var title>new</var> has no <span>icon</span>.)
<p>Once <span data-anolis-spec=html title=fetch>fetching</span> has
finished and the image format is supported, set
<var title>new</var>'s <span>icon</span> to the decoded resource.
(Otherwise <var title>new</var> has no <span>icon</span>.)

<li><p>If <var title>old</var> is in the
<span>list of pending notifications</span>,
Expand Down Expand Up @@ -471,15 +471,22 @@ <h2>API</h2>
<var title>notification</var>'s <span>tag</span> to <code title>tag</code>.

<li><p>If <var title>options</var>'s <code title>iconUrl</code> is present,
set <var title>notification</var>'s <span>icon URL</span> to
<code title>iconUrl</code>.
<span title="resolve a URL" data-anolis-spec=html>resolve</span>
<code title>iconUrl</code> against the
<span data-anolis-spec=html>entry script</span>'s
<span title="script's base URL" data-anolis-spec=html>base URL</span>, and
if that does not fail, set
<var title>notification</var>'s <span>icon URL</span> to the resulting
<span data-anolis-spec=html>absolute URL</span>. (Otherwise
<span>icon URL</span> is not set.)

<li><p>Return <var title>notification</var>, but continue running these
steps asynchronouusly.

<li><p>If the notification platform supports icons, the user agent may
start <span data-anolis-spec=html title=fetch>fetching</span>
<var title>notification</var>'s <span>icon URL</span> at this point.
<var title>notification</var>'s <span>icon URL</span> at this point, if
<span>icon URL</span> is set.

<li><p>Run the <span>show steps</span> for <var title>notification</var>.
</ol>
Expand Down

0 comments on commit 0f8a7b6

Please sign in to comment.