tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit d25f8b37f4b35f44f5eb378e454f8de716f581ed
parent 139b833802a0327a6404a6cda9313b6b8b5e245b
Author: Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
Date:   Thu, 20 Nov 2025 06:27:50 +0000

Bug 1995803 - Stop doing `IsResolutionUpdated()` check assertion in a full transaction when clearing pending scroll updates. r=tnikkel,layout-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D273330

Diffstat:
Mgfx/layers/wr/WebRenderLayerManager.cpp | 16++++++----------
Mgfx/layers/wr/WebRenderLayerManager.h | 3+--
Mlayout/base/nsLayoutUtils.cpp | 7+++++++
Mlayout/base/nsLayoutUtils.h | 6++++++
4 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/gfx/layers/wr/WebRenderLayerManager.cpp b/gfx/layers/wr/WebRenderLayerManager.cpp @@ -420,10 +420,7 @@ void WebRenderLayerManager::EndTransactionWithoutLayer( // Since we're sending a full mScrollData that will include the new scroll // offsets, and we can throw away the pending scroll updates we had kept for // an empty transaction. - auto scrollIdsUpdated = ClearPendingScrollInfoUpdate(); - for (ScrollableLayerGuid::ViewID update : scrollIdsUpdated) { - nsLayoutUtils::NotifyPaintSkipTransaction(update); - } + ClearAndNotifyOfFullTransactionPendingScrollInfoUpdate(); // Don't block on hidden windows on Linux as it may block all rendering. const bool throttle = mWidget->IsMapped() && !aRenderOffscreen; @@ -823,13 +820,12 @@ UniquePtr<LayerUserData> WebRenderLayerManager::RemoveUserData(void* aKey) { return d; } -std::unordered_set<ScrollableLayerGuid::ViewID> -WebRenderLayerManager::ClearPendingScrollInfoUpdate() { - std::unordered_set<ScrollableLayerGuid::ViewID> scrollIds( - mPendingScrollUpdates.Keys().cbegin(), - mPendingScrollUpdates.Keys().cend()); +void WebRenderLayerManager:: + ClearAndNotifyOfFullTransactionPendingScrollInfoUpdate() { + for (ScrollableLayerGuid::ViewID update : mPendingScrollUpdates.Keys()) { + nsLayoutUtils::NotifyApzTransaction(update); + } mPendingScrollUpdates.Clear(); - return scrollIds; } bool WebRenderLayerManager::AddPendingScrollUpdateForNextTransaction( diff --git a/gfx/layers/wr/WebRenderLayerManager.h b/gfx/layers/wr/WebRenderLayerManager.h @@ -206,8 +206,7 @@ class WebRenderLayerManager final : public WindowRenderer { mUserData.Get(static_cast<gfx::UserDataKey*>(aKey))); } - std::unordered_set<ScrollableLayerGuid::ViewID> - ClearPendingScrollInfoUpdate(); + void ClearAndNotifyOfFullTransactionPendingScrollInfoUpdate(); #ifdef DEBUG gfxContext* GetTarget() const { return mTarget; } diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp @@ -781,6 +781,13 @@ void nsLayoutUtils::NotifyPaintSkipTransaction(ViewID aScrollId) { } } +void nsLayoutUtils::NotifyApzTransaction(ViewID aScrollId) { + if (ScrollContainerFrame* sf = + nsLayoutUtils::FindScrollContainerFrameFor(aScrollId)) { + sf->NotifyApzTransaction(); + } +} + nsContainerFrame* nsLayoutUtils::LastContinuationWithChild( nsContainerFrame* aFrame) { MOZ_ASSERT(aFrame, "NULL frame pointer"); diff --git a/layout/base/nsLayoutUtils.h b/layout/base/nsLayoutUtils.h @@ -249,6 +249,12 @@ class nsLayoutUtils { static void NotifyPaintSkipTransaction(ViewID aScrollId); /** + * Similar to above NotifyPaintSkipTransaction, but scroll offset is being + * sent to APZ in a full transaction. + */ + static void NotifyApzTransaction(ViewID aScrollId); + + /** * Use heuristics to figure out the child list that * aChildFrame is currently in. */