2011-01-10 Jer Noble <jer.noble@apple.com>
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Jan 2011 00:29:21 +0000 (00:29 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Jan 2011 00:29:21 +0000 (00:29 +0000)
        Reviewed by Simon Fraser.

        https://bugs.webkit.org/show_bug.cgi?id=52095
        REGRESSION (r75277): 2 test cases (<1%) had incorrect layout

        Fixes tests:
            fullscreen/full-screen-remove-ancestor.html
            fullscreen/full-screen-remove.html

        Revert change made in r75326, now that the underlying issue has been fixed.

        * fullscreen/full-screen-remove-ancestor-expected.txt:
        * fullscreen/full-screen-remove-expected.txt:
2011-01-10  Jer Noble  <jer.noble@apple.com>

        Reviewed by Simon Fraser.

        https://bugs.webkit.org/show_bug.cgi?id=52095
        REGRESSION (r75277): 2 test cases (<1%) had incorrect layout

        Fixes tests:
            fullscreen/full-screen-remove-ancestor.html
            fullscreen/full-screen-remove.html

        Previously, the above tests were failing because DRT dumped the contents of their
        <script> tags, though all the explicit tests were passing.  This was caused by
        the document's render tree being left in an inconsistent state when a full screen
        element's ancestor was removed from the DOM.

        In nodeWillBeRemoved(), match the code in webkitDidExitFullScreen().
        Don't detach the documentElement, but rather simply call recalcStyle(Force).

        * dom/Document.cpp:
        (WebCore::Document::nodeWillBeRemoved):
        * rendering/RenderFullScreen.cpp:
        (RenderFullScreen::setAnimating): #if ENABLED -> # if USE
        * rendering/RenderFullScreen.h:
        (WebCore::RenderFullScreen::RenderFullScreen): RenderFullScreen should be an anonymous renderer.

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

LayoutTests/ChangeLog
LayoutTests/fullscreen/full-screen-remove-ancestor-expected.txt
LayoutTests/fullscreen/full-screen-remove-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/rendering/RenderFullScreen.cpp
Source/WebCore/rendering/RenderFullScreen.h

index bd0449813176ffef5609238c797cdf3abd188870..039789a67e1b4487574b51d0b9736f39cd6c9a88 100644 (file)
@@ -1,3 +1,19 @@
+2011-01-10  Jer Noble  <jer.noble@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        https://bugs.webkit.org/show_bug.cgi?id=52095
+        REGRESSION (r75277): 2 test cases (<1%) had incorrect layout
+        
+        Fixes tests:
+            fullscreen/full-screen-remove-ancestor.html
+            fullscreen/full-screen-remove.html
+            
+        Revert change made in r75326, now that the underlying issue has been fixed.
+
+        * fullscreen/full-screen-remove-ancestor-expected.txt:
+        * fullscreen/full-screen-remove-expected.txt:
+
 2011-01-10  Mihai Parparita  <mihaip@chromium.org>
 
         Unreviewed Chromium test expectations update.
index 70479f374c6a5439a968b014f9b499e39a562195..d9a0ab300cfdce0b31cb859302e9758f1adad4bf 100644 (file)
@@ -1,42 +1,6 @@
-
 EVENT(webkitfullscreenchange)
 EXPECTED (document.webkitCurrentFullScreenElement == '[object HTMLElement]') OK
 EVENT(webkitfullscreenchange)
 EXPECTED (document.webkitCurrentFullScreenElement == '[object HTMLHtmlElement]') OK
 END OF TEST
 
-
-
-    // Bail out early if the full screen API is not enabled or is missing:
-    if (Element.prototype.webkitRequestFullScreen == undefined) {
-        logResult(false, "Element.prototype.webkitRequestFullScreen == undefined");
-        endTest();
-    } else {
-        var callback;
-        var fullscreenChanged = function(event)
-        {
-            if (callback)
-                callback(event)
-        };
-        waitForEvent(document, 'webkitfullscreenchange', fullscreenChanged);
-
-        var span = document.getElementsByTagName('span')[0];
-        var div = span.parentNode;
-
-        var spanEnteredFullScreen = function(event) {
-            callback = documentEnteredFullScreen;
-            testExpected("document.webkitCurrentFullScreenElement", span);
-            document.body.removeChild(div);
-        };
-
-        var documentEnteredFullScreen = function(event) {
-            callback = null;
-            testExpected("document.webkitCurrentFullScreenElement", document.documentElement);
-            endTest();
-        };
-
-        callback = spanEnteredFullScreen;
-        span.webkitRequestFullScreen();
-    }
-
-
index 8dc271474b78053734b67f5f0ea4e634ee4c5cf0..d9a0ab300cfdce0b31cb859302e9758f1adad4bf 100644 (file)
@@ -1,41 +1,6 @@
-
 EVENT(webkitfullscreenchange)
 EXPECTED (document.webkitCurrentFullScreenElement == '[object HTMLElement]') OK
 EVENT(webkitfullscreenchange)
 EXPECTED (document.webkitCurrentFullScreenElement == '[object HTMLHtmlElement]') OK
 END OF TEST
 
-
-
-    // Bail out early if the full screen API is not enabled or is missing:
-    if (Element.prototype.webkitRequestFullScreen == undefined) {
-        logResult(false, "Element.prototype.webkitRequestFullScreen == undefined");
-        endTest();
-    } else {
-        var callback;
-        var fullscreenChanged = function(event)
-        {
-            if (callback)
-                callback(event)
-        };
-        waitForEvent(document, 'webkitfullscreenchange', fullscreenChanged);
-    
-        var span = document.getElementsByTagName('span')[0];
-    
-        var spanEnteredFullScreen = function(event) {
-            callback = documentEnteredFullScreen;
-            testExpected("document.webkitCurrentFullScreenElement", span);
-            span.parentNode.removeChild(span);
-        };
-    
-        var documentEnteredFullScreen = function(event) {
-            callback = null;
-            testExpected("document.webkitCurrentFullScreenElement", document.documentElement);
-            endTest();
-        };
-    
-        callback = spanEnteredFullScreen;
-        span.webkitRequestFullScreen();
-    }
-
-
index 8170f432e527791cf9591e354038be9fca35137c..ba841744f4873b4b3ab4db7b420eeabb09d1b2aa 100644 (file)
@@ -1,3 +1,29 @@
+2011-01-10  Jer Noble  <jer.noble@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        https://bugs.webkit.org/show_bug.cgi?id=52095
+        REGRESSION (r75277): 2 test cases (<1%) had incorrect layout
+        
+        Fixes tests:
+            fullscreen/full-screen-remove-ancestor.html
+            fullscreen/full-screen-remove.html
+            
+        Previously, the above tests were failing because DRT dumped the contents of their
+        <script> tags, though all the explicit tests were passing.  This was caused by
+        the document's render tree being left in an inconsistent state when a full screen
+        element's ancestor was removed from the DOM.
+        
+        In nodeWillBeRemoved(), match the code in webkitDidExitFullScreen().
+        Don't detach the documentElement, but rather simply call recalcStyle(Force).
+
+        * dom/Document.cpp:
+        (WebCore::Document::nodeWillBeRemoved):
+        * rendering/RenderFullScreen.cpp:
+        (RenderFullScreen::setAnimating): #if ENABLED -> # if USE
+        * rendering/RenderFullScreen.h:
+        (WebCore::RenderFullScreen::RenderFullScreen): RenderFullScreen should be an anonymous renderer.
+
 2011-01-10  Martin Robinson  <mrobinson@igalia.com>
 
         Reviewed by Xan Lopez.
index e4b1128c998922e039cb52959accc23a0c15f13a..1e12958e0bd0a1be97f268efbaf0c43311258e62 100644 (file)
@@ -3389,11 +3389,13 @@ void Document::nodeWillBeRemoved(Node* n)
     ASSERT(n);
     if (n->contains(m_fullScreenElement.get())) {
         ASSERT(n != documentElement());
+        
+        if (m_fullScreenRenderer)
+            m_fullScreenRenderer->remove();
+
         setFullScreenRenderer(0);
         m_fullScreenElement = documentElement();
-        m_fullScreenElement->setNeedsStyleRecalc();
-        m_fullScreenElement->detach();
-        updateStyleIfNeeded();
+        recalcStyle(Force);
         m_fullScreenChangeDelayTimer.startOneShot(0);
     }
 #endif
index 7cd452f8c111bc89966b738510c23fd4e756fa2b..cc53a6e6ca49dacd8ca98fdd38f53daa1e940d84 100644 (file)
@@ -35,7 +35,7 @@ using namespace WebCore;
 void RenderFullScreen::setAnimating(bool animating)
 {
     m_isAnimating = animating;
-#if ENABLE(ACCELERATED_COMPOSITING)
+#if USE(ACCELERATED_COMPOSITING)
     if (layer())
         layer()->contentChanged(RenderLayer::FullScreenChanged);
 #endif
index 52d4ee2a7bd4edb76a79f0a7a99904344bf32010..30f95c1a38f3a89ebffd86547619b71542264a8a 100644 (file)
@@ -33,7 +33,7 @@ namespace WebCore {
 
 class RenderFullScreen : public RenderFlexibleBox {
 public:
-    RenderFullScreen(Node* node) : RenderFlexibleBox(node) { setReplaced(false); setIsAnonymous(false); }
+    RenderFullScreen(Node* node) : RenderFlexibleBox(node) { setReplaced(false); }
     virtual bool isRenderFullScreen() const { return true; }
     virtual const char* renderName() const { return "RenderFullScreen"; }