summaryrefslogtreecommitdiffstats
path: root/layout/base/nsRefreshDriver.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
commit59203c63bb777a3bacec32fb8830fba33540e809 (patch)
tree58298e711c0ff0575818c30485b44a2f21bf28a0 /layout/base/nsRefreshDriver.cpp
parentAdding upstream version 126.0.1. (diff)
downloadfirefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz
firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/base/nsRefreshDriver.cpp')
-rw-r--r--layout/base/nsRefreshDriver.cpp30
1 files changed, 7 insertions, 23 deletions
diff --git a/layout/base/nsRefreshDriver.cpp b/layout/base/nsRefreshDriver.cpp
index 7885d6b8db..218d158a47 100644
--- a/layout/base/nsRefreshDriver.cpp
+++ b/layout/base/nsRefreshDriver.cpp
@@ -831,11 +831,11 @@ class VsyncRefreshDriverTimer : public RefreshDriverTimer {
const TimeDuration previousRate = mVsyncRate;
const TimeDuration rate = GetTimerRate();
- hal::PerformanceHintSession* const performanceHintSession =
- GetPerformanceHintSession();
- if (performanceHintSession && rate != previousRate) {
- performanceHintSession->UpdateTargetWorkDuration(
- ContentChild::GetPerformanceHintTarget(rate));
+ if (rate != previousRate) {
+ if (auto* const performanceHintSession = GetPerformanceHintSession()) {
+ performanceHintSession->UpdateTargetWorkDuration(
+ ContentChild::GetPerformanceHintTarget(rate));
+ }
}
if (TimeDuration::FromMilliseconds(nsRefreshDriver::DefaultInterval()) >
@@ -862,7 +862,7 @@ class VsyncRefreshDriverTimer : public RefreshDriverTimer {
TimeStamp tickEnd = TimeStamp::Now();
- if (performanceHintSession) {
+ if (auto* const performanceHintSession = GetPerformanceHintSession()) {
performanceHintSession->ReportActualWorkDuration(tickEnd - tickStart);
}
@@ -2228,23 +2228,7 @@ void nsRefreshDriver::RunFullscreenSteps() {
void nsRefreshDriver::UpdateIntersectionObservations(TimeStamp aNowTime) {
AUTO_PROFILER_LABEL_RELEVANT_FOR_JS("Compute intersections", LAYOUT);
-
- AutoTArray<RefPtr<Document>, 32> documents;
-
- if (mPresContext->Document()->HasIntersectionObservers()) {
- documents.AppendElement(mPresContext->Document());
- }
-
- mPresContext->Document()->CollectDescendantDocuments(
- documents, [](const Document* document) -> bool {
- return document->HasIntersectionObservers();
- });
-
- for (const auto& doc : documents) {
- doc->UpdateIntersectionObservations(aNowTime);
- doc->ScheduleIntersectionObserverNotification();
- }
-
+ mPresContext->Document()->UpdateIntersections(aNowTime);
mNeedToUpdateIntersectionObservations = false;
}