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

Unified Diff: Source/core/dom/FullscreenElementStack.cpp

Issue 317493002: Change FrameTree to return Frames instead of LocalFrames. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: dcheng's comment addressed Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/DocumentInit.cpp ('k') | Source/core/dom/TreeScope.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/FullscreenElementStack.cpp
diff --git a/Source/core/dom/FullscreenElementStack.cpp b/Source/core/dom/FullscreenElementStack.cpp
index c4474020267df308cf732f2e9c91ca2e3d782755..8d0b0bed9dd1993f3ae0d864e8497624c1114390 100644
--- a/Source/core/dom/FullscreenElementStack.cpp
+++ b/Source/core/dom/FullscreenElementStack.cpp
@@ -189,9 +189,11 @@ void FullscreenElementStack::requestFullScreenForElement(Element* element, unsig
// A descendant browsing context's document has a non-empty fullscreen element stack.
bool descendentHasNonEmptyStack = false;
- for (LocalFrame* descendant = document()->frame() ? document()->frame()->tree().traverseNext() : 0; descendant; descendant = descendant->tree().traverseNext()) {
- ASSERT(descendant->document());
- if (fullscreenElementFrom(*descendant->document())) {
+ for (Frame* descendant = document()->frame() ? document()->frame()->tree().traverseNext() : 0; descendant; descendant = descendant->tree().traverseNext()) {
+ if (!descendant->isLocalFrame())
+ continue;
+ ASSERT(toLocalFrame(descendant)->document());
+ if (fullscreenElementFrom(*toLocalFrame(descendant)->document())) {
descendentHasNonEmptyStack = true;
break;
}
@@ -302,10 +304,12 @@ void FullscreenElementStack::webkitExitFullscreen()
// element stack (if any), ordered so that the child of the doc is last and the document furthest
// away from the doc is first.
WillBeHeapDeque<RefPtrWillBeMember<Document> > descendants;
- for (LocalFrame* descendant = document()->frame() ? document()->frame()->tree().traverseNext() : 0; descendant; descendant = descendant->tree().traverseNext()) {
- ASSERT(descendant->document());
- if (fullscreenElementFrom(*descendant->document()))
- descendants.prepend(descendant->document());
+ for (Frame* descendant = document()->frame() ? document()->frame()->tree().traverseNext() : 0; descendant; descendant = descendant->tree().traverseNext()) {
+ if (!descendant->isLocalFrame())
+ continue;
+ ASSERT(toLocalFrame(descendant)->document());
+ if (fullscreenElementFrom(*toLocalFrame(descendant)->document()))
+ descendants.prepend(toLocalFrame(descendant)->document());
}
// 4. For each descendant in descendants, empty descendant's fullscreen element stack, and queue a
« no previous file with comments | « Source/core/dom/DocumentInit.cpp ('k') | Source/core/dom/TreeScope.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698