Closed Bug 2094918 Opened 11 days ago Closed 9 days ago

[wpt-sync] Sync PR 65015 - [ResourceTiming] Gate static router info on the timing allow check

Categories

(Core :: DOM: Service Workers, task, P4)

task

Tracking

()

RESOLVED FIXED
163 Branch
Tracking Status
firefox163 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 65015 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/65015
Details from upstream follow.

Noam Rosenthal <nrosenthal@chromium.org> wrote:

[ResourceTiming] Gate static router info on the timing allow check

PerformanceResourceTiming exposed the Service Worker Static Routing
attributes (workerMatchedRouterSource / workerFinalRouterSource and
their legacy *SourceType aliases, also via toJSON()) without checking
the Timing-Allow-Origin result, and CreateResourceTimingInfo() copied
the router info onto opaque (non-TAO) entries.

Because the router info is only attached to the response head when a
head actually arrives, a page that registers a static route could tell,
for any cross-origin no-cors subresource, whether the network service
delivered an opaque response ("network") or terminated the load with a
network error (""), even though every TAO-gated field and the element's
own error event are identical.

Per Fetch's "create an opaque timing info", the router info is now only
copied when the timing allow check passed, and the getters (plus
workerRouterEvaluationStart / workerCacheLookupStart for consistency)
return the empty value when it failed. The static-router kCache
fetchStart() fallback to responseStart() is also limited to the TAO
passed case, since responseStart() is masked to 0 otherwise and
fetchStart would end up below startTime.

Bug: 581410303
Change-Id: I9aab13946678fd7aa9f623838be64a357b25e428
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8775876
Reviewed-by: Keita Suzuki \<suzukikeita@chromium.org>
Commit-Queue: Noam Rosenthal \<nrosenthal@google.com>
Cr-Commit-Position: refs/heads/main@{#1741545}

Component: web-platform-tests → DOM: Service Workers
Product: Testing → Core

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 1 tests and 16 subtests

Status Summary

Firefox

OK : 1
FAIL: 16

Chrome

OK : 1
PASS: 15
FAIL: 1

Safari

OK : 1
PASS: 15
FAIL: 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

Firefox-only Failures

  • /service-workers/service-worker/tentative/static-router/static-router-resource-timing.https.html [wpt.fyi]
    • Main resource matched the rule with fetch-event source: FAIL
    • Main resource load matched with the condition and resource timing: FAIL
    • Main resource load not matched with the condition and resource timing: FAIL
    • Main resource load matched with the cache source and resource timing: FAIL
    • Main resource fallback to the network when there is no cache entry and resource timing: FAIL
    • Subresource load matched the rule fetch-event source: FAIL
    • Subresource load not matched with URLPattern condition: FAIL
    • Subresource load matched with URLPattern condition: FAIL
    • Subresource load matched with the cache source rule: FAIL
    • Subresource load did not match with the cache and fallback to the network: FAIL
    • Cross-origin subresource with Timing-Allow-Origin exposes router source types: FAIL
    • Main resource load matched the rule with race-network-and-fetch-handler source, and the fetch handler response is faster than the server response: FAIL
    • Main resource load matched the rule with race-network-and-fetch-handler source, and the server reseponse is faster than the fetch handler: FAIL
    • Subresource load matched the rule with race-network-and-fetch-handler source, and the fetch handler response is faster than the server response: FAIL
    • Subresource load matched the rule with race-network-and-fetch-handler source, and the server reseponse is faster than the fetch handler: FAIL

New Tests That Don't Pass

  • /service-workers/service-worker/tentative/static-router/static-router-resource-timing.https.html [wpt.fyi]: OK [GitHub], SKIP [Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] (Chrome: OK, Safari: OK)
    • Main resource matched the rule with fetch-event source: FAIL (Chrome: PASS, Safari: PASS)
    • Main resource load matched with the condition and resource timing: FAIL (Chrome: PASS, Safari: PASS)
    • Main resource load not matched with the condition and resource timing: FAIL (Chrome: PASS, Safari: PASS)
    • Main resource load matched with the cache source and resource timing: FAIL (Chrome: PASS, Safari: PASS)
    • Main resource fallback to the network when there is no cache entry and resource timing: FAIL (Chrome: PASS, Safari: PASS)
    • Subresource load matched the rule fetch-event source: FAIL (Chrome: PASS, Safari: PASS)
    • Subresource load not matched with URLPattern condition: FAIL (Chrome: PASS, Safari: PASS)
    • Subresource load matched with URLPattern condition: FAIL (Chrome: PASS, Safari: PASS)
    • Subresource load matched with the cache source rule: FAIL (Chrome: PASS, Safari: PASS)
    • Subresource load did not match with the cache and fallback to the network: FAIL (Chrome: PASS, Safari: PASS)
    • Cross-origin subresource without Timing-Allow-Origin does not expose router source types: FAIL (Chrome: FAIL, Safari: FAIL)
    • Cross-origin subresource with Timing-Allow-Origin exposes router source types: FAIL (Chrome: PASS, Safari: PASS)
    • Main resource load matched the rule with race-network-and-fetch-handler source, and the fetch handler response is faster than the server response: FAIL (Chrome: PASS, Safari: PASS)
    • Main resource load matched the rule with race-network-and-fetch-handler source, and the server reseponse is faster than the fetch handler: FAIL (Chrome: PASS, Safari: PASS)
    • Subresource load matched the rule with race-network-and-fetch-handler source, and the fetch handler response is faster than the server response: FAIL (Chrome: PASS, Safari: PASS)
    • Subresource load matched the rule with race-network-and-fetch-handler source, and the server reseponse is faster than the fetch handler: FAIL (Chrome: PASS, Safari: PASS)

Tests Disabled in Gecko Infrastructure

Pushed by wptsync@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/62946e96d1a7 https://hg.mozilla.org/integration/autoland/rev/9e4038b5bea0 [wpt PR 65015] - [ResourceTiming] Gate static router info on the timing allow check, a=testonly
Status: NEW → RESOLVED
Closed: 9 days ago
Resolution: --- → FIXED
Target Milestone: --- → 163 Branch
You need to log in before you can comment on or make changes to this bug.