RESOLVED FIXED 60943
Disable keyboard input (with exceptions) in full-screen mode.
https://bugs.webkit.org/show_bug.cgi?id=60943
Summary Disable keyboard input (with exceptions) in full-screen mode.
Jer Noble
Reported 2011-05-16 23:06:01 PDT
Disable keyboard input (with exceptions) in full-screen mode.
Attachments
Patch (8.52 KB, patch)
2011-05-16 23:14 PDT, Jer Noble
darin: review+
Jer Noble
Comment 1 2011-05-16 23:06:19 PDT
Jer Noble
Comment 2 2011-05-16 23:14:15 PDT
Darin Adler
Comment 3 2011-05-17 18:11:11 PDT
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.
Jer Noble
Comment 4 2011-05-17 21:19:38 PDT
(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!
Jer Noble
Comment 5 2011-05-18 00:38:41 PDT
Note You need to log in before you can comment on or make changes to this bug.