WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-162855-20161002123635.patch (text/plain), 7.00 KB, created by
Chris Dumez
on 2016-10-02 12:39:43 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2016-10-02 12:39:43 PDT
Size:
7.00 KB
patch
obsolete
>Subversion Revision: 206719 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 335b8f140d861fbdfe6c2a833465048274b7d684..dfd919212b92c45d1c025faa17880df6bdf06650 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,5 +1,21 @@ > 2016-10-02 Chris Dumez <cdumez@apple.com> > >+ Add support for KeyboardEvent.getModifierState() operation >+ https://bugs.webkit.org/show_bug.cgi?id=162855 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add support for KeyboardEvent.getModifierState() operation: >+ - https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate >+ >+ Test: fast/events/constructors/keyboard-event-getModifierState.html >+ >+ * dom/KeyboardEvent.cpp: >+ (WebCore::KeyboardEvent::getModifierState): >+ * dom/KeyboardEvent.idl: >+ >+2016-10-02 Chris Dumez <cdumez@apple.com> >+ > Unreviewed, rolling out r206692 and r206718. > > Seems to have caused >200 failures on Sierra >diff --git a/Source/WebCore/dom/KeyboardEvent.cpp b/Source/WebCore/dom/KeyboardEvent.cpp >index 3bffae3317212657b35320724c03f86f0f1997fc..ef1232d79a8b94c65642007ee6ca1e4889c2b257 100644 >--- a/Source/WebCore/dom/KeyboardEvent.cpp >+++ b/Source/WebCore/dom/KeyboardEvent.cpp >@@ -167,6 +167,9 @@ bool KeyboardEvent::getModifierState(const String& keyIdentifier) const > return altKey(); > if (keyIdentifier == "Meta") > return metaKey(); >+ if (keyIdentifier == "AltGraph") >+ return altGraphKey(); >+ // FIXME: We should support CapsLock, Fn, FnLock, Hyper, NumLock, Super, ScrollLock, Symbol, SymbolLock. > return false; > } > >diff --git a/Source/WebCore/dom/KeyboardEvent.idl b/Source/WebCore/dom/KeyboardEvent.idl >index 852e5c2f5eeb9d169671513b5bc27f121cc2dd39..6677170428e905eddbc248318b2046040c986cee 100644 >--- a/Source/WebCore/dom/KeyboardEvent.idl >+++ b/Source/WebCore/dom/KeyboardEvent.idl >@@ -37,6 +37,8 @@ > [InitializedByEventConstructor] readonly attribute boolean metaKey; > readonly attribute boolean altGraphKey; > >+ boolean getModifierState(DOMString keyArg); >+ > // FIXME: this does not match the version in the DOM spec. > // FIXME: Using "undefined" as default parameter value is wrong. > void initKeyboardEvent(optional DOMString type = "undefined", optional boolean canBubble = false, optional boolean cancelable = false, >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 8695ecec8901e4ef2b5404eea4e6b1485c9741db..c955ae84575c1fdbba4fa4e1d3c2e778632549ff 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,5 +1,17 @@ > 2016-10-02 Chris Dumez <cdumez@apple.com> > >+ Add support for KeyboardEvent.getModifierState() operation >+ https://bugs.webkit.org/show_bug.cgi?id=162855 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add layout test coverage. >+ >+ * fast/events/constructors/keyboard-event-getModifierState-expected.txt: Added. >+ * fast/events/constructors/keyboard-event-getModifierState.html: Added. >+ >+2016-10-02 Chris Dumez <cdumez@apple.com> >+ > Unreviewed, rolling out r206692 and r206718. > > Seems to have caused >200 failures on Sierra >diff --git a/LayoutTests/fast/events/constructors/keyboard-event-getModifierState-expected.txt b/LayoutTests/fast/events/constructors/keyboard-event-getModifierState-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..819424712880de77d332b30f08c7da3f0c405eab >--- /dev/null >+++ b/LayoutTests/fast/events/constructors/keyboard-event-getModifierState-expected.txt >@@ -0,0 +1,33 @@ >+This tests KeyboardEvent.getModifierState(). >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+PASS event.getModifierState('Control') is false >+PASS event.getModifierState('Alt') is false >+PASS event.getModifierState('Shift') is false >+PASS event.getModifierState('Meta') is false >+PASS event.getModifierState('Control') is true >+PASS event.getModifierState('Alt') is false >+PASS event.getModifierState('Shift') is false >+PASS event.getModifierState('Meta') is false >+PASS event.getModifierState('Control') is false >+PASS event.getModifierState('Alt') is true >+PASS event.getModifierState('Shift') is false >+PASS event.getModifierState('Meta') is false >+PASS event.getModifierState('Control') is false >+PASS event.getModifierState('Alt') is false >+PASS event.getModifierState('Shift') is true >+PASS event.getModifierState('Meta') is false >+PASS event.getModifierState('Control') is false >+PASS event.getModifierState('Alt') is false >+PASS event.getModifierState('Shift') is false >+PASS event.getModifierState('Meta') is true >+PASS event.getModifierState('Control') is true >+PASS event.getModifierState('Alt') is true >+PASS event.getModifierState('Shift') is true >+PASS event.getModifierState('Meta') is true >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/fast/events/constructors/keyboard-event-getModifierState.html b/LayoutTests/fast/events/constructors/keyboard-event-getModifierState.html >new file mode 100644 >index 0000000000000000000000000000000000000000..f3483ac327386a49aaa3dc8999bc4a3fb7784b09 >--- /dev/null >+++ b/LayoutTests/fast/events/constructors/keyboard-event-getModifierState.html >@@ -0,0 +1,49 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../../../resources/js-test-pre.js"></script> >+</head> >+<body> >+<script> >+ >+description("This tests KeyboardEvent.getModifierState()."); >+ >+var event = new KeyboardEvent('keydown', { }); >+shouldBeFalse("event.getModifierState('Control')"); >+shouldBeFalse("event.getModifierState('Alt')"); >+shouldBeFalse("event.getModifierState('Shift')"); >+shouldBeFalse("event.getModifierState('Meta')"); >+ >+var event = new KeyboardEvent('keydown', { ctrlKey: true }); >+shouldBeTrue("event.getModifierState('Control')"); >+shouldBeFalse("event.getModifierState('Alt')"); >+shouldBeFalse("event.getModifierState('Shift')"); >+shouldBeFalse("event.getModifierState('Meta')"); >+ >+var event = new KeyboardEvent('keydown', { altKey: true }); >+shouldBeFalse("event.getModifierState('Control')"); >+shouldBeTrue("event.getModifierState('Alt')"); >+shouldBeFalse("event.getModifierState('Shift')"); >+shouldBeFalse("event.getModifierState('Meta')"); >+ >+var event = new KeyboardEvent('keydown', { shiftKey: true }); >+shouldBeFalse("event.getModifierState('Control')"); >+shouldBeFalse("event.getModifierState('Alt')"); >+shouldBeTrue("event.getModifierState('Shift')"); >+shouldBeFalse("event.getModifierState('Meta')"); >+ >+var event = new KeyboardEvent('keydown', { metaKey: true }); >+shouldBeFalse("event.getModifierState('Control')"); >+shouldBeFalse("event.getModifierState('Alt')"); >+shouldBeFalse("event.getModifierState('Shift')"); >+shouldBeTrue("event.getModifierState('Meta')"); >+ >+var event = new KeyboardEvent('keydown', { ctrlKey: true, altKey: true, shiftKey: true, metaKey: true }); >+shouldBeTrue("event.getModifierState('Control')"); >+shouldBeTrue("event.getModifierState('Alt')"); >+shouldBeTrue("event.getModifierState('Shift')"); >+shouldBeTrue("event.getModifierState('Meta')"); >+</script> >+<script src="../../../resources/js-test-post.js"></script> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 162855
: 290473