Title: [86880] branches/safari-534.36-branch

Diff

Modified: branches/safari-534.36-branch/LayoutTests/ChangeLog (86879 => 86880)


--- branches/safari-534.36-branch/LayoutTests/ChangeLog	2011-05-19 20:10:06 UTC (rev 86879)
+++ branches/safari-534.36-branch/LayoutTests/ChangeLog	2011-05-19 20:11:47 UTC (rev 86880)
@@ -1,5 +1,26 @@
 2011-05-19  Lucas Forschler  <[email protected]
 
+    Merged r86737.
+
+    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-19  Lucas Forschler  <[email protected]
+
     Merge r86727.
     
     2011-05-17  Geoffrey Garen  <[email protected]>

Modified: branches/safari-534.36-branch/LayoutTests/fullscreen/full-screen-remove-ancestor-expected.txt (86879 => 86880)


--- branches/safari-534.36-branch/LayoutTests/fullscreen/full-screen-remove-ancestor-expected.txt	2011-05-19 20:10:06 UTC (rev 86879)
+++ branches/safari-534.36-branch/LayoutTests/fullscreen/full-screen-remove-ancestor-expected.txt	2011-05-19 20:11:47 UTC (rev 86880)
@@ -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: branches/safari-534.36-branch/LayoutTests/fullscreen/full-screen-remove-ancestor.html (86879 => 86880)


--- branches/safari-534.36-branch/LayoutTests/fullscreen/full-screen-remove-ancestor.html	2011-05-19 20:10:06 UTC (rev 86879)
+++ branches/safari-534.36-branch/LayoutTests/fullscreen/full-screen-remove-ancestor.html	2011-05-19 20:11:47 UTC (rev 86880)
@@ -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: branches/safari-534.36-branch/LayoutTests/fullscreen/full-screen-remove-children-expected.txt (86879 => 86880)


--- branches/safari-534.36-branch/LayoutTests/fullscreen/full-screen-remove-children-expected.txt	2011-05-19 20:10:06 UTC (rev 86879)
+++ branches/safari-534.36-branch/LayoutTests/fullscreen/full-screen-remove-children-expected.txt	2011-05-19 20:11:47 UTC (rev 86880)
@@ -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: branches/safari-534.36-branch/LayoutTests/fullscreen/full-screen-remove-children.html (86879 => 86880)


--- branches/safari-534.36-branch/LayoutTests/fullscreen/full-screen-remove-children.html	2011-05-19 20:10:06 UTC (rev 86879)
+++ branches/safari-534.36-branch/LayoutTests/fullscreen/full-screen-remove-children.html	2011-05-19 20:11:47 UTC (rev 86880)
@@ -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: branches/safari-534.36-branch/LayoutTests/fullscreen/full-screen-remove-expected.txt (86879 => 86880)


--- branches/safari-534.36-branch/LayoutTests/fullscreen/full-screen-remove-expected.txt	2011-05-19 20:10:06 UTC (rev 86879)
+++ branches/safari-534.36-branch/LayoutTests/fullscreen/full-screen-remove-expected.txt	2011-05-19 20:11:47 UTC (rev 86880)
@@ -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: branches/safari-534.36-branch/LayoutTests/fullscreen/full-screen-remove.html (86879 => 86880)


--- branches/safari-534.36-branch/LayoutTests/fullscreen/full-screen-remove.html	2011-05-19 20:10:06 UTC (rev 86879)
+++ branches/safari-534.36-branch/LayoutTests/fullscreen/full-screen-remove.html	2011-05-19 20:11:47 UTC (rev 86880)
@@ -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: branches/safari-534.36-branch/Source/WebCore/ChangeLog (86879 => 86880)


--- branches/safari-534.36-branch/Source/WebCore/ChangeLog	2011-05-19 20:10:06 UTC (rev 86879)
+++ branches/safari-534.36-branch/Source/WebCore/ChangeLog	2011-05-19 20:11:47 UTC (rev 86880)
@@ -1,3 +1,23 @@
+2011-05-19  Lucas Forschler  <[email protected]
+
+    Merged r86737.
+
+    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  Cris Neckar  <[email protected]>
 
         Reviewed by Adam Barth.

Modified: branches/safari-534.36-branch/Source/WebCore/dom/Document.cpp (86879 => 86880)


--- branches/safari-534.36-branch/Source/WebCore/dom/Document.cpp	2011-05-19 20:10:06 UTC (rev 86879)
+++ branches/safari-534.36-branch/Source/WebCore/dom/Document.cpp	2011-05-19 20:11:47 UTC (rev 86880)
@@ -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