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

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

Issue 179163004: Have Document::topDocument() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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
Index: Source/core/dom/FullscreenElementStack.cpp
diff --git a/Source/core/dom/FullscreenElementStack.cpp b/Source/core/dom/FullscreenElementStack.cpp
index 722445fd20b574e1c2218bbb04d471a52c10503f..ea8e967c740e0f44a2657c07b47d4720f6ac2550 100644
--- a/Source/core/dom/FullscreenElementStack.cpp
+++ b/Source/core/dom/FullscreenElementStack.cpp
@@ -257,19 +257,18 @@ void FullscreenElementStack::requestFullScreenForElement(Element* element, unsig
void FullscreenElementStack::webkitCancelFullScreen()
{
- ASSERT(document()->topDocument());
// The Mozilla "cancelFullScreen()" API behaves like the W3C "fully exit fullscreen" behavior, which
// is defined as:
// "To fully exit fullscreen act as if the exitFullscreen() method was invoked on the top-level browsing
// context's document and subsequently empty that document's fullscreen element stack."
- if (!fullscreenElementFrom(*document()->topDocument()))
+ if (!fullscreenElementFrom(document()->topDocument()))
return;
// To achieve that aim, remove all the elements from the top document's stack except for the first before
// calling webkitExitFullscreen():
Vector<RefPtr<Element> > replacementFullscreenElementStack;
- replacementFullscreenElementStack.append(fullscreenElementFrom(*document()->topDocument()));
- FullscreenElementStack& topFullscreenElementStack = from(*document()->topDocument());
+ replacementFullscreenElementStack.append(fullscreenElementFrom(document()->topDocument()));
+ FullscreenElementStack& topFullscreenElementStack = from(document()->topDocument());
topFullscreenElementStack.m_fullScreenElementStack.swap(replacementFullscreenElementStack);
topFullscreenElementStack.webkitExitFullscreen();
}
@@ -445,7 +444,7 @@ void FullscreenElementStack::webkitDidExitFullScreenForElement(Element*)
// the exiting document.
Document* exitingDocument = document();
if (m_fullScreenChangeEventTargetQueue.isEmpty() && m_fullScreenErrorEventTargetQueue.isEmpty())
- exitingDocument = document()->topDocument();
+ exitingDocument = &document()->topDocument();
ASSERT(exitingDocument);
from(*exitingDocument).m_fullScreenChangeDelayTimer.startOneShot(0);
}

Powered by Google App Engine
This is Rietveld 408576698