diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
commit | a90a5cba08fdf6c0ceb95101c275108a152a3aed (patch) | |
tree | 532507288f3defd7f4dcf1af49698bcb76034855 /layout/base/nsRefreshDriver.cpp | |
parent | Adding debian version 126.0.1-1. (diff) | |
download | firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip |
Merging upstream version 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; } |