Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Side by Side Diff: Source/core/dom/FullscreenElementStack.cpp

Issue 476433002: Sync fullscreen element removal with the spec (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: nits Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/FullscreenElementStack.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
9 * Copyright (C) 2013 Google Inc. All rights reserved. 9 * Copyright (C) 2013 Google Inc. All rights reserved.
10 * 10 *
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 // If the element was removed from our tree, also message the documentEl ement. 549 // If the element was removed from our tree, also message the documentEl ement.
550 if (!target->inDocument() && document()->documentElement()) { 550 if (!target->inDocument() && document()->documentElement()) {
551 ASSERT(isPrefixed(event->type())); 551 ASSERT(isPrefixed(event->type()));
552 eventQueue.append(createEvent(event->type(), *document()->documentEl ement())); 552 eventQueue.append(createEvent(event->type(), *document()->documentEl ement()));
553 } 553 }
554 554
555 target->dispatchEvent(event); 555 target->dispatchEvent(event);
556 } 556 }
557 } 557 }
558 558
559 void FullscreenElementStack::fullScreenElementRemoved() 559 void FullscreenElementStack::elementRemoved(Element& element)
560 { 560 {
561 m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBou ndaries(false); 561 // If an element |element| in a fullscreen element stack is removed from a d ocument |document|,
562 fullyExitFullscreen(); 562 // run these steps:
563 }
564 563
565 void FullscreenElementStack::removeFullScreenElementOfSubtree(Node* node, bool a mongChildrenOnly) 564 // 1. If |element| was at the top of |document|'s fullscreen element stack, act as if the
566 { 565 // exitFullscreen() method was invoked on that document.
567 if (!m_fullScreenElement) 566 if (fullscreenElement() == &element) {
567 exitFullscreen();
568 return; 568 return;
569 }
569 570
570 // If the node isn't in a document it can't have a fullscreen'd child. 571 // 2. Otherwise, remove |element| from |document|'s fullscreen element stack .
571 if (!node->inDocument()) 572 for (size_t i = 0; i < m_fullScreenElementStack.size(); ++i) {
572 return; 573 if (m_fullScreenElementStack[i].first.get() == &element) {
574 m_fullScreenElementStack.remove(i);
575 return;
576 }
577 }
573 578
574 bool elementInSubtree = false; 579 // NOTE: |element| was not in the fullscreen element stack.
575 if (amongChildrenOnly)
576 elementInSubtree = m_fullScreenElement->isDescendantOf(node);
577 else
578 elementInSubtree = (m_fullScreenElement == node) || m_fullScreenElement- >isDescendantOf(node);
579
580 if (elementInSubtree)
581 fullScreenElementRemoved();
582 } 580 }
583 581
584 void FullscreenElementStack::clearFullscreenElementStack() 582 void FullscreenElementStack::clearFullscreenElementStack()
585 { 583 {
586 m_fullScreenElementStack.clear(); 584 m_fullScreenElementStack.clear();
587 } 585 }
588 586
589 void FullscreenElementStack::popFullscreenElementStack() 587 void FullscreenElementStack::popFullscreenElementStack()
590 { 588 {
591 if (m_fullScreenElementStack.isEmpty()) 589 if (m_fullScreenElementStack.isEmpty())
(...skipping 10 matching lines...) Expand all
602 void FullscreenElementStack::trace(Visitor* visitor) 600 void FullscreenElementStack::trace(Visitor* visitor)
603 { 601 {
604 visitor->trace(m_fullScreenElement); 602 visitor->trace(m_fullScreenElement);
605 visitor->trace(m_fullScreenElementStack); 603 visitor->trace(m_fullScreenElementStack);
606 visitor->trace(m_fullScreenRenderer); 604 visitor->trace(m_fullScreenRenderer);
607 visitor->trace(m_eventQueue); 605 visitor->trace(m_eventQueue);
608 DocumentSupplement::trace(visitor); 606 DocumentSupplement::trace(visitor);
609 } 607 }
610 608
611 } // namespace blink 609 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/FullscreenElementStack.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698