Skip to content

Commit c3e18c8

Browse files
authored
Various fixes to ImageResource processing algorithms: (#811)
Normative: - Removed passing the name of the member to the processing algorithm. It just directly takes the array of image resources. This fixes a mismatch between the callers (which were already passing the array) and the definition of the algorithm. - Removed definition of steps for processing "src". This was doing almost nothing; just inline the parsing of the URL. - Copy "platform" into the output array. Formatting: - Fixed links to "sizes" definition. - Remove redundant list in processing algorithm.
1 parent 8716ead commit c3e18c8

File tree

1 file changed

+40
-63
lines changed

1 file changed

+40
-63
lines changed

index.html

Lines changed: 40 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,13 +1542,12 @@ <h3>
15421542
</li>
15431543
<li>Set <var>manifest</var>["<a>icons</a>"] to the result of running
15441544
<a>processing ImageResource members</a> given
1545-
<var>manifest</var>["<a>icons</a>"], <var>manifest URL</var>, and
1546-
<code>"icons"</code>.
1545+
<var>manifest</var>["<a>icons</a>"] and <var>manifest URL</var>.
15471546
</li>
15481547
<li>Set <var>manifest</var>["<a>screenshots</a>"] to the result of
15491548
running <a>processing ImageResource members</a> given
1550-
<var>manifest</var>["<a>screenshots</a>"], <var>manifest URL</var>,
1551-
and <code>"screenshots"</code>.
1549+
<var>manifest</var>["<a>screenshots</a>"] and <var>manifest
1550+
URL</var>.
15521551
</li>
15531552
<li>Set <var>manifest</var>["<a>related_applications</a>"] to the
15541553
result of running <a>processing the <code>related_applications</code>
@@ -2803,7 +2802,7 @@ <h2 class="icon-title">
28032802
</div>
28042803
</section>
28052804
</section>
2806-
<section data-dfn-for="imageresource">
2805+
<section data-dfn-for="ImageResource" data-link-for="ImageResource">
28072806
<h3>
28082807
<dfn>sizes</dfn> member
28092808
</h3>
@@ -2861,24 +2860,6 @@ <h3>
28612860
The <a>src</a> member of an <a>ImageResource</a> is a <a>URL</a> from
28622861
which a user agent can fetch the image's data.
28632862
</p>
2864-
<p>
2865-
The steps for <dfn>processing the <code>src</code> member of an
2866-
image</dfn> are given by the following algorithm. The algorithm takes
2867-
a <a>ImageResource</a> <var>icon</var>, and a <a>URL</a>
2868-
<var>manifest URL</var> , which is the <a>URL</a> from which the
2869-
<var>manifest</var> was fetched. This algorithm will return a
2870-
<a>URL</a> or <code>undefined</code>.
2871-
</p>
2872-
<ol>
2873-
<li>Let <var>value</var> be <var>image</var>["src"].
2874-
</li>
2875-
<li>If <a>Type</a>(<var>value</var>) it not String, return
2876-
<code>undefined</code>.
2877-
</li>
2878-
<li>Otherwise, <a>parse</a> <var>value</var> using <var>manifest
2879-
URL</var> as the base URL and return the result.
2880-
</li>
2881-
</ol>
28822863
</section>
28832864
<section data-dfn-for="ImageResource">
28842865
<h3>
@@ -2929,54 +2910,50 @@ <h3>
29292910
</h3>
29302911
<p>
29312912
The steps for <dfn>processing <a>ImageResource</a> members</dfn> are
2932-
given by the following algorithm. The algorithm takes a manifest, a
2933-
<a>URL</a> <var>manifest URL</var>, which is the URL from which the
2934-
<var>manifest</var> was fetched, and a <a>string</a> that represents
2935-
the <var>member name</var> of the member which contains the array of
2936-
<a>ImageResource</a>s. This algorithm returns an
2937-
Array&lt;<a>ImageResource</a>&gt;
2913+
given by the following algorithm. The algorithm takes a
2914+
Array&lt;<a>ImageResource</a>&gt; <var>entries</var> and a <a>URL</a>
2915+
<var>manifest URL</var>. This algorithm returns an
2916+
Array&lt;<a>ImageResource</a>&gt;.
29382917
</p>
29392918
<ol>
29402919
<li>Let <var>imageResources</var> be a new Array object created as if
29412920
by the expression [].
29422921
</li>
29432922
<li>
2944-
<a>For each</a> <var>entry</var> of <var>manifest</var>[<var>member
2945-
name</var>]:
2923+
<a>For each</a> <var>entry</var> of <var>entries</var>:
29462924
</li>
2947-
<li>
2925+
<li>If <var>entry</var>["src"] is not <code>undefined</code>:
29482926
<ol>
2949-
<li>If <var>entry</var>["src"] is not <code>undefined</code>:
2950-
<ol>
2951-
<li>Let <var>image</var> be a new object created as if by the
2952-
expression ({}).
2953-
</li>
2954-
<li>Set <var>image</var>["src"] to the result of running <a>
2955-
processing the <code>src</code> member of an image</a>
2956-
given <var>entry</var> and <var>manifest URL</var>.
2957-
</li>
2958-
<li>Set <var>image</var>["type"] to the result of running <a>
2959-
processing the <code>type</code> member of an image</a>
2960-
given <var>entry</var> and <var>manifest URL</var>.
2961-
</li>
2962-
<li>Set <var>image</var>["sizes"] to the result of running
2963-
<a>processing the <code>sizes</code> member of an image</a>
2964-
given <var>entry</var> and <var>manifest URL</var>.
2965-
</li>
2966-
<li>Let <var>purpose</var> be the result of running
2967-
<a>processing the <code>purpose</code> member of an image</a>
2968-
given <var>entry</var> and <var>manifest URL</var>.
2969-
</li>
2970-
<li>If <var>purpose</var> is failure, <a data-lt=
2971-
"iteration-continue">continue</a>.
2972-
</li>
2973-
<li>Set <var>image</var>["purpose"] to <var>purpose</var>.
2974-
</li>
2975-
<li>
2976-
<a data-lt="list-append">Append</a> <var>image</var> to
2977-
<var>imageResources</var>
2978-
</li>
2979-
</ol>
2927+
<li>Let <var>image</var> be a new object created as if by the
2928+
expression ({}).
2929+
</li>
2930+
<li>Set <var>image</var>["src"] to the result of <a>parsing</a>
2931+
<var>entry</var>["src"] using <var>manifest URL</var> as the base
2932+
URL.
2933+
</li>
2934+
<li>Set <var>image</var>["type"] to the result of running
2935+
<a>processing the <code>type</code> member of an image</a> given
2936+
<var>entry</var> and <var>manifest URL</var>.
2937+
</li>
2938+
<li>Set <var>image</var>["sizes"] to the result of running
2939+
<a>processing the <code>sizes</code> member of an image</a> given
2940+
<var>entry</var> and <var>manifest URL</var>.
2941+
</li>
2942+
<li>Let <var>purpose</var> be the result of running <a>processing
2943+
the <code>purpose</code> member of an image</a> given
2944+
<var>entry</var> and <var>manifest URL</var>.
2945+
</li>
2946+
<li>If <var>purpose</var> is failure, <a data-lt=
2947+
"iteration-continue">continue</a>.
2948+
</li>
2949+
<li>Set <var>image</var>["purpose"] to <var>purpose</var>.
2950+
</li>
2951+
<li>Set <var>image</var>["platform"] to
2952+
<var>entry</var>["platform"].
2953+
</li>
2954+
<li>
2955+
<a data-lt="list-append">Append</a> <var>image</var> to
2956+
<var>imageResources</var>
29802957
</li>
29812958
</ol>
29822959
</li>

0 commit comments

Comments
 (0)