-
Notifications
You must be signed in to change notification settings - Fork 380
Remove location URL as field on responses #1149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Complements whatwg/fetch#1149.
domenic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO this should either be "extract a location URL" and take a header list (like "extract a MIME type"), or it should be "response's location URL" (like "response's/request's MIME type"). I prefer the latter.
| <!-- https://github.com/whatwg/fetch/issues/814#issuecomment-431366126 --> | ||
|
|
||
| <li> | ||
| <p>If <var>location</var> is a <a for=header>value</a>, then set <var>location</var> to the result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"extracting header list values" returns a list, not a value, if I am reading this right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but I'm not fixing this here.
davidben
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this!
|
A request never has a location URL so that seems kinda redundant. |
|
I'm just suggesting changing the phrasing from "To extract a location URL given a response response" to "The location URL of a response response is the value given by the following algorithm:". This lets the call sites be nicer, more like a "getter" instead of a "function call". |
|
@davidben if you have a changeset up for Chromium could you link it here? I would like to use that to satisfy the test criteria. I also take it web-platform-tests/wpt#10449 can be closed in favor of that? |
It does not need to be stored on a response and therefore resulted in confusion. Also clarify that synthetic responses need to have an absolute URL in the Location header field value (Response.redirect() does this automatically). Corresponding HTML PR: TODO. Tests: TODO. Closes #631, closes #633, closes #958, and closes #1146. (Some of these can be closed due to #1030 making response's URL no longer null for network responses.)
154ede8 to
e63e41a
Compare
Here you are. Sorry about the delay. I tried to get a test working for relative script-constructed redirects. I... only sort of succeeded. It relies on network errors triggering iframe onload which seems to only be true in Chromium. (And, even then, It's Complicated.) Is there's a better trick for that sort of thing? |
|
It seems you could do a |
|
Ah, yeah that'll work. Similar to how I previously misread it, I thought only navigations followed SW-constructed redirects, but that's not quite true since HTTP fetch step 3 still continues on to step 6, and step 3.2.3 only forbids opaqueredirect on non-manual requests. Synthetic ones are still fine. I'll switch it to that. |
We currently resolve Service-Worker-forwarded location headers using the
request. While this matches Firefox, this does not match the spec or
Safari's behavior. Instead, the spec says to resolve the location header
based on the response's URL.
This comes up if the FetchEvent was for /, but the Service Worker
responded with ev.respondWith(fetch("/foo/", {redirect: "manual"})). In
that case, a Location: bar.html header would result in /bar.html by our
version and /foo/bar.html by the spec's version.
Align with the spec. This makes the redirect go where it would have gone
under {redirect: "follow"}. This has two platform-visible behavior
changes:
- First, cases like the above will result in a different URL.
- Second, script-constructed Response objects do not have a URL list. If
the URLs are absolute, this works fine. If they are relative, those
fetches will now result in a network error. Note Response.redirect()
internally constructs absolute URLs, so those continue to work. This
only affects ev.respondWith(new Response(... location: "bar.html"}})).
Both of these changes match Safari.
Note that, as of writing, the Fetch spec describes this behavior in
terms of a location URL property on the response object. This would
require computing the location URL earlier and preserving it across many
layers, including persisting in CacheStorage. See
https://chromium-review.googlesource.com/c/chromium/src/+/2648648.
Instead, this CL uses the equivalent formulation in
whatwg/fetch#1149. See also discussion in
whatwg/fetch#1146.
Bug: 1170379
Change-Id: Ibb6b12566244fd259029e67787dd7f08edeece9d
We currently resolve Service-Worker-forwarded location headers using the
request. While this matches Firefox, this does not match the spec or
Safari's behavior. Instead, the spec says to resolve the location header
based on the response's URL.
This comes up if the FetchEvent was for /, but the Service Worker
responded with ev.respondWith(fetch("/foo/", {redirect: "manual"})). In
that case, a Location: bar.html header would result in /bar.html by our
version and /foo/bar.html by the spec's version.
Align with the spec. This makes the redirect go where it would have gone
under {redirect: "follow"}. This has two platform-visible behavior
changes:
- First, cases like the above will result in a different URL.
- Second, script-constructed Response objects do not have a URL list. If
the URLs are absolute, this works fine. If they are relative, those
fetches will now result in a network error. Note Response.redirect()
internally constructs absolute URLs, so those continue to work. This
only affects ev.respondWith(new Response(... location: "bar.html"}})).
Both of these changes match Safari.
Note that, as of writing, the Fetch spec describes this behavior in
terms of a location URL property on the response object. This would
require computing the location URL earlier and preserving it across many
layers, including persisting in CacheStorage. See
https://chromium-review.googlesource.com/c/chromium/src/+/2648648.
Instead, this CL uses the equivalent formulation in
whatwg/fetch#1149. See also discussion in
whatwg/fetch#1146.
Bug: 1170379
Change-Id: Ibb6b12566244fd259029e67787dd7f08edeece9d
We currently resolve Service-Worker-forwarded location headers using the
request. While this matches Firefox, this does not match the spec or
Safari's behavior. Instead, the spec says to resolve the location header
based on the response's URL.
This comes up if the FetchEvent was for /, but the Service Worker
responded with ev.respondWith(fetch("/foo/", {redirect: "manual"})). In
that case, a Location: bar.html header would result in /bar.html by our
version and /foo/bar.html by the spec's version.
Align with the spec. This makes the redirect go where it would have gone
under {redirect: "follow"}. This has two platform-visible behavior
changes:
- First, cases like the above will result in a different URL.
- Second, script-constructed Response objects do not have a URL list. If
the URLs are absolute, this works fine. If they are relative, those
fetches will now result in a network error. Note Response.redirect()
internally constructs absolute URLs, so those continue to work. This
only affects ev.respondWith(new Response(... location: "bar.html"}})).
Both of these changes match Safari.
Note that, as of writing, the Fetch spec describes this behavior in
terms of a location URL property on the response object. This would
require computing the location URL earlier and preserving it across many
layers, including persisting in CacheStorage. See
https://chromium-review.googlesource.com/c/chromium/src/+/2648648.
Instead, this CL uses the equivalent formulation in
whatwg/fetch#1149. See also discussion in
whatwg/fetch#1146.
Bug: 1170379
Change-Id: Ibb6b12566244fd259029e67787dd7f08edeece9d
We currently resolve Service-Worker-forwarded location headers using the
request. While this matches Firefox, this does not match the spec or
Safari's behavior. Instead, the spec says to resolve the location header
based on the response's URL.
This comes up if the FetchEvent was for /, but the Service Worker
responded with ev.respondWith(fetch("/foo/", {redirect: "manual"})). In
that case, a Location: bar.html header would result in /bar.html by our
version and /foo/bar.html by the spec's version.
Align with the spec. This makes the redirect go where it would have gone
under {redirect: "follow"}. This has two platform-visible behavior
changes:
- First, cases like the above will result in a different URL.
- Second, script-constructed Response objects do not have a URL list. If
the URLs are absolute, this works fine. If they are relative, those
fetches will now result in a network error. Note Response.redirect()
internally constructs absolute URLs, so those continue to work. This
only affects ev.respondWith(new Response(... location: "bar.html"}})).
Both of these changes match Safari.
Note that, as of writing, the Fetch spec describes this behavior in
terms of a location URL property on the response object. This would
require computing the location URL earlier and preserving it across many
layers, including persisting in CacheStorage. See
https://chromium-review.googlesource.com/c/chromium/src/+/2648648.
Instead, this CL uses the equivalent formulation in
whatwg/fetch#1149. See also discussion in
whatwg/fetch#1146.
Bug: 1170379
Change-Id: Ibb6b12566244fd259029e67787dd7f08edeece9d
We currently resolve Service-Worker-forwarded location headers using the
request. While this matches Firefox, this does not match the spec or
Safari's behavior. Instead, the spec says to resolve the location header
based on the response's URL.
This comes up if the FetchEvent was for /, but the Service Worker
responded with ev.respondWith(fetch("/foo/", {redirect: "manual"})). In
that case, a Location: bar.html header would result in /bar.html by our
version and /foo/bar.html by the spec's version.
Align with the spec. This makes the redirect go where it would have gone
under {redirect: "follow"}. This has two platform-visible behavior
changes:
- First, cases like the above will result in a different URL.
- Second, script-constructed Response objects do not have a URL list. If
the URLs are absolute, this works fine. If they are relative, those
fetches will now result in a network error. Note Response.redirect()
internally constructs absolute URLs, so those continue to work. This
only affects ev.respondWith(new Response(... location: "bar.html"}})).
Both of these changes match Safari.
Note that, as of writing, the Fetch spec describes this behavior in
terms of a location URL property on the response object. This would
require computing the location URL earlier and preserving it across many
layers, including persisting in CacheStorage. See
https://chromium-review.googlesource.com/c/chromium/src/+/2648648.
Instead, this CL uses the equivalent formulation in
whatwg/fetch#1149. See also discussion in
whatwg/fetch#1146.
Bug: 1170379
Change-Id: Ibb6b12566244fd259029e67787dd7f08edeece9d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2665871
Reviewed-by: Makoto Shimazu <[email protected]>
Reviewed-by: Kinuko Yasuda <[email protected]>
Reviewed-by: Ben Kelly <[email protected]>
Commit-Queue: David Benjamin <[email protected]>
Cr-Commit-Position: refs/heads/master@{#850874}
We currently resolve Service-Worker-forwarded location headers using the
request. While this matches Firefox, this does not match the spec or
Safari's behavior. Instead, the spec says to resolve the location header
based on the response's URL.
This comes up if the FetchEvent was for /, but the Service Worker
responded with ev.respondWith(fetch("/foo/", {redirect: "manual"})). In
that case, a Location: bar.html header would result in /bar.html by our
version and /foo/bar.html by the spec's version.
Align with the spec. This makes the redirect go where it would have gone
under {redirect: "follow"}. This has two platform-visible behavior
changes:
- First, cases like the above will result in a different URL.
- Second, script-constructed Response objects do not have a URL list. If
the URLs are absolute, this works fine. If they are relative, those
fetches will now result in a network error. Note Response.redirect()
internally constructs absolute URLs, so those continue to work. This
only affects ev.respondWith(new Response(... location: "bar.html"}})).
Both of these changes match Safari.
Note that, as of writing, the Fetch spec describes this behavior in
terms of a location URL property on the response object. This would
require computing the location URL earlier and preserving it across many
layers, including persisting in CacheStorage. See
https://chromium-review.googlesource.com/c/chromium/src/+/2648648.
Instead, this CL uses the equivalent formulation in
whatwg/fetch#1149. See also discussion in
whatwg/fetch#1146.
Bug: 1170379
Change-Id: Ibb6b12566244fd259029e67787dd7f08edeece9d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2665871
Reviewed-by: Makoto Shimazu <[email protected]>
Reviewed-by: Kinuko Yasuda <[email protected]>
Reviewed-by: Ben Kelly <[email protected]>
Commit-Queue: David Benjamin <[email protected]>
Cr-Commit-Position: refs/heads/master@{#850874}
We currently resolve Service-Worker-forwarded location headers using the
request. While this matches Firefox, this does not match the spec or
Safari's behavior. Instead, the spec says to resolve the location header
based on the response's URL.
This comes up if the FetchEvent was for /, but the Service Worker
responded with ev.respondWith(fetch("/foo/", {redirect: "manual"})). In
that case, a Location: bar.html header would result in /bar.html by our
version and /foo/bar.html by the spec's version.
Align with the spec. This makes the redirect go where it would have gone
under {redirect: "follow"}. This has two platform-visible behavior
changes:
- First, cases like the above will result in a different URL.
- Second, script-constructed Response objects do not have a URL list. If
the URLs are absolute, this works fine. If they are relative, those
fetches will now result in a network error. Note Response.redirect()
internally constructs absolute URLs, so those continue to work. This
only affects ev.respondWith(new Response(... location: "bar.html"}})).
Both of these changes match Safari.
Note that, as of writing, the Fetch spec describes this behavior in
terms of a location URL property on the response object. This would
require computing the location URL earlier and preserving it across many
layers, including persisting in CacheStorage. See
https://chromium-review.googlesource.com/c/chromium/src/+/2648648.
Instead, this CL uses the equivalent formulation in
whatwg/fetch#1149. See also discussion in
whatwg/fetch#1146.
Bug: 1170379
Change-Id: Ibb6b12566244fd259029e67787dd7f08edeece9d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2665871
Reviewed-by: Makoto Shimazu <[email protected]>
Reviewed-by: Kinuko Yasuda <[email protected]>
Reviewed-by: Ben Kelly <[email protected]>
Commit-Queue: David Benjamin <[email protected]>
Cr-Commit-Position: refs/heads/master@{#850874}
…n the response, a=testonly
Automatic update from web-platform-tests
Resolve Service Worker redirects based on the response
We currently resolve Service-Worker-forwarded location headers using the
request. While this matches Firefox, this does not match the spec or
Safari's behavior. Instead, the spec says to resolve the location header
based on the response's URL.
This comes up if the FetchEvent was for /, but the Service Worker
responded with ev.respondWith(fetch("/foo/", {redirect: "manual"})). In
that case, a Location: bar.html header would result in /bar.html by our
version and /foo/bar.html by the spec's version.
Align with the spec. This makes the redirect go where it would have gone
under {redirect: "follow"}. This has two platform-visible behavior
changes:
- First, cases like the above will result in a different URL.
- Second, script-constructed Response objects do not have a URL list. If
the URLs are absolute, this works fine. If they are relative, those
fetches will now result in a network error. Note Response.redirect()
internally constructs absolute URLs, so those continue to work. This
only affects ev.respondWith(new Response(... location: "bar.html"}})).
Both of these changes match Safari.
Note that, as of writing, the Fetch spec describes this behavior in
terms of a location URL property on the response object. This would
require computing the location URL earlier and preserving it across many
layers, including persisting in CacheStorage. See
https://chromium-review.googlesource.com/c/chromium/src/+/2648648.
Instead, this CL uses the equivalent formulation in
whatwg/fetch#1149. See also discussion in
whatwg/fetch#1146.
Bug: 1170379
Change-Id: Ibb6b12566244fd259029e67787dd7f08edeece9d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2665871
Reviewed-by: Makoto Shimazu <[email protected]>
Reviewed-by: Kinuko Yasuda <[email protected]>
Reviewed-by: Ben Kelly <[email protected]>
Commit-Queue: David Benjamin <[email protected]>
Cr-Commit-Position: refs/heads/master@{#850874}
--
wpt-commits: 020c59f0ae3ce0a5649c8e811faca2101d947d63
wpt-pr: 27444
…n the response, a=testonly
Automatic update from web-platform-tests
Resolve Service Worker redirects based on the response
We currently resolve Service-Worker-forwarded location headers using the
request. While this matches Firefox, this does not match the spec or
Safari's behavior. Instead, the spec says to resolve the location header
based on the response's URL.
This comes up if the FetchEvent was for /, but the Service Worker
responded with ev.respondWith(fetch("/foo/", {redirect: "manual"})). In
that case, a Location: bar.html header would result in /bar.html by our
version and /foo/bar.html by the spec's version.
Align with the spec. This makes the redirect go where it would have gone
under {redirect: "follow"}. This has two platform-visible behavior
changes:
- First, cases like the above will result in a different URL.
- Second, script-constructed Response objects do not have a URL list. If
the URLs are absolute, this works fine. If they are relative, those
fetches will now result in a network error. Note Response.redirect()
internally constructs absolute URLs, so those continue to work. This
only affects ev.respondWith(new Response(... location: "bar.html"}})).
Both of these changes match Safari.
Note that, as of writing, the Fetch spec describes this behavior in
terms of a location URL property on the response object. This would
require computing the location URL earlier and preserving it across many
layers, including persisting in CacheStorage. See
https://chromium-review.googlesource.com/c/chromium/src/+/2648648.
Instead, this CL uses the equivalent formulation in
whatwg/fetch#1149. See also discussion in
whatwg/fetch#1146.
Bug: 1170379
Change-Id: Ibb6b12566244fd259029e67787dd7f08edeece9d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2665871
Reviewed-by: Makoto Shimazu <shimazuchromium.org>
Reviewed-by: Kinuko Yasuda <kinukochromium.org>
Reviewed-by: Ben Kelly <wanderviewchromium.org>
Commit-Queue: David Benjamin <davidbenchromium.org>
Cr-Commit-Position: refs/heads/master{#850874}
--
wpt-commits: 020c59f0ae3ce0a5649c8e811faca2101d947d63
wpt-pr: 27444
UltraBlame original commit: f5404d5590f52e0ccf7100a37b1429363ca23c0c
…n the response, a=testonly
Automatic update from web-platform-tests
Resolve Service Worker redirects based on the response
We currently resolve Service-Worker-forwarded location headers using the
request. While this matches Firefox, this does not match the spec or
Safari's behavior. Instead, the spec says to resolve the location header
based on the response's URL.
This comes up if the FetchEvent was for /, but the Service Worker
responded with ev.respondWith(fetch("/foo/", {redirect: "manual"})). In
that case, a Location: bar.html header would result in /bar.html by our
version and /foo/bar.html by the spec's version.
Align with the spec. This makes the redirect go where it would have gone
under {redirect: "follow"}. This has two platform-visible behavior
changes:
- First, cases like the above will result in a different URL.
- Second, script-constructed Response objects do not have a URL list. If
the URLs are absolute, this works fine. If they are relative, those
fetches will now result in a network error. Note Response.redirect()
internally constructs absolute URLs, so those continue to work. This
only affects ev.respondWith(new Response(... location: "bar.html"}})).
Both of these changes match Safari.
Note that, as of writing, the Fetch spec describes this behavior in
terms of a location URL property on the response object. This would
require computing the location URL earlier and preserving it across many
layers, including persisting in CacheStorage. See
https://chromium-review.googlesource.com/c/chromium/src/+/2648648.
Instead, this CL uses the equivalent formulation in
whatwg/fetch#1149. See also discussion in
whatwg/fetch#1146.
Bug: 1170379
Change-Id: Ibb6b12566244fd259029e67787dd7f08edeece9d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2665871
Reviewed-by: Makoto Shimazu <shimazuchromium.org>
Reviewed-by: Kinuko Yasuda <kinukochromium.org>
Reviewed-by: Ben Kelly <wanderviewchromium.org>
Commit-Queue: David Benjamin <davidbenchromium.org>
Cr-Commit-Position: refs/heads/master{#850874}
--
wpt-commits: 020c59f0ae3ce0a5649c8e811faca2101d947d63
wpt-pr: 27444
UltraBlame original commit: f5404d5590f52e0ccf7100a37b1429363ca23c0c
…n the response, a=testonly
Automatic update from web-platform-tests
Resolve Service Worker redirects based on the response
We currently resolve Service-Worker-forwarded location headers using the
request. While this matches Firefox, this does not match the spec or
Safari's behavior. Instead, the spec says to resolve the location header
based on the response's URL.
This comes up if the FetchEvent was for /, but the Service Worker
responded with ev.respondWith(fetch("/foo/", {redirect: "manual"})). In
that case, a Location: bar.html header would result in /bar.html by our
version and /foo/bar.html by the spec's version.
Align with the spec. This makes the redirect go where it would have gone
under {redirect: "follow"}. This has two platform-visible behavior
changes:
- First, cases like the above will result in a different URL.
- Second, script-constructed Response objects do not have a URL list. If
the URLs are absolute, this works fine. If they are relative, those
fetches will now result in a network error. Note Response.redirect()
internally constructs absolute URLs, so those continue to work. This
only affects ev.respondWith(new Response(... location: "bar.html"}})).
Both of these changes match Safari.
Note that, as of writing, the Fetch spec describes this behavior in
terms of a location URL property on the response object. This would
require computing the location URL earlier and preserving it across many
layers, including persisting in CacheStorage. See
https://chromium-review.googlesource.com/c/chromium/src/+/2648648.
Instead, this CL uses the equivalent formulation in
whatwg/fetch#1149. See also discussion in
whatwg/fetch#1146.
Bug: 1170379
Change-Id: Ibb6b12566244fd259029e67787dd7f08edeece9d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2665871
Reviewed-by: Makoto Shimazu <shimazuchromium.org>
Reviewed-by: Kinuko Yasuda <kinukochromium.org>
Reviewed-by: Ben Kelly <wanderviewchromium.org>
Commit-Queue: David Benjamin <davidbenchromium.org>
Cr-Commit-Position: refs/heads/master{#850874}
--
wpt-commits: 020c59f0ae3ce0a5649c8e811faca2101d947d63
wpt-pr: 27444
UltraBlame original commit: f5404d5590f52e0ccf7100a37b1429363ca23c0c
…n the response, a=testonly
Automatic update from web-platform-tests
Resolve Service Worker redirects based on the response
We currently resolve Service-Worker-forwarded location headers using the
request. While this matches Firefox, this does not match the spec or
Safari's behavior. Instead, the spec says to resolve the location header
based on the response's URL.
This comes up if the FetchEvent was for /, but the Service Worker
responded with ev.respondWith(fetch("/foo/", {redirect: "manual"})). In
that case, a Location: bar.html header would result in /bar.html by our
version and /foo/bar.html by the spec's version.
Align with the spec. This makes the redirect go where it would have gone
under {redirect: "follow"}. This has two platform-visible behavior
changes:
- First, cases like the above will result in a different URL.
- Second, script-constructed Response objects do not have a URL list. If
the URLs are absolute, this works fine. If they are relative, those
fetches will now result in a network error. Note Response.redirect()
internally constructs absolute URLs, so those continue to work. This
only affects ev.respondWith(new Response(... location: "bar.html"}})).
Both of these changes match Safari.
Note that, as of writing, the Fetch spec describes this behavior in
terms of a location URL property on the response object. This would
require computing the location URL earlier and preserving it across many
layers, including persisting in CacheStorage. See
https://chromium-review.googlesource.com/c/chromium/src/+/2648648.
Instead, this CL uses the equivalent formulation in
whatwg/fetch#1149. See also discussion in
whatwg/fetch#1146.
Bug: 1170379
Change-Id: Ibb6b12566244fd259029e67787dd7f08edeece9d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2665871
Reviewed-by: Makoto Shimazu <[email protected]>
Reviewed-by: Kinuko Yasuda <[email protected]>
Reviewed-by: Ben Kelly <[email protected]>
Commit-Queue: David Benjamin <[email protected]>
Cr-Commit-Position: refs/heads/master@{#850874}
--
wpt-commits: 020c59f0ae3ce0a5649c8e811faca2101d947d63
wpt-pr: 27444
* Editorial: remove redundant "the" * Meta: default branch rename Also correct a broken link. Not even w3.org URLs are that cool. Helps with whatwg/meta#174. * Editorial: clean up calls to "parse a URL" It actually takes a string, so calls should be clear about that. * Review Draft Publication: January 2021 * Simplify <link>s In particular, remove their activation behavior, stop them from matching :link and :visited, and stop suggesting that they be focusable areas. This also includes a slight expansion and rearrangement of the link element's section to make it clearer what hyperlinks created by <link> are meant for, contrasting them to <a> and <area> hyperlinks. Closes whatwg#4831. Closes whatwg#2617. Helps with whatwg#5490. * Meta: remove demos/offline/* (whatwg#6307) These are no longer needed as of e4330d5. * Meta: minor references cleanup Use more HTTPS and drop obsolete HTML Differences reference. * Editorial: anticlockwise → counterclockwise We use en-US these days. Spotted in https://twitter.com/iso2022jp/status/1352601086519955456. * Use :focus-visible in the UA stylesheet See w3c/csswg-drafts#4278. * Editorial: align with WebIDL and Infra * Fix "update a style block" early return The new version matches implementation reality and CSSWG resolution. The algorithm was also inconsistent, as it looked at whether the element was in a shadow tree or in the document tree, but it was only specified to be re-run if the element becomes connected or disconnected. The CSSWG discussed this in w3c/csswg-drafts#3096 (comment) and http://wpt.live/shadow-dom/ShadowRoot-interface.html tests this. This also matches closer the definition of <link rel="stylesheet">, which does use connectedness (though it uses "browsing-context connected", which is a bit different): https://html.spec.whatwg.org/#link-type-stylesheet * Modernize and refactor simple dialogs This contains a small bug fix, in that confirm() and prompt() said "return" in some cases instead of "return false" or "return null" as appropriate. Other notable changes, all editorial, are: * Factoring out repeated "cannot show simple dialogs" steps, which will likely expand over time (see e.g. whatwg#6297). * Separating out and explaining the no-argument overload of alert(). * Passing the document through to the "printing steps", instead of just having them talk about "this Window object". * Meta: add definition markup for MessageEvent * Remove <marquee> events They are only supported by one engine (Gecko). Closes whatwg#2957. * Clarify when microtasks happen * Ignore COEP on non-secure contexts Fixes whatwg#6328. * Editorial: update URL Standard integration * Editorial: only invoke response's location URL once Complements whatwg/fetch#1149. * Track the incumbent settings and active script in Promise callbacks Closes whatwg#5213. * createImageBitmap(): stop clipping sourceRect to source's dimensions It has been found in whatwg#6306 that this was an oversight at the time of its introduction. Current behavior goes against author expectations and no implementer has opposed the change to "no-clip". Tests: web-platform-tests/wpt#27040. Closes whatwg#6306. * Remove CSP plugin-types blocking With Flash not being supported anymore, the CSP directive plugin-types has lost its main reason for being and is being removed from the Content Security Policy specification: w3c/webappsec-csp#456. This change removes references to the relevant algorithm from the Content Security Policy spec. * Meta: set more dfn types A follow-up to: * whatwg#5694 * whatwg#5916 * Editorial: occuring → occurring * Make all plugin-related APIs no-ops Part of whatwg#6003. * Disallow simple dialogs from different-origin domain iframes Closes whatwg#5407. * Revive @@iterator for PluginArray/MimeTypeArray/Plugin @@iterator is implicitly installed by defining an indexed property getter. Since there is no other way to define it exclusively, this restores some methods back to being indexed getters. This fixes an inadvertent observable behavior change in d4f07b8. * Adjust web+ scheme security considerations to account for FTP removal Also, network scheme is now reduced to HTTP(S) scheme. Helps with whatwg#5375, but form submission issue remains. See whatwg/fetch#1166 for context. * Meta: export pause Nobody but XMLHttpRequest take a dependency on this please. You have been warned. Context: whatwg/xhr#311. * Fix typo: ancestor → accessor Fixes whatwg#6374. Co-authored-by: Dominic Farolino <[email protected]> Co-authored-by: Anne van Kesteren <[email protected]> Co-authored-by: Domenic Denicola <[email protected]> Co-authored-by: Emilio Cobos Álvarez <[email protected]> Co-authored-by: Momdo Nakamura <[email protected]> Co-authored-by: Jake Archibald <[email protected]> Co-authored-by: Yutaka Hirano <[email protected]> Co-authored-by: Shu-yu Guo <[email protected]> Co-authored-by: Kaiido <[email protected]> Co-authored-by: Antonio Sartori <[email protected]> Co-authored-by: Michael[tm] Smith <[email protected]> Co-authored-by: Ikko Ashimine <[email protected]> Co-authored-by: Carlos IL <[email protected]> Co-authored-by: Kagami Sascha Rosylight <[email protected]> Co-authored-by: Simon Pieters <[email protected]>
…n the response, a=testonly
Automatic update from web-platform-tests
Resolve Service Worker redirects based on the response
We currently resolve Service-Worker-forwarded location headers using the
request. While this matches Firefox, this does not match the spec or
Safari's behavior. Instead, the spec says to resolve the location header
based on the response's URL.
This comes up if the FetchEvent was for /, but the Service Worker
responded with ev.respondWith(fetch("/foo/", {redirect: "manual"})). In
that case, a Location: bar.html header would result in /bar.html by our
version and /foo/bar.html by the spec's version.
Align with the spec. This makes the redirect go where it would have gone
under {redirect: "follow"}. This has two platform-visible behavior
changes:
- First, cases like the above will result in a different URL.
- Second, script-constructed Response objects do not have a URL list. If
the URLs are absolute, this works fine. If they are relative, those
fetches will now result in a network error. Note Response.redirect()
internally constructs absolute URLs, so those continue to work. This
only affects ev.respondWith(new Response(... location: "bar.html"}})).
Both of these changes match Safari.
Note that, as of writing, the Fetch spec describes this behavior in
terms of a location URL property on the response object. This would
require computing the location URL earlier and preserving it across many
layers, including persisting in CacheStorage. See
https://chromium-review.googlesource.com/c/chromium/src/+/2648648.
Instead, this CL uses the equivalent formulation in
whatwg/fetch#1149. See also discussion in
whatwg/fetch#1146.
Bug: 1170379
Change-Id: Ibb6b12566244fd259029e67787dd7f08edeece9d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2665871
Reviewed-by: Makoto Shimazu <[email protected]>
Reviewed-by: Kinuko Yasuda <[email protected]>
Reviewed-by: Ben Kelly <[email protected]>
Commit-Queue: David Benjamin <[email protected]>
Cr-Commit-Position: refs/heads/master@{#850874}
--
wpt-commits: 020c59f0ae3ce0a5649c8e811faca2101d947d63
wpt-pr: 27444
It does not need to be stored on a response and therefore resulted in confusion.
Also clarify that synthetic responses need to have an absolute URL in the Location header field value (Response.redirect() does this automatically).
Corresponding HTML PR: TODO.
Tests: TODO.
Closes #631, closes #633, closes #958, and closes #1146. (Some of these can be closed due to #1030 making response's URL no longer null for network responses.)
(See WHATWG Working Mode: Changes for more details.)
Preview | Diff