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

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

Issue 392913002: Simplify an error condition in requestFullScreenForElement() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 break; 166 break;
167 167
168 // The context object's node document, or an ancestor browsing context's document does not have 168 // The context object's node document, or an ancestor browsing context's document does not have
169 // the fullscreen enabled flag set. 169 // the fullscreen enabled flag set.
170 if (requestType != PrefixedVideoRequest && !fullscreenIsAllowedForAllOwn ers(element.document())) 170 if (requestType != PrefixedVideoRequest && !fullscreenIsAllowedForAllOwn ers(element.document()))
171 break; 171 break;
172 172
173 // The context object's node document fullscreen element stack is not em pty and its top element 173 // The context object's node document fullscreen element stack is not em pty and its top element
174 // is not an ancestor of the context object. (NOTE: Ignore this requirem ent if the request was 174 // is not an ancestor of the context object. (NOTE: Ignore this requirem ent if the request was
175 // made via the legacy Mozilla-style API.) 175 // made via the legacy Mozilla-style API.)
176 if (!m_fullScreenElementStack.isEmpty()) { 176 if (Element* lastElementOnStack = fullscreenElement()) {
177 Element* lastElementOnStack = m_fullScreenElementStack.last().get(); 177 if (!element.isDescendantOf(lastElementOnStack)) {
178 if (lastElementOnStack == &element || !lastElementOnStack->contains( &element)) {
179 if (inLegacyMozillaMode) 178 if (inLegacyMozillaMode)
180 UseCounter::count(element.document(), UseCounter::LegacyFull ScreenErrorExemption); 179 UseCounter::count(element.document(), UseCounter::LegacyFull ScreenErrorExemption);
181 else 180 else
182 break; 181 break;
183 } 182 }
184 } 183 }
185 184
186 // A descendant browsing context's document has a non-empty fullscreen e lement stack. 185 // A descendant browsing context's document has a non-empty fullscreen e lement stack.
187 bool descendentHasNonEmptyStack = false; 186 bool descendentHasNonEmptyStack = false;
188 for (Frame* descendant = document()->frame() ? document()->frame()->tree ().traverseNext() : 0; descendant; descendant = descendant->tree().traverseNext( )) { 187 for (Frame* descendant = document()->frame() ? document()->frame()->tree ().traverseNext() : 0; descendant; descendant = descendant->tree().traverseNext( )) {
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 568
570 void FullscreenElementStack::trace(Visitor* visitor) 569 void FullscreenElementStack::trace(Visitor* visitor)
571 { 570 {
572 visitor->trace(m_fullScreenElement); 571 visitor->trace(m_fullScreenElement);
573 visitor->trace(m_fullScreenElementStack); 572 visitor->trace(m_fullScreenElementStack);
574 visitor->trace(m_eventQueue); 573 visitor->trace(m_eventQueue);
575 DocumentSupplement::trace(visitor); 574 DocumentSupplement::trace(visitor);
576 } 575 }
577 576
578 } // namespace WebCore 577 } // namespace WebCore
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