8000 define how iconUrl is resolved and what happens if that fails; also b… · whatwg/notifications@0f8a7b6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0f8a7b6

Browse files
committed
define how iconUrl is resolved and what happens if that fails; also be clearer that the icon URL concept is not always set
1 parent 3cfad2d commit 0f8a7b6

File tree

2 files changed

+63
-49
lines changed

2 files changed

+63
-49
lines changed

Overview.html

Lines changed: 33 additions & 26 deletions
< 67DE td data-grid-cell-id="diff-d8adac750acc947123f2d8e77244ac97ed1e32fa65c0ca334c08fc620ab7ad60-506-513-1" data-selected="false" role="gridcell" style="background-color:var(--bgColor-default);text-align:center" tabindex="-1" valign="top" class="focusable-grid-cell diff-line-number position-relative diff-line-number-neutral left-side">513
Original file line numberDiff line numberDiff line change
@@ -340,17 +340,17 @@ <h3 id="displaying-notifications"><span class="secno">4.6 </span>Displaying noti
340340
are:
341341

342342
<ol>
343-
<li><p>If the notification platform supports icons and
344-
<var title="">notification</var>'s <a href="#icon-url">icon URL</a> has not yet been
345-
<a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch" title="fetch">fetched</a>,
346-
<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
347-
fully downloaded.
348-
349-
<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>
350-
<var title="">notification</var>'s <a href="#icon-url">icon URL</a> finished and the
351-
image format is supported, set <var title="">notification</var>'s
352-
<a href="#icon">icon</a> to the decoded resource. (Otherwise
353-
<var title="">notification</var> has no <a href="#icon">icon</a>.)
343+
<li>
344+
<p>If the notification platform supports icons,
345+
<var title="">notification</var>'s <a href="#icon-url">icon URL</a> is set and has not
346+
yet been <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch" title="fetch">fetched</a>,
347+
<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
348+
be fully downloaded.
349+
350+
<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
351+
finished and the image format is supported, set
352+
<var title="">notification</var>'s <a href="#icon">icon</a> to the decoded resource.
353+
(Otherwise <var title="">notification</var> has no <a href="#icon">icon</a>.)
354354

355355
<li>
356356
<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:
@@ -381,18 +381,18 @@ <h3 id="replacing-a-notification"><span class="secno">4.7 </span>Replacing a not
381381
<var title="">new</var> one are:
382382

383383
<ol>
384-
<li><p>If the notification platform supports icons and
385-
<var title="">new</var>'s <a href="#icon-url">icon URL</a> has not yet been
386-
<a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch" title="fetch">fetched</a>,
387-
<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
388-
fully downloaded.
389-
390-
<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>
391-
<var title="">new</var>'s <a href="#icon-url">icon URL</a> finished and the image format
392-
is supported, set <var title="">new</var>'s <a href="#icon">icon</a> to the decoded
393-
resource. (Otherwise <var title="">new</var> has no <a href="#icon">icon</a>.)
394-
395-
<li><p>If <var title="">old</var> is in the
384+
<p>If the notification platform supports icons,
385+
<var title="">new</var>'s <a href="#icon-url">icon URL</a> is set and has not
386+
yet been <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch" title="fetch">fetched</a>,
387+
<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
388+
be fully downloaded.
389+
390+
<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
391+
finished and the image format is supported, set
392+
<var title="">new</var>'s <a href="#icon">icon</a> to the decoded resource.
393+
(Otherwise <var title="">new</var> has no <a href="#icon">icon</a>.)
394+
395+
</p><li><p>If <var title="">old</var> is in the
396396
<a href="#list-of-pending-notifications">list of pending notifications</a>,
397397
<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
398398
<var title="">old</var> with <var title="">new</var>, in the same position, in
@@ -493,15 +493,22 @@ <h2 id="api"><span class="secno">5 </span>API</h2>
493493
<var title="">notification</var>'s <a href="#tag">tag</a> to <code title="">tag</code>.
494494

495495
<li><p>If <var title="">options</var>'s <code title="">iconUrl</code> is present,
496-
set <var title="">notification</var>'s <a href="#icon-url">icon URL</a> to
497-
<code title="">iconUrl</code>.
496+
<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>
497+
<code title="">iconUrl</code> against the
498+
<a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#entry-script">entry script</a>'s
499+
<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
500+
if that does not fail, set
501+
<var title="">notification</var>'s <a href="#icon-url">icon URL</a> to the resulting
502+
<a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#absolute-url">absolute URL</a>. (Otherwise
503+
<a href="#icon-url">icon URL</a> is not set.)
498504

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

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

506
<li><p>Run the <a href="#show-steps">show steps</a> for <var title="">notification</var>.
507514
</ol>

Overview.src.html

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -318,17 +318,17 @@ <h3>Displaying notifications</h3>
318318
are:
319319

320320
<ol>
321-
<li><p>If the notification platform supports icons and
322-
<var title>notification</var>'s <span>icon URL</span> has not yet been
323-
<span data-anolis-spec=html title=fetch>fetched</span>,
324-
<span data-anolis-spec=html>fetch</span> it and wait for the resource to be
325-
fully downloaded.
326-
327-
<li><p>If <span data-anolis-spec=html title=fetch>fetching</span>
328-
<var title>notification</var>'s <span>icon URL</span> finished and the
329-
image format is supported, set <var title>notification</var>'s
330-
<span>icon</span> to the decoded resource. (Otherwise
331-
<var title>notification</var> has no <span>icon</span>.)
321+
<li>
322+
<p>If the notification platform supports icons,
323+
<var title>notification</var>'s <span>icon URL</span> is set and has not
324+
yet been <span data-anolis-spec=html title=fetch>fetched</span>,
325+
<span data-anolis-spec=html>fetch</span> it and wait for the resource to
326+
be fully downloaded.
327+
328+
<p>Once <span data-anolis-spec=html title=fetch>fetching</span> has
329+
finished and the image format is supported, set
330+
<var title>notification</var>'s <span>icon</span> to the decoded resource.
331+
(Otherwise <var title>notification</var> has no <span>icon</span>.)
332332

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

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)
0