Changeset 235268 in webkit


Ignore:
Timestamp:
Aug 23, 2018 7:01:29 PM (6 years ago)
Author:
rniwa@webkit.org
Message:

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.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r235264 r235268  
     12018-08-23  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        initKeyboardEvent doesn't clear CapsLock state
     4        https://bugs.webkit.org/show_bug.cgi?id=188909
     5
     6        Reviewed by Wenson Hsieh.
     7
     8        Added a regression test. Note that altGraph is only supported in WebKit
     9        so Chrome and Firefox would fail to reset it via initKeyboardEvent.
     10
     11        * fast/events/init-event-clears-capslock-expected.txt: Added.
     12        * fast/events/init-event-clears-capslock.html: Added.
     13
    1142018-08-23  Ryosuke Niwa  <rniwa@webkit.org>
    215
  • trunk/Source/WebCore/ChangeLog

    r235263 r235268  
     12018-08-23  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        initKeyboardEvent doesn't clear CapsLock state
     4        https://bugs.webkit.org/show_bug.cgi?id=188909
     5
     6        Reviewed by Wenson Hsieh.
     7
     8        Fixed the bug by not preserving CapsLock state in setModifierKeys variant which takes boolean
     9        for altGraphKey, which is only called by KeyboardEvent::initKeyboardEvent.
     10
     11        Test: fast/events/init-event-clears-capslock.html
     12
     13        * dom/UIEventWithKeyState.h:
     14        (WebCore::UIEventWithKeyState::setModifierKeys):
     15
    1162018-08-23  Aditya Keerthi  <akeerthi@apple.com>
    217
  • trunk/Source/WebCore/dom/UIEventWithKeyState.h

    r235158 r235268  
    7777        if (altGraphKey)
    7878            result |= Modifier::AltGraphKey;
    79         //  FIXME: Chrome or Firefox don't preserve this state.
    80         if (m_modifiers & Modifier::CapsLockKey)
    81             result |= Modifier::CapsLockKey;
    8279        m_modifiers = result;
    8380    }
Note: See TracChangeset for help on using the changeset viewer.