File mozilla-fullscreen_part_1.patch of Package MozillaFirefox.3830

# HG changeset patch
# Parent  9878301a5f4f323fac4791bf76b9d86bbed6907d
bsc#992549, merged in FF46

mozilla-release:
changeset:   316475:f521bf0274c7
user:        Xidorn Quan <quanxunzhen@gmail.com>
date:        Tue Jan 12 15:18:47 2016 +1100
files:       dom/base/nsGlobalWindow.cpp
description:
Bug 1189622 part 1 - Ensure the in-fullscreen-change flag is set before calling the second phase. r=smaug

diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -6084,16 +6084,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)
 {