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

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

Issue 600773002: Notify in console when an API fails because it needs to be invoked on user action. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed requestPointerLock related changes. Created 6 years, 2 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
« no previous file with comments | « LayoutTests/media/video-prefixed-fullscreen-expected.txt ('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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 // node document: 224 // node document:
225 225
226 // The fullscreen element ready check returns false. 226 // The fullscreen element ready check returns false.
227 if (!fullscreenElementReady(element, requestType)) 227 if (!fullscreenElementReady(element, requestType))
228 break; 228 break;
229 229
230 // This algorithm is not allowed to show a pop-up: 230 // This algorithm is not allowed to show a pop-up:
231 // An algorithm is allowed to show a pop-up if, in the task in which t he algorithm is running, either: 231 // An algorithm is allowed to show a pop-up if, in the task in which t he algorithm is running, either:
232 // - an activation behavior is currently being processed whose click e vent was trusted, or 232 // - an activation behavior is currently being processed whose click e vent was trusted, or
233 // - the event listener for a trusted click event is being handled. 233 // - the event listener for a trusted click event is being handled.
234 if (!UserGestureIndicator::processingUserGesture()) 234 if (!UserGestureIndicator::processingUserGesture()) {
235 String message = ExceptionMessages::failedToExecute("requestFullScre en",
236 "Element", "API can only be initiated by a user gesture.");
237 document()->executionContext()->addConsoleMessage(
238 ConsoleMessage::create(JSMessageSource, WarningMessageLevel, mes sage));
235 break; 239 break;
240 }
236 241
237 // Fullscreen is not supported. 242 // Fullscreen is not supported.
238 if (!fullscreenIsSupported(element.document(), element)) 243 if (!fullscreenIsSupported(element.document(), element))
239 break; 244 break;
240 245
241 // 2. Let doc be element's node document. (i.e. "this") 246 // 2. Let doc be element's node document. (i.e. "this")
242 Document* currentDoc = document(); 247 Document* currentDoc = document();
243 248
244 // 3. Let docs be all doc's ancestor browsing context's documents (if an y) and doc. 249 // 3. Let docs be all doc's ancestor browsing context's documents (if an y) and doc.
245 Deque<Document*> docs; 250 Deque<Document*> docs;
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 void Fullscreen::trace(Visitor* visitor) 608 void Fullscreen::trace(Visitor* visitor)
604 { 609 {
605 visitor->trace(m_fullScreenElement); 610 visitor->trace(m_fullScreenElement);
606 visitor->trace(m_fullScreenElementStack); 611 visitor->trace(m_fullScreenElementStack);
607 visitor->trace(m_fullScreenRenderer); 612 visitor->trace(m_fullScreenRenderer);
608 visitor->trace(m_eventQueue); 613 visitor->trace(m_eventQueue);
609 DocumentSupplement::trace(visitor); 614 DocumentSupplement::trace(visitor);
610 } 615 }
611 616
612 } // namespace blink 617 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/media/video-prefixed-fullscreen-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698