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 256757 dee3e26cc1c0f4deeb49eaa06b03a3c06ac4927f
parent 256756 9060b380602b0580be686f64176dfcf4732d71cf
child 256758 dc3a755872e1ff6ecbc0465876b6d554921217c2
push id29187
push usercbook@mozilla.com
push dateFri, 07 Aug 2015 11:13:32 +0000
treeherdermozilla-central@3e51753a099f [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),