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

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

Issue 2175863002: Allow going fullscreen during a screen orientation change handler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 28 matching lines...) Expand all
39 #include "core/frame/Settings.h" 39 #include "core/frame/Settings.h"
40 #include "core/frame/UseCounter.h" 40 #include "core/frame/UseCounter.h"
41 #include "core/html/HTMLIFrameElement.h" 41 #include "core/html/HTMLIFrameElement.h"
42 #include "core/html/HTMLMediaElement.h" 42 #include "core/html/HTMLMediaElement.h"
43 #include "core/input/EventHandler.h" 43 #include "core/input/EventHandler.h"
44 #include "core/inspector/ConsoleMessage.h" 44 #include "core/inspector/ConsoleMessage.h"
45 #include "core/layout/LayoutBlockFlow.h" 45 #include "core/layout/LayoutBlockFlow.h"
46 #include "core/layout/LayoutFullScreen.h" 46 #include "core/layout/LayoutFullScreen.h"
47 #include "core/layout/api/LayoutFullScreenItem.h" 47 #include "core/layout/api/LayoutFullScreenItem.h"
48 #include "core/page/ChromeClient.h" 48 #include "core/page/ChromeClient.h"
49 #include "platform/ScopedOrientationChangeIndicator.h"
49 #include "platform/UserGestureIndicator.h" 50 #include "platform/UserGestureIndicator.h"
50 51
51 namespace blink { 52 namespace blink {
52 53
53 using namespace HTMLNames; 54 using namespace HTMLNames;
54 55
55 namespace { 56 namespace {
56 57
57 bool fullscreenIsAllowedForAllOwners(const Document& document) 58 bool fullscreenIsAllowedForAllOwners(const Document& document)
58 { 59 {
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 248
248 do { 249 do {
249 // 1. If any of the following conditions are true, terminate these steps and queue a task to fire 250 // 1. If any of the following conditions are true, terminate these steps and queue a task to fire
250 // an event named fullscreenerror with its bubbles attribute set to true on the context object's 251 // an event named fullscreenerror with its bubbles attribute set to true on the context object's
251 // node document: 252 // node document:
252 253
253 // The fullscreen element ready check returns false. 254 // The fullscreen element ready check returns false.
254 if (!fullscreenElementReady(element)) 255 if (!fullscreenElementReady(element))
255 break; 256 break;
256 257
257 // This algorithm is not allowed to show a pop-up: 258 // Fullscreen is not supported.
258 // An algorithm is allowed to show a pop-up if, in the task in which t he algorithm is running, either: 259 if (!fullscreenIsSupported(element.document()))
259 // - an activation behavior is currently being processed whose click e vent was trusted, or 260 break;
260 // - the event listener for a trusted click event is being handled. 261
262 // This algorithm is not allowed to request fullscreen.
263 // An algorithm is allowed to request fullscreen if one of the following
264 // is true:
265 // - the algorithm is triggered by a user activation.
266 // - the algorithm is triggered by a user generated orientation change.
261 // 267 //
262 // If |forCrossProcessDescendant| is true, requestFullscreen 268 // If |forCrossProcessDescendant| is true, requestFullscreen
263 // was already called on a descendant element in another process, and 269 // was already called on a descendant element in another process, and
264 // getting here means that it already passed the user gesture check. 270 // getting here means that it already passed the user gesture check.
265 if (!UserGestureIndicator::utilizeUserGesture() && !forCrossProcessDesce ndant) { 271 if (!UserGestureIndicator::utilizeUserGesture() && !ScopedOrientationCha ngeIndicator::processingOrientationChange() && !forCrossProcessDescendant) {
266 String message = ExceptionMessages::failedToExecute("requestFullScre en", 272 String message = ExceptionMessages::failedToExecute("requestFullScre en",
267 "Element", "API can only be initiated by a user gesture."); 273 "Element", "API can only be initiated by a user gesture.");
268 document()->addConsoleMessage( 274 document()->addConsoleMessage(
269 ConsoleMessage::create(JSMessageSource, WarningMessageLevel, mes sage)); 275 ConsoleMessage::create(JSMessageSource, WarningMessageLevel, mes sage));
270 break; 276 break;
271 } 277 }
272 278
273 // Fullscreen is not supported.
274 if (!fullscreenIsSupported(element.document()))
foolip 2016/07/23 00:33:54 Why was this block moved up?
275 break;
276
277 // 2. Let doc be element's node document. (i.e. "this") 279 // 2. Let doc be element's node document. (i.e. "this")
278 Document* currentDoc = document(); 280 Document* currentDoc = document();
279 281
280 // 3. Let docs be all doc's ancestor browsing context's documents (if an y) and doc. 282 // 3. Let docs be all doc's ancestor browsing context's documents (if an y) and doc.
281 // 283 //
282 // For OOPIF scenarios, |docs| will only contain documents for local 284 // For OOPIF scenarios, |docs| will only contain documents for local
283 // ancestors, and remote ancestors will be processed in their 285 // ancestors, and remote ancestors will be processed in their
284 // respective processes. This preserves the spec's event firing order 286 // respective processes. This preserves the spec's event firing order
285 // for local ancestors, but not for remote ancestors. However, that 287 // for local ancestors, but not for remote ancestors. However, that
286 // difference shouldn't be observable in practice: a fullscreenchange 288 // difference shouldn't be observable in practice: a fullscreenchange
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 DEFINE_TRACE(Fullscreen) 694 DEFINE_TRACE(Fullscreen)
693 { 695 {
694 visitor->trace(m_fullScreenElement); 696 visitor->trace(m_fullScreenElement);
695 visitor->trace(m_fullScreenElementStack); 697 visitor->trace(m_fullScreenElementStack);
696 visitor->trace(m_eventQueue); 698 visitor->trace(m_eventQueue);
697 Supplement<Document>::trace(visitor); 699 Supplement<Document>::trace(visitor);
698 ContextLifecycleObserver::trace(visitor); 700 ContextLifecycleObserver::trace(visitor);
699 } 701 }
700 702
701 } // namespace blink 703 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698