Elements can appear over fullscreen video
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Jan 2012 17:38:34 +0000 (17:38 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Jan 2012 17:38:34 +0000 (17:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=75913

Reviewed by Simon Fraser.

Source/WebCore:

No new tests; updated fullscreen/full-screen-zIndex.html to trigger error condition.

RenderFullScreenPlaceholder inherits the pre-fullscreen element's style, causing a stacking
context to be created.  Instead of making the placeholder the parent of the RenderFullScreen
object, make the two renderers siblings.  Then the stacking context created by the placeholder
will not affect the z-ordering of the RenderFullScreen.

* rendering/RenderFullScreen.cpp:
(RenderFullScreen::wrapRenderer):
(RenderFullScreen::unwrapRenderer):
(RenderFullScreen::createPlaceholder):

LayoutTests:

Update the test to trigger the error condition in the linked bug.

* fullscreen/full-screen-zIndex.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@104589 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fullscreen/full-screen-zIndex.html
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderFullScreen.cpp

index 97c721e..95065a5 100644 (file)
@@ -1,3 +1,14 @@
+2012-01-09  Jer Noble  <jer.noble@apple.com>
+
+        Elements can appear over fullscreen video
+        https://bugs.webkit.org/show_bug.cgi?id=75913
+
+        Reviewed by Simon Fraser.
+
+        Update the test to trigger the error condition in the linked bug.
+
+        * fullscreen/full-screen-zIndex.html:
+
 2012-01-10  Julien Chaffraix  <jchaffraix@webkit.org>
 
         REGRESSION (r93614): Safari Reader doesn't repaint correctly when scrolling
index 2d0d7ca..594c5b8 100644 (file)
@@ -26,6 +26,8 @@
                 height: 100px;
                 border: 4px solid darkgreen;
                 background-color: green;
+                z-index: 100;
+                position: relative;
             }
             #block2 {
                 width: 100px;
index adafb91..e83ea78 100644 (file)
@@ -1,3 +1,22 @@
+2012-01-09  Jer Noble  <jer.noble@apple.com>
+
+        Elements can appear over fullscreen video
+        https://bugs.webkit.org/show_bug.cgi?id=75913
+
+        Reviewed by Simon Fraser.
+
+        No new tests; updated fullscreen/full-screen-zIndex.html to trigger error condition.
+
+        RenderFullScreenPlaceholder inherits the pre-fullscreen element's style, causing a stacking
+        context to be created.  Instead of making the placeholder the parent of the RenderFullScreen
+        object, make the two renderers siblings.  Then the stacking context created by the placeholder
+        will not affect the z-ordering of the RenderFullScreen.
+
+        * rendering/RenderFullScreen.cpp:
+        (RenderFullScreen::wrapRenderer):
+        (RenderFullScreen::unwrapRenderer):
+        (RenderFullScreen::createPlaceholder):
+
 2012-01-10  Pavel Feldman  <pfeldman@google.com>
 
         Web Inspector: add "free flow DOM editing" experiment.
index 014f17a..1d689f5 100644 (file)
@@ -117,21 +117,20 @@ RenderObject* RenderFullScreen::wrapRenderer(RenderObject* object, Document* doc
         fullscreenRenderer->addChild(object);
     }
     document->setFullScreenRenderer(fullscreenRenderer);
-    if (fullscreenRenderer->placeholder())
-        return fullscreenRenderer->placeholder();
     return fullscreenRenderer;
 }
 
 void RenderFullScreen::unwrapRenderer()
 {
-    RenderObject* holder = placeholder() ? placeholder() : this;
-    if (holder->parent()) {
+    if (parent()) {
         RenderObject* child;
         while ((child = firstChild())) {
             child->remove();
-            holder->parent()->addChild(child, holder);
+            parent()->addChild(child, this);
         }
     }
+    if (placeholder())
+        placeholder()->remove();
     remove();
     document()->setFullScreenRenderer(0);
 }
@@ -151,11 +150,8 @@ void RenderFullScreen::createPlaceholder(PassRefPtr<RenderStyle> style, const In
     if (!m_placeholder) {
         m_placeholder = new (document()->renderArena()) RenderFullScreenPlaceholder(this);
         m_placeholder->setStyle(style);
-        if (parent()) {
+        if (parent())
             parent()->addChild(m_placeholder, this);
-            remove();
-        }
-        m_placeholder->addChild(this);
     } else
         m_placeholder->setStyle(style);
 }