Repository navigation
Expose redirectCount for TAO opted-in redirect chains - #12513
Conversation
annevk
left a comment
There was a problem hiding this comment.
I don't understand how this works. What if one redirect allows it and one doesn't?
I may have gotten this wrong, but I thought TAO check only passes if the entire redirect chain has |
|
No, TAO check only looks at a single response. There's https://fetch.spec.whatwg.org/#concept-response-timing-allow-passed but I don't actually know if that works well for navigations. Navigations are messy. |
|
Yeah that looks correct. I think there are still issues with it, but this is not one of them. There is still the question as to whether it's okay that same-origin redirects end up exposed without opt-in. |
Yeah, I'll open a separate issue RE that |
|
|
In w3c/navigation-timing#215 (comment) @achristensen07 suggests that we should also take the "noreferrer" values into account. This seems like we could add that condition here. In the context of Fetch, I'm working on a PR to create navigation-specific TAO checks that look at the destination origin. |
Thinking about this, I think it makes sense. We can think of it as:
|
|
As far as implementer support, Chrome team is supportive. |
This CL implements whatwg/html#12513 and whatwg/fetch#1931, in order to resolve w3c/navigation-timing#215. It enables developers to opt-in to get cross-origin redirect timings, through destination-based Timing-Allow-Origin headers. I2P: https://groups.google.com/a/chromium.org/g/blink-dev/c/GOPn8-wQlsk/m/x5Q3G6KuAgAJ Change-Id: Ib463010f1862af523a241d2e9180ff09bfedb101 Bug: 521861828 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7915892 Commit-Queue: Yoav Weiss (@Shopify) <[email protected]> Reviewed-by: Noam Rosenthal <[email protected]> Cr-Commit-Position: refs/heads/main@{#1650808}
This CL implements whatwg/html#12513 and whatwg/fetch#1931, in order to resolve w3c/navigation-timing#215. It enables developers to opt-in to get cross-origin redirect timings, through destination-based Timing-Allow-Origin headers. I2P: https://groups.google.com/a/chromium.org/g/blink-dev/c/GOPn8-wQlsk/m/x5Q3G6KuAgAJ Change-Id: Ib463010f1862af523a241d2e9180ff09bfedb101 Bug: 521861828 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7915892 Commit-Queue: Yoav Weiss (@Shopify) <[email protected]> Reviewed-by: Noam Rosenthal <[email protected]> Cr-Commit-Position: refs/heads/main@{#1650808}
annevk
left a comment
There was a problem hiding this comment.
I think we should invert this. Start out with 0 and reveal the count if we're satisfied all conditions are met.
Done! |
Timing-Allow-Origin (TAO) currently only opts-in "backwards" in terms of origins and doesn't constitute an opt-in to the destination origin, which is the appropriate opt-in for navigations (contrary to subresources). This PR adds the mechanisms that can enable such "forward" opt-in, and can enable a navigation response to a redirect chain to know that the redirect chain opted in to expose the redirects to its origin. Tests: web-platform-tests/wpt#60823 & web-platform-tests/wpt#60873. Corresponding HTML PR: whatwg/html#12513.
…, a=testonly Automatic update from web-platform-tests Navigation-Timing: destination-based TAO (#60823) This CL implements whatwg/html#12513 and whatwg/fetch#1931, in order to resolve w3c/navigation-timing#215. It enables developers to opt-in to get cross-origin redirect timings, through destination-based Timing-Allow-Origin headers. I2P: https://groups.google.com/a/chromium.org/g/blink-dev/c/GOPn8-wQlsk/m/x5Q3G6KuAgAJ Change-Id: Ib463010f1862af523a241d2e9180ff09bfedb101 Bug: 521861828 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7915892 Commit-Queue: Yoav Weiss (@Shopify) <[email protected]> Reviewed-by: Noam Rosenthal <[email protected]> Cr-Commit-Position: refs/heads/main@{#1650808} Co-authored-by: Yoav Weiss <[email protected]> -- wpt-commits: 2b0c3ce064199c58603edca2a8562da285f8d82b wpt-pr: 60823
…stination origin. https://bugs.webkit.org/show_bug.cgi?id=316647 Reviewed by Alex Christensen. This PR aligns the WebKit implementation with whatwg/fetch#1931 and whatwg/html#12513, and ensures that TAO opt-ins for navigation timing take the destination origin into account. New iframe tests, plus test progressions. * LayoutTests/imported/w3c/web-platform-tests/navigation-timing/redirect-tao-expected.txt: Progression. * LayoutTests/imported/w3c/web-platform-tests/navigation-timing/redirect-tao.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-timing/resources/redirect-tao-helper.js: * LayoutTests/imported/w3c/web-platform-tests/navigation-timing/resources/report-navigation-redirect-timing.html: Added. * LayoutTests/imported/w3c/web-platform-tests/navigation-timing/response-start-after-coop-bcg-switch.https-expected.txt: Expectation change. * LayoutTests/imported/w3c/web-platform-tests/navigation-timing/unload-event-same-origin-check-expected.txt: Progression. * Source/WebCore/loader/DocumentLoader.cpp: (WebCore::hideRedirectTimingForNoReferrerNavigation): Resets redirect count if noreferrer. (WebCore::DocumentLoader::notifyFinished): Calls hideRedirectTimingForNoReferrerNavigation. (WebCore::DocumentLoader::commitData): Calls hideRedirectTimingForNoReferrerNavigation. * Source/WebCore/page/PerformanceNavigationTiming.cpp: (WebCore::PerformanceNavigationTiming::shouldExposeRedirectTiming const): Only exposes redirect timing if redirectCount is not zero. (WebCore::PerformanceNavigationTiming::redirectCount const): TAO check. * Source/WebCore/page/PerformanceNavigationTiming.h: * Source/WebCore/page/PerformanceResourceTiming.cpp: (WebCore::fetchStart): Pass exposeRedirectTiming. (WebCore::entryStartTime): Use shouldExposeRedirectTiming(). (WebCore::PerformanceResourceTiming::shouldExposeRedirectTiming const): A virtual fun that enables NavigationTiming to override the default RT behavior. (WebCore::PerformanceResourceTiming::redirectStart const): Use shouldExposeRedirectTiming(). (WebCore::PerformanceResourceTiming::redirectEnd const): Use shouldExposeRedirectTiming(). (WebCore::PerformanceResourceTiming::fetchStart const): Use shouldExposeRedirectTiming(). * Source/WebCore/page/PerformanceResourceTiming.h: * Source/WebCore/platform/network/TimingAllowOrigin.cpp: (WebCore::passesNavigationTAOCheck): * Source/WebCore/platform/network/TimingAllowOrigin.h: * Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::checkRedirection): Append TAO values. (WebKit::NetworkLoadChecker::validateResponse): Set TAO values on the response. (WebKit::NetworkLoadChecker::appendToNavigationTimingAllowValuesList): Accumulate TAO values. * Source/WebKit/NetworkProcess/NetworkLoadChecker.h: (WebKit::NetworkLoadChecker::navigationTAOCheckPassed const): Getter. * Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didFinishLoading): Canonical link: https://commits.webkit.org/317061@main
…, a=testonly Automatic update from web-platform-tests Navigation-Timing: destination-based TAO (#60823) This CL implements whatwg/html#12513 and whatwg/fetch#1931, in order to resolve w3c/navigation-timing#215. It enables developers to opt-in to get cross-origin redirect timings, through destination-based Timing-Allow-Origin headers. I2P: https://groups.google.com/a/chromium.org/g/blink-dev/c/GOPn8-wQlsk/m/x5Q3G6KuAgAJ Change-Id: Ib463010f1862af523a241d2e9180ff09bfedb101 Bug: 521861828 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7915892 Commit-Queue: Yoav Weiss (@Shopify) <[email protected]> Reviewed-by: Noam Rosenthal <[email protected]> Cr-Commit-Position: refs/heads/main@{#1650808} Co-authored-by: Yoav Weiss <[email protected]> -- wpt-commits: 2b0c3ce064199c58603edca2a8562da285f8d82b wpt-pr: 60823
…stination origin. This PR aligns the WebKit implementation with whatwg/fetch#1931 and whatwg/html#12513, and ensures that TAO opt-ins for navigation timing take the destination origin into account. New iframe tests, plus test progressions. WebKit-Bug: https://bugs.webkit.org/show_bug.cgi?id=316647 WebKit-Canonical-Link: https://commits.webkit.org/317061@main
…stination origin. This PR aligns the WebKit implementation with whatwg/fetch#1931 and whatwg/html#12513, and ensures that TAO opt-ins for navigation timing take the destination origin into account. New iframe tests, plus test progressions. WebKit-Bug: https://bugs.webkit.org/show_bug.cgi?id=316647 WebKit-Canonical-Link: https://commits.webkit.org/317061@main
…/show_bug.cgi?id=316647, a=testonly Automatic update from web-platform-tests Navigation Timing: cross-origin redirect opt-in should be based on destination origin. This PR aligns the WebKit implementation with whatwg/fetch#1931 and whatwg/html#12513, and ensures that TAO opt-ins for navigation timing take the destination origin into account. New iframe tests, plus test progressions. WebKit-Bug: https://bugs.webkit.org/show_bug.cgi?id=316647 WebKit-Canonical-Link: https://commits.webkit.org/317061@main -- wpt-commits: 6662bb5ac7dfcf0b31d010d7f402360e00cbf0e3 wpt-pr: 64599
…/show_bug.cgi?id=316647, a=testonly Automatic update from web-platform-tests Navigation Timing: cross-origin redirect opt-in should be based on destination origin. This PR aligns the WebKit implementation with whatwg/fetch#1931 and whatwg/html#12513, and ensures that TAO opt-ins for navigation timing take the destination origin into account. New iframe tests, plus test progressions. WebKit-Bug: https://bugs.webkit.org/show_bug.cgi?id=316647 WebKit-Canonical-Link: https://commits.webkit.org/317061@main -- wpt-commits: 5a686a30bc8638de1a161d781e4234a661116879 wpt-pr: 64618
…/show_bug.cgi?id=316647, a=testonly Automatic update from web-platform-tests Navigation Timing: cross-origin redirect opt-in should be based on destination origin. This PR aligns the WebKit implementation with whatwg/fetch#1931 and whatwg/html#12513, and ensures that TAO opt-ins for navigation timing take the destination origin into account. New iframe tests, plus test progressions. WebKit-Bug: https://bugs.webkit.org/show_bug.cgi?id=316647 WebKit-Canonical-Link: https://commits.webkit.org/317061main -- wpt-commits: 6662bb5ac7dfcf0b31d010d7f402360e00cbf0e3 wpt-pr: 64599 UltraBlame original commit: 60b9f2299b1e1102d2e9d99367f2238f5204e19e
…/show_bug.cgi?id=316647, a=testonly Automatic update from web-platform-tests Navigation Timing: cross-origin redirect opt-in should be based on destination origin. This PR aligns the WebKit implementation with whatwg/fetch#1931 and whatwg/html#12513, and ensures that TAO opt-ins for navigation timing take the destination origin into account. New iframe tests, plus test progressions. WebKit-Bug: https://bugs.webkit.org/show_bug.cgi?id=316647 WebKit-Canonical-Link: https://commits.webkit.org/317061main -- wpt-commits: 5a686a30bc8638de1a161d781e4234a661116879 wpt-pr: 64618 UltraBlame original commit: d061e4b754b982c689b5a94599eea146292b0e53
…/show_bug.cgi?id=316647, a=testonly Automatic update from web-platform-tests Navigation Timing: cross-origin redirect opt-in should be based on destination origin. This PR aligns the WebKit implementation with whatwg/fetch#1931 and whatwg/html#12513, and ensures that TAO opt-ins for navigation timing take the destination origin into account. New iframe tests, plus test progressions. WebKit-Bug: https://bugs.webkit.org/show_bug.cgi?id=316647 WebKit-Canonical-Link: https://commits.webkit.org/317061main -- wpt-commits: 6662bb5ac7dfcf0b31d010d7f402360e00cbf0e3 wpt-pr: 64599 UltraBlame original commit: 60b9f2299b1e1102d2e9d99367f2238f5204e19e
…/show_bug.cgi?id=316647, a=testonly Automatic update from web-platform-tests Navigation Timing: cross-origin redirect opt-in should be based on destination origin. This PR aligns the WebKit implementation with whatwg/fetch#1931 and whatwg/html#12513, and ensures that TAO opt-ins for navigation timing take the destination origin into account. New iframe tests, plus test progressions. WebKit-Bug: https://bugs.webkit.org/show_bug.cgi?id=316647 WebKit-Canonical-Link: https://commits.webkit.org/317061main -- wpt-commits: 5a686a30bc8638de1a161d781e4234a661116879 wpt-pr: 64618 UltraBlame original commit: d061e4b754b982c689b5a94599eea146292b0e53
…/show_bug.cgi?id=316647, a=testonly Automatic update from web-platform-tests Navigation Timing: cross-origin redirect opt-in should be based on destination origin. This PR aligns the WebKit implementation with whatwg/fetch#1931 and whatwg/html#12513, and ensures that TAO opt-ins for navigation timing take the destination origin into account. New iframe tests, plus test progressions. WebKit-Bug: https://bugs.webkit.org/show_bug.cgi?id=316647 WebKit-Canonical-Link: https://commits.webkit.org/317061main -- wpt-commits: 6662bb5ac7dfcf0b31d010d7f402360e00cbf0e3 wpt-pr: 64599 UltraBlame original commit: 60b9f2299b1e1102d2e9d99367f2238f5204e19e
…/show_bug.cgi?id=316647, a=testonly Automatic update from web-platform-tests Navigation Timing: cross-origin redirect opt-in should be based on destination origin. This PR aligns the WebKit implementation with whatwg/fetch#1931 and whatwg/html#12513, and ensures that TAO opt-ins for navigation timing take the destination origin into account. New iframe tests, plus test progressions. WebKit-Bug: https://bugs.webkit.org/show_bug.cgi?id=316647 WebKit-Canonical-Link: https://commits.webkit.org/317061main -- wpt-commits: 5a686a30bc8638de1a161d781e4234a661116879 wpt-pr: 64618 UltraBlame original commit: d061e4b754b982c689b5a94599eea146292b0e53
As part of the WebPerfWG discussion, we aligned Fetch's TAO definition to opt-in to the destination origin for navigations: whatwg/fetch#1931
This PR implements the HTML parts of using these new algorithms in order to resolve w3c/navigation-timing#215.
(See WHATWG Working Mode: Changes for more details.)
/document-lifecycle.html ( diff )
/infrastructure.html ( diff )