Skip to content

Commit 94f1192

Browse files
Add export to terms needed by URL spec.
Also update "Origin of blob URLs" section since the algorithm that was there will be part of the URL spec instead. Part of the work to address #63
1 parent 28e2f7b commit 94f1192

File tree

1 file changed

+12
-23
lines changed

1 file changed

+12
-23
lines changed

index.bs

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,10 +1620,10 @@ A [=blob URL store=] is a [=map=]
16201620
where [=map/keys=] are [=valid URL strings=]
16211621
and [=map/values=] are [=blob URL Entries=].
16221622

1623-
A blob URL entry consists of
1624-
an object (typically a {{Blob}},
1623+
A export>blob URL entry consists of
1624+
an export for="blob URL entry">object (typically a {{Blob}},
16251625
but other specs can extend this to refer to other types of objects),
1626-
and an environment (an [=environment settings object=]).
1626+
and an export for="blob URL entry">environment (an [=environment settings object=]).
16271627

16281628
[=map/Keys=] in the [=blob URL store=] (also known as blob URLs)
16291629
are [=valid URL strings=] that when [=URL parser|parsed=]
@@ -1689,33 +1689,22 @@ To resolve a blob URL given a |url
16891689

16901690
16911691

1692-
Futher requirements for the parsing an fetching model for [=blob URLs=] are defined in the [[!URL]] and [[!Fetch]] specifications.
1692+
Futher requirements for the parsing and fetching model for [=blob URLs=] are defined in the [[!URL]] and [[!Fetch]] specifications.
16931693

16941694

16951695
Origin of blob URLs
16961696

1697-
1698-
To resolve the origin of a blob URL given a |url| (a [=URL=]), run the following steps:
1697+
*This section is informative.*
16991698

1700-
1. [=Assert=]: |url|'s [=url/scheme=] is "`blob`".
1701-
1. Let |entry| be the result of [=blob URL/resolve|resolving=] |url|.
1702-
1. If |entry| is not failure, return |entry|'s [=blob URL entry/environment=]'s [=environment settings object/origin=].
1703-
1. Let |nested url| be the result of [=URL parser|parsing=] |url|'s [=url/path=][0].
1704-
1. Return a new [=opaque origin=], if |nested url| is failure, and |nested url|'s [=url/origin=] otherwise.
1699+
The origin of a blob URL is always the same as that of the environment that created the URL,
1700+
as long as the URL hasn't been revoked yet. This is achieved by the [[URL]] spec looking up
1701+
the URL in the [=blob URL store=] when parsing a URL, and using that entry to return
1702+
the correct origin.
17051703

1706-
1707-
1708-
Note: The effect of this algorithm is that the origin of a blob URL is always
1709-
the same as that of the environment that created the URL,
1710-
as long as the URL hasn't been revoked yet.
17111704
If the URL was revoked the serialization of the origin will still remain the same
17121705
as the serialization of the origin of the environment that created the blob URL,
1713-
but for opaque origins the origin itself might be distinct.
1714-
This difference isn't observable though, since a revoked blob URL can't be resolved/fetched anymore anyway.
1715-
1716-
Issue: The [[URL]] spec should be updated to refer to this algorithm to resolve the origin of a blob URL when the URL is first parsed.
1717-
This is tracked in issue #63 and in
1718-
1706+
but for opaque origins the origin itself might be distinct. This difference isn't
1707+
observable though, since a revoked blob URL can't be resolved/fetched anymore anyway.
17191708

17201709

17211710
Lifetime of blob URLs
@@ -1756,7 +1745,7 @@ The revokeObjectURL(|url|) st
17561745

17571746
1. Let |url record| be the result of [=URL parser|parsing=] |url|.
17581747
1. If |url record|'s [=url/scheme=] is not "`blob`", return.
1759-
1. Let |origin| be the result of [=resolving the origin=] of |url record|.
1748+
1. Let |origin| be the [=url/origin=] of |url record|.
17601749
1. Let |settings| be the [=current settings object=].
17611750
1. If |origin| is not [=same origin=] with |settings|'s [=environment settings object/origin=], return.
17621751
1. [=Remove an entry from the Blob URL Store=] for |url|.

0 commit comments

Comments
 (0)