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: https://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 bd04498..039789a 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 70479f3..d9a0ab3 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 8dc2714..d9a0ab3 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 8170f43..ba84174 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 e4b1128..1e12958 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 7cd452f..cc53a6e 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 52d4ee2..30f95c1 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"; }