From 50965fb22347a255996efa3fa84f96dbe6a49be4 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Wed, 4 May 2022 17:24:10 +0000 Subject: [PATCH] No issue - Align our resource timing with the updated Fetch spec. This makes FetchStart use StartTime() when the TAO check fails for PerformanceResourceTiming Given the recent Fetch spec updates, Step 8.1 in https://fetch.spec.whatwg.org/#finalize-and-report-timing specifies that start time(StartTime) and post-redirect start time(FetchStart) should be start time when the TAO check fails. --- dom/performance/PerformanceResourceTiming.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dom/performance/PerformanceResourceTiming.h b/dom/performance/PerformanceResourceTiming.h index 61ad8f0c65..b4775d4322 100644 --- a/dom/performance/PerformanceResourceTiming.h +++ b/dom/performance/PerformanceResourceTiming.h @@ -69,9 +69,12 @@ public: } DOMHighResTimeStamp FetchStart() const { - return mTiming + if (mTiming) { + return mTiming->TimingAllowed() ? mTiming->FetchStartHighRes() - : 0; + : StartTime(); + } + return 0; } DOMHighResTimeStamp RedirectStart() const {