Skip to content

Speculation Rules: implement Navigation Timing's deliveryType#52200

Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
yoavweiss:specrules_delivery_type
Nov 25, 2025
Merged

Speculation Rules: implement Navigation Timing's deliveryType#52200
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
yoavweiss:specrules_delivery_type

Conversation

@yoavweiss
Copy link
Contributor

@yoavweiss yoavweiss commented Oct 12, 2025

f009b61

Speculation Rules: implement Navigation Timing's deliveryType
https://bugs.webkit.org/show_bug.cgi?id=300586

Reviewed by Alex Christensen.

This PR exposes the `deliveryType` attribute on Resource Timing, with an empty string value in most cases.
It then sets that value to "navigational-prefetch" for prefetched documents, exposed in their navigation timing entries.

No new tests, but existing test expectations progress.

* LayoutTests/imported/w3c/web-platform-tests/resource-timing/idlharness.any-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/resource-timing/idlharness.any.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/speculation-rules/prefetch/navigation-timing-delivery-type.https_prefetch=false&bypass_cache=false-expected.txt: Progression.
* LayoutTests/imported/w3c/web-platform-tests/speculation-rules/prefetch/navigation-timing-delivery-type.https_prefetch=false&bypass_cache=true-expected.txt: Progression.
* LayoutTests/imported/w3c/web-platform-tests/speculation-rules/prefetch/navigation-timing-delivery-type.https_prefetch=true&bypass_cache=false-expected.txt: Progression.
* LayoutTests/imported/w3c/web-platform-tests/speculation-rules/prefetch/navigation-timing-delivery-type.https_prefetch=true&bypass_cache=true-expected.txt: Progression.
* LayoutTests/imported/w3c/web-platform-tests/speculation-rules/prefetch/prefetch-uses-cache.sub.https_cross-site-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/speculation-rules/prefetch/prefetch-uses-cache.sub.https_same-site-expected.txt:
* Source/WebCore/loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::notifyFinished): Set the `fromPrefetch` parameter on metrics that come from a prefetched resource.
(WebCore::DocumentLoader::commitData): Set the `fromPrefetch` parameter on metrics where there's an in-flight prefetch with the same URL.
* Source/WebCore/loader/DocumentPrefetcher.cpp:
(WebCore::DocumentPrefetcher::wasPrefetched const): Returns true if there's an in-flight prefetch with that URL.
(WebCore::DocumentPrefetcher::takePrefetchedNetworkLoadMetrics):
* Source/WebCore/loader/DocumentPrefetcher.h:
* Source/WebCore/loader/ResourceTiming.h:
(WebCore::ResourceTiming::deliveryType const): Getter.
* Source/WebCore/page/PerformanceResourceTiming.h:
(WebCore::PerformanceResourceTiming::deliveryType const):
(WebCore::PerformanceResourceTiming::resourceTiming):
* Source/WebCore/page/PerformanceResourceTiming.idl: Add the deliveryType attribute.
* Source/WebCore/platform/network/NetworkLoadMetrics.cpp:
(WebCore::NetworkLoadMetrics::NetworkLoadMetrics): Initialize fromPrefetch.
(WebCore::NetworkLoadMetrics::isolatedCopy const): Copy fromPrefetch.
* Source/WebCore/platform/network/NetworkLoadMetrics.h:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:

Canonical link: https://commits.webkit.org/303527@main

50c492c

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ✅ 🧪 win-tests
✅ 🧪 webkitperl 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
🧪 ios-wk2-wpt ✅ 🧪 api-mac-debug ✅ 🛠 wpe-cairo
✅ 🧪 api-ios ✅ 🧪 mac-wk1 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-wk2 ❌ 🧪 gtk-wk2
✅ 🛠 vision-sim ❌ 🧪 mac-AS-debug-wk2 ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-wk2-stress ✅ 🛠 playstation
✅ 🛠 tv ✅ 🧪 mac-intel-wk2
✅ 🛠 tv-sim ✅ 🛠 mac-safer-cpp
✅ 🛠 watch
✅ 🛠 watch-sim

@yoavweiss yoavweiss requested a review from cdumez as a code owner October 12, 2025 16:53
@yoavweiss yoavweiss self-assigned this Oct 12, 2025
@yoavweiss yoavweiss added the New Bugs Unclassified bugs are placed in this component until the correct component can be determined. label Oct 12, 2025
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Oct 12, 2025
@yoavweiss yoavweiss removed the merging-blocked Applied to prevent a change from being merged label Oct 13, 2025
@yoavweiss yoavweiss force-pushed the specrules_delivery_type branch from 34781c5 to de3f9c2 Compare October 13, 2025 06:44
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Oct 13, 2025
@yoavweiss yoavweiss removed the merging-blocked Applied to prevent a change from being merged label Oct 13, 2025
@yoavweiss yoavweiss force-pushed the specrules_delivery_type branch from de3f9c2 to d04e70a Compare October 13, 2025 20:51
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Oct 14, 2025
@yoavweiss yoavweiss removed the merging-blocked Applied to prevent a change from being merged label Nov 3, 2025
@yoavweiss yoavweiss force-pushed the specrules_delivery_type branch from d04e70a to f770d31 Compare November 3, 2025 13:19
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Nov 3, 2025
@yoavweiss yoavweiss removed the merging-blocked Applied to prevent a change from being merged label Nov 6, 2025
@yoavweiss yoavweiss force-pushed the specrules_delivery_type branch from f770d31 to 63cfeff Compare November 6, 2025 20:01
@yoavweiss yoavweiss force-pushed the specrules_delivery_type branch from 63cfeff to 782d1a2 Compare November 6, 2025 20:23
@yoavweiss yoavweiss added the safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks label Nov 6, 2025
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Nov 7, 2025
@yoavweiss yoavweiss removed the merging-blocked Applied to prevent a change from being merged label Nov 25, 2025
@yoavweiss yoavweiss force-pushed the specrules_delivery_type branch from 782d1a2 to 50c492c Compare November 25, 2025 04:48
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Nov 25, 2025
@yoavweiss yoavweiss added merge-queue Applied to send a pull request to merge-queue and removed merging-blocked Applied to prevent a change from being merged safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks labels Nov 25, 2025
@yoavweiss
Copy link
Contributor Author

Merging as the test failures seem random and unrelated

https://bugs.webkit.org/show_bug.cgi?id=300586

Reviewed by Alex Christensen.

This PR exposes the `deliveryType` attribute on Resource Timing, with an empty string value in most cases.
It then sets that value to "navigational-prefetch" for prefetched documents, exposed in their navigation timing entries.

No new tests, but existing test expectations progress.

* LayoutTests/imported/w3c/web-platform-tests/resource-timing/idlharness.any-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/resource-timing/idlharness.any.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/speculation-rules/prefetch/navigation-timing-delivery-type.https_prefetch=false&bypass_cache=false-expected.txt: Progression.
* LayoutTests/imported/w3c/web-platform-tests/speculation-rules/prefetch/navigation-timing-delivery-type.https_prefetch=false&bypass_cache=true-expected.txt: Progression.
* LayoutTests/imported/w3c/web-platform-tests/speculation-rules/prefetch/navigation-timing-delivery-type.https_prefetch=true&bypass_cache=false-expected.txt: Progression.
* LayoutTests/imported/w3c/web-platform-tests/speculation-rules/prefetch/navigation-timing-delivery-type.https_prefetch=true&bypass_cache=true-expected.txt: Progression.
* LayoutTests/imported/w3c/web-platform-tests/speculation-rules/prefetch/prefetch-uses-cache.sub.https_cross-site-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/speculation-rules/prefetch/prefetch-uses-cache.sub.https_same-site-expected.txt:
* Source/WebCore/loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::notifyFinished): Set the `fromPrefetch` parameter on metrics that come from a prefetched resource.
(WebCore::DocumentLoader::commitData): Set the `fromPrefetch` parameter on metrics where there's an in-flight prefetch with the same URL.
* Source/WebCore/loader/DocumentPrefetcher.cpp:
(WebCore::DocumentPrefetcher::wasPrefetched const): Returns true if there's an in-flight prefetch with that URL.
(WebCore::DocumentPrefetcher::takePrefetchedNetworkLoadMetrics):
* Source/WebCore/loader/DocumentPrefetcher.h:
* Source/WebCore/loader/ResourceTiming.h:
(WebCore::ResourceTiming::deliveryType const): Getter.
* Source/WebCore/page/PerformanceResourceTiming.h:
(WebCore::PerformanceResourceTiming::deliveryType const):
(WebCore::PerformanceResourceTiming::resourceTiming):
* Source/WebCore/page/PerformanceResourceTiming.idl: Add the deliveryType attribute.
* Source/WebCore/platform/network/NetworkLoadMetrics.cpp:
(WebCore::NetworkLoadMetrics::NetworkLoadMetrics): Initialize fromPrefetch.
(WebCore::NetworkLoadMetrics::isolatedCopy const): Copy fromPrefetch.
* Source/WebCore/platform/network/NetworkLoadMetrics.h:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:

Canonical link: https://commits.webkit.org/303527@main
@webkit-commit-queue
Copy link
Collaborator

Committed 303527@main (f009b61): https://commits.webkit.org/303527@main

Reviewed commits have been landed. Closing PR #52200 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit f009b61 into WebKit:main Nov 25, 2025
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New Bugs Unclassified bugs are placed in this component until the correct component can be determined.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants