Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(725)

Unified Diff: third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.cpp

Issue 2710623002: Enforce FirstContentfulPaint <= FirstMeaningfulPaint (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetectorTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.cpp
diff --git a/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.cpp b/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.cpp
index 5b52320b918b4e7a613936f0899f21c255453a3b..9fca4136977ee48f1cbc383fcf7596b21f0748de 100644
--- a/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.cpp
+++ b/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.cpp
@@ -122,8 +122,12 @@ void FirstMeaningfulPaintDetector::networkStableTimerFired(TimerBase*) {
!m_paintTiming->firstContentfulPaint())
return;
- if (m_provisionalFirstMeaningfulPaint)
- m_paintTiming->setFirstMeaningfulPaint(m_provisionalFirstMeaningfulPaint);
+ if (m_provisionalFirstMeaningfulPaint) {
+ // Enforce FirstContentfulPaint <= FirstMeaningfulPaint.
+ double timestamp = std::max(m_provisionalFirstMeaningfulPaint,
+ m_paintTiming->firstContentfulPaint());
+ m_paintTiming->setFirstMeaningfulPaint(timestamp);
+ }
m_state = Reported;
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetectorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698