Summary: | Disable keyboard input (with exceptions) in full-screen mode. | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Jer Noble <jer.noble> | ||||
Component: | New Bugs | Assignee: | Jer Noble <jer.noble> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | Keywords: | InRadar | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Jer Noble
2011-05-16 23:06:01 PDT
Created attachment 93740 [details]
Patch
Comment on attachment 93740 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=93740&action=review > Source/WebCore/page/EventHandler.cpp:2442 > + if ((keyCode >= VK_BACK && keyCode <= VK_CAPITAL) > + || (keyCode >= VK_SPACE && keyCode <= VK_DELETE) > + || (keyCode >= VK_OEM_1 && keyCode <= VK_OEM_PLUS) > + || (keyCode >= VK_MULTIPLY && keyCode <= VK_OEM_8)) > + return true; > + > + return false; This seems quite unclear. Is this specific set of key code ranges straight out of some specification? If not, what is the rationale for what keys are listed here and what keys are not? Also, if (x) return true; return false; is an anti-pattern. Just use a return. (In reply to comment #3) > (From update of attachment 93740 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=93740&action=review > > > Source/WebCore/page/EventHandler.cpp:2442 > > + if ((keyCode >= VK_BACK && keyCode <= VK_CAPITAL) > > + || (keyCode >= VK_SPACE && keyCode <= VK_DELETE) > > + || (keyCode >= VK_OEM_1 && keyCode <= VK_OEM_PLUS) > > + || (keyCode >= VK_MULTIPLY && keyCode <= VK_OEM_8)) > > + return true; > > + > > + return false; > > This seems quite unclear. Is this specific set of key code ranges straight out of some specification? If not, what is the rationale for what keys are listed here and what keys are not? Yes, it's specifically from the proposed Full Screen API: "Toplevel browsing contexts can be in a "keys disabled" state. In this state, the user agent must suppress all keyup, keydown and keypress events whose keyCode is not in one of the following ranges: DOM_VK_CANCEL to DOM_VK_CAPS_LOCK, inclusive DOM_VK_SPACE to DOM_VK_DELETE, inclusive DOM_VK_SEMICOLON to DOM_VK_EQUALS, inclusive DOM_VK_MULTIPLY to DOM_VK_META, inclusive" The key codes listed in the patch are the equivalents to the Mozilla-specific enums in the spec. > Also, if (x) return true; return false; is an anti-pattern. Just use a return. Sure thing. Thanks! Committed r86741: <http://trac.webkit.org/changeset/86741> |