commit 629ba9fbd736e50ece755fcda4212db11650f80c
parent e4cfc7d3e0b15330d8ee87620d8bb3597e7d8ac5
Author: Timothy Nikkel <tnikkel@gmail.com>
Date: Sun, 23 Nov 2025 05:52:39 +0200
Bug 2001802. Ensure that DisablePartialUpdates gets cleared if we do a full rebuild. r?#layout-reviewers,#gfx-reviewers DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D273718
Diffstat:
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);