Re: [w3c/manifest] Add id member to manifest (#988)

@marcoscaceres commented on this pull request.



> +        </p>
+        <p class="note">
+          The [=identity=] can be used by a service that collects lists of web
+          applications to uniquely identify applications.
+        </p>
+        <p class="note">
+          The [=identity=] is processed like a URL but it doesn't point to a
+          resource that can be navigated to, so it's not required to be
+          [=URL/within scope=].
+        </p>
+        <p>
+          To <dfn>process the `id` member</dfn>, given [=object=]
+          |json:JSON|, [=ordered map=] |manifest:ordered map|:
+        </p>
+        <ol class="algorithm">
+          <li>Set |manifest|["id"] to |manifest|["start_url"] with [=URL/fragment=] removed.

As we can do the comparison by ignoring the fragment, we don't need to remove it here anymore.  

```suggestion
          <li>Set |manifest|["id"] to |manifest|["start_url"].
```

> +        </p>
+        <ol class="algorithm">
+          <li>Set |manifest|["id"] to |manifest|["start_url"] with [=URL/fragment=] removed.
+          </li>
+          <li>If the type of |json|["id"] is not [=string=], return.
+          </li>
+          <li>If |json|["id"] is the empty string, return.
+          </li>
+          <li>Let |base origin| be |manifest|["start_url"]'s [=url/origin=].</li> 
+          <li>Let |id:URL| be the result of [=URL Parser|parsing=] |json|["id"] with  |base origin| as the base URL.
+          </li>
+          <li>If |id| is failure, return.
+          </li>
+          <li>If |id| is not [=same origin=] as |manifest|["start_url"], return.
+          </li>
+          <li>Remove [=URL/fragment=] from |id|.</li>

```suggestion
```

> +          <p>Below table shows some example cases of the |identity| processing algorithm.</p>
+          <table class="data">
+            <tr>
+              <th>|json|["id"]</th>
+              <th>|manifest|["start_url"]</th>
+              <th>|manifest|["id"]</th>
+            </tr>
+            <tr>
+              <td><i>undefined</i></td>
+              <td>"https://example.com/my-app/start"</td>
+              <td>"https://example.com/my-app/start"</td>
+            </tr>
+            <tr>
+              <td><i>undefined</i></td>
+              <td>"https://example.com/my-app/#here"</td>
+              <td>"https://example.com/my-app/"</td>

```suggestion
              <td>"https://example.com/my-app/#here"</td>
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/manifest/pull/988#pullrequestreview-772069825

Received on Wednesday, 6 October 2021 03:26:17 UTC