Bug 162861

Summary: KeyboardEvent.getModifierState() should support "CapsLock" modifier
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, cdumez, commit-queue, darin, sam, webkit
Priority: P2 Keywords: WebExposed
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
URL: https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate
Bug Depends on: 162855    
Bug Blocks: 162852    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Description Chris Dumez 2016-10-02 15:15:35 PDT
getModifierState() should support for modifiers:
- https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate

In particular, we are missing the following ones: CapsLock, Fn, FnLock, Hyper, NumLock, Super, ScrollLock, Symbol, SymbolLock.
Comment 1 Chris Dumez 2016-10-04 09:06:33 PDT
The only one that is missing and that seems to make sense on Mac is capsLock.
Comment 2 Chris Dumez 2016-10-05 12:00:31 PDT
Created attachment 290734 [details]
Patch
Comment 3 Chris Dumez 2016-10-05 12:03:49 PDT
Created attachment 290735 [details]
Patch
Comment 4 Darin Adler 2016-10-05 12:22:09 PDT
Why doesn’t Fn make sense on Mac?
Comment 5 Darin Adler 2016-10-05 12:24:28 PDT
A good test case with Fn might be the return key with the "Fn" modifier down.
Comment 6 Chris Dumez 2016-10-05 12:25:06 PDT
(In reply to comment #4)
> Why doesn’t Fn make sense on Mac?

As far as I can tell, this is a hardware key, it does not generate an NSEvent.

Note that there is no ModifierFlag for Fn key on NSEvent:
- https://developer.apple.com/reference/appkit/nsevent/modifier_flags
Comment 7 Chris Dumez 2016-10-05 12:42:40 PDT
Created attachment 290741 [details]
Patch
Comment 8 Chris Dumez 2016-10-05 13:08:20 PDT
Created attachment 290743 [details]
Patch
Comment 9 WebKit Commit Bot 2016-10-05 14:15:20 PDT
Comment on attachment 290743 [details]
Patch

Clearing flags on attachment: 290743

Committed r206828: <http://trac.webkit.org/changeset/206828>
Comment 10 WebKit Commit Bot 2016-10-05 14:15:26 PDT
All reviewed patches have been landed.  Closing bug.