Skip to content

Commit 1a6f054

Browse files
domenicmkruisselbrink
authored andcommitted
Stop using incumbent settings object (#67)
* Stop using incumbent settings object Also adds a warning about #63. * "Issue" not "Warning" * Fix local builds and do Bikeshed rebuild
1 parent 64c346d commit 1a6f054

File tree

2 files changed

+29
-12
lines changed

2 files changed

+29
-12
lines changed

index.bs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Editor: Marijn Kruisselbrink, Google, [email protected]
99
Status: ED
1010
ED: https://w3c.github.io/FileAPI/
1111
TR: http://www.w3.org/TR/FileAPI/
12+
Repository: w3c/FileAPI
1213
Previous Version: http://www.w3.org/TR/2012/WD-FileAPI-20121025/
1314
Abstract: This specification provides an API for representing file objects in web applications,
1415
as well as programmatically selecting them and accessing their data. This includes:
@@ -1677,9 +1678,14 @@ Origin of Blob URLs</h4>
16771678
<a>Blob URLs</a> are created using <code>URL.{{URL/createObjectURL()}}</code>,
16781679
and are revoked using <code>URL.{{URL/revokeObjectURL()}}</code>.
16791680
The <dfn lt="origin of a Blob URL|Blob URL's origin">origin of a Blob URL</dfn> must be the same as the [=environment settings object/origin=]
1680-
specified by the <a>incumbent settings object</a>
1681+
specified by the <a>current settings object</a>
16811682
at the time the method that created it was called.
16821683

1684+
Issue: there is currently some confusion between the generic definition of the
1685+
[=url/origin|origin of a URL=] and the specific definition of the [=origin of a Blob URL=]. This is
1686+
tracked in <a href="https://github.com/w3c/FileAPI/issues/63">issue #63</a> and in
1687+
<a href="https://github.com/whatwg/url/issues/127">whatwg/url#127</a>.
1688+
16831689
[=CORS protocol|Cross-origin requests=] on Blob URLs must return a <a>network error</a>.
16841690

16851691
Note: In practice this means that HTTP and HTTPS [=/origins=]
@@ -1702,7 +1708,7 @@ which is invoked by <code>URL.{{URL/createObjectURL()}}</code>:
17021708
(that is, the Unicode code point sequence U+0062, U+006C, U+006F, U+0062)
17031709
to |result|.
17041710
1. Append the ":" (U+003A COLON) character to |result|.
1705-
1. Let |settings| be the [=incumbent settings object=]
1711+
1. Let |settings| be the [=current settings object=]
17061712
1. Let |origin| be |settings|'s [=environment settings object/origin=].
17071713
1. Let |serialized| be the <a lt="ASCII serialization of an origin">ASCII serialization</a> of |origin|.
17081714
1. If |serialized| is "null", set it to an implementation-defined value.

index.html

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@
419419
[data-algorithm]:not(.heading) {
420420
padding: .5em;
421421
border: thin solid #ddd; border-radius: .5em;
422-
margin: .5em 0;
422+
margin: .5em calc(-0.5em - 1px);
423423
}
424424
[data-algorithm]:not(.heading) > :first-child {
425425
margin-top: 0;
@@ -1177,7 +1177,7 @@
11771177
}
11781178
}
11791179
</style>
1180-
<meta content="Bikeshed version 8ced20b1ada534532c822aed50a7dcb3d8dbe809" name="generator">
1180+
<meta content="Bikeshed version 017e947f5c8044969eb6c697519bf98b715cf564" name="generator">
11811181
<style>/* style-md-lists */
11821182

11831183
/* This is a weird hack for me not yet following the commonmark spec
@@ -1424,7 +1424,7 @@
14241424
<div class="head">
14251425
<p data-fill-with="logo"><a class="logo" href="http://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" width="72"> </a> </p>
14261426
<h1 class="p-name no-ref" id="title">File API</h1>
1427-
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="2017-02-04">4 February 2017</time></span></h2>
1427+
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="2017-02-09">9 February 2017</time></span></h2>
14281428
<div data-fill-with="spec-metadata">
14291429
<dl>
14301430
<dt>This version:
@@ -2199,14 +2199,14 @@ <h3 class="heading settled" data-level="4.2" id="file-attrs"><span class="secno"
21992199
<span class="kd">var</span> date <span class="o">=</span> <span class="k">new</span> Date<span class="p">(</span>file<span class="p">.</span>lastModified<span class="p">)</span><span class="p">;</span>
22002200
println<span class="p">(</span><span class="s2">"You selected the file "</span> <span class="o">+</span> file<span class="p">.</span>name <span class="o">+</span> <span class="s2">" which was modified on "</span> <span class="o">+</span> date<span class="p">.</span>toDateString<span class="p">(</span><span class="p">)</span> <span class="o">+</span> <span class="s2">"."</span><span class="p">)</span><span class="p">;</span>
22012201

2202-
<span class="p">.</span><span class="p">.</span><span class="p">.</span>
2202+
<span class="p">...</span>
22032203

22042204
<span class="c1">// Generate a file with a specific last modified date
22052205
</span>
22062206
<span class="kd">var</span> d <span class="o">=</span> <span class="k">new</span> Date<span class="p">(</span><span class="mi">2013</span><span class="p">,</span> <span class="mi">12</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">16</span><span class="p">,</span> <span class="mi">23</span><span class="p">,</span> <span class="mi">45</span><span class="p">,</span> <span class="mi">600</span><span class="p">)</span><span class="p">;</span>
22072207
<span class="kd">var</span> generatedFile <span class="o">=</span> <span class="k">new</span> File<span class="p">(</span><span class="p">[</span><span class="s2">"Rough Draft ...."</span><span class="p">]</span><span class="p">,</span> <span class="s2">"Draft1.txt"</span><span class="p">,</span> <span class="p">{</span>type<span class="o">:</span> <span class="s2">"text/plain"</span><span class="p">,</span> lastModified<span class="o">:</span> d<span class="p">}</span><span class="p">)</span>
22082208

2209-
<span class="p">.</span><span class="p">.</span><span class="p">.</span>
2209+
<span class="p">...</span>
22102210
</pre>
22112211
</div>
22122212
<h2 class="heading settled" data-level="5" id="filelist-section"><span class="secno">5. </span><span class="content"> The FileList Interface</span><a class="self-link" href="#filelist-section"></a></h2>
@@ -2795,7 +2795,7 @@ <h4 class="heading settled" data-level="6.5.2" id="eventInvariants"><span class=
27952795
</span>reader<span class="p">.</span>readAsText<span class="p">(</span>file<span class="p">)</span><span class="p">;</span>
27962796
reader<span class="p">.</span>onload <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="p">)</span><span class="p">{</span>reader<span class="p">.</span>readAsText<span class="p">(</span>alternateFile<span class="p">)</span><span class="p">;</span><span class="p">}</span>
27972797

2798-
<span class="p">.</span><span class="p">.</span><span class="p">.</span><span class="p">.</span><span class="p">.</span>
2798+
<span class="p">...</span><span class="p">.</span><span class="p">.</span>
27992799

28002800
<span class="c1">//... the loadend event must not fire for the first read
28012801
</span>
@@ -3107,7 +3107,9 @@ <h3 class="heading settled" data-level="8.3" id="DefinitionOfScheme"><span class
31073107
<h4 class="heading settled" data-level="8.3.1" id="originOfBlobURL"><span class="secno">8.3.1. </span><span class="content"> Origin of Blob URLs</span><a class="self-link" href="#originOfBlobURL"></a></h4>
31083108
<p><a data-link-type="dfn" href="#blob-url" id="ref-for-blob-url-4">Blob URLs</a> are created using <code>URL.<code class="idl"><a data-link-type="idl" href="#dfn-createObjectURL" id="ref-for-dfn-createObjectURL-2">createObjectURL()</a></code></code>,
31093109
and are revoked using <code>URL.<code class="idl"><a data-link-type="idl" href="#dfn-revokeObjectURL" id="ref-for-dfn-revokeObjectURL-1">revokeObjectURL()</a></code></code>.
3110-
The <dfn data-dfn-type="dfn" data-lt="origin of a Blob URL|Blob URL’s origin" data-noexport="" id="origin-of-a-blob-url">origin of a Blob URL<a class="self-link" href="#origin-of-a-blob-url"></a></dfn> must be the same as the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin">origin</a> specified by the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#incumbent-settings-object">incumbent settings object</a> at the time the method that created it was called.</p>
3110+
The <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="origin of a Blob URL|Blob URL’s origin" data-noexport="" id="origin-of-a-blob-url">origin of a Blob URL</dfn> must be the same as the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin">origin</a> specified by the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object">current settings object</a> at the time the method that created it was called.</p>
3111+
<p class="issue" id="issue-4a4344c2"><a class="self-link" href="#issue-4a4344c2"></a> there is currently some confusion between the generic definition of the <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-origin">origin of a URL</a> and the specific definition of the <a data-link-type="dfn" href="#origin-of-a-blob-url" id="ref-for-origin-of-a-blob-url-1">origin of a Blob URL</a>. This is
3112+
tracked in <a href="https://github.com/w3c/FileAPI/issues/63">issue #63</a> and in <a href="https://github.com/whatwg/url/issues/127">whatwg/url#127</a>.</p>
31113113
<p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#cors-protocol">Cross-origin requests</a> on Blob URLs must return a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-network-error">network error</a>.</p>
31123114
<p class="note" role="note"><span>Note:</span> In practice this means that HTTP and HTTPS <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin">origins</a> are covered by this specification as valid origins for use with Blob URLs.
31133115
This specification does not address the case of non-HTTP and non-HTTPS <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin">origins</a>.
@@ -3126,7 +3128,7 @@ <h4 class="heading settled" data-level="8.3.2" id="unicodeSerializationOfBlobURL
31263128
<li data-md="">
31273129
<p>Append the ":" (U+003A COLON) character to <var>result</var>.</p>
31283130
<li data-md="">
3129-
<p>Let <var>settings</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#incumbent-settings-object">incumbent settings object</a></p>
3131+
<p>Let <var>settings</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object">current settings object</a></p>
31303132
<li data-md="">
31313133
<p>Let <var>origin</var> be <var>settings</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin">origin</a>.</p>
31323134
<li data-md="">
@@ -3200,7 +3202,7 @@ <h4 class="heading settled" data-level="8.4.3" id="NetworkError"><span class="se
32003202
<h4 class="heading settled" data-level="8.4.4" id="ProtocolExamples"><span class="secno">8.4.4. </span><span class="content"> Sample Request and Response Headers</span><a class="self-link" href="#ProtocolExamples"></a></h4>
32013203
<p><em>This section is informative.</em></p>
32023204
<p>This section provides sample exchanges between web applications and user agents using <a data-link-type="dfn" href="#blob-url" id="ref-for-blob-url-12">Blob URLs</a>.
3203-
A <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request">request</a> can be triggered using HTML markup of the sort <code class="lang-markup highlight"><span class="nt">&lt;img</span> <span class="na">src=</span><span class="s">"blob:http://example.org:8080/550e8400-e29b-41d4-a716-446655440000"</span><span class="nt">></span></code>.
3205+
A <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request">request</a> can be triggered using HTML markup of the sort <code class="lang-markup highlight"><span class="p">&lt;</span><span class="nt">img</span> <span class="na">src</span><span class="o">=</span><span class="s">"blob:http://example.org:8080/550e8400-e29b-41d4-a716-446655440000"</span><span class="p">></span></code>.
32043206
These examples merely illustrate the <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request">request</a> and <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response">response</a>;
32053207
web developers are not likely to interact with all the headers,
32063208
but the <code class="idl"><a data-link-type="idl" href="https://xhr.spec.whatwg.org/#dom-xmlhttprequest-getallresponseheaders">getAllResponseHeaders()</a></code> method of <code class="idl"><a data-link-type="idl" href="https://xhr.spec.whatwg.org/#xmlhttprequest">XMLHttpRequest</a></code>, if used,
@@ -3692,12 +3694,12 @@ <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span cla
36923694
<li><a href="https://html.spec.whatwg.org/multipage/workers.html#workerglobalscope">WorkerGlobalScope</a>
36933695
<li><a href="https://html.spec.whatwg.org/multipage/semantics.html#the-a-element">a</a>
36943696
<li><a href="https://html.spec.whatwg.org/multipage/browsers.html#ascii-serialisation-of-an-origin">ascii serialization of an origin</a>
3697+
<li><a href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object">current settings object</a>
36953698
<li><a href="https://html.spec.whatwg.org/multipage/semantics.html#attr-hyperlink-download">download</a>
36963699
<li><a href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-content-attributes">event handler content attribute</a>
36973700
<li><a href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type">event handler event type</a>
36983701
<li><a href="https://html.spec.whatwg.org/multipage/embedded-content.html#the-iframe-element">iframe</a>
36993702
<li><a href="https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element">img</a>
3700-
<li><a href="https://html.spec.whatwg.org/multipage/webappapis.html#incumbent-settings-object">incumbent settings object</a>
37013703
<li><a href="https://html.spec.whatwg.org/multipage/forms.html#the-input-element">input</a>
37023704
<li><a href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin">origin</a>
37033705
<li><a href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin">origin <small>(for environment settings object)</small></a>
@@ -3921,6 +3923,8 @@ <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">I
39213923
</pre>
39223924
<h2 class="no-num no-ref heading settled" id="issues-index"><span class="content">Issues Index</span><a class="self-link" href="#issues-index"></a></h2>
39233925
<div style="counter-reset:issue">
3926+
<div class="issue"> there is currently some confusion between the generic definition of the <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-origin">origin of a URL</a> and the specific definition of the <a data-link-type="dfn" href="#origin-of-a-blob-url">origin of a Blob URL</a>. This is
3927+
tracked in <a href="https://github.com/w3c/FileAPI/issues/63">issue #63</a> and in <a href="https://github.com/whatwg/url/issues/127">whatwg/url#127</a>.<a href="#issue-4a4344c2"></a></div>
39243928
<div class="issue"> This section is provisional; more security data may supplement this in subsequent drafts.<a href="#issue-61296551"></a></div>
39253929
</div>
39263930
<aside class="dfn-panel" data-for="terminate-an-algorithm">
@@ -5197,6 +5201,13 @@ <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content
51975201
Security and Privacy Considerations</a>
51985202
</ul>
51995203
</aside>
5204+
<aside class="dfn-panel" data-for="origin-of-a-blob-url">
5205+
<b><a href="#origin-of-a-blob-url">#origin-of-a-blob-url</a></b><b>Referenced in:</b>
5206+
<ul>
5207+
<li><a href="#ref-for-origin-of-a-blob-url-1">8.3.1.
5208+
Origin of Blob URLs</a>
5209+
</ul>
5210+
</aside>
52005211
<aside class="dfn-panel" data-for="unicodeBlobURL">
52015212
<b><a href="#unicodeBlobURL">#unicodeBlobURL</a></b><b>Referenced in:</b>
52025213
<ul>

0 commit comments

Comments
 (0)