Changeset 86737 in webkit


Ignore:
Timestamp:
May 17, 2011 11:12:12 PM (13 years ago)
Author:
jer.noble@apple.com
Message:

2011-05-17 Jeremy Noble <jer.noble@apple.com>

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 <jer.noble@apple.com>

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.

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r86736 r86737  
     12011-05-17  Jeremy Noble  <jer.noble@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Removing a full-screen element or ancestor from the DOM should trigger exiting full-screen mode.
     6        https://bugs.webkit.org/show_bug.cgi?id=60997
     7
     8        Updated the following tests with the new expectation that removing an element from the DOM will trigger
     9        full screen mode to exit.
     10
     11        * fullscreen/full-screen-remove-ancestor-expected.txt:
     12        * fullscreen/full-screen-remove-ancestor.html:
     13        * fullscreen/full-screen-remove-children-expected.txt:
     14        * fullscreen/full-screen-remove-children.html:
     15        * fullscreen/full-screen-remove-expected.txt:
     16        * fullscreen/full-screen-remove.html:
     17
    1182011-05-17  Csaba Osztrogonác  <ossy@webkit.org>
    219
  • trunk/LayoutTests/fullscreen/full-screen-remove-ancestor-expected.txt

    r75450 r86737  
    22EXPECTED (document.webkitCurrentFullScreenElement == '[object HTMLElement]') OK
    33EVENT(webkitfullscreenchange)
    4 EXPECTED (document.webkitCurrentFullScreenElement == '[object HTMLHtmlElement]') OK
     4EXPECTED (document.webkitCurrentFullScreenElement == 'null') OK
    55END OF TEST
    66
  • trunk/LayoutTests/fullscreen/full-screen-remove-ancestor.html

    r81038 r86737  
    2020
    2121        var spanEnteredFullScreen = function(event) {
    22             callback = documentEnteredFullScreen;
     22            callback = spanExitedFullScreen;
    2323            testExpected("document.webkitCurrentFullScreenElement", span);
    2424            document.body.removeChild(div);
    2525        };
    2626
    27         var documentEnteredFullScreen = function(event) {
     27        var spanExitedFullScreen = function(event) {
    2828            callback = null;
    29             testExpected("document.webkitCurrentFullScreenElement", document.documentElement);
     29            testExpected("document.webkitCurrentFullScreenElement", null);
    3030            endTest();
    3131        };
  • trunk/LayoutTests/fullscreen/full-screen-remove-children-expected.txt

    r86185 r86737  
    22EXPECTED (document.webkitCurrentFullScreenElement == '[object HTMLElement]') OK
    33EVENT(webkitfullscreenchange)
    4 EXPECTED (document.webkitCurrentFullScreenElement == '[object HTMLHtmlElement]') OK
     4EXPECTED (document.webkitCurrentFullScreenElement == 'null') OK
    55END OF TEST
    66
  • trunk/LayoutTests/fullscreen/full-screen-remove-children.html

    r86185 r86737  
    2020
    2121        var spanEnteredFullScreen = function(event) {
    22             callback = documentEnteredFullScreen;
     22            callback = spanExitedFullScreen;
    2323            testExpected("document.webkitCurrentFullScreenElement", span);
    2424            div.innerHTML = "";
    2525        };
    2626
    27         var documentEnteredFullScreen = function(event) {
     27        var spanExitedFullScreen = function(event) {
    2828            callback = null;
    29             testExpected("document.webkitCurrentFullScreenElement", document.documentElement);
     29            testExpected("document.webkitCurrentFullScreenElement", null);
    3030            endTest();
    3131        };
  • trunk/LayoutTests/fullscreen/full-screen-remove-expected.txt

    r75450 r86737  
    22EXPECTED (document.webkitCurrentFullScreenElement == '[object HTMLElement]') OK
    33EVENT(webkitfullscreenchange)
    4 EXPECTED (document.webkitCurrentFullScreenElement == '[object HTMLHtmlElement]') OK
     4EXPECTED (document.webkitCurrentFullScreenElement == 'null') OK
    55END OF TEST
    66
  • trunk/LayoutTests/fullscreen/full-screen-remove.html

    r81038 r86737  
    1919   
    2020        var spanEnteredFullScreen = function(event) {
    21             callback = documentEnteredFullScreen;
     21            callback = spanExitedFullScreen;
    2222            testExpected("document.webkitCurrentFullScreenElement", span);
    2323            span.parentNode.removeChild(span);
    2424        };
    2525   
    26         var documentEnteredFullScreen = function(event) {
     26        var spanExitedFullScreen = function(event) {
    2727            callback = null;
    28             testExpected("document.webkitCurrentFullScreenElement", document.documentElement);
     28            testExpected("document.webkitCurrentFullScreenElement", null);
    2929            endTest();
    3030        };
  • trunk/Source/WebCore/ChangeLog

    r86732 r86737  
     12011-05-17  Jeremy Noble  <jer.noble@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Removing a full-screen element or ancestor from the DOM should trigger exiting full-screen mode.
     6        https://bugs.webkit.org/show_bug.cgi?id=60997
     7
     8        Tests: fullscreen/full-screen-remove-ancestor.html
     9               fullscreen/full-screen-remove-children.html
     10               fullscreen/full-screen-remove.html
     11
     12        * dom/Document.cpp:
     13        (WebCore::Document::fullScreenChangeDelayTimerFired): If the target node was removed from the document
     14            make sure to message the documentElement() as well.
     15        (WebCore::Document::fullScreenElementRemoved): Cancel full screen mode.
     16
    1172011-05-17  Yuta Kitamura  <yutak@chromium.org>
    218
  • trunk/Source/WebCore/dom/Document.cpp

    r86700 r86737  
    49884988       
    49894989        element->dispatchEvent(Event::create(eventNames().webkitfullscreenchangeEvent, true, false));
     4990
     4991        // If the element was removed from our tree, also message the documentElement.
     4992        if (!contains(element.get()))
     4993            m_fullScreenChangeEventTargetQueue.append(documentElement());
    49904994    }
    49914995}
     
    49934997void Document::fullScreenElementRemoved()
    49944998{
    4995     // If the current full screen element or any of its ancestors is removed, set the current
    4996     // full screen element to the document root, and fire a fullscreenchange event to inform
    4997     // clients of the DOM.
    4998     if (m_fullScreenRenderer)
    4999         m_fullScreenRenderer->remove();
    5000     setFullScreenRenderer(0);
    5001 
    5002     m_fullScreenChangeEventTargetQueue.append(m_fullScreenElement.release());
    5003     m_fullScreenElement = documentElement();
    5004     recalcStyle(Force);
    5005    
    5006     // Dispatch this event manually, before the element is actually removed from the DOM
    5007     // so that the message cascades as expected.
    5008     fullScreenChangeDelayTimerFired(&m_fullScreenChangeDelayTimer);
    5009     m_fullScreenChangeDelayTimer.stop();
     4999    webkitCancelFullScreen();
    50105000}
    50115001
Note: See TracChangeset for help on using the changeset viewer.