Bug 1186890 - Ensure parent always know when the child exit fullscreen. r=Dolske
authorXidorn Quan <quanxunzhen@gmail.com>
Fri, 07 Aug 2015 13:38:10 +1000
changeset 288407 dee3e26cc1c0f4deeb49eaa06b03a3c06ac4927f
parent 288406 9060b380602b0580be686f64176dfcf4732d71cf
child 288408 dc3a755872e1ff6ecbc0465876b6d554921217c2
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersDolske
bugs1186890
milestone42.0a1
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
Bug 1186890 - Ensure parent always know when the child exit fullscreen. r=Dolske
browser/base/content/tab-content.js
layout/style/generate-stylestructlist.py
--- a/browser/base/content/tab-content.js
+++ b/browser/base/content/tab-content.js
@@ -641,16 +641,22 @@ let DOMFullscreenHandler = {
       }
       case "MozDOMFullscreen:Exit": {
         sendAsyncMessage("DOMFullscreen:Exit");
         break;
       }
       case "MozDOMFullscreen:Entered":
       case "MozDOMFullscreen:Exited": {
         addEventListener("MozAfterPaint", this);
+        if (!content || !content.document.mozFullScreen) {
+          // If we receive any fullscreen change event, and find we are
+          // actually not in fullscreen, also ask the parent to exit to
+          // ensure that the parent always exits fullscreen when we do.
+          sendAsyncMessage("DOMFullscreen:Exit");
+        }
         break;
       }
       case "MozAfterPaint": {
         removeEventListener("MozAfterPaint", this);
         sendAsyncMessage("DOMFullscreen:Painted");
         break;
       }
     }
--- a/layout/style/generate-stylestructlist.py
+++ b/layout/style/generate-stylestructlist.py
@@ -33,17 +33,17 @@ STYLE_STRUCTS = [("INHERITED",) + x for 
     ("TableBorder",    "nullptr",               NORMAL_DEP + LENGTH_DEP),
     ("SVG",            "nullptr",               NORMAL_DEP + LENGTH_DEP + COLOR_DEP),
     ("Variables",      "CheckVariablesCallback",[]),
 ]] + [("RESET",) + x for x in [
     # Reset style structs.
     ("Background",     "nullptr",   NORMAL_DEP + LENGTH_DEP + COLOR_DEP),
     ("Position",       "nullptr",   NORMAL_DEP + LENGTH_DEP),
     ("TextReset",      "nullptr",   NORMAL_DEP + LENGTH_DEP + COLOR_DEP),
-    ("Display",        "nullptr",   NORMAL_DEP + LENGTH_DEP),
+    ("Display",        "nullptr",   NORMAL_DEP),
     ("Content",        "nullptr",   NORMAL_DEP + LENGTH_DEP),
     ("UIReset",        "nullptr",   NORMAL_DEP),
     ("Table",          "nullptr",   NORMAL_DEP),
     ("Margin",         "nullptr",   NORMAL_DEP + LENGTH_DEP),
     ("Padding",        "nullptr",   NORMAL_DEP + LENGTH_DEP),
     ("Border",         "nullptr",   NORMAL_DEP + LENGTH_DEP + COLOR_DEP),
     ("Outline",        "nullptr",   NORMAL_DEP + LENGTH_DEP + COLOR_DEP),
     ("XUL",            "nullptr",   NORMAL_DEP),