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

Unified 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: review comments Created 4 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
Index: third_party/WebKit/Source/core/dom/Fullscreen.cpp
diff --git a/third_party/WebKit/Source/core/dom/Fullscreen.cpp b/third_party/WebKit/Source/core/dom/Fullscreen.cpp
index ebdca0e38d66995b95607ff5c0664a124f3a6636..e07337eec2678a9b5f17fb23d6272227b8bc6b49 100644
--- a/third_party/WebKit/Source/core/dom/Fullscreen.cpp
+++ b/third_party/WebKit/Source/core/dom/Fullscreen.cpp
@@ -46,6 +46,7 @@
#include "core/layout/LayoutFullScreen.h"
#include "core/layout/api/LayoutFullScreenItem.h"
#include "core/page/ChromeClient.h"
+#include "platform/ScopedOrientationChangeIndicator.h"
#include "platform/UserGestureIndicator.h"
namespace blink {
@@ -254,15 +255,20 @@ void Fullscreen::requestFullscreen(Element& element, RequestType requestType, bo
if (!fullscreenElementReady(element))
break;
- // This algorithm is not allowed to show a pop-up:
- // An algorithm is allowed to show a pop-up if, in the task in which the algorithm is running, either:
- // - an activation behavior is currently being processed whose click event was trusted, or
- // - the event listener for a trusted click event is being handled.
+ // Fullscreen is not supported.
+ if (!fullscreenIsSupported(element.document()))
+ break;
+
+ // This algorithm is not allowed to request fullscreen.
+ // An algorithm is allowed to request fullscreen if one of the following
+ // is true:
+ // - the algorithm is triggered by a user activation.
+ // - the algorithm is triggered by a user generated orientation change.
//
// If |forCrossProcessDescendant| is true, requestFullscreen
// was already called on a descendant element in another process, and
// getting here means that it already passed the user gesture check.
- if (!UserGestureIndicator::utilizeUserGesture() && !forCrossProcessDescendant) {
+ if (!UserGestureIndicator::utilizeUserGesture() && !ScopedOrientationChangeIndicator::processingOrientationChange() && !forCrossProcessDescendant) {
String message = ExceptionMessages::failedToExecute("requestFullScreen",
"Element", "API can only be initiated by a user gesture.");
document()->addConsoleMessage(
@@ -270,10 +276,6 @@ void Fullscreen::requestFullscreen(Element& element, RequestType requestType, bo
break;
}
- // Fullscreen is not supported.
- if (!fullscreenIsSupported(element.document()))
- break;
-
// 2. Let doc be element's node document. (i.e. "this")
Document* currentDoc = document();

Powered by Google App Engine
This is Rietveld 408576698