initKeyboardEvent doesn't clear CapsLock state
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Aug 2018 02:01:29 +0000 (02:01 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Aug 2018 02:01:29 +0000 (02:01 +0000)
commit618e31e71816832ebceb5c9e6651477f1c84e1a4
tree10c3ec06699328f56e21f7dba1f9cfc417e5700b
parent3610726cfc43d3faec3cd7c0991f04d76cb14853
initKeyboardEvent doesn't clear CapsLock state
https://bugs.webkit.org/show_bug.cgi?id=188909

Reviewed by Wenson Hsieh.

Source/WebCore:

Fixed the bug by not preserving CapsLock state in setModifierKeys variant which takes boolean
for altGraphKey, which is only called by KeyboardEvent::initKeyboardEvent.

Test: fast/events/init-event-clears-capslock.html

* dom/UIEventWithKeyState.h:
(WebCore::UIEventWithKeyState::setModifierKeys):

LayoutTests:

Added a regression test. Note that altGraph is only supported in WebKit
so Chrome and Firefox would fail to reset it via initKeyboardEvent.

* fast/events/init-event-clears-capslock-expected.txt: Added.
* fast/events/init-event-clears-capslock.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235268 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/events/init-event-clears-capslock-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/init-event-clears-capslock.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/UIEventWithKeyState.h