Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: fed984d0feb9b3773d13dfa6270fde810f980994
      
https://github.com/WebKit/WebKit/commit/fed984d0feb9b3773d13dfa6270fde810f980994
  Author: Yoav Weiss <[email protected]>
  Date:   2025-10-13 (Mon, 13 Oct 2025)

  Changed paths:
    M LayoutTests/TestExpectations
    M 
LayoutTests/imported/w3c/web-platform-tests/speculation-rules/prefetch/navigation-timing-requestStart-responseStart.https_include=waitingForRedirect-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/speculation-rules/prefetch/navigation-timing-requestStart-responseStart.https_include=waitingForResponse-expected.txt
    M Source/WebCore/loader/DocumentLoader.cpp
    M Source/WebCore/loader/DocumentPrefetcher.cpp
    M Source/WebCore/loader/ResourceLoaderOptions.h
    M Source/WebCore/loader/cache/CachedResource.cpp
    M Source/WebCore/loader/cache/CachedResource.h
    M Source/WebCore/loader/cache/CachedResourceLoader.cpp
    M Source/WebCore/loader/cache/CachedResourceRequest.h
    M Source/WebCore/page/PerformanceResourceTiming.cpp
    M Source/WebCore/platform/network/CacheValidation.cpp

  Log Message:
  -----------
  Speculation Rules: Fix waitForResponse test scenarios
https://bugs.webkit.org/show_bug.cgi?id=300582

Reviewed by Alex Christensen.

The navigation-timing waitForResponse and waitForRedirect tests are testing two 
different things:
(1) That prefetch is working correctly when the prefetched response starts 
arriving after the navigation to that response.
(2) That when that happens, the navigation timing values for responseStart and 
requestStart are correct.

Fixing (1) required avoiding canceling loaders for prefetch resources when 
navigating.
Fixing (2) required making sure that the navigation timing values cannot be 
negative (relative to the current document's timeOrigin).

No new tests, but this adjusts existing test expectations.

* LayoutTests/TestExpectations: Remove skipping of the navigation-timing tests.
* 
LayoutTests/imported/w3c/web-platform-tests/speculation-rules/prefetch/navigation-timing-requestStart-responseStart.https_include=waitingForRedirect-expected.txt:
 Progression.
* 
LayoutTests/imported/w3c/web-platform-tests/speculation-rules/prefetch/navigation-timing-requestStart-responseStart.https_include=waitingForResponse-expected.txt:
 Progression.
* Source/WebCore/loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::stopLoadingSubresources): Don't stop prefetch 
resource loaders.
(WebCore::DocumentLoader::loadMainResource): Rename to 
AllowCachingMainResourcePrefetch.
(WebCore::DocumentLoader::cancelMainResourceLoad): Don't cancel a main resource 
prefetch.
* Source/WebCore/loader/DocumentPrefetcher.cpp:
(WebCore::DocumentPrefetcher::prefetch): Rename to 
AllowCachingMainResourcePrefetch.
* Source/WebCore/loader/ResourceLoaderOptions.h:
* Source/WebCore/loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource): Rename to 
AllowCachingMainResourcePrefetch.
(WebCore::CachedResource::addClientToSet): Rename to 
AllowCachingMainResourcePrefetch.
* Source/WebCore/loader/cache/CachedResource.h:
(WebCore::CachedResource::allowsCaching const):
* Source/WebCore/loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest): 
Rename to AllowCachingMainResourcePrefetch.
(WebCore::isResourceSuitableForDirectReuse): Rename to 
AllowCachingMainResourcePrefetch.
(WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest): Rename 
to AllowCachingMainResourcePrefetch.
(WebCore::mustReloadFromServiceWorkerOptions): Rename to 
AllowCachingMainResourcePrefetch.
(WebCore::CachedResourceLoader::determineRevalidationPolicy const): Rename to 
AllowCachingMainResourcePrefetch.
* Source/WebCore/loader/cache/CachedResourceRequest.h:
(WebCore::CachedResourceRequest::allowsCaching const): Rename to 
AllowCachingMainResourcePrefetch.
* Source/WebCore/page/PerformanceResourceTiming.cpp:
(WebCore::networkLoadTimeToDOMHighResTimeStamp): Return 0.0 instead of a 
negative timestamp.
* Source/WebCore/platform/network/CacheValidation.cpp:
(WebCore::updateRedirectChainStatus): Rename to 
AllowCachingMainResourcePrefetch.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to