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

mkruisselbrink commented on this pull request.



> @@ -1026,6 +1026,12 @@ resource the <a for=/>URL</a>'s other components identify. It is initially null.
 "<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 for=url>cached origin</dfn> that is either null or a <a>ASCII string</a>.

Done

> @@ -1026,6 +1026,12 @@ resource the <a for=/>URL</a>'s other components identify. It is initially null.
 "<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 for=url>cached origin</dfn> that is either null or a <a>ASCII string</a>.
+It is initially null.
+
+<p class="note">This is used to support caching the origin of a "<code>blob</code>"
+<a for=/>URL</a> at the time it is parsed.

Yeah, object origin makes sense. It's only observable for fetches to/from unique origins. The string serialization of the origin isn't changing, just that identity comparison with unique origined blob URLs will now work correctly (especially if the blob URL was parsed/resolved before the URL was revoked, but fetched after being revoked. Without caching this origin same-origin checks would fail during fetching in unique origins).

>  
- <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>object</a> to the result of
+ <a for="blob URL" lt="resolve">resolving the blob URL</a> <var>url</var>.

Done

>  
-  <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.
+  <p>Return the result of <a for="blob URL" lt="resolve the origin">resolving the origin of the blob URL</a>.
   <!-- Did you mean: recursion -->

Yeah, making it less observable when things are revoked, and also making it work for URLs that were never created in the first place, or if some spec creates a URL record manually without going through the parsing steps.

-- 
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#discussion_r165745164

Received on Friday, 2 February 2018 20:06:01 UTC