commit bc28b38ab59b4e8cf29e674af8b39b711479e035
parent 6afa1531afef7e8383c4b74120c02d7c8e76c440
Author: Emilio Cobos Álvarez <emilio@crisal.io>
Date: Wed, 5 Nov 2025 10:08:33 +0000
Bug 1998218 - Call into paint even with null root frame. r=tnikkel
Follow-up to D271257. Tim's comment thee is right, technically the
previous patch changed behavior if somebody calls
PresShell::SetViewportCanvasBackground explicitly.
Allow passing a null root frame in that case.
Differential Revision: https://phabricator.services.mozilla.com/D271369
Diffstat:
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/dom/ipc/BrowserChild.cpp b/dom/ipc/BrowserChild.cpp
@@ -3063,9 +3063,12 @@ mozilla::ipc::IPCResult BrowserChild::RecvRenderLayers(const bool& aEnabled) {
presShell->SuppressDisplayport(true);
if (nsContentUtils::IsSafeToRunScript()) {
WebWidget()->PaintNowIfNeeded();
- } else if (nsIFrame* root = presShell->GetRootFrame()) {
- presShell->PaintAndRequestComposite(
- root, mPuppetWidget->GetWindowRenderer(), PaintFlags::None);
+ } else {
+ // NOTE: We want to call in even without a root frame (we might paint the
+ // canvas background in that case).
+ presShell->PaintAndRequestComposite(presShell->GetRootFrame(),
+ mPuppetWidget->GetWindowRenderer(),
+ PaintFlags::None);
}
presShell->SuppressDisplayport(false);
return IPC_OK();