Title: [86737] trunk
Revision
86737
Author
[email protected]
Date
2011-05-17 23:12:12 -0700 (Tue, 17 May 2011)

Log Message

2011-05-17  Jeremy Noble  <[email protected]>

        Reviewed by Darin Adler.

        Removing a full-screen element or ancestor from the DOM should trigger exiting full-screen mode.
        https://bugs.webkit.org/show_bug.cgi?id=60997

        Updated the following tests with the new expectation that removing an element from the DOM will trigger
        full screen mode to exit.

        * fullscreen/full-screen-remove-ancestor-expected.txt:
        * fullscreen/full-screen-remove-ancestor.html:
        * fullscreen/full-screen-remove-children-expected.txt:
        * fullscreen/full-screen-remove-children.html:
        * fullscreen/full-screen-remove-expected.txt:
        * fullscreen/full-screen-remove.html:
2011-05-17  Jeremy Noble  <[email protected]>

        Reviewed by Darin Adler.

        Removing a full-screen element or ancestor from the DOM should trigger exiting full-screen mode.
        https://bugs.webkit.org/show_bug.cgi?id=60997

        Tests: fullscreen/full-screen-remove-ancestor.html
               fullscreen/full-screen-remove-children.html
               fullscreen/full-screen-remove.html

        * dom/Document.cpp:
        (WebCore::Document::fullScreenChangeDelayTimerFired): If the target node was removed from the document
            make sure to message the documentElement() as well.
        (WebCore::Document::fullScreenElementRemoved): Cancel full screen mode.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (86736 => 86737)


--- trunk/LayoutTests/ChangeLog	2011-05-18 05:50:53 UTC (rev 86736)
+++ trunk/LayoutTests/ChangeLog	2011-05-18 06:12:12 UTC (rev 86737)
@@ -1,3 +1,20 @@
+2011-05-17  Jeremy Noble  <[email protected]>
+
+        Reviewed by Darin Adler.
+
+        Removing a full-screen element or ancestor from the DOM should trigger exiting full-screen mode.
+        https://bugs.webkit.org/show_bug.cgi?id=60997
+
+        Updated the following tests with the new expectation that removing an element from the DOM will trigger
+        full screen mode to exit.
+
+        * fullscreen/full-screen-remove-ancestor-expected.txt:
+        * fullscreen/full-screen-remove-ancestor.html:
+        * fullscreen/full-screen-remove-children-expected.txt:
+        * fullscreen/full-screen-remove-children.html:
+        * fullscreen/full-screen-remove-expected.txt:
+        * fullscreen/full-screen-remove.html:
+
 2011-05-17  Csaba Osztrogonác  <[email protected]>
 
         [Qt] Skip failing tests on minor Qt platforms.

Modified: trunk/LayoutTests/fullscreen/full-screen-remove-ancestor-expected.txt (86736 => 86737)


--- trunk/LayoutTests/fullscreen/full-screen-remove-ancestor-expected.txt	2011-05-18 05:50:53 UTC (rev 86736)
+++ trunk/LayoutTests/fullscreen/full-screen-remove-ancestor-expected.txt	2011-05-18 06:12:12 UTC (rev 86737)
@@ -1,6 +1,6 @@
 EVENT(webkitfullscreenchange)
 EXPECTED (document.webkitCurrentFullScreenElement == '[object HTMLElement]') OK
 EVENT(webkitfullscreenchange)
-EXPECTED (document.webkitCurrentFullScreenElement == '[object HTMLHtmlElement]') OK
+EXPECTED (document.webkitCurrentFullScreenElement == 'null') OK
 END OF TEST
 

Modified: trunk/LayoutTests/fullscreen/full-screen-remove-ancestor.html (86736 => 86737)


--- trunk/LayoutTests/fullscreen/full-screen-remove-ancestor.html	2011-05-18 05:50:53 UTC (rev 86736)
+++ trunk/LayoutTests/fullscreen/full-screen-remove-ancestor.html	2011-05-18 06:12:12 UTC (rev 86737)
@@ -19,14 +19,14 @@
         var div = span.parentNode;
 
         var spanEnteredFullScreen = function(event) {
-            callback = documentEnteredFullScreen;
+            callback = spanExitedFullScreen;
             testExpected("document.webkitCurrentFullScreenElement", span);
             document.body.removeChild(div);
         };
 
-        var documentEnteredFullScreen = function(event) {
+        var spanExitedFullScreen = function(event) {
             callback = null;
-            testExpected("document.webkitCurrentFullScreenElement", document.documentElement);
+            testExpected("document.webkitCurrentFullScreenElement", null);
             endTest();
         };
 

Modified: trunk/LayoutTests/fullscreen/full-screen-remove-children-expected.txt (86736 => 86737)


--- trunk/LayoutTests/fullscreen/full-screen-remove-children-expected.txt	2011-05-18 05:50:53 UTC (rev 86736)
+++ trunk/LayoutTests/fullscreen/full-screen-remove-children-expected.txt	2011-05-18 06:12:12 UTC (rev 86737)
@@ -1,6 +1,6 @@
 EVENT(webkitfullscreenchange)
 EXPECTED (document.webkitCurrentFullScreenElement == '[object HTMLElement]') OK
 EVENT(webkitfullscreenchange)
-EXPECTED (document.webkitCurrentFullScreenElement == '[object HTMLHtmlElement]') OK
+EXPECTED (document.webkitCurrentFullScreenElement == 'null') OK
 END OF TEST
 

Modified: trunk/LayoutTests/fullscreen/full-screen-remove-children.html (86736 => 86737)


--- trunk/LayoutTests/fullscreen/full-screen-remove-children.html	2011-05-18 05:50:53 UTC (rev 86736)
+++ trunk/LayoutTests/fullscreen/full-screen-remove-children.html	2011-05-18 06:12:12 UTC (rev 86737)
@@ -19,14 +19,14 @@
         var div = span.parentNode;
 
         var spanEnteredFullScreen = function(event) {
-            callback = documentEnteredFullScreen;
+            callback = spanExitedFullScreen;
             testExpected("document.webkitCurrentFullScreenElement", span);
             div.innerHTML = "";
         };
 
-        var documentEnteredFullScreen = function(event) {
+        var spanExitedFullScreen = function(event) {
             callback = null;
-            testExpected("document.webkitCurrentFullScreenElement", document.documentElement);
+            testExpected("document.webkitCurrentFullScreenElement", null);
             endTest();
         };
 

Modified: trunk/LayoutTests/fullscreen/full-screen-remove-expected.txt (86736 => 86737)


--- trunk/LayoutTests/fullscreen/full-screen-remove-expected.txt	2011-05-18 05:50:53 UTC (rev 86736)
+++ trunk/LayoutTests/fullscreen/full-screen-remove-expected.txt	2011-05-18 06:12:12 UTC (rev 86737)
@@ -1,6 +1,6 @@
 EVENT(webkitfullscreenchange)
 EXPECTED (document.webkitCurrentFullScreenElement == '[object HTMLElement]') OK
 EVENT(webkitfullscreenchange)
-EXPECTED (document.webkitCurrentFullScreenElement == '[object HTMLHtmlElement]') OK
+EXPECTED (document.webkitCurrentFullScreenElement == 'null') OK
 END OF TEST
 

Modified: trunk/LayoutTests/fullscreen/full-screen-remove.html (86736 => 86737)


--- trunk/LayoutTests/fullscreen/full-screen-remove.html	2011-05-18 05:50:53 UTC (rev 86736)
+++ trunk/LayoutTests/fullscreen/full-screen-remove.html	2011-05-18 06:12:12 UTC (rev 86737)
@@ -18,14 +18,14 @@
         var span = document.getElementsByTagName('span')[0];
     
         var spanEnteredFullScreen = function(event) {
-            callback = documentEnteredFullScreen;
+            callback = spanExitedFullScreen;
             testExpected("document.webkitCurrentFullScreenElement", span);
             span.parentNode.removeChild(span);
         };
     
-        var documentEnteredFullScreen = function(event) {
+        var spanExitedFullScreen = function(event) {
             callback = null;
-            testExpected("document.webkitCurrentFullScreenElement", document.documentElement);
+            testExpected("document.webkitCurrentFullScreenElement", null);
             endTest();
         };
     

Modified: trunk/Source/WebCore/ChangeLog (86736 => 86737)


--- trunk/Source/WebCore/ChangeLog	2011-05-18 05:50:53 UTC (rev 86736)
+++ trunk/Source/WebCore/ChangeLog	2011-05-18 06:12:12 UTC (rev 86737)
@@ -1,3 +1,19 @@
+2011-05-17  Jeremy Noble  <[email protected]>
+
+        Reviewed by Darin Adler.
+
+        Removing a full-screen element or ancestor from the DOM should trigger exiting full-screen mode.
+        https://bugs.webkit.org/show_bug.cgi?id=60997
+
+        Tests: fullscreen/full-screen-remove-ancestor.html
+               fullscreen/full-screen-remove-children.html
+               fullscreen/full-screen-remove.html
+
+        * dom/Document.cpp:
+        (WebCore::Document::fullScreenChangeDelayTimerFired): If the target node was removed from the document
+            make sure to message the documentElement() as well.
+        (WebCore::Document::fullScreenElementRemoved): Cancel full screen mode.
+
 2011-05-17  Yuta Kitamura  <[email protected]>
 
         Reviewed by Kent Tamura.

Modified: trunk/Source/WebCore/dom/Document.cpp (86736 => 86737)


--- trunk/Source/WebCore/dom/Document.cpp	2011-05-18 05:50:53 UTC (rev 86736)
+++ trunk/Source/WebCore/dom/Document.cpp	2011-05-18 06:12:12 UTC (rev 86737)
@@ -4987,26 +4987,16 @@
             element = documentElement();
         
         element->dispatchEvent(Event::create(eventNames().webkitfullscreenchangeEvent, true, false));
+
+        // If the element was removed from our tree, also message the documentElement.
+        if (!contains(element.get()))
+            m_fullScreenChangeEventTargetQueue.append(documentElement());
     }
 }
 
 void Document::fullScreenElementRemoved()
 {
-    // If the current full screen element or any of its ancestors is removed, set the current
-    // full screen element to the document root, and fire a fullscreenchange event to inform 
-    // clients of the DOM.
-    if (m_fullScreenRenderer)
-        m_fullScreenRenderer->remove();
-    setFullScreenRenderer(0);
-
-    m_fullScreenChangeEventTargetQueue.append(m_fullScreenElement.release());
-    m_fullScreenElement = documentElement();
-    recalcStyle(Force);
-    
-    // Dispatch this event manually, before the element is actually removed from the DOM
-    // so that the message cascades as expected.
-    fullScreenChangeDelayTimerFired(&m_fullScreenChangeDelayTimer);
-    m_fullScreenChangeDelayTimer.stop();
+    webkitCancelFullScreen();
 }
 
 void Document::removeFullScreenElementOfSubtree(Node* node, bool amongChildrenOnly)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to