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

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

Issue 365993002: Simplify FullscreenElementStack::fullScreenChangeDelayTimerFired() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | « 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 d153ed3d1dd4a2d29b7c9fa328098d5d350f7cf1..934b0eb7e4fe1de75081d73e22c1443ddb4e6114 100644
--- a/Source/core/dom/FullscreenElementStack.cpp
+++ b/Source/core/dom/FullscreenElementStack.cpp
@@ -496,15 +496,9 @@ void FullscreenElementStack::fullScreenChangeDelayTimerFired(Timer<FullscreenEle
while (!changeQueue.isEmpty()) {
RefPtrWillBeRawPtr<Node> node = changeQueue.takeFirst();
- if (!node)
- node = document()->documentElement();
- // The dispatchEvent below may have blown away our documentElement.
falken 2014/07/03 01:51:42 Hmm, why is this no longer possible? Can we add do
philipj_slow 2014/07/03 13:53:00 Since we never push null to the queue and the queu
falken 2014/07/03 14:48:38 OK I see. lgtm
- if (!node)
- continue;
- // If the element was removed from our tree, also message the documentElement. Since we may
- // have a document hierarchy, check that node isn't in another document.
- if (!document()->contains(node.get()) && !node->inDocument())
falken 2014/07/03 01:51:42 nice catch!
+ // If the element was removed from our tree, also message the documentElement.
+ if (!node->inDocument() && document()->documentElement())
changeQueue.append(document()->documentElement());
node->dispatchEvent(Event::createBubble(EventTypeNames::webkitfullscreenchange));
@@ -512,15 +506,9 @@ void FullscreenElementStack::fullScreenChangeDelayTimerFired(Timer<FullscreenEle
while (!errorQueue.isEmpty()) {
RefPtrWillBeRawPtr<Node> node = errorQueue.takeFirst();
- if (!node)
- node = document()->documentElement();
- // The dispatchEvent below may have blown away our documentElement.
- if (!node)
- continue;
- // If the element was removed from our tree, also message the documentElement. Since we may
- // have a document hierarchy, check that node isn't in another document.
- if (!document()->contains(node.get()) && !node->inDocument())
+ // If the element was removed from our tree, also message the documentElement.
+ if (!node->inDocument() && document()->documentElement())
errorQueue.append(document()->documentElement());
node->dispatchEvent(Event::createBubble(EventTypeNames::webkitfullscreenerror));
« 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