Unreviewed, rolling out r167441.
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Apr 2014 22:48:32 +0000 (22:48 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Apr 2014 22:48:32 +0000 (22:48 +0000)
https://bugs.webkit.org/show_bug.cgi?id=132152

Caused full screen regressions on vimeo, youtube, and others.
(Requested by jernoble on #webkit).

Reverted changeset:

"Fullscreen media controls are unusable in pagination mode"
https://bugs.webkit.org/show_bug.cgi?id=131705
http://trac.webkit.org/changeset/167441

Patch by Commit Queue <commit-queue@webkit.org> on 2014-04-24

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

LayoutTests/ChangeLog
LayoutTests/fullscreen/full-screen-no-style-sharing-expected.txt
LayoutTests/fullscreen/video-cursor-auto-hide.html
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/rendering/RenderFullScreen.cpp
Source/WebCore/rendering/RenderFullScreen.h

index 312b4d3..5d46bba 100644 (file)
@@ -1,3 +1,17 @@
+2014-04-24  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r167441.
+        https://bugs.webkit.org/show_bug.cgi?id=132152
+
+        Caused full screen regressions on vimeo, youtube, and others.
+        (Requested by jernoble on #webkit).
+
+        Reverted changeset:
+
+        "Fullscreen media controls are unusable in pagination mode"
+        https://bugs.webkit.org/show_bug.cgi?id=131705
+        http://trac.webkit.org/changeset/167441
+
 2014-04-24  Zalan Bujtas  <zalan@apple.com>
 
         Subpixel rendering: Clipping on text areas when shifted by one device pixel.
index 17f8b2e..f1c49a8 100644 (file)
@@ -6,7 +6,6 @@
     <script src="full-screen-test.js"></script>
     <script>
         var wrapper = document.getElementById('wrapper');
-        var video = document.getElementById('video');
 
         function checkForHiddenMouse()
         {
@@ -18,8 +17,8 @@
         {
             if (window.internals) {
                 internals.settings.setTimeWithoutMouseMovementBeforeHidingControls(0);
-                videoBox = internals.boundingBox(video);
-                eventSender.mouseMoveTo(videoBox.left + videoBox.width / 2, videoBox.top + videoBox.height / 2);
+                wrapperBox = internals.boundingBox(wrapper);
+                eventSender.mouseMoveTo(wrapperBox.left + wrapperBox.width / 2, wrapperBox.top + wrapperBox.height / 2);
                 testExpected('window.internals.getCurrentCursorInfo()', 'type=Pointer hotSpot=0,0');
                 setTimeout(checkForHiddenMouse, 0);
             }
index 89663e1..50fb3a7 100644 (file)
@@ -1,3 +1,17 @@
+2014-04-24  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r167441.
+        https://bugs.webkit.org/show_bug.cgi?id=132152
+
+        Caused full screen regressions on vimeo, youtube, and others.
+        (Requested by jernoble on #webkit).
+
+        Reverted changeset:
+
+        "Fullscreen media controls are unusable in pagination mode"
+        https://bugs.webkit.org/show_bug.cgi?id=131705
+        http://trac.webkit.org/changeset/167441
+
 2014-04-24  Adenilson Cavalcanti  <cavalcantii@gmail.com>
 
         Unused class forward declarations in Page
index 8cf1503..4b68f5e 100644 (file)
@@ -5363,6 +5363,9 @@ void Document::webkitWillEnterFullScreenForElement(Element* element)
         m_savedPlaceholderRenderStyle = RenderStyle::clone(&renderer->style());
     }
 
+    if (m_fullScreenElement != documentElement())
+        RenderFullScreen::wrapRenderer(renderer, renderer ? renderer->parent() : nullptr, *this);
+
     m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(true);
     
     recalcStyle(Style::Force);
@@ -5427,10 +5430,10 @@ void Document::setFullScreenRenderer(RenderFullScreen* renderer)
         return;
 
     if (renderer && m_savedPlaceholderRenderStyle) 
-        renderer->setPlaceholderStyle(m_savedPlaceholderRenderStyle.releaseNonNull(), m_savedPlaceholderFrameRect);
+        renderer->createPlaceholder(m_savedPlaceholderRenderStyle.releaseNonNull(), m_savedPlaceholderFrameRect);
     else if (renderer && m_fullScreenRenderer && m_fullScreenRenderer->placeholder()) {
         RenderBlock* placeholder = m_fullScreenRenderer->placeholder();
-        renderer->setPlaceholderStyle(RenderStyle::clone(&placeholder->style()), placeholder->frameRect());
+        renderer->createPlaceholder(RenderStyle::clone(&placeholder->style()), placeholder->frameRect());
     }
 
     if (m_fullScreenRenderer)
index 25df572..97e8efd 100644 (file)
@@ -31,7 +31,6 @@
 #include "RenderBlockFlow.h"
 #include "RenderLayer.h"
 #include "RenderLayerCompositor.h"
-#include "RenderView.h"
 
 namespace WebCore {
 
@@ -51,7 +50,7 @@ private:
 
 void RenderFullScreenPlaceholder::willBeDestroyed()
 {
-    m_owner.clearPlaceholder();
+    m_owner.setPlaceholder(0);
     RenderBlockFlow::willBeDestroyed();
 }
 
@@ -105,7 +104,7 @@ static PassRef<RenderStyle> createFullScreenStyle()
     return fullscreenStyle;
 }
 
-RenderElement* RenderFullScreen::wrapRenderer(RenderObject* object, RenderElement* parent, Document& document)
+RenderFullScreen* RenderFullScreen::wrapRenderer(RenderObject* object, RenderElement* parent, Document& document)
 {
     RenderFullScreen* fullscreenRenderer = new RenderFullScreen(document, createFullScreenStyle());
     fullscreenRenderer->initializeStyle();
@@ -119,12 +118,11 @@ RenderElement* RenderFullScreen::wrapRenderer(RenderObject* object, RenderElemen
         if (RenderElement* parent = object->parent()) {
             RenderBlock* containingBlock = object->containingBlock();
             ASSERT(containingBlock);
-
             // Since we are moving the |object| to a new parent |fullscreenRenderer|,
             // the line box tree underneath our |containingBlock| is not longer valid.
             containingBlock->deleteLines();
 
-            parent->addChild(fullscreenRenderer->ensurePlaceholder(), object);
+            parent->addChild(fullscreenRenderer, object);
             object->removeFromParent();
             
             // Always just do a full layout to ensure that line boxes get deleted properly.
@@ -133,17 +131,16 @@ RenderElement* RenderFullScreen::wrapRenderer(RenderObject* object, RenderElemen
             parent->setNeedsLayoutAndPrefWidthsRecalc();
             containingBlock->setNeedsLayoutAndPrefWidthsRecalc();
         }
-
-        object->view().addChild(fullscreenRenderer);
         fullscreenRenderer->addChild(object);
+        fullscreenRenderer->setNeedsLayoutAndPrefWidthsRecalc();
     }
     document.setFullScreenRenderer(fullscreenRenderer);
-    return fullscreenRenderer->ensurePlaceholder();
+    return fullscreenRenderer;
 }
 
 void RenderFullScreen::unwrapRenderer()
 {
-    if (placeholder() && placeholder()->parent()) {
+    if (parent()) {
         RenderObject* child;
         while ((child = firstChild())) {
             // We have to clear the override size, because as a flexbox, we
@@ -152,38 +149,39 @@ void RenderFullScreen::unwrapRenderer()
             if (child->isBox())
                 toRenderBox(child)->clearOverrideSize();
             child->removeFromParent();
-            placeholder()->parent()->addChild(child, m_placeholder);
+            parent()->addChild(child, this);
+            parent()->setNeedsLayoutAndPrefWidthsRecalc();
         }
-
-        placeholder()->removeFromParent();
     }
+    if (placeholder())
+        placeholder()->removeFromParent();
     removeFromParent();
     document().setFullScreenRenderer(0);
 }
 
-void RenderFullScreen::clearPlaceholder()
+void RenderFullScreen::setPlaceholder(RenderBlock* placeholder)
 {
-    m_placeholder = nullptr;
+    m_placeholder = placeholder;
 }
 
-RenderBlock* RenderFullScreen::ensurePlaceholder()
-{
-    if (m_placeholder)
-        return m_placeholder;
-
-    m_placeholder = new RenderFullScreenPlaceholder(*this, RenderStyle::create());
-    m_placeholder->initializeStyle();
-    return m_placeholder;
-}
-
-void RenderFullScreen::setPlaceholderStyle(PassRef<RenderStyle> style, const LayoutRect& frameRect)
+void RenderFullScreen::createPlaceholder(PassRef<RenderStyle> style, const LayoutRect& frameRect)
 {
     if (style.get().width().isAuto())
         style.get().setWidth(Length(frameRect.width(), Fixed));
     if (style.get().height().isAuto())
         style.get().setHeight(Length(frameRect.height(), Fixed));
 
-    ensurePlaceholder()->setStyle(std::move(style));
+    if (m_placeholder) {
+        m_placeholder->setStyle(std::move(style));
+        return;
+    }
+
+    m_placeholder = new RenderFullScreenPlaceholder(*this, std::move(style));
+    m_placeholder->initializeStyle();
+    if (parent()) {
+        parent()->addChild(m_placeholder, this);
+        parent()->setNeedsLayoutAndPrefWidthsRecalc();
+    }
 }
 
 }
index e295ea6..c8b397a 100644 (file)
@@ -39,12 +39,11 @@ public:
     virtual bool isRenderFullScreen() const override { return true; }
     virtual const char* renderName() const override { return "RenderFullScreen"; }
 
-    void clearPlaceholder();
-    RenderBlock* ensurePlaceholder();
+    void setPlaceholder(RenderBlock*);
     RenderBlock* placeholder() { return m_placeholder; }
-    void setPlaceholderStyle(PassRef<RenderStyle>, const LayoutRect& frameRect);
+    void createPlaceholder(PassRef<RenderStyle>, const LayoutRect& frameRect);
 
-    static RenderElement* wrapRenderer(RenderObject*, RenderElement*, Document&);
+    static RenderFullScreen* wrapRenderer(RenderObject*, RenderElement*, Document&);
     void unwrapRenderer();
 
 private: