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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | 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 c58d1f1b78b25470b5ee08fd04439cefba01f83b..85f472d75043a36ad16d6f6c98ad334cfa966a02 100644
--- a/Source/core/dom/FullscreenElementStack.cpp
+++ b/Source/core/dom/FullscreenElementStack.cpp
@@ -173,9 +173,8 @@ void FullscreenElementStack::requestFullScreenForElement(Element& element, Reque
// The context object's node document fullscreen element stack is not empty and its top element
// is not an ancestor of the context object. (NOTE: Ignore this requirement if the request was
// made via the legacy Mozilla-style API.)
- if (!m_fullScreenElementStack.isEmpty()) {
- Element* lastElementOnStack = m_fullScreenElementStack.last().get();
- if (lastElementOnStack == &element || !lastElementOnStack->contains(&element)) {
+ if (Element* lastElementOnStack = fullscreenElement()) {
+ if (!element.isDescendantOf(lastElementOnStack)) {
if (inLegacyMozillaMode)
UseCounter::count(element.document(), UseCounter::LegacyFullScreenErrorExemption);
else
« 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