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

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

Issue 473803002: Tweak the documentation of "fullscreen element ready check" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 { 164 {
165 // NOTE: the context dispose phase is not supported in oilpan. Please 165 // NOTE: the context dispose phase is not supported in oilpan. Please
166 // consider using the detach phase instead. 166 // consider using the detach phase instead.
167 m_fullScreenElement = nullptr; 167 m_fullScreenElement = nullptr;
168 m_fullScreenElementStack.clear(); 168 m_fullScreenElementStack.clear();
169 } 169 }
170 #endif 170 #endif
171 171
172 bool FullscreenElementStack::elementReady(Element& element, RequestType requestT ype) 172 bool FullscreenElementStack::elementReady(Element& element, RequestType requestT ype)
173 { 173 {
174 // A fullscreen element ready check for an element returns true if all of th e following are 174 // A fullscreen element ready check for an element |element| returns true if all of the
175 // true, and false otherwise: 175 // following are true, and false otherwise:
176 176
177 // element is in a document. 177 // |element| is in a document.
178 if (!element.inDocument()) 178 if (!element.inDocument())
179 return false; 179 return false;
180 180
181 // element's node document's fullscreen enabled flag is set. 181 // |element|'s node document's fullscreen enabled flag is set.
182 if (!fullscreenIsAllowedForAllOwners(element.document())) { 182 if (!fullscreenIsAllowedForAllOwners(element.document())) {
183 if (requestType == PrefixedVideoRequest) 183 if (requestType == PrefixedVideoRequest)
184 UseCounter::count(element.document(), UseCounter::VideoFullscreenAll owedExemption); 184 UseCounter::count(element.document(), UseCounter::VideoFullscreenAll owedExemption);
185 else 185 else
186 return false; 186 return false;
187 } 187 }
188 188
189 // element's node document's fullscreen element stack is either empty or its top element is an 189 // |element|'s node document's fullscreen element stack is either empty or i ts top element is an
190 // ancestor of element. 190 // ancestor of |element|.
191 if (Element* topElement = fullscreenElementFrom(element.document())) { 191 if (Element* topElement = fullscreenElementFrom(element.document())) {
192 if (!element.isDescendantOf(topElement)) 192 if (!element.isDescendantOf(topElement))
193 return false; 193 return false;
194 } 194 }
195 195
196 // element has no ancestor element whose local name is iframe and namespace is the HTML 196 // |element| has no ancestor element whose local name is iframe and namespac e is the HTML
197 // namespace. 197 // namespace.
198 if (Traversal<HTMLIFrameElement>::firstAncestor(element)) 198 if (Traversal<HTMLIFrameElement>::firstAncestor(element))
199 return false; 199 return false;
200 200
201 return true; 201 return true;
202 } 202 }
203 203
204 void FullscreenElementStack::requestFullscreen(Element& element, RequestType req uestType) 204 void FullscreenElementStack::requestFullscreen(Element& element, RequestType req uestType)
205 { 205 {
206 // Ignore this request if the document is not in a live frame. 206 // Ignore this request if the document is not in a live frame.
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 void FullscreenElementStack::trace(Visitor* visitor) 602 void FullscreenElementStack::trace(Visitor* visitor)
603 { 603 {
604 visitor->trace(m_fullScreenElement); 604 visitor->trace(m_fullScreenElement);
605 visitor->trace(m_fullScreenElementStack); 605 visitor->trace(m_fullScreenElementStack);
606 visitor->trace(m_fullScreenRenderer); 606 visitor->trace(m_fullScreenRenderer);
607 visitor->trace(m_eventQueue); 607 visitor->trace(m_eventQueue);
608 DocumentSupplement::trace(visitor); 608 DocumentSupplement::trace(visitor);
609 } 609 }
610 610
611 } // namespace blink 611 } // 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