Navigation Timing: cross-origin redirect opt-in should be based on destination origin. - #66762
Conversation
|
EWS run on previous version of this PR (hash 90a077f) Details |
90a077f to
c517be0
Compare
|
EWS run on previous version of this PR (hash c517be0) Details |
c517be0 to
4e478b0
Compare
|
EWS run on previous version of this PR (hash 4e478b0) Details |
4e478b0 to
5283d7b
Compare
|
EWS run on previous version of this PR (hash 5283d7b) Details |
5283d7b to
5146fa2
Compare
|
EWS run on previous version of this PR (hash 5146fa2) Details |
5146fa2 to
16437fa
Compare
|
EWS run on previous version of this PR (hash 16437fa) Details |
macOS Safer C++ Build #116919 (16437fa)❌ Found 304 failing files with 230 issues. Please address these issues before landing. See WebKit Guidelines for Safer C++ Programming. |
|
EWS run on previous version of this PR (hash 212247d) Details |
| @@ -237,6 +240,10 @@ ResourceError NetworkLoadChecker::validateResponse(const ResourceRequest& reques | |||
| response.setDeprecatedNetworkLoadMetrics(WTF::move(metrics)); | |||
| } | |||
| } | |||
|
|
|||
| // https://fetch.spec.whatwg.org/#navigation-tao-check | |||
| if (m_options.mode == FetchOptions::Mode::Navigate && !response.isRedirection()) | |||
There was a problem hiding this comment.
Are iframe navigations covered in the tests? Would iframe navigations need to TAO the main frame origin or just the origin the iframe is navigating to?
There was a problem hiding this comment.
The origin of the iframe it's navigating to, as the top-level origin has no access to the information exposed in the iframe (without active collaboration).
03ff248 to
dd03cc3
Compare
|
EWS run on previous version of this PR (hash dd03cc3) Details |
dd03cc3 to
5d0fda0
Compare
|
EWS run on previous version of this PR (hash 5d0fda0) Details |
| @@ -134,7 +141,7 @@ double PerformanceResourceTiming::redirectStart() const | |||
|
|
|||
| double PerformanceResourceTiming::redirectEnd() const | |||
| { | |||
| if (m_resourceTiming.networkLoadMetrics().failsTAOCheck) | |||
| if (!shouldExposeRedirectTiming()) | |||
There was a problem hiding this comment.
The shouldExposeRedirectTiming changes look unnecessary now. We already check failsTAOCheck and redirectCount. It seems like the only change needed is adding a redirectCount check in WebCore::fetchStart
There was a problem hiding this comment.
It seems like we don't reset redirectCount for subresources that don't pass TAO check, and doing so is a behavior change for resource timing.
5d0fda0 to
75e1879
Compare
|
EWS run on previous version of this PR (hash 75e1879) Details |
75e1879 to
6559937
Compare
|
EWS run on current version of this PR (hash 6559937) Details |
6559937 to
08a9b91
Compare
…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
08a9b91 to
0df60f4
Compare
|
Committed 317061@main (0df60f4): https://commits.webkit.org/317061@main Reviewed commits have been landed. Closing PR #66762 and removing active labels. |
🧪 api-mac
0df60f4
6559937