Changeset 86185 in webkit


Ignore:
Timestamp:
May 10, 2011 3:38:52 PM (13 years ago)
Author:
jer.noble@apple.com
Message:

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

Reviewed by Maciej Stachowiak.

Removing the full screen element via parent.innerHTML="" does not result in a webkitfullscreenchange event.
https://bugs.webkit.org/show_bug.cgi?id=60278

  • fullscreen/full-screen-remove-children-expected.txt: Added.
  • fullscreen/full-screen-remove-children.html: Added.
  • fullscreen/full-screen-test.js: Fixed an exception when running in Safari.

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

Reviewed by Maciej Stachowiak.

Removing the full screen element via parent.innerHTML="" does not result in a webkitfullscreenchange event.
https://bugs.webkit.org/show_bug.cgi?id=60278

Handle the removal of a full screen element from within Node::willRemove() instead
of Document::nodeWillBeRemoved(). The new function Document::fullScreenElementWillBeRemoved() will
be called by Node::willRemove() to handle those changes which used to occur in nodeWillBeRemoved().

Test: fullscreen/full-screen-remove-children.html

  • dom/Document.cpp: (WebCore::Document::nodeWillBeRemoved): Removed the code checking for the full screen element. (WebCore::Document::fullScreenElementWillBeRemoved): Added, moved from nodeWillBeRemoved.
  • dom/Document.h:
  • dom/Node.cpp: (WebCore::Node::willRemove): Check to see if this is the current full screen element.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r86171 r86185  
     12011-05-05  Jer Noble  <jer.noble@apple.com>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        Removing the full screen element via parent.innerHTML="" does not result in a webkitfullscreenchange event.
     6        https://bugs.webkit.org/show_bug.cgi?id=60278
     7
     8        * fullscreen/full-screen-remove-children-expected.txt: Added.
     9        * fullscreen/full-screen-remove-children.html: Added.
     10        * fullscreen/full-screen-test.js: Fixed an exception when running in Safari.
     11
    1122011-05-10  Kenichi Ishibashi  <bashi@chromium.org>
    213
  • trunk/LayoutTests/fullscreen/full-screen-test.js

    r85897 r86185  
    1414    // FIXME: WKTR does not yet support the keyDown() message.  Do a mouseDown here
    1515    // instead until keyDown support is added.
    16     document.addEventListener(eventSender.keyDown ? 'keypress' : 'mousedown', function() { fn(); }, false);
     16        var eventName = !window.layoutTestController || eventSender.keyDown ? 'keypress' : 'mousedown'
     17    document.addEventListener(eventName, function() { fn(); }, false);
    1718    if (window.layoutTestController) {
    1819        if (eventSender.keyDown)
  • trunk/Source/WebCore/ChangeLog

    r86184 r86185  
     12011-05-05  Jer Noble  <jer.noble@apple.com>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        Removing the full screen element via parent.innerHTML="" does not result in a webkitfullscreenchange event.
     6        https://bugs.webkit.org/show_bug.cgi?id=60278
     7
     8        Handle the removal of a full screen element from within Node::willRemove() instead
     9        of Document::nodeWillBeRemoved().  The new function Document::fullScreenElementWillBeRemoved() will
     10        be called by Node::willRemove() to handle those changes which used to occur in nodeWillBeRemoved().
     11
     12        Test: fullscreen/full-screen-remove-children.html
     13
     14        * dom/Document.cpp:
     15        (WebCore::Document::nodeWillBeRemoved): Removed the code checking for the full screen element.
     16        (WebCore::Document::fullScreenElementWillBeRemoved): Added, moved from nodeWillBeRemoved.
     17        * dom/Document.h:
     18        * dom/Node.cpp:
     19        (WebCore::Node::willRemove): Check to see if this is the current full screen element.
     20
    1212011-05-10  Beth Dakin  <bdakin@apple.com>
    222
  • trunk/Source/WebCore/dom/ContainerNode.cpp

    r85864 r86185  
    435435    document()->removeFocusedNodeOfSubtree(child.get());
    436436
     437#if ENABLE(FULLSCREEN_API)
     438    document()->removeFullScreenElementOfSubtree(child.get());
     439#endif
     440
     441
    437442    // Events fired when blurring currently focused node might have moved this
    438443    // child into a different parent.
     
    525530    // exclude this node when looking for removed focusedNode since only children will be removed
    526531    document()->removeFocusedNodeOfSubtree(this, true);
     532
     533#if ENABLE(FULLSCREEN_API)
     534    document()->removeFullScreenElementOfSubtree(this, true);
     535#endif
    527536
    528537    forbidEventDispatch();
  • trunk/Source/WebCore/dom/Document.cpp

    r86184 r86185  
    34223422        frame->page()->dragCaretController()->nodeWillBeRemoved(n);
    34233423    }
    3424    
    3425 #if ENABLE(FULLSCREEN_API)
    3426     // If the current full screen element or any of its ancestors is removed, set the current
    3427     // full screen element to the document root, and fire a fullscreenchange event to inform
    3428     // clients of the DOM.
    3429     ASSERT(n);
    3430     if (n->contains(m_fullScreenElement.get())) {
    3431         ASSERT(n != documentElement());
    3432        
    3433         if (m_fullScreenRenderer)
    3434             m_fullScreenRenderer->remove();
    3435 
    3436         setFullScreenRenderer(0);
    3437         m_fullScreenElement = documentElement();
    3438         recalcStyle(Force);
    3439         m_fullScreenChangeDelayTimer.startOneShot(0);
    3440     }
    3441 #endif
    34423424}
    34433425
     
    50014983}
    50024984
     4985void Document::fullScreenElementRemoved()
     4986{
     4987    // If the current full screen element or any of its ancestors is removed, set the current
     4988    // full screen element to the document root, and fire a fullscreenchange event to inform
     4989    // clients of the DOM.
     4990    if (m_fullScreenRenderer)
     4991        m_fullScreenRenderer->remove();
     4992   
     4993    setFullScreenRenderer(0);
     4994    m_fullScreenElement = documentElement();
     4995    recalcStyle(Force);
     4996    m_fullScreenChangeDelayTimer.startOneShot(0);
     4997}
     4998
     4999void Document::removeFullScreenElementOfSubtree(Node* node, bool amongChildrenOnly)
     5000{
     5001    if (!m_fullScreenElement)
     5002        return;
     5003   
     5004    bool elementInSubtree = false;
     5005    if (amongChildrenOnly)
     5006        elementInSubtree = m_fullScreenElement->isDescendantOf(node);
     5007    else
     5008        elementInSubtree = (m_fullScreenElement == node) || m_fullScreenElement->isDescendantOf(node);
     5009   
     5010    if (elementInSubtree)
     5011        fullScreenElementRemoved();
     5012}
    50035013#endif
    50045014
  • trunk/Source/WebCore/dom/Document.h

    r86047 r86185  
    10691069    void fullScreenChangeDelayTimerFired(Timer<Document>*);
    10701070    bool fullScreenIsAllowedForElement(Element*) const;
     1071    void fullScreenElementRemoved();
     1072    void removeFullScreenElementOfSubtree(Node*, bool amongChildrenOnly = false);
    10711073#endif
    10721074
Note: See TracChangeset for help on using the changeset viewer.