Skip to content

Commit f2c7ea3

Browse files
jyasskindomenic
authored andcommitted
Specify a navigated-to new document's URL
The "URL that was originally to be fetched" isn't clear about which URL that actually was. This makes it clear that we use the request's current URL when available, or the response's URL when not. For javascript: URLs, this fixes them to match 2/3 browser behavior. 6440cca regressed the algorithm by deleting the actual usage site of the address variable. This change reintroduces the use of address, although in a simpler way, by appending address to the request's URL list, instead of using the "override URL" concept which was removed. Fixes #3953. Closes #1565 by preserving the special case; discussions there and in https://bugzilla.mozilla.org/show_bug.cgi?id=1281375#c7 indicate that the special case is more web-compatible. Tests: * https://github.com/web-platform-tests/wpt/blob/7ed525acfb4133c1177fdb1ff8477e2a6469e6b4/html/browsers/history/the-location-interface/location_hash.html#L24 * https://github.com/web-platform-tests/wpt/blob/7ed525acfb4133c1177fdb1ff8477e2a6469e6b4/html/semantics/embedded-content/the-iframe-element/iframe_javascript_url_01.htm * web-platform-tests/wpt#14288 * web-platform-tests/wpt#14316
1 parent 31334d7 commit f2c7ea3

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

source

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2796,6 +2796,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
27962796
<li><dfn data-x="concept-request-header-list" data-x-href="https://fetch.spec.whatwg.org/#concept-request-header-list">header list</dfn></li>
27972797
<li><dfn data-x="concept-request-body" data-x-href="https://fetch.spec.whatwg.org/#concept-request-body">body</dfn></li>
27982798
<li><dfn data-x="concept-request-client" data-x-href="https://fetch.spec.whatwg.org/#concept-request-client">client</dfn></li>
2799+
<li><dfn data-x="concept-request-url-list" data-x-href="https://fetch.spec.whatwg.org/#concept-request-url-list">URL list</dfn></li>
27992800
<li><dfn data-x="concept-request-current-url" data-x-href="https://fetch.spec.whatwg.org/#concept-request-current-url">current URL</dfn></li>
28002801
<li><dfn data-x="concept-request-reserved-client" data-x-href="https://fetch.spec.whatwg.org/#concept-request-reserved-client">reserved client</dfn></li>
28012802
<li><dfn data-x="concept-request-replaces-client-id" data-x-href="https://fetch.spec.whatwg.org/#concept-request-replaces-client-id">replaces client id</dfn></li>
@@ -82005,6 +82006,9 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
8200582006
<li><p>Let <var>address</var> be the <span data-x="concept-document-url">URL</span> of the
8200682007
<span>active document</span> of <var>browsingContext</var>.</p></li>
8200782008

82009+
<li><p>Append <var>address</var> to <var>resource</var>'s <span
82010+
data-x="concept-request-url-list">URL list</span>.</p></li>
82011+
8200882012
<li><p>Let <var>settings</var> be the <span>relevant settings object</span> for the
8200982013
<span>active document</span> of <var>browsingContext</var>.</p></li>
8201082014

@@ -82419,8 +82423,13 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
8241982423

8242082424
<p><dfn data-x="set the document's address">Setting the document's address</dfn>: Any
8242182425
<code>Document</code> created by these steps must have its <span
82422-
data-x="concept-document-url">URL</span> set to the <span>URL</span> that was originally to be
82423-
fetched, ignoring any other data that was used to obtain the resource.</p>
82426+
data-x="concept-document-url">URL</span> set to:</p>
82427+
<dl class="switch">
82428+
<dt>If <var>request</var> is non-null,</dt>
82429+
<dd><var>request</var>'s <span data-x="concept-request-current-url">current URL</span></dd>
82430+
<dt>Otherwise (<var>request</var> is null),</dt>
82431+
<dd><var>response</var>'s <span data-x="concept-response-url">URL</span></dd>
82432+
</dl>
8242482433

8242582434
<p><!--en-GB--><dfn id="initialise-the-document-object" data-x="initialize the Document object"
8242682435
data-export="">Initializing a new <code>Document</code> object</dfn>: when a

0 commit comments

Comments
 (0)