[CherryPick] Hide all ancestors of the full screen element when going full screen
authorLukasz Krok <l.krok@samsung.com>
Wed, 26 Jun 2013 08:28:02 +0000 (10:28 +0200)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Wed, 21 Aug 2013 00:23:43 +0000 (00:23 +0000)
[Title][CherryPick] Hide all ancestors of the full screen element when going full screen
[Issue] N_SE-48867
[Problem] Unable to restore the video to its previous size - Youtube.com - PC site
[Cause] In fullscreen.css 'position: static !important;' is missing in '-webkit-full-screen-ancestor:not(iframe)' class
[Solution] Cherry picked.
[Cherry-Picker] Lukasz Krok

Hide all ancestors of the full screen element when going full screen
https://bugs.webkit.org/show_bug.cgi?id=96332

Reviewed by James Robinson.

Source/WebCore:

Since fixed position elements can now sometimes become stacking
contexts, explicitly set position: static on full-screen ancestors so
that there are no stacking context ancestors that could cause the full
screen element to become incorrectly sorted.

Test: fullscreen/full-screen-fixed-pos-parent.html

* css/fullscreen.css:
(:-webkit-full-screen-ancestor:not(iframe)):

Change-Id: I0635e79968fc581d48c2f1700362f347bc02dc9a

LayoutTests/fullscreen/full-screen-fixed-pos-parent-expected.png [new file with mode: 0644]
LayoutTests/fullscreen/full-screen-fixed-pos-parent-expected.txt [new file with mode: 0644]
LayoutTests/fullscreen/full-screen-fixed-pos-parent.html [new file with mode: 0644]
LayoutTests/fullscreen/resources/green.html [new file with mode: 0644]
Source/WebCore/css/fullscreen.css

diff --git a/LayoutTests/fullscreen/full-screen-fixed-pos-parent-expected.png b/LayoutTests/fullscreen/full-screen-fixed-pos-parent-expected.png
new file mode 100644 (file)
index 0000000..8d13e4d
Binary files /dev/null and b/LayoutTests/fullscreen/full-screen-fixed-pos-parent-expected.png differ
diff --git a/LayoutTests/fullscreen/full-screen-fixed-pos-parent-expected.txt b/LayoutTests/fullscreen/full-screen-fixed-pos-parent-expected.txt
new file mode 100644 (file)
index 0000000..139597f
--- /dev/null
@@ -0,0 +1,2 @@
+
+
diff --git a/LayoutTests/fullscreen/full-screen-fixed-pos-parent.html b/LayoutTests/fullscreen/full-screen-fixed-pos-parent.html
new file mode 100644 (file)
index 0000000..054523b
--- /dev/null
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html>
+<style>
+    #bad {
+        position: fixed;
+        top: 0px;
+        left: 0px;
+        background-color: red;
+        width: 100%;
+        height: 100%;
+    }
+
+    #fixed-container {
+        position: fixed;
+        top: 0px;
+        left: 0px;
+        z-index: 0;
+    }
+
+    #fullscreenme {
+        height: 400px;
+        width: 400px;
+        border: 0px;
+    }
+</style>
+</head>
+<script src="full-screen-test.js"></script>
+<script>
+    if (window.internals)
+        window.internals.settings.setFixedPositionCreatesStackingContext(true);
+
+    function doTest() {
+        if (window.testRunner) {
+            testRunner.dumpAsText(true);
+            testRunner.waitUntilDone();
+        }
+        document.body.offsetTop;
+        var fullscreen = document.getElementById('fullscreenme');
+
+        var fullscreenChangeEvent = function(event) {
+            if (window.testRunner)
+                testRunner.notifyDone();
+        };
+
+        document.addEventListener('webkitfullscreenchange', fullscreenChangeEvent);
+        document.addEventListener('keydown', function () {
+            fullscreen.webkitRequestFullScreen();
+
+        });
+        if (window.eventSender)
+            eventSender.keyDown('a');
+    }
+    if ("webkitRequestFullScreen" in Element.prototype)
+        window.addEventListener("load", doTest, false);
+</script>
+<body>
+    <!-- when full screening the iframe, bad should not be visible -->
+    <div id="fixed-container">
+        <iframe id="fullscreenme" src="resources/green.html"></iframe>
+    </div>
+    <div id="bad"></div>
+</body>
+</html>
diff --git a/LayoutTests/fullscreen/resources/green.html b/LayoutTests/fullscreen/resources/green.html
new file mode 100644 (file)
index 0000000..9b2defa
--- /dev/null
@@ -0,0 +1,8 @@
+<html>
+  <style>
+    body {
+      background-color: green;
+    }
+  </style>
+  <body></body>
+</html>
index 135acb1..b91f6bc 100644 (file)
@@ -9,6 +9,7 @@
 
 :-webkit-full-screen-ancestor:not(iframe) {
     z-index: auto !important;
+    position: static !important;
     opacity: 1 !important;
     -webkit-transform: none !important;
     -webkit-mask: none !important;