One esc to exit fullscreen and pointer lock
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Dec 2016 01:19:03 +0000 (01:19 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Dec 2016 01:19:03 +0000 (01:19 +0000)
commit466069e90ac88b88944240b5f37f2256bc426f91
tree71e5cfe0bb1dab56b1c2734bfd787bee40783a18
parent5b75ceb4989f679d20a0de93f7b8e6a280beb8b0
One esc to exit fullscreen and pointer lock
https://bugs.webkit.org/show_bug.cgi?id=165416
rdar://problem/29430711

Patch by Jeremy Jones <jeremyj@apple.com> on 2016-12-07
Reviewed by Jer Noble.

Source/WebCore:

Test: pointer-lock/lock-lost-on-esc-in-fullscreen.html

When handling escape, also exit fullscreen on escape.
This also means that escape can exit fullscreen in TestRunner.

* page/EventHandler.cpp:
(WebCore::EventHandler::keyEvent):

Source/WebKit2:

Fix a crash when didLosePointerLock is not specified.

* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):

Tools:

Implement WKPageUIClientV8 for pointer lock support.
Add "escape" key support in EventSenderProxy.

* WebKitTestRunner/TestController.cpp:
(WTR::requestPointerLock):
(WTR::TestController::createOtherPage):
(WTR::TestController::createWebViewWithOptions):
* WebKitTestRunner/mac/EventSenderProxy.mm:
(WTR::EventSenderProxy::keyDown):

LayoutTests:

* platform/mac-wk2/TestExpectations:
* pointer-lock/lock-lost-on-esc-in-fullscreen-expected.txt: Added.
* pointer-lock/lock-lost-on-esc-in-fullscreen.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209504 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/TestExpectations
LayoutTests/pointer-lock/lock-lost-on-esc-in-fullscreen-expected.txt [new file with mode: 0644]
LayoutTests/pointer-lock/lock-lost-on-esc-in-fullscreen.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/EventHandler.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/C/WKPage.cpp
Tools/ChangeLog
Tools/WebKitTestRunner/TestController.cpp
Tools/WebKitTestRunner/mac/EventSenderProxy.mm