tor-browser

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

commit 29fc55bd500c0c18f94dee84775c583fab74b8d6
parent 6250d3aebe7e91e633775f9dcdf59aefba263961
Author: Timothy Nikkel <tnikkel@gmail.com>
Date:   Sun, 23 Nov 2025 03:50:09 +0000

Bug 2001802. Ensure that DisablePartialUpdates gets cleared if we do a full rebuild. r=layout-reviewers,emilio

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

Diffstat:
Mlayout/base/nsLayoutUtils.cpp | 6++++++
Mlayout/painting/RetainedDisplayListBuilder.cpp | 18+++++++++---------
2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp @@ -3084,6 +3084,12 @@ void nsLayoutUtils::PaintFrame(gfxContext* aRenderingContext, nsIFrame* aFrame, DL_LOGI("Partial updates are disabled"); metrics->mPartialUpdateResult = PartialUpdateResult::Failed; metrics->mPartialUpdateFailReason = PartialUpdateFailReason::Disabled; + + // Now that we've decided to do a full rebuild make sure to clear the + // disable partial updates bool so that we can maybe attempt a partial + // update on the paint after this one (if it doesn't get disabled again + // during this paint). + builder->SetDisablePartialUpdates(false); } // Rebuild the full display list if the partial display list build failed. diff --git a/layout/painting/RetainedDisplayListBuilder.cpp b/layout/painting/RetainedDisplayListBuilder.cpp @@ -1265,6 +1265,15 @@ bool RetainedDisplayListBuilder::ComputeRebuildRegion( bool RetainedDisplayListBuilder::ShouldBuildPartial( nsTArray<nsIFrame*>& aModifiedFrames) { + // We don't support retaining with overlay scrollbars, since they require + // us to look at the display list and pick the highest z-index, which + // we can't do during partial building. + if (mBuilder.DisablePartialUpdates()) { + mBuilder.SetDisablePartialUpdates(false); + Metrics()->mPartialUpdateFailReason = PartialUpdateFailReason::Disabled; + return false; + } + if (mList.IsEmpty()) { // Partial builds without a previous display list do not make sense. Metrics()->mPartialUpdateFailReason = PartialUpdateFailReason::EmptyList; @@ -1278,15 +1287,6 @@ bool RetainedDisplayListBuilder::ShouldBuildPartial( return false; } - // We don't support retaining with overlay scrollbars, since they require - // us to look at the display list and pick the highest z-index, which - // we can't do during partial building. - if (mBuilder.DisablePartialUpdates()) { - mBuilder.SetDisablePartialUpdates(false); - Metrics()->mPartialUpdateFailReason = PartialUpdateFailReason::Disabled; - return false; - } - for (nsIFrame* f : aModifiedFrames) { MOZ_ASSERT(f);