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

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

Issue 477133002: Sync fullscreen element removal with the spec (again) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase 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 | « no previous file | 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 Fullscreen::elementRemoved(Element& element) 559 void Fullscreen::elementRemoved(Element& oldNode)
560 { 560 {
561 // If an element |element| in a fullscreen element stack is removed from a d ocument |document|, 561 // Whenever the removing steps run with an |oldNode| and |oldNode| is in its node document's
562 // run these steps: 562 // fullscreen element stack, run these steps:
563 563
564 // 1. If |element| was at the top of |document|'s fullscreen element stack, act as if the 564 // 1. If |oldNode| is at the top of its node document's fullscreen element s tack, act as if the
565 // exitFullscreen() method was invoked on that document. 565 // exitFullscreen() method was invoked on that document.
566 if (fullscreenElement() == &element) { 566 if (fullscreenElement() == &oldNode) {
567 exitFullscreen(); 567 exitFullscreen();
568 return; 568 return;
569 } 569 }
570 570
571 // 2. Otherwise, remove |element| from |document|'s fullscreen element stack . 571 // 2. Otherwise, remove |oldNode| from its node document's fullscreen elemen t stack.
572 for (size_t i = 0; i < m_fullScreenElementStack.size(); ++i) { 572 for (size_t i = 0; i < m_fullScreenElementStack.size(); ++i) {
573 if (m_fullScreenElementStack[i].first.get() == &element) { 573 if (m_fullScreenElementStack[i].first.get() == &oldNode) {
574 m_fullScreenElementStack.remove(i); 574 m_fullScreenElementStack.remove(i);
575 return; 575 return;
576 } 576 }
577 } 577 }
578 578
579 // NOTE: |element| was not in the fullscreen element stack. 579 // NOTE: |oldNode| was not in the fullscreen element stack.
580 } 580 }
581 581
582 void Fullscreen::clearFullscreenElementStack() 582 void Fullscreen::clearFullscreenElementStack()
583 { 583 {
584 m_fullScreenElementStack.clear(); 584 m_fullScreenElementStack.clear();
585 } 585 }
586 586
587 void Fullscreen::popFullscreenElementStack() 587 void Fullscreen::popFullscreenElementStack()
588 { 588 {
589 if (m_fullScreenElementStack.isEmpty()) 589 if (m_fullScreenElementStack.isEmpty())
(...skipping 10 matching lines...) Expand all
600 void Fullscreen::trace(Visitor* visitor) 600 void Fullscreen::trace(Visitor* visitor)
601 { 601 {
602 visitor->trace(m_fullScreenElement); 602 visitor->trace(m_fullScreenElement);
603 visitor->trace(m_fullScreenElementStack); 603 visitor->trace(m_fullScreenElementStack);
604 visitor->trace(m_fullScreenRenderer); 604 visitor->trace(m_fullScreenRenderer);
605 visitor->trace(m_eventQueue); 605 visitor->trace(m_eventQueue);
606 DocumentSupplement::trace(visitor); 606 DocumentSupplement::trace(visitor);
607 } 607 }
608 608
609 } // namespace blink 609 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698