diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
commit | 59203c63bb777a3bacec32fb8830fba33540e809 (patch) | |
tree | 58298e711c0ff0575818c30485b44a2f21bf28a0 /layout/base/nsRefreshDriver.cpp | |
parent | Adding upstream version 126.0.1. (diff) | |
download | firefox-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.cpp | 30 |
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; } |