Skip to content

Commit

Permalink
add example
Browse files Browse the repository at this point in the history
  • Loading branch information
philloooo committed Jul 15, 2021
1 parent 781ce4c commit bfca9ef
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -824,32 +824,30 @@ <h3>
</p>
<p>
To <dfn>process the `id` member</dfn>, given [=object=]
|json:JSON|, [=ordered map=] |manifest:ordered map|, and [=URL=]
|document URL:URL|:
|json:JSON|, [=ordered map=] |manifest:ordered map|.:
</p>
<ol class="algorithm">
<li>If the type of |json|["id"] is not [=string=], return.
</li>
<li>If |json|["start_url"] is the empty string, return.
</li>
<li>Let |id:URL| be the result of [=URL Parser|parsing=]
|json|["id"], using the origin of <var>document URL</var> as the base URL.
(<var>start URL's origin</var> + "/" + |json|["id"]).
</li>
<li>If |id| is failure, return.
</li>
<li>If |id| is not <a>same origin</a> as <var>document
URL</var>, return.
</li>
<li>Otherwise, set |manifest|["id"] to |start URL|.
</li>
</ol>
<aside class="example">
<p>
For example, if the value of [=manifest/start_url=] is
<samp>../start_point.html</samp>, and the manifest's URL is
<samp>https://example.com/resources/manifest.webmanifest</samp>,
then the result of [=URL parser|parsing=] would be
<samp>https://example.com/start_point.html</samp>.
For example, if the |start URL| is
<samp>https://example.com/resources/start</samp>,
and the value of [=manifest/id=] is <samp>"1"</samp>, then the
processed result is <samp>https://example.com/1</samp>. If the
value of [=manifest/id=] is <samp>""</samp>, then the processed
result is <samp>https://example.com/</samp>. If [=manifest/id=]
not specified, then the processed result is
<samp>https://example.com/start</samp>.

</p>
</aside>
</section>
Expand Down

0 comments on commit bfca9ef

Please sign in to comment.