[pointer-lock] Cursor should become visible when exiting pointer-lock via ESC key.
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Dec 2016 16:40:56 +0000 (16:40 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Dec 2016 16:40:56 +0000 (16:40 +0000)
commit887e502c5066ac46baedcb542ff3e26e65701480
tree531520ba785c8bf667df56a6f487c4470309c304
parent067fdca65f19535312b6263992471c17f3af9402
[pointer-lock] Cursor should become visible when exiting pointer-lock via ESC key.
https://bugs.webkit.org/show_bug.cgi?id=165377

Reviewed by Darin Adler.

Introduce the concept of "force cursor to become visible" when requesting the pointer be
unlocked.  ESC events will cause the pointer to become visible, while normal key events
will not.

* page/EventHandler.cpp:
(WebCore::EventHandler::keyEvent):
* page/PointerLockController.cpp:
(WebCore::PointerLockController::requestPointerUnlock):
(WebCore::PointerLockController::requestPointerUnlockAndForceCursorVisible):
(WebCore::PointerLockController::documentDetached):
(WebCore::PointerLockController::didLosePointerLock):
* page/PointerLockController.h:

Drive-by fix: apply Darin's feedback to existing functions:

* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):
* dom/Element.cpp:
(WebCore::Element::removedFrom):
* page/PointerLockController.cpp:
(WebCore::PointerLockController::elementRemoved):
(WebCore::PointerLockController::documentDetached):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209394 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/PointerLockController.cpp
Source/WebCore/page/PointerLockController.h