commit fe854316afdeb03d39a09b5061f00ed0047d6a0e
parent 229c3c661faedcfa091da4f73c1425d0101bae71
Author: Nazım Can Altınova <canaltinova@gmail.com>
Date: Tue, 7 Oct 2025 20:06:26 +0000
Bug 1991587 - Use consistent timestamp for FCP and LCP entries r=jlink,smaug
FCP and LCP were using different timestamps for the same paint. FCP used
`RefreshDriver()->MostRecentRefresh()` (tick start time) while LCP used
`TimeStamp::Now()` captured in the function, causing LCP to be reported
differently compared to FCP.
Both metrics now capture `TimeStamp::Now()` once and share it. This matches
the Paint Timing spec which says to capture "rendering update end time"
when mark paint timing runs, not reuse the tick start timestamp:
https://w3c.github.io/paint-timing/#mark-paint-timing
Differential Revision: https://phabricator.services.mozilla.com/D267757
Diffstat:
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp
@@ -2760,7 +2760,7 @@ void nsPresContext::NotifyContentfulPaint() {
"We should only notify contentful paint during refresh "
"driver ticks");
if (!perf->HadFCPTimingEntry()) {
- TimeStamp nowTime = rootPresContext->RefreshDriver()->MostRecentRefresh();
+ TimeStamp nowTime = mMarkPaintTimingStart;
MOZ_ASSERT(!nowTime.IsNull(),
"Most recent refresh timestamp should exist since we are in "
"a refresh driver tick");
diff --git a/testing/web-platform/meta/largest-contentful-paint/first-paint-equals-lcp-text.html.ini b/testing/web-platform/meta/largest-contentful-paint/first-paint-equals-lcp-text.html.ini
@@ -1,5 +0,0 @@
-[first-paint-equals-lcp-text.html]
- expected:
- if (os == "android") and fission: [OK, TIMEOUT]
- [FCP and LCP are the same when there is a single text element in the page.]
- expected: FAIL