From aefcde20724172d8995e153104ec5716ea1c04b3 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Fri, 29 Jan 2021 10:43:00 +0100 Subject: [PATCH 1/3] Adopt Fetch's extract a location URL Complements https://github.com/whatwg/fetch/pull/1149. --- source | 52 +++++++++++++++++++++++++--------------------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/source b/source index 02fee399df0..cdc5e673486 100644 --- a/source +++ b/source @@ -2527,9 +2527,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • body
  • internal response
  • CSP list
  • -
  • location URL
  • +
  • extract a location URL
  • request and its associated: @@ -84530,14 +84530,17 @@ interface Location { // but see also current URL.

  • +
  • While true:

      -
    1. Let currentURL be response's location URL, if response is not null, - and request's current URL - otherwise.

    2. +
    3. If locationURL is non-null, then set currentURL to + locationURL.

    4. If reservedEnvironment is not null and currentURL's @@ -84669,12 +84672,13 @@ interface Location { // but see also extracting a location URL given response.

    5. +
    6. -

      If response does not have a location URL or the location URL is not a URL whose - scheme is an HTTP(S) scheme, - then break.

      +

      If locationURL is not a URL whose scheme is an HTTP(S) scheme, then + break.

      Navigation handles redirects manually as navigation is the only place in the web platform that cares for redirects to mailto: @@ -84685,31 +84689,25 @@ interface Location { // but see also location - URL that is failure, then set response to a network +

    7. If locationURL is failure, then set response to a network error.

    8. -
    9. Otherwise, if response has a location URL that is a URL whose

      Otherwise, if locationURL is a URL whose scheme is "blob", "file", "filesystem", or "javascript", then set response to a network error.

    10. -
    11. Otherwise, if response has a location URL that is a URL whose

      Otherwise, if locationURL is a URL whose scheme is a fetch scheme, then run process a navigate fetch with a new request - whose url is response's location URL, sourceBrowsingContext, - browsingContext, navigationType, sandboxFlags, - incumbentNavigationOrigin, activeDocumentNavigationOrigin, and - historyHandling, and return. - -

    12. Otherwise, if response has a location URL that is a URL, run the - process a navigate URL scheme given response's location URL and - browsingContext, and return.

    13. + whose url is locationURL, + sourceBrowsingContext, browsingContext, navigationType, + sandboxFlags, incumbentNavigationOrigin, + activeDocumentNavigationOrigin, and historyHandling, and return. + +
    14. Otherwise, if locationURL is a URL, run the process a + navigate URL scheme given locationURL and browsingContext, and + return.

    15. Let navigationParams be a new navigation params whose request is request, Date: Fri, 29 Jan 2021 10:45:57 +0100 Subject: [PATCH 2/3] nit --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index cdc5e673486..587b0a36378 100644 --- a/source +++ b/source @@ -2529,7 +2529,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

    16. CSP list
    17. -
    18. extract a location URL
    19. +
    20. extract a location URL
    21. request and its associated: From 45d4b1396333e030b4d5a3ea8acdedc500361d6d Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Sat, 30 Jan 2021 08:16:47 +0100 Subject: [PATCH 3/3] slight change --- source | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source b/source index 587b0a36378..dbc322571b6 100644 --- a/source +++ b/source @@ -2527,9 +2527,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
    22. body
    23. internal response
    24. CSP list
    25. +
    26. location URL
    27. -
    28. extract a location URL
    29. request and its associated: @@ -84672,8 +84672,8 @@ interface Location { // but see also extracting a location URL given response.

    30. +
    31. Set locationURL to response's location URL.

    32. If locationURL is not a URL whose