Index: Source/core/page/PointerLockController.cpp |
diff --git a/Source/core/page/PointerLockController.cpp b/Source/core/page/PointerLockController.cpp |
index 8fe61a2b9d856ee3161823457530778e31b82dbc..6b3ac9cca6f1421265b634c94d1c1d986deb140f 100644 |
--- a/Source/core/page/PointerLockController.cpp |
+++ b/Source/core/page/PointerLockController.cpp |
@@ -49,6 +49,11 @@ PassOwnPtrWillBeRawPtr<PointerLockController> PointerLockController::create(Page |
void PointerLockController::requestPointerLock(Element* target) |
{ |
+ if (!UserGestureIndicator::processingUserGesture()) { |
+ target->document().executionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, |
+ "requestPointerLock() can only be intiated by a user gesture.")); |
meacer
2014/09/26 17:47:38
Same here, no need for paranthesis and intiated ->
Mayur Kankanwadi
2014/09/29 11:22:13
Done.
|
+ } |
+ |
if (!target || !target->inDocument() || m_documentOfRemovedElementWhileWaitingForUnlock) { |
enqueueEvent(EventTypeNames::pointerlockerror, target); |
return; |