Pressing the Escape key should not be a valid user gesture to enter fullscreen
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Jul 2017 17:15:31 +0000 (17:15 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Jul 2017 17:15:31 +0000 (17:15 +0000)
commit2378963f31fa178bf4f3d7e79357e82d19148923
tree56748aa08feb2132023abf86e843aa001e44853a
parent03bb526984f14643bbfb75dcab8bb92373561b78
Pressing the Escape key should not be a valid user gesture to enter fullscreen
https://bugs.webkit.org/show_bug.cgi?id=174864
<rdar://problem/33009088>

Reviewed by Geoffrey Garen.

Source/WebCore:

Pressing the Escape key should not be a valid user gesture to enter fullscreen since this
is the gesture to exit fullscreen already.

Test: fullscreen/requestFullscreen-escape-key.html

* dom/Document.cpp:
(WebCore::Document::requestFullScreenForElement):
* dom/UserGestureIndicator.cpp:
(WebCore::UserGestureIndicator::UserGestureIndicator):
* dom/UserGestureIndicator.h:
(WebCore::UserGestureToken::create):
(WebCore::UserGestureToken::gestureType):
(WebCore::UserGestureToken::UserGestureToken):
* page/EventHandler.cpp:
(WebCore::EventHandler::internalKeyEvent):

Tools:

Add support for eventSender.keyDown('escape') in DRT to match the behavior of
WKTR.

* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController keyDown:withModifiers:withLocation:]):

LayoutTests:

Add layout test coverage.

* fullscreen/requestFullscreen-escape-key-expected.txt: Added.
* fullscreen/requestFullscreen-escape-key.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219950 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fullscreen/requestFullscreen-escape-key-expected.txt [new file with mode: 0644]
LayoutTests/fullscreen/requestFullscreen-escape-key.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/UserGestureIndicator.cpp
Source/WebCore/dom/UserGestureIndicator.h
Source/WebCore/page/EventHandler.cpp
Tools/ChangeLog
Tools/DumpRenderTree/mac/EventSendingController.mm