Bug 1722322 - Implement LargestContentfulPaint r=emilio

Spec: https://w3c.github.io/largest-contentful-paint

Differential Revision: https://phabricator.services.mozilla.com/D151079
This commit is contained in:
Sean Feng
2023-11-02 17:04:47 +00:00
parent a048b4f7a6
commit cacfa492a8
30 changed files with 1079 additions and 52 deletions

View File

@@ -11,6 +11,8 @@
#include "Units.h"
#include "mozilla/dom/FontFaceSet.h"
#include "mozilla/dom/ElementBinding.h"
#include "mozilla/dom/LargestContentfulPaint.h"
#include "mozilla/dom/PerformanceMainThread.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/Attributes.h"
#include "mozilla/AutoRestore.h"
@@ -11839,6 +11841,13 @@ void PresShell::EndPaint() {
}
return CallState::Continue;
});
if (nsPresContext* presContext = GetPresContext()) {
if (PerformanceMainThread* perf =
presContext->GetPerformanceMainThread()) {
perf->FinalizeLCPEntriesForText();
}
}
}
}