Backed out 4 changesets (bug 1160014) for M2 bustages CLOSED TREE
authorNigel Babu <nigelbabu@gmail.com>
Sat, 11 Jul 2015 10:49:25 +0530
changeset 252477 7ab0df390753c1be668ca0491651722b36cec85d
parent 252476 836d79194ff1bd3789b8d5a05af8ab858db20d58
child 252478 30da8d4a3ba54e9827355904a26535c2c18df6a4
push id29035
push usercbook@mozilla.com
push dateMon, 13 Jul 2015 09:52:17 +0000
treeherdermozilla-central@38d03bf4616e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1160014
milestone42.0a1
backs out87b00a9dac95f6503a5f59124ee96ec050538d2e
d4fa5c794e08bcef55b9ca2886e8c21f2456fe37
fca26897d5349472296d9c35207df6e0ce9521cf
b0b7f4f09ed2caa64e163cb4d3945c31bbf866dc
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 4 changesets (bug 1160014) for M2 bustages CLOSED TREE Backed out changeset 87b00a9dac95 (bug 1160014) Backed out changeset d4fa5c794e08 (bug 1160014) Backed out changeset fca26897d534 (bug 1160014) Backed out changeset b0b7f4f09ed2 (bug 1160014)
browser/base/content/browser-fullScreen.js
browser/base/content/tab-content.js
browser/base/content/test/general/browser_domFullscreen_fullscreenMode.js
browser/base/content/test/general/test_contextmenu.html
dom/base/nsGlobalWindow.cpp
dom/base/nsGlobalWindow.h
dom/html/test/test_fullscreen-api.html
dom/tests/mochitest/chrome/test_MozDomFullscreen_event.xul
dom/tests/mochitest/pointerlock/test_pointerlock-api.html
modules/libpref/init/all.js
widget/cocoa/nsCocoaWindow.h
widget/cocoa/nsCocoaWindow.mm
widget/nsBaseWidget.cpp
widget/nsBaseWidget.h
widget/nsIWidget.h
widget/windows/nsWindow.cpp
widget/windows/nsWindow.h
widget/windows/nsWindowDefs.h
--- a/browser/base/content/browser-fullScreen.js
+++ b/browser/base/content/browser-fullScreen.js
@@ -3,17 +3,16 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 var FullScreen = {
   _MESSAGES: [
     "DOMFullscreen:Request",
     "DOMFullscreen:NewOrigin",
     "DOMFullscreen:Exit",
-    "DOMFullscreen:Painted",
   ],
 
   init: function() {
     // called when we go into full screen, even if initiated by a web page script
     window.addEventListener("fullscreen", this, true);
     window.addEventListener("MozDOMFullscreen:Entered", this,
                             /* useCapture */ true,
                             /* wantsUntrusted */ false);
@@ -162,20 +161,16 @@ var FullScreen = {
       case "DOMFullscreen:NewOrigin": {
         this.showWarning(aMessage.data.originNoSuffix);
         break;
       }
       case "DOMFullscreen:Exit": {
         this._windowUtils.remoteFrameFullscreenReverted();
         break;
       }
-      case "DOMFullscreen:Painted": {
-        Services.obs.notifyObservers(window, "fullscreen-painted", "");
-        break;
-      }
     }
   },
 
   enterDomFullscreen : function(aBrowser) {
     if (!document.mozFullScreen)
       return false;
 
     // If we've received a fullscreen notification, we have to ensure that the
--- a/browser/base/content/tab-content.js
+++ b/browser/base/content/tab-content.js
@@ -619,20 +619,18 @@ if (Services.appinfo.processType == Serv
 let DOMFullscreenHandler = {
   _fullscreenDoc: null,
 
   init: function() {
     addMessageListener("DOMFullscreen:Entered", this);
     addMessageListener("DOMFullscreen:Approved", this);
     addMessageListener("DOMFullscreen:CleanUp", this);
     addEventListener("MozDOMFullscreen:Request", this);
-    addEventListener("MozDOMFullscreen:Entered", this);
     addEventListener("MozDOMFullscreen:NewOrigin", this);
     addEventListener("MozDOMFullscreen:Exit", this);
-    addEventListener("MozDOMFullscreen:Exited", this);
   },
 
   get _windowUtils() {
     return content.QueryInterface(Ci.nsIInterfaceRequestor)
                   .getInterface(Ci.nsIDOMWindowUtils);
   },
 
   receiveMessage: function(aMessage) {
@@ -675,22 +673,12 @@ let DOMFullscreenHandler = {
           originNoSuffix: this._fullscreenDoc.nodePrincipal.originNoSuffix,
         });
         break;
       }
       case "MozDOMFullscreen:Exit": {
         sendAsyncMessage("DOMFullscreen:Exit");
         break;
       }
-      case "MozDOMFullscreen:Entered":
-      case "MozDOMFullscreen:Exited": {
-        addEventListener("MozAfterPaint", this);
-        break;
-      }
-      case "MozAfterPaint": {
-        removeEventListener("MozAfterPaint", this);
-        sendAsyncMessage("DOMFullscreen:Painted");
-        break;
-      }
     }
   }
 };
 DOMFullscreenHandler.init();
--- a/browser/base/content/test/general/browser_domFullscreen_fullscreenMode.js
+++ b/browser/base/content/test/general/browser_domFullscreen_fullscreenMode.js
@@ -116,20 +116,16 @@ let gTests = [
     affectsFullscreenMode: true,
     exitFunc: function () {
       executeSoon(() => EventUtils.synthesizeKey("VK_F11", {}));
     }
   }
 ];
 
 add_task(function* () {
-  yield pushPrefs(
-    ["full-screen-api.transition-duration.enter", "0 0"],
-    ["full-screen-api.transition-duration.leave", "0 0"]);
-
   let tab = gBrowser.addTab("about:robots");
   let browser = tab.linkedBrowser;
   gBrowser.selectedTab = tab;
   yield waitForDocLoadComplete();
 
   registerCleanupFunction(() => {
     if (browser.contentWindow.fullScreen) {
       BrowserFullScreen();
--- a/browser/base/content/test/general/test_contextmenu.html
+++ b/browser/base/content/test/general/test_contextmenu.html
@@ -502,18 +502,16 @@ function runTest(testNum) {
         var full_screen_element = subwindow.document.getElementById("test-dom-full-screen");
         var openDomFullScreen = function() {
             subwindow.removeEventListener("mozfullscreenchange", openDomFullScreen, false);
             openContextMenuFor(dom_full_screen, true); // Invoke context menu for next test.
         }
         subwindow.addEventListener("mozfullscreenchange", openDomFullScreen, false);
         SpecialPowers.setBoolPref("full-screen-api.approval-required", false);
         SpecialPowers.setBoolPref("full-screen-api.allow-trusted-requests-only", false);
-        SpecialPowers.setCharPref("full-screen-api.transition-duration.enter", "0 0");
-        SpecialPowers.setCharPref("full-screen-api.transition-duration.leave", "0 0");
         full_screen_element.mozRequestFullScreen();
     },
 
     function () {
         // Context menu for DOM Fullscreen mode (NOTE: this is *NOT* on an img)
         checkContextMenu(["context-navigation", null,
                               ["context-back",            false,
                                "context-forward",         false,
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -6025,227 +6025,29 @@ FinishDOMFullscreenChange(nsIDocument* a
     // Force exit from DOM full-screen mode. This is so that if we're in
     // DOM full-screen mode and the user exits full-screen mode with
     // the browser full-screen mode toggle keyboard-shortcut, we'll detect
     // that and leave DOM API full-screen mode too.
     nsIDocument::ExitFullscreen(aDoc, /* async */ false);
   }
 }
 
-struct FullscreenTransitionDuration
-{
-  // The unit of the durations is millisecond
-  uint16_t mFadeIn = 0;
-  uint16_t mFadeOut = 0;
-  bool IsSuppressed() const
-  {
-    return mFadeIn == 0 && mFadeOut == 0;
-  }
-};
-
-static void
-GetFullscreenTransitionDuration(bool aEnterFullscreen,
-                                FullscreenTransitionDuration* aDuration)
-{
-  const char* pref = aEnterFullscreen ?
-    "full-screen-api.transition-duration.enter" :
-    "full-screen-api.transition-duration.leave";
-  nsAdoptingCString prefValue = Preferences::GetCString(pref);
-  if (!prefValue.IsEmpty()) {
-    sscanf(prefValue.get(), "%hu%hu",
-           &aDuration->mFadeIn, &aDuration->mFadeOut);
-  }
-}
-
-class FullscreenTransitionTask : public nsRunnable
-{
-public:
-  FullscreenTransitionTask(const FullscreenTransitionDuration& aDuration,
-                           nsGlobalWindow* aWindow, bool aFullscreen,
-                           nsIWidget* aWidget, nsIScreen* aScreen,
-                           nsISupports* aTransitionData)
-    : mWindow(aWindow)
-    , mWidget(aWidget)
-    , mScreen(aScreen)
-    , mTransitionData(aTransitionData)
-    , mDuration(aDuration)
-    , mStage(eBeforeToggle)
-    , mFullscreen(aFullscreen)
-  {}
-
-  NS_IMETHOD Run() override;
-
-private:
-  enum Stage {
-    // BeforeToggle stage happens before we enter or leave fullscreen
-    // state. In this stage, the task triggers the pre-toggle fullscreen
-    // transition on the widget.
-    eBeforeToggle,
-    // ToggleFullscreen stage actually executes the fullscreen toggle,
-    // and wait for the next paint on the content to continue.
-    eToggleFullscreen,
-    // AfterToggle stage happens after we toggle the fullscreen state.
-    // In this stage, the task triggers the post-toggle fullscreen
-    // transition on the widget.
-    eAfterToggle
-  };
-
-  class Observer final : public nsIObserver
-  {
-  public:
-    NS_DECL_ISUPPORTS
-    NS_DECL_NSIOBSERVER
-
-    explicit Observer(FullscreenTransitionTask* aTask)
-      : mTask(aTask) { }
-
-  private:
-    ~Observer() {}
-
-    nsRefPtr<FullscreenTransitionTask> mTask;
-  };
-
-  static const uint32_t kNextPaintTimeout = 1000; // ms
-  static const char* const kPaintedTopic;
-
-  nsRefPtr<nsGlobalWindow> mWindow;
-  nsCOMPtr<nsIWidget> mWidget;
-  nsCOMPtr<nsIScreen> mScreen;
-  nsCOMPtr<nsITimer> mTimer;
-  nsCOMPtr<nsISupports> mTransitionData;
-
-  FullscreenTransitionDuration mDuration;
-  Stage mStage;
-  bool mFullscreen;
-};
-
-const char* const
-FullscreenTransitionTask::kPaintedTopic = "fullscreen-painted";
-
-NS_IMETHODIMP
-FullscreenTransitionTask::Run()
-{
-  Stage stage = mStage;
-  mStage = Stage(mStage + 1);
-  if (stage == eBeforeToggle) {
-    mWidget->PerformFullscreenTransition(nsIWidget::eBeforeFullscreenToggle,
-                                         mDuration.mFadeIn, mTransitionData,
-                                         this);
-  } else if (stage == eToggleFullscreen) {
-    if (MOZ_UNLIKELY(mWindow->mFullScreen != mFullscreen)) {
-      // This could happen in theory if several fullscreen requests in
-      // different direction happen continuously in a short time. We
-      // need to ensure the fullscreen state matches our target here,
-      // otherwise the widget would change the window state as if we
-      // toggle for Fullscreen Mode instead of Fullscreen API.
-      NS_WARNING("The fullscreen state of the window does not match");
-      mWindow->mFullScreen = mFullscreen;
-    }
-    // Toggle the fullscreen state on the widget
-    mWidget->MakeFullScreen(mFullscreen, mScreen);
-    // Set observer for the next content paint.
-    nsCOMPtr<nsIObserver> observer = new Observer(this);
-    nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
-    obs->AddObserver(observer, kPaintedTopic, false);
-    // There are several edge cases where we may never get the paint
-    // notification, including:
-    // 1. the window/tab is closed before the next paint;
-    // 2. the user has switched to another tab before we get here.
-    // Completely fixing those cases seems to be tricky, and since they
-    // should rarely happen, it probably isn't worth to fix. Hence we
-    // simply add a timeout here to ensure we never hang forever.
-    mTimer = do_CreateInstance(NS_TIMER_CONTRACTID);
-    mTimer->Init(observer, kNextPaintTimeout, nsITimer::TYPE_ONE_SHOT);
-  } else if (stage == eAfterToggle) {
-    mWidget->PerformFullscreenTransition(nsIWidget::eAfterFullscreenToggle,
-                                         mDuration.mFadeOut, mTransitionData,
-                                         this);
-  }
-  return NS_OK;
-}
-
-NS_IMPL_ISUPPORTS(FullscreenTransitionTask::Observer, nsIObserver)
-
-NS_IMETHODIMP
-FullscreenTransitionTask::Observer::Observe(nsISupports* aSubject,
-                                            const char* aTopic,
-                                            const char16_t* aData)
-{
-  bool shouldContinue = false;
-  if (strcmp(aTopic, FullscreenTransitionTask::kPaintedTopic) == 0) {
-    nsCOMPtr<nsPIDOMWindow> win(do_QueryInterface(aSubject));
-    nsCOMPtr<nsIWidget> widget = win ?
-      static_cast<nsGlobalWindow*>(win.get())->GetMainWidget() : nullptr;
-    if (widget == mTask->mWidget) {
-      // The paint notification arrives first. Cancel the timer.
-      mTask->mTimer->Cancel();
-      shouldContinue = true;
-    }
-  } else {
-#ifdef DEBUG
-    MOZ_ASSERT(strcmp(aTopic, NS_TIMER_CALLBACK_TOPIC) == 0,
-               "Should only get fullscreen-painted or timer-callback");
-    nsCOMPtr<nsITimer> timer(do_QueryInterface(aSubject));
-    MOZ_ASSERT(timer && timer == mTask->mTimer,
-               "Should only trigger this with the timer the task created");
-#endif
-    shouldContinue = true;
-  }
-  if (shouldContinue) {
-    nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
-    obs->RemoveObserver(this, kPaintedTopic);
-    mTask->mTimer = nullptr;
-    mTask->Run();
-  }
-  return NS_OK;
-}
-
-static bool
-MakeWidgetFullscreen(nsGlobalWindow* aWindow, gfx::VRHMDInfo* aHMD,
-                     nsPIDOMWindow::FullscreenReason aReason, bool aFullscreen)
-{
-  nsCOMPtr<nsIWidget> widget = aWindow->GetMainWidget();
-  if (!widget) {
-    return false;
-  }
-
-  FullscreenTransitionDuration duration;
-  bool performTransition = false;
-  nsCOMPtr<nsISupports> transitionData;
-  if (aReason == nsPIDOMWindow::eForFullscreenAPI) {
-    GetFullscreenTransitionDuration(aFullscreen, &duration);
-    if (!duration.IsSuppressed()) {
-      performTransition = widget->
-        PrepareForFullscreenTransition(getter_AddRefs(transitionData));
-    }
-  }
-  nsCOMPtr<nsIScreen> screen = aHMD ? aHMD->GetScreen() : nullptr;
-  if (!performTransition) {
-    widget->MakeFullScreen(aFullscreen, screen);
-  } else {
-    nsCOMPtr<nsIRunnable> task =
-      new FullscreenTransitionTask(duration, aWindow, aFullscreen,
-                                   widget, screen, transitionData);
-    task->Run();
-  }
-  return true;
-}
-
 nsresult
 nsGlobalWindow::SetFullscreenInternal(FullscreenReason aReason,
                                       bool aFullScreen,
                                       gfx::VRHMDInfo* aHMD)
 {
   MOZ_ASSERT(IsOuterWindow());
 
   NS_ENSURE_TRUE(mDocShell, NS_ERROR_FAILURE);
 
   // Only chrome can change our fullscreen mode. Otherwise, the state
   // can only be changed for DOM fullscreen.
-  if (aReason == eForFullscreenMode && !nsContentUtils::IsCallerChrome()) {
+  if (aFullScreen == FullScreen() ||
+      (aReason == eForFullscreenMode && !nsContentUtils::IsCallerChrome())) {
     return NS_OK;
   }
 
   // SetFullScreen needs to be called on the root window, so get that
   // via the DocShell tree, and if we are not already the root,
   // call SetFullScreen on that window instead.
   nsCOMPtr<nsIDocShellTreeItem> rootItem;
   mDocShell->GetRootTreeItem(getter_AddRefs(rootItem));
@@ -6291,17 +6093,26 @@ nsGlobalWindow::SetFullscreenInternal(Fu
   // gone full screen, the state trap above works.
   mFullScreen = aFullScreen;
 
   // Sometimes we don't want the top-level widget to actually go fullscreen,
   // for example in the B2G desktop client, we don't want the emulated screen
   // dimensions to appear to increase when entering fullscreen mode; we just
   // want the content to fill the entire client area of the emulator window.
   if (!Preferences::GetBool("full-screen-api.ignore-widgets", false)) {
-    if (MakeWidgetFullscreen(this, aHMD, aReason, aFullScreen)) {
+    nsCOMPtr<nsIWidget> widget = GetMainWidget();
+    if (widget) {
+      nsCOMPtr<nsIScreen> screen;
+      if (aHMD) {
+        screen = aHMD->GetScreen();
+      }
+      if (aReason == eForFullscreenAPI) {
+        widget->PrepareForDOMFullscreenTransition();
+      }
+      widget->MakeFullScreen(aFullScreen, screen);
       // The rest of code for switching fullscreen is in nsGlobalWindow::
       // FinishFullscreenChange() which will be called after sizemodechange
       // event is dispatched.
       return NS_OK;
     }
   }
 
   FinishFullscreenChange(aFullScreen);
--- a/dom/base/nsGlobalWindow.h
+++ b/dom/base/nsGlobalWindow.h
@@ -479,19 +479,16 @@ public:
 
   // Outer windows only.
   virtual bool DispatchCustomEvent(const nsAString& aEventName) override;
   bool DispatchResizeEvent(const mozilla::CSSIntSize& aSize);
 
   // Inner windows only.
   virtual void RefreshCompartmentPrincipal() override;
 
-  // For accessing protected field mFullScreen
-  friend class FullscreenTransitionTask;
-
   // Outer windows only.
   virtual nsresult SetFullscreenInternal(
     FullscreenReason aReason, bool aIsFullscreen,
     mozilla::gfx::VRHMDInfo *aHMD = nullptr) override final;
   virtual void FinishFullscreenChange(bool aIsFullscreen) override final;
   bool FullScreen() const;
 
   // Inner windows only.
--- a/dom/html/test/test_fullscreen-api.html
+++ b/dom/html/test/test_fullscreen-api.html
@@ -81,20 +81,16 @@ try {
 } catch (e) {
 }
 is(window.fullScreen, false, "Shouldn't be able to set window fullscreen from content");
 // Ensure the full-screen api is enabled, and will be disabled on test exit.
 // Disable the requirement for trusted contexts only, so the tests are easier
 // to write
 addLoadEvent(function() {
   SpecialPowers.pushPrefEnv({
-      "set": [
-        ["full-screen-api.enabled", true],
-        ["full-screen-api.allow-trusted-requests-only", false],
-        ["full-screen-api.transition-duration.enter", "0 0"],
-        ["full-screen-api.transition-duration.leave", "0 0"]
-      ]}, nextTest);
+    "set":[["full-screen-api.enabled", true],
+            ["full-screen-api.allow-trusted-requests-only", false]]}, nextTest);
 });
 SimpleTest.waitForExplicitFinish();
 </script>
 </pre>
 </body>
 </html>
--- a/dom/tests/mochitest/chrome/test_MozDomFullscreen_event.xul
+++ b/dom/tests/mochitest/chrome/test_MozDomFullscreen_event.xul
@@ -27,22 +27,18 @@ function make_uri(url) {
 // Ensure "fullscreen" permissions are not present on the test URI.
 var pm = Cc["@mozilla.org/permissionmanager;1"].getService(Ci.nsIPermissionManager);
 var uri = make_uri("http://mochi.test:8888");
 var principal = Components.classes["@mozilla.org/scriptsecuritymanager;1"]
                   .getService(Ci.nsIScriptSecurityManager)
                   .getNoAppCodebasePrincipal(uri);
 pm.removeFromPrincipal(principal, "fullscreen");
 
-SpecialPowers.pushPrefEnv({"set": [
-  ['full-screen-api.enabled', true],
-  ['full-screen-api.allow-trusted-requests-only', false],
-  ['full-screen-api.transition-duration.enter', '0 0'],
-  ['full-screen-api.transition-duration.leave', '0 0']
-]}, setup);
+SpecialPowers.pushPrefEnv({"set": [['full-screen-api.enabled', true],
+                                   ['full-screen-api.allow-trusted-requests-only', false]]}, setup);
 
 function setup() {
    newwindow = window.open("MozDomFullscreen_chrome.xul", "_blank","chrome,resizable=yes,width=400,height=400");
 }
 
 function done()
 {
   newwindow.close();
--- a/dom/tests/mochitest/pointerlock/test_pointerlock-api.html
+++ b/dom/tests/mochitest/pointerlock/test_pointerlock-api.html
@@ -23,27 +23,26 @@ https://bugzilla.mozilla.org/show_bug.cg
          * which doesn't work when run in the mochitests' iframe, since the
          * mochitests' iframe doesn't have an allowfullscreen attribute.  To get
          * around this, all tests are run in a child window, which can go fullscreen.
          * This method is borrowed from dom/html/test/test_fullscreen-api.html.
          **/
 
         SimpleTest.waitForExplicitFinish();
 
+        // Ensure the full-screen api is enabled, and will be disabled on test exit.
+        SpecialPowers.setBoolPref("full-screen-api.enabled", true);
+
+        // Disable the requirement for trusted contexts only, so the tests are easier to write.
+        SpecialPowers.setBoolPref("full-screen-api.allow-trusted-requests-only", false);
+
         // Grant "fullscreen" permission on the test domain. This means fullscreen will be
         // automatically approved, so pointer lock in the tests will be too.
         SpecialPowers.setFullscreenAllowed(document);
 
-        SpecialPowers.pushPrefEnv({"set": [
-          ["full-screen-api.enabled", true],
-          ["full-screen-api.allow-trusted-requests-only", false],
-          ["full-screen-api.transition-duration.enter", "0 0"],
-          ["full-screen-api.transition-duration.leave", "0 0"]
-        ]}, nextTest);
-
         // Run the tests which go full-screen in new window, as Mochitests
         // normally run in an iframe, which by default will not have the
         // allowfullscreen attribute set, so full-screen won't work.
         var gTestFiles = [
           "file_approval.html",
           "file_screenClientXYConst.html",
           "file_childIframe.html",
           "file_doubleLock.html",
@@ -68,16 +67,18 @@ https://bugzilla.mozilla.org/show_bug.cg
           { file: "file_screenClientXYConst.html",
             platform: "MacIntel" }
         ];
 
         var gTestWindow = null;
         var gTestIndex = 0;
 
         function finish() {
+          SpecialPowers.clearUserPref("full-screen-api.enabled");
+          SpecialPowers.clearUserPref("full-screen-api.allow-trusted-requests-only");
           SpecialPowers.removeFullscreenAllowed(document)
           SimpleTest.finish();
         }
 
         function nextTest() {
           if (gTestWindow) {
             gTestWindow.close();
           }
@@ -101,12 +102,14 @@ https://bugzilla.mozilla.org/show_bug.cg
               gTestWindow = window.open(file, "", "width=500,height=500");
             } else {
               nextTest();
             }
           } else {
             finish();
           }
         }
+
+        addLoadEvent(nextTest);
       </script>
     </pre>
   </body>
 </html>
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -4337,19 +4337,16 @@ pref("dom.webnotifications.enabled", tru
 
 // Alert animation effect, name is disableSlidingEffect for backwards-compat.
 pref("alerts.disableSlidingEffect", false);
 
 // DOM full-screen API.
 pref("full-screen-api.enabled", false);
 pref("full-screen-api.allow-trusted-requests-only", true);
 pref("full-screen-api.pointer-lock.enabled", true);
-// transition duration of fade-to-black and fade-from-black, unit: ms
-pref("full-screen-api.transition-duration.enter", "400 400");
-pref("full-screen-api.transition-duration.leave", "400 400");
 
 // DOM idle observers API
 pref("dom.idle-observers-api.enabled", true);
 
 // Time limit, in milliseconds, for EventStateManager::IsHandlingUserInput().
 // Used to detect long running handlers of user-generated events.
 pref("dom.event.handling-user-input-time-limit", 1000);
 
--- a/widget/cocoa/nsCocoaWindow.h
+++ b/widget/cocoa/nsCocoaWindow.h
@@ -280,17 +280,17 @@ public:
     NS_IMETHOD              ConstrainPosition(bool aAllowSlop,
                                               int32_t *aX, int32_t *aY) override;
     virtual void            SetSizeConstraints(const SizeConstraints& aConstraints) override;
     NS_IMETHOD              Move(double aX, double aY) override;
     NS_IMETHOD              PlaceBehind(nsTopLevelWidgetZPlacement aPlacement,
                                         nsIWidget *aWidget, bool aActivate) override;
     NS_IMETHOD              SetSizeMode(int32_t aMode) override;
     NS_IMETHOD              HideWindowChrome(bool aShouldHide) override;
-    virtual bool PrepareForFullscreenTransition(nsISupports** aData) override;
+    virtual void            PrepareForDOMFullscreenTransition() override;
     void EnteredFullScreen(bool aFullScreen, bool aNativeMode = true);
     inline bool ShouldToggleNativeFullscreen(bool aFullScreen);
     NS_IMETHOD              MakeFullScreen(bool aFullScreen, nsIScreen* aTargetScreen = nullptr) override;
     NS_IMETHOD              Resize(double aWidth, double aHeight, bool aRepaint) override;
     NS_IMETHOD              Resize(double aX, double aY, double aWidth, double aHeight, bool aRepaint) override;
     NS_IMETHOD              GetClientBounds(nsIntRect &aRect) override;
     NS_IMETHOD              GetScreenBounds(nsIntRect &aRect) override;
     void                    ReportMoveEvent();
--- a/widget/cocoa/nsCocoaWindow.mm
+++ b/widget/cocoa/nsCocoaWindow.mm
@@ -1261,21 +1261,19 @@ NS_IMETHODIMP nsCocoaWindow::HideWindowC
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   return NS_OK;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
-/* virtual */ bool
-nsCocoaWindow::PrepareForFullscreenTransition(nsISupports** aData)
+void nsCocoaWindow::PrepareForDOMFullscreenTransition()
 {
   mInDOMFullscreenTransition = true;
-  return false;
 }
 
 void nsCocoaWindow::EnteredFullScreen(bool aFullScreen, bool aNativeMode)
 {
   mInFullScreenTransition = false;
   mInFullScreenMode = aFullScreen;
   if (aNativeMode || mInNativeFullScreenMode) {
     mInNativeFullScreenMode = aFullScreen;
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -765,51 +765,59 @@ NS_IMETHODIMP nsBaseWidget::SetWindowSha
 // Hide window borders/decorations for this widget
 //
 //-------------------------------------------------------------------------
 NS_IMETHODIMP nsBaseWidget::HideWindowChrome(bool aShouldHide)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-/* virtual */ void
-nsBaseWidget::PerformFullscreenTransition(FullscreenTransitionStage aStage,
-                                          uint16_t aDuration,
-                                          nsISupports* aData,
-                                          nsIRunnable* aCallback)
-{
-  MOZ_ASSERT_UNREACHABLE(
-    "Should never call PerformFullscreenTransition on nsBaseWidget");
-}
-
 //-------------------------------------------------------------------------
 //
 // Put the window into full-screen mode
 //
 //-------------------------------------------------------------------------
 NS_IMETHODIMP nsBaseWidget::MakeFullScreen(bool aFullScreen, nsIScreen* aScreen)
 {
   HideWindowChrome(aFullScreen);
 
   if (aFullScreen) {
     if (!mOriginalBounds)
       mOriginalBounds = new nsIntRect();
-    *mOriginalBounds = GetScaledScreenBounds();
+    GetScreenBounds(*mOriginalBounds);
+    // convert dev pix to display pix for window manipulation
+    CSSToLayoutDeviceScale scale = GetDefaultScale();
+    mOriginalBounds->x = NSToIntRound(mOriginalBounds->x / scale.scale);
+    mOriginalBounds->y = NSToIntRound(mOriginalBounds->y / scale.scale);
+    mOriginalBounds->width = NSToIntRound(mOriginalBounds->width / scale.scale);
+    mOriginalBounds->height = NSToIntRound(mOriginalBounds->height / scale.scale);
 
     // Move to top-left corner of screen and size to the screen dimensions
-    nsCOMPtr<nsIScreen> screen = aScreen;
-    if (!screen) {
-      screen = GetWidgetScreen();
-    }
-    if (screen) {
-      int32_t left, top, width, height;
-      if (NS_SUCCEEDED(screen->GetRectDisplayPix(&left, &top, &width, &height))) {
-        Resize(left, top, width, height, true);
+    nsCOMPtr<nsIScreenManager> screenManager;
+    screenManager = do_GetService("@mozilla.org/gfx/screenmanager;1");
+    NS_ASSERTION(screenManager, "Unable to grab screenManager.");
+    if (screenManager) {
+      nsCOMPtr<nsIScreen> screen = aScreen;
+      if (!screen) {
+        // no screen was passed in, use the one that the window is on
+        screenManager->ScreenForRect(mOriginalBounds->x,
+                                     mOriginalBounds->y,
+                                     mOriginalBounds->width,
+                                     mOriginalBounds->height,
+                                     getter_AddRefs(screen));
+      }
+
+      if (screen) {
+        int32_t left, top, width, height;
+        if (NS_SUCCEEDED(screen->GetRectDisplayPix(&left, &top, &width, &height))) {
+          Resize(left, top, width, height, true);
+        }
       }
     }
+
   } else if (mOriginalBounds) {
     Resize(mOriginalBounds->x, mOriginalBounds->y, mOriginalBounds->width,
            mOriginalBounds->height, true);
   }
 
   return NS_OK;
 }
 
@@ -1735,46 +1743,16 @@ nsBaseWidget::GetRootAccessible()
     return accService->GetRootDocumentAccessible(presShell, nsContentUtils::IsSafeToRunScript());
   }
 
   return nullptr;
 }
 
 #endif // ACCESSIBILITY
 
-nsIntRect
-nsBaseWidget::GetScaledScreenBounds()
-{
-  nsIntRect bounds;
-  GetScreenBounds(bounds);
-  CSSToLayoutDeviceScale scale = GetDefaultScale();
-  bounds.x = NSToIntRound(bounds.x / scale.scale);
-  bounds.y = NSToIntRound(bounds.y / scale.scale);
-  bounds.width = NSToIntRound(bounds.width / scale.scale);
-  bounds.height = NSToIntRound(bounds.height / scale.scale);
-  return bounds;
-}
-
-already_AddRefed<nsIScreen>
-nsBaseWidget::GetWidgetScreen()
-{
-  nsCOMPtr<nsIScreenManager> screenManager;
-  screenManager = do_GetService("@mozilla.org/gfx/screenmanager;1");
-  if (!screenManager) {
-    return nullptr;
-  }
-
-  nsIntRect bounds = GetScaledScreenBounds();
-  nsCOMPtr<nsIScreen> screen;
-  screenManager->ScreenForRect(bounds.x, bounds.y,
-                               bounds.width, bounds.height,
-                               getter_AddRefs(screen));
-  return screen.forget();
-}
-
 nsresult
 nsIWidget::SynthesizeNativeTouchTap(nsIntPoint aPointerScreenPoint, bool aLongTap,
                                     nsIObserver* aObserver)
 {
   AutoObserverNotifier notifier(aObserver, "touchtap");
 
   if (sPointerIdCounter > TOUCH_INJECT_MAX_POINTS) {
     sPointerIdCounter = 0;
--- a/widget/nsBaseWidget.h
+++ b/widget/nsBaseWidget.h
@@ -138,21 +138,17 @@ public:
   virtual void            SetTransparencyMode(nsTransparencyMode aMode) override;
   virtual nsTransparencyMode GetTransparencyMode() override;
   virtual void            GetWindowClipRegion(nsTArray<nsIntRect>* aRects) override;
   NS_IMETHOD              SetWindowShadowStyle(int32_t aStyle) override;
   virtual void            SetShowsToolbarButton(bool aShow) override {}
   virtual void            SetShowsFullScreenButton(bool aShow) override {}
   virtual void            SetWindowAnimationType(WindowAnimationType aType) override {}
   NS_IMETHOD              HideWindowChrome(bool aShouldHide) override;
-  virtual bool PrepareForFullscreenTransition(nsISupports** aData) override { return false; }
-  virtual void PerformFullscreenTransition(FullscreenTransitionStage aStage,
-                                           uint16_t aDuration,
-                                           nsISupports* aData,
-                                           nsIRunnable* aCallback) override;
+  virtual void            PrepareForDOMFullscreenTransition() override {}
   NS_IMETHOD              MakeFullScreen(bool aFullScreen, nsIScreen* aScreen = nullptr) override;
   virtual LayerManager*   GetLayerManager(PLayerTransactionChild* aShadowManager = nullptr,
                                           LayersBackend aBackendHint = mozilla::layers::LayersBackend::LAYERS_NONE,
                                           LayerManagerPersistence aPersistence = LAYER_MANAGER_CURRENT,
                                           bool* aAllowRetaining = nullptr) override;
 
   CompositorVsyncDispatcher* GetCompositorVsyncDispatcher() override;
   void            CreateCompositorVsyncDispatcher();
@@ -278,23 +274,16 @@ public:
   nsPopupLevel PopupLevel() { return mPopupLevel; }
 
   virtual mozilla::LayoutDeviceIntSize
   ClientToWindowSize(const mozilla::LayoutDeviceIntSize& aClientSize) override
   {
     return aClientSize;
   }
 
-  // return the widget's outside dimensions
-  // in global coordinates in display pixel.
-  nsIntRect GetScaledScreenBounds();
-
-  // return the screen the widget is in.
-  already_AddRefed<nsIScreen> GetWidgetScreen();
-
   // return true if this is a popup widget with a native titlebar
   bool IsPopupWithTitleBar() const
   {
     return (mWindowType == eWindowType_popup && 
             mBorderStyle != eBorderStyle_default &&
             mBorderStyle & eBorderStyle_title);
   }
 
--- a/widget/nsIWidget.h
+++ b/widget/nsIWidget.h
@@ -32,17 +32,16 @@
 // forward declarations
 class   nsIRollupListener;
 class   imgIContainer;
 class   nsIContent;
 class   ViewWrapper;
 class   nsIWidgetListener;
 class   nsIntRegion;
 class   nsIScreen;
-class   nsIRunnable;
 
 namespace mozilla {
 class CompositorVsyncDispatcher;
 class WritingMode;
 namespace dom {
 class TabChild;
 }
 namespace plugins {
@@ -115,18 +114,18 @@ typedef void* nsNativeWidget;
 #if defined(MOZ_WIDGET_GTK)
 // set/get nsPluginNativeWindowGtk, e10s specific
 #define NS_NATIVE_PLUGIN_OBJECT_PTR    104
 #endif
 // See RegisterPluginWindowForRemoteUpdates
 #define NS_NATIVE_PLUGIN_ID            105
 
 #define NS_IWIDGET_IID \
-{ 0x22b4504e, 0xddba, 0x4211, \
-  { 0xa1, 0x49, 0x6e, 0x11, 0x73, 0xc4, 0x11, 0x45 } };
+{ 0x53376F57, 0xF081, 0x4949, \
+  { 0xB5, 0x5E, 0x87, 0xEF, 0x6A, 0xE9, 0xE3, 0x5A } };
 
 /*
  * Window shadow styles
  * Also used for the -moz-window-shadow CSS property
  */
 
 #define NS_STYLE_WINDOW_SHADOW_NONE             0
 #define NS_STYLE_WINDOW_SHADOW_DEFAULT          1
@@ -1692,43 +1691,28 @@ class nsIWidget : public nsISupports {
     virtual void SetUseBrightTitlebarForeground(bool aBrightForeground) {}
 
     /** 
      * Hide window chrome (borders, buttons) for this widget.
      *
      */
     NS_IMETHOD HideWindowChrome(bool aShouldHide) = 0;
 
-    enum FullscreenTransitionStage
-    {
-      eBeforeFullscreenToggle,
-      eAfterFullscreenToggle
-    };
-
     /**
-     * Prepares for fullscreen transition and returns whether the widget
-     * supports fullscreen transition. If this method returns false,
-     * PerformFullscreenTransition() must never be called. Otherwise,
-     * caller should call that method twice with "before" and "after"
-     * stages respectively in order. In the latter case, this method may
-     * return some data via aData pointer. Caller must pass that data to
-     * PerformFullscreenTransition() if any, and caller is responsible
-     * for releasing that data.
+     * Ask the widget to start the transition for entering or exiting
+     * DOM Fullscreen.
+     *
+     * XXX This method is currently not actually implemented by any
+     * widget. The only function of this method is to notify cocoa
+     * window that it should not use the native fullscreen mode. This
+     * method is reserved for bug 1160014 where a transition will be
+     * added for DOM fullscreen. Hence, this function is likely to
+     * be further changed then.
      */
-    virtual bool PrepareForFullscreenTransition(nsISupports** aData) = 0;
-
-    /**
-     * Performs fullscreen transition. This method returns immediately,
-     * and will post aCallback to the main thread when the transition
-     * finishes.
-     */
-    virtual void PerformFullscreenTransition(FullscreenTransitionStage aStage,
-                                             uint16_t aDuration,
-                                             nsISupports* aData,
-                                             nsIRunnable* aCallback) = 0;
+    virtual void PrepareForDOMFullscreenTransition() = 0;
 
     /**
      * Put the toplevel window into or out of fullscreen mode.
      * If aTargetScreen is given, attempt to go fullscreen on that screen,
      * if possible.  (If not, it behaves as if aTargetScreen is null.)
      * If !aFullScreen, aTargetScreen is ignored.
      * aTargetScreen support is currently only implemented on Windows.
      */
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -320,17 +320,16 @@ static const DWORD kEventTimeHalfRange =
  *
  **************************************************************/
 
 nsWindow::nsWindow() : nsWindowBase()
 {
   mIconSmall            = nullptr;
   mIconBig              = nullptr;
   mWnd                  = nullptr;
-  mTransitionWnd        = nullptr;
   mPaintDC              = nullptr;
   mCompositeDC          = nullptr;
   mPrevWndProc          = nullptr;
   mNativeDragTarget     = nullptr;
   mInDtor               = false;
   mIsVisible            = false;
   mIsTopWidgetWindow    = false;
   mUnicodeWidget        = true;
@@ -1517,25 +1516,16 @@ NS_METHOD nsWindow::Resize(double aX, do
     UINT  flags = SWP_NOZORDER | SWP_NOACTIVATE;
     if (!aRepaint) {
       flags |= SWP_NOREDRAW;
     }
 
     ClearThemeRegion();
     VERIFY(::SetWindowPos(mWnd, nullptr, x, y,
                           width, GetHeight(height), flags));
-    if (mTransitionWnd) {
-      // If we have a fullscreen transition window, we need to make
-      // it topmost again, otherwise the taskbar may be raised by
-      // the system unexpectedly when we leave fullscreen state.
-      ::SetWindowPos(mTransitionWnd, HWND_TOPMOST, 0, 0, 0, 0,
-                     SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
-      // Every transition window is only used once.
-      mTransitionWnd = nullptr;
-    }
     SetThemeRegion();
   }
 
   if (aRepaint)
     Invalidate();
 
   NotifyRollupGeometryChange();
   return NS_OK;
@@ -2853,183 +2843,16 @@ NS_METHOD nsWindow::Invalidate(const nsI
     rect.right  = aRect.x + aRect.width;
     rect.bottom = aRect.y + aRect.height;
 
     VERIFY(::InvalidateRect(mWnd, &rect, FALSE));
   }
   return NS_OK;
 }
 
-static LRESULT CALLBACK
-FullscreenTransitionWindowProc(HWND hWnd, UINT uMsg,
-                               WPARAM wParam, LPARAM lParam)
-{
-  switch (uMsg) {
-    case WM_FULLSCREEN_TRANSITION_BEFORE:
-    case WM_FULLSCREEN_TRANSITION_AFTER: {
-      // The message sender should have added ref for us.
-      nsCOMPtr<nsIRunnable> callback =
-        already_AddRefed<nsIRunnable>((nsIRunnable*)wParam);
-      DWORD duration = (DWORD)lParam;
-      DWORD flags = AW_BLEND;
-      if (uMsg == WM_FULLSCREEN_TRANSITION_AFTER) {
-        flags |= AW_HIDE;
-      }
-      ::AnimateWindow(hWnd, duration, flags);
-      NS_DispatchToMainThread(callback);
-      break;
-    }
-    case WM_DESTROY:
-      ::PostQuitMessage(0);
-      break;
-    default:
-      return ::DefWindowProcW(hWnd, uMsg, wParam, lParam);
-  }
-  return 0;
-}
-
-struct FullscreenTransitionInitData
-{
-  nsIntRect mBounds;
-  HANDLE mSemaphore;
-  HANDLE mThread;
-  HWND mWnd;
-
-  FullscreenTransitionInitData()
-    : mSemaphore(nullptr)
-    , mThread(nullptr)
-    , mWnd(nullptr) { }
-
-  ~FullscreenTransitionInitData()
-  {
-    if (mSemaphore) {
-      ::CloseHandle(mSemaphore);
-    }
-    if (mThread) {
-      ::CloseHandle(mThread);
-    }
-  }
-};
-
-static DWORD WINAPI
-FullscreenTransitionThreadProc(LPVOID lpParam)
-{
-  // Initialize window class
-  static bool sInitialized = false;
-  if (!sInitialized) {
-    WNDCLASSW wc = {};
-    wc.lpfnWndProc = ::FullscreenTransitionWindowProc;
-    wc.hInstance = nsToolkit::mDllInstance;
-    wc.hbrBackground = ::CreateSolidBrush(RGB(0, 0, 0));
-    wc.lpszClassName = kClassNameTransition;
-    ::RegisterClassW(&wc);
-    sInitialized = true;
-  }
-
-  auto data = static_cast<FullscreenTransitionInitData*>(lpParam);
-  HWND wnd = ::CreateWindowW(
-    kClassNameTransition, L"", 0, 0, 0, 0, 0,
-    nullptr, nullptr, nsToolkit::mDllInstance, nullptr);
-  if (!wnd) {
-    ::ReleaseSemaphore(data->mSemaphore, 1, nullptr);
-    return 0;
-  }
-
-  // Since AnimateWindow blocks the thread of the transition window,
-  // we need to hide the cursor for that window, otherwise the system
-  // would show the busy pointer to the user.
-  ::ShowCursor(false);
-  ::SetWindowLongW(wnd, GWL_STYLE, 0);
-  ::SetWindowLongW(wnd, GWL_EXSTYLE, WS_EX_LAYERED |
-                   WS_EX_TRANSPARENT | WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE);
-  ::SetWindowPos(wnd, HWND_TOPMOST, data->mBounds.x, data->mBounds.y,
-                 data->mBounds.width, data->mBounds.height, 0);
-  data->mWnd = wnd;
-  ::ReleaseSemaphore(data->mSemaphore, 1, nullptr);
-  // The initialization data may no longer be valid
-  // after we release the semaphore.
-  data = nullptr;
-
-  MSG msg;
-  while (::GetMessageW(&msg, nullptr, 0, 0)) {
-    ::TranslateMessage(&msg);
-    ::DispatchMessage(&msg);
-  }
-  ::ShowCursor(true);
-  ::DestroyWindow(wnd);
-  return 0;
-}
-
-class FullscreenTransitionData final : public nsISupports
-{
-public:
-  NS_DECL_ISUPPORTS
-
-  explicit FullscreenTransitionData(HWND aWnd)
-    : mWnd(aWnd)
-  {
-    MOZ_ASSERT(NS_IsMainThread(), "FullscreenTransitionData "
-               "should be constructed in the main thread");
-  }
-
-  const HWND mWnd;
-
-private:
-  ~FullscreenTransitionData()
-  {
-    MOZ_ASSERT(NS_IsMainThread(), "FullscreenTransitionData "
-               "should be deconstructed in the main thread");
-    ::PostMessageW(mWnd, WM_DESTROY, 0, 0);
-  }
-};
-
-NS_IMPL_ISUPPORTS0(FullscreenTransitionData)
-
-/* virtual */ bool
-nsWindow::PrepareForFullscreenTransition(nsISupports** aData)
-{
-  FullscreenTransitionInitData initData;
-  nsCOMPtr<nsIScreen> screen = GetWidgetScreen();
-  screen->GetRectDisplayPix(&initData.mBounds.x, &initData.mBounds.y,
-                            &initData.mBounds.width, &initData.mBounds.height);
-  // Create a semaphore for synchronizing the window handle which will
-  // be created by the transition thread and used by the main thread for
-  // posting the transition messages.
-  initData.mSemaphore = ::CreateSemaphore(nullptr, 0, 1, nullptr);
-  if (initData.mSemaphore) {
-    initData.mThread = ::CreateThread(
-      nullptr, 0, FullscreenTransitionThreadProc, &initData, 0, nullptr);
-    if (initData.mThread) {
-      ::WaitForSingleObject(initData.mSemaphore, INFINITE);
-    }
-  }
-  if (!initData.mWnd) {
-    return false;
-  }
-
-  mTransitionWnd = initData.mWnd;
-  auto data = new FullscreenTransitionData(initData.mWnd);
-  *aData = data;
-  NS_ADDREF(data);
-  return true;
-}
-
-/* virtual */ void
-nsWindow::PerformFullscreenTransition(FullscreenTransitionStage aStage,
-                                      uint16_t aDuration, nsISupports* aData,
-                                      nsIRunnable* aCallback)
-{
-  auto data = static_cast<FullscreenTransitionData*>(aData);
-  nsCOMPtr<nsIRunnable> callback = aCallback;
-  UINT msg = aStage == eBeforeFullscreenToggle ?
-    WM_FULLSCREEN_TRANSITION_BEFORE : WM_FULLSCREEN_TRANSITION_AFTER;
-  WPARAM wparam = (WPARAM)callback.forget().take();
-  ::PostMessage(data->mWnd, msg, wparam, (LPARAM)aDuration);
-}
-
 NS_IMETHODIMP
 nsWindow::MakeFullScreen(bool aFullScreen, nsIScreen* aTargetScreen)
 {
   // taskbarInfo will be nullptr pre Windows 7 until Bug 680227 is resolved.
   nsCOMPtr<nsIWinTaskbar> taskbarInfo =
     do_GetService(NS_TASKBAR_CONTRACTID);
 
   mFullscreenMode = aFullScreen;
@@ -3047,26 +2870,36 @@ nsWindow::MakeFullScreen(bool aFullScree
     if (mSizeMode != nsSizeMode_Fullscreen)
       return NS_OK;
     SetSizeMode(mOldSizeMode);
   }
 
   // If we are going fullscreen, the window size continues to change
   // and the window will be reflow again then.
   UpdateNonClientMargins(mSizeMode, /* Reflow */ !aFullScreen);
+
+  bool visible = mIsVisible;
+  if (mOldSizeMode == nsSizeMode_Normal)
+    Show(false);
   
   // Will call hide chrome, reposition window. Note this will
   // also cache dimensions for restoration, so it should only
   // be called once per fullscreen request.
   nsresult rv = nsBaseWidget::MakeFullScreen(aFullScreen, aTargetScreen);
 
-  if (mIsVisible && !aFullScreen && mOldSizeMode == nsSizeMode_Normal) {
-    // Ensure the window exiting fullscreen get activated. Window
-    // activation might be bypassed in SetSizeMode.
-    DispatchFocusToTopLevelWindow(true);
+  if (visible) {
+    Show(true);
+    Invalidate();
+
+    if (!aFullScreen && mOldSizeMode == nsSizeMode_Normal) {
+      // Ensure the window exiting fullscreen get activated. Window
+      // activation was bypassed by SetSizeMode, and hiding window for
+      // transition could also blur the current window.
+      DispatchFocusToTopLevelWindow(true);
+    }
   }
 
   // Notify the taskbar that we have exited full screen mode.
   if (!aFullScreen && taskbarInfo) {
     taskbarInfo->PrepareFullScreenHWND(mWnd, FALSE);
   }
 
   if (mWidgetListener) {
--- a/widget/windows/nsWindow.h
+++ b/widget/windows/nsWindow.h
@@ -121,21 +121,16 @@ public:
   NS_IMETHOD              GetRestoredBounds(nsIntRect &aRect) override;
   NS_IMETHOD              GetClientBounds(nsIntRect &aRect);
   virtual nsIntPoint      GetClientOffset();
   void                    SetBackgroundColor(const nscolor &aColor);
   NS_IMETHOD              SetCursor(imgIContainer* aCursor,
                                     uint32_t aHotspotX, uint32_t aHotspotY);
   NS_IMETHOD              SetCursor(nsCursor aCursor);
   virtual nsresult        ConfigureChildren(const nsTArray<Configuration>& aConfigurations);
-  virtual bool PrepareForFullscreenTransition(nsISupports** aData) override;
-  virtual void PerformFullscreenTransition(FullscreenTransitionStage aStage,
-                                           uint16_t aDuration,
-                                           nsISupports* aData,
-                                           nsIRunnable* aCallback) override;
   NS_IMETHOD              MakeFullScreen(bool aFullScreen, nsIScreen* aScreen = nullptr);
   NS_IMETHOD              HideWindowChrome(bool aShouldHide);
   NS_IMETHOD              Invalidate(bool aEraseBackground = false,
                                      bool aUpdateNCArea = false,
                                      bool aIncludeChildren = false);
   NS_IMETHOD              Invalidate(const nsIntRect & aRect);
   virtual void*           GetNativeData(uint32_t aDataType);
   void                    SetNativeData(uint32_t aDataType, uintptr_t aVal) override;
@@ -463,17 +458,16 @@ protected:
   virtual bool            PreRender(LayerManagerComposite*) override;
   virtual void            PostRender(LayerManagerComposite*) override;
 
 protected:
   nsCOMPtr<nsIWidget>   mParent;
   nsIntSize             mLastSize;
   nsIntPoint            mLastPoint;
   HWND                  mWnd;
-  HWND                  mTransitionWnd;
   WNDPROC               mPrevWndProc;
   HBRUSH                mBrush;
   bool                  mIsTopWidgetWindow;
   bool                  mInDtor;
   bool                  mIsVisible;
   bool                  mUnicodeWidget;
   bool                  mPainting;
   bool                  mTouchWindow;
--- a/widget/windows/nsWindowDefs.h
+++ b/widget/windows/nsWindowDefs.h
@@ -86,26 +86,26 @@
 #define MAPVK_VK_TO_VSC                   0
 #define MAPVK_VSC_TO_VK                   1
 #define MAPVK_VK_TO_CHAR                  2
 #define MAPVK_VSC_TO_VK_EX                3
 #define MAPVK_VK_TO_VSC_EX                4
 #endif
 
 #ifndef WM_DWMCOMPOSITIONCHANGED
-#define WM_DWMCOMPOSITIONCHANGED          0x031E
+#define WM_DWMCOMPOSITIONCHANGED          0x031E
 #endif
 #ifndef WM_DWMNCRENDERINGCHANGED
-#define WM_DWMNCRENDERINGCHANGED          0x031F
+#define WM_DWMNCRENDERINGCHANGED          0x031F
 #endif
 #ifndef WM_DWMCOLORIZATIONCOLORCHANGED
-#define WM_DWMCOLORIZATIONCOLORCHANGED    0x0320
+#define WM_DWMCOLORIZATIONCOLORCHANGED    0x0320
 #endif
 #ifndef WM_DWMWINDOWMAXIMIZEDCHANGE
-#define WM_DWMWINDOWMAXIMIZEDCHANGE       0x0321
+#define WM_DWMWINDOWMAXIMIZEDCHANGE       0x0321
 #endif
 
 // ConstrainPosition window positioning slop value
 #define kWindowPositionSlop               20
 
 // Origin of the system context menu when displayed in full screen mode
 #define MOZ_SYSCONTEXT_X_POS              20
 #define MOZ_SYSCONTEXT_Y_POS              20
@@ -178,20 +178,16 @@
 #endif // #ifndef APPCOMMAND_BROWSER_BACKWARD
 
 //Tablet PC Mouse Input Source
 #define TABLET_INK_SIGNATURE 0xFFFFFF00
 #define TABLET_INK_CHECK     0xFF515700
 #define TABLET_INK_TOUCH     0x00000080
 #define MOUSE_INPUT_SOURCE() WinUtils::GetMouseInputSource()
 
-// Messages for fullscreen transition window
-#define WM_FULLSCREEN_TRANSITION_BEFORE     (WM_USER + 0)
-#define WM_FULLSCREEN_TRANSITION_AFTER      (WM_USER + 1)
-
 /**************************************************************
  *
  * SECTION: enums
  * 
  **************************************************************/
 
 // nsWindow::sCanQuit
 typedef enum
@@ -217,17 +213,16 @@ typedef enum
  * touchpad scrolling or screen readers.
  */
 const uint32_t kMaxClassNameLength   = 40;
 const wchar_t kClassNameHidden[]     = L"MozillaHiddenWindowClass";
 const wchar_t kClassNameGeneral[]    = L"MozillaWindowClass";
 const wchar_t kClassNameDialog[]     = L"MozillaDialogClass";
 const wchar_t kClassNameDropShadow[] = L"MozillaDropShadowWindowClass";
 const wchar_t kClassNameTemp[]       = L"MozillaTempWindowClass";
-const wchar_t kClassNameTransition[] = L"MozillaTransitionWindowClass";
 
 /**************************************************************
  *
  * SECTION: structs
  * 
  **************************************************************/
 
 // Used for synthesizing events