Re: [whatwg/url] Use definitions in FileAPI spec to resolve blob URLs and their origins. (#371)

annevk commented on this pull request.

Thanks, I like this! I suspect we don't need to change too many places, since only Fetch is really supposed to inspect this field.

> @@ -1120,15 +1120,13 @@ resource the <a for=/>URL</a>'s other components identify. It is initially null.
 <p id=non-relative-flag>A <a for=/>URL</a> also has an associated
 <dfn export for=url>cannot-be-a-base-URL flag</dfn>. It is initially unset.
 
-<p>A <a for=/>URL</a> also has an associated <dfn export for=url id=concept-url-object>object</dfn>
-that is null, a {{Blob}} object, or a {{MediaSource}} object. It is initially null.
-[[!FILEAPI]]
-[[!MEDIA-SOURCE]]
-
-<p class="note no-backref">At this point this is used primarily to support
-"<code>blob</code>" <a for=/>URLs</a>, but others can be added going forward, hence
-"object".
+<p>A <a for=/>URL</a> also has an associated <dfn export for=url id=concept-url-blob-entry>blob entry</dfn>
+that is either null or a <a>blob URL entry</a>. It is initially null.

This seems reasonable. Any reason for the name difference?

> @@ -1429,12 +1427,9 @@ different document encoding. Using the <a>UTF-8</a> encoding everywhere solves t
  <li><p>If <var>url</var>'s <a for=url>scheme</a> is not
  "<code>blob</code>", return <var>url</var>.
 
- <li><p>If <var>url</var>'s <a for=url>path</a> <a for=list>is empty</a> or <var>url</var>'s
- <a for=url>path</a>[0] is not in the <a>Blob URL Store</a>, then return <var>url</var>.
- [[!FILEAPI]]
-
- <li><p>Set <var>url</var>'s <a for=url>object</a> to the entry in the <a>Blob URL Store</a>
- corresponding to <var>url</var>'s <a for=url>path</a>[0].
+ <li><p>Set <var>url</var>'s <a for=url>blob entry</a> to the result of
+ <a for="blob URL" lt="resolve">resolving the blob URL</a> <var>url</var>,
+ or null if that returned failure.

if that did not return failure, and null otherwise.*

> @@ -2437,11 +2432,16 @@ background information. [[!HTML]]
 <dl class=switch>
  <dt>"<code>blob</code>"
  <dd>
+  If <a for=/>URL</a>'s <a for=url>blob entry</a> is not null, return <a for=/>URL</a>'s
+  <a for=url>blob entry</a>'s <a for="blob URL entry">environment</a>'s
+  <a for="environment settings object">origin</a>.

Presumably we'd return `<a for="blob URL entry">origin</a>`? Or do we need to store the environment on this entry as well?

>    <p>Let <var>url</var> be the result of <a lt="basic URL parser">parsing</a> <a for=/>URL</a>'s
   <a for=url>path</a>[0].
 
   <p>Return a new <a>opaque origin</a>, if <var>url</var> is failure, and <var>url</var>'s
   <a for=url>origin</a> otherwise.
+

This newline can now be dropped.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/pull/371#pullrequestreview-190148300

Received on Tuesday, 8 January 2019 09:19:20 UTC