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

Unified Diff: Source/WebCore/dom/Document.cpp

Issue 10855251: Merge 126043 - webkitfullscreenchange not fired properly in iframe. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1229/
Patch Set: Created 8 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 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/WebCore/dom/Document.cpp
===================================================================
--- Source/WebCore/dom/Document.cpp (revision 126049)
+++ Source/WebCore/dom/Document.cpp (working copy)
@@ -5,7 +5,7 @@
* (C) 2006 Alexey Proskuryakov (ap@webkit.org)
* Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All rights reserved.
* Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
- * Copyright (C) 2008, 2009, 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
* Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
*
@@ -5540,15 +5540,14 @@
// 2. Queue a task to fire an event named fullscreenchange with its bubbles attribute set to true
// on doc.
- Node* target = currentDoc->m_fullScreenElement.get();
- if (!target)
- target = currentDoc;
addDocumentToFullScreenChangeEventQueue(currentDoc);
// 3. If doc's fullscreen element stack is empty and doc's browsing context has a browsing context
// container, set doc to that browsing context container's node document.
- if (!newTop && currentDoc->ownerElement())
+ if (!newTop && currentDoc->ownerElement()) {
currentDoc = currentDoc->ownerElement()->document();
+ continue;
+ }
// 4. Otherwise, set doc to null.
currentDoc = 0;
@@ -5661,7 +5660,13 @@
m_fullScreenElement = 0;
scheduleForcedStyleRecalc();
- m_fullScreenChangeDelayTimer.startOneShot(0);
+ // When webkitCancelFullScreen is called, we call webkitExitFullScreen on the topDocument(). That
+ // means that the events will be queued there. So if we have no events here, start the timer on
+ // the exiting document.
+ Document* exitingDocument = this;
+ if (m_fullScreenChangeEventTargetQueue.isEmpty() && m_fullScreenErrorEventTargetQueue.isEmpty())
+ exitingDocument = topDocument();
+ exitingDocument->m_fullScreenChangeDelayTimer.startOneShot(0);
}
void Document::setFullScreenRenderer(RenderFullScreen* renderer)
@@ -5732,8 +5737,9 @@
if (!node)
node = documentElement();
- // If the element was removed from our tree, also message the documentElement.
- if (!contains(node.get()))
+ // 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 (!contains(node.get()) && !node->inDocument())
changeQueue.append(documentElement());
node->dispatchEvent(Event::create(eventNames().webkitfullscreenchangeEvent, true, false));
@@ -5747,8 +5753,9 @@
if (!node)
node = documentElement();
- // If the node was removed from our tree, also message the documentElement.
- if (!contains(node.get()))
+ // 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 (!contains(node.get()) && !node->inDocument())
errorQueue.append(documentElement());
node->dispatchEvent(Event::create(eventNames().webkitfullscreenerrorEvent, true, false));
« 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