Bug 1189622 part 1 - Ensure the in-fullscreen-change flag is set before calling the second phase.
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -6089,16 +6089,23 @@ nsGlobalWindow::SetFullscreenInternal(Fu
if (MakeWidgetFullscreen(this, aHMD, aReason, aFullScreen)) {
// The rest of code for switching fullscreen is in nsGlobalWindow::
// FinishFullscreenChange() which will be called after sizemodechange
// event is dispatched.
return NS_OK;
}
}
+ // If we didn't setup the widget, we may need to manually set this
+ // flag, or the assertion in FinishFullscreenChange is violated.
+ if (nsCOMPtr<nsIPresShell> presShell = mDocShell->GetPresShell()) {
+ if (!presShell->IsInFullscreenChange()) {
+ presShell->SetIsInFullscreenChange(true);
+ }
+ }
FinishFullscreenChange(aFullScreen);
return NS_OK;
}
void
nsGlobalWindow::SetWidgetFullscreen(FullscreenReason aReason, bool aIsFullscreen,
nsIWidget* aWidget, nsIScreen* aScreen)
{