diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index de4eeafc93de..0ef9e4cc465b 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -6094,6 +6094,13 @@ nsGlobalWindow::SetFullscreenInternal(FullscreenReason aReason, } } + // If we didn't setup the widget, we may need to manually set this + // flag, or the assertion in FinishFullscreenChange is violated. + if (nsCOMPtr presShell = mDocShell->GetPresShell()) { + if (!presShell->IsInFullscreenChange()) { + presShell->SetIsInFullscreenChange(true); + } + } FinishFullscreenChange(aFullScreen); return NS_OK; }