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

Side by Side Diff: Source/core/dom/Fullscreen.cpp

Issue 470723002: Sync "fully exit fullscreen" with the spec (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: test with window.open() Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fullscreen/model/fully-exit-fullscreen-single.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
9 * Copyright (C) 2013 Google Inc. All rights reserved. 9 * Copyright (C) 2013 Google Inc. All rights reserved.
10 * 10 *
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 280
281 // 7. Optionally, display a message indicating how the user can exit dis playing the context object fullscreen. 281 // 7. Optionally, display a message indicating how the user can exit dis playing the context object fullscreen.
282 return; 282 return;
283 } while (0); 283 } while (0);
284 284
285 enqueueErrorEvent(element, requestType); 285 enqueueErrorEvent(element, requestType);
286 } 286 }
287 287
288 void Fullscreen::fullyExitFullscreen() 288 void Fullscreen::fullyExitFullscreen()
289 { 289 {
290 // "To fully exit fullscreen act as if the exitFullscreen() method was invok ed on the top-level browsing 290 // To fully exit fullscreen, run these steps:
291 // context's document and subsequently empty that document's fullscreen elem ent stack." 291
292 if (!fullscreenElementFrom(document()->topDocument())) 292 // 1. Let |doc| be the top-level browsing context's document.
293 Document& doc = document()->topDocument();
294
295 // 2. If |doc|'s fullscreen element stack is empty, terminate these steps.
296 if (!fullscreenElementFrom(doc))
293 return; 297 return;
294 298
295 // To achieve that aim, remove all the elements from the top document's stac k except for the first before 299 // 3. Remove elements from |doc|'s fullscreen element stack until only the t op element is left.
296 // calling exitFullscreen(): 300 size_t stackSize = from(doc).m_fullScreenElementStack.size();
297 WillBeHeapVector<std::pair<RefPtrWillBeMember<Element>, RequestType> > repla cementFullscreenElementStack; 301 from(doc).m_fullScreenElementStack.remove(0, stackSize - 1);
298 Fullscreen& topFullscreen = from(document()->topDocument()); 302 ASSERT(from(doc).m_fullScreenElementStack.size() == 1);
299 replacementFullscreenElementStack.append(topFullscreen.m_fullScreenElementSt ack.last()); 303
300 topFullscreen.m_fullScreenElementStack.swap(replacementFullscreenElementStac k); 304 // 4. Act as if the exitFullscreen() method was invoked on |doc|.
301 topFullscreen.exitFullscreen(); 305 from(doc).exitFullscreen();
302 } 306 }
303 307
304 void Fullscreen::exitFullscreen() 308 void Fullscreen::exitFullscreen()
305 { 309 {
306 // The exitFullscreen() method must run these steps: 310 // The exitFullscreen() method must run these steps:
307 311
308 // 1. Let doc be the context object. (i.e. "this") 312 // 1. Let doc be the context object. (i.e. "this")
309 Document* currentDoc = document(); 313 Document* currentDoc = document();
310 if (!currentDoc->isActive()) 314 if (!currentDoc->isActive())
311 return; 315 return;
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 void Fullscreen::trace(Visitor* visitor) 604 void Fullscreen::trace(Visitor* visitor)
601 { 605 {
602 visitor->trace(m_fullScreenElement); 606 visitor->trace(m_fullScreenElement);
603 visitor->trace(m_fullScreenElementStack); 607 visitor->trace(m_fullScreenElementStack);
604 visitor->trace(m_fullScreenRenderer); 608 visitor->trace(m_fullScreenRenderer);
605 visitor->trace(m_eventQueue); 609 visitor->trace(m_eventQueue);
606 DocumentSupplement::trace(visitor); 610 DocumentSupplement::trace(visitor);
607 } 611 }
608 612
609 } // namespace blink 613 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fullscreen/model/fully-exit-fullscreen-single.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698