<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[206828] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/206828">206828</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-10-05 14:12:51 -0700 (Wed, 05 Oct 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>KeyboardEvent.getModifierState() should support "CapsLock" modifier
https://bugs.webkit.org/show_bug.cgi?id=162861
Reviewed by Darin Adler.
Source/WebCore:
Add support for "CapsLock" modifier on Mac / iOS for KeyboardEvent's
getModifierState() API, as per:
- https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate
No new tests, updated existing test.
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
(WebCore::KeyboardEvent::getModifierState):
* dom/KeyboardEvent.h:
* platform/PlatformEvent.h:
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::modifiersForEvent):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::keyIdentifierForKeyEvent):
Source/WebKit2:
Add support for CapsLock modifier on events.
* Shared/API/c/WKEvent.h:
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toAPI):
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
(WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
(WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
(WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
(WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):
* Shared/efl/WebEventFactory.cpp:
(WebKit::toWebEventModifiers):
* Shared/ios/WebIOSEventFactory.mm:
(modifiersForEvent):
* Shared/mac/WebEventFactory.mm:
(WebKit::modifiersForEvent):
* UIProcess/API/Cocoa/WKNavigationAction.mm:
(toNSEventModifierFlags):
* UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
Tools:
Add support for 'capsLockKey' modifier for EventSender.keyDown() so
that we can test this new modifier support for layout tests.
* TestWebKitAPI/mac/PlatformWebViewMac.mm:
(TestWebKitAPI::modifierFlagsForWKModifiers):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::parseModifier):
* WebKitTestRunner/mac/EventSenderProxy.mm:
(WTR::buildModifierFlags):
LayoutTests:
Extend layout test coverage to cover 'Caps Lock' modifier.
* fast/events/special-key-events-in-input-text-expected.txt:
* fast/events/special-key-events-in-input-text.html:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfasteventsspecialkeyeventsininputtextexpectedtxt">trunk/LayoutTests/fast/events/special-key-events-in-input-text-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventsspecialkeyeventsininputtexthtml">trunk/LayoutTests/fast/events/special-key-events-in-input-text.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomKeyboardEventcpp">trunk/Source/WebCore/dom/KeyboardEvent.cpp</a></li>
<li><a href="#trunkSourceWebCoredomKeyboardEventh">trunk/Source/WebCore/dom/KeyboardEvent.h</a></li>
<li><a href="#trunkSourceWebCoreplatformPlatformEventh">trunk/Source/WebCore/platform/PlatformEvent.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosPlatformEventFactoryIOSmm">trunk/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacPlatformEventFactoryMacmm">trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedAPIcWKEventh">trunk/Source/WebKit2/Shared/API/c/WKEvent.h</a></li>
<li><a href="#trunkSourceWebKit2SharedAPIcWKSharedAPICasth">trunk/Source/WebKit2/Shared/API/c/WKSharedAPICast.h</a></li>
<li><a href="#trunkSourceWebKit2SharedWebEventConversioncpp">trunk/Source/WebKit2/Shared/WebEventConversion.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedeflWebEventFactorycpp">trunk/Source/WebKit2/Shared/efl/WebEventFactory.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharediosWebIOSEventFactorymm">trunk/Source/WebKit2/Shared/ios/WebIOSEventFactory.mm</a></li>
<li><a href="#trunkSourceWebKit2SharedmacWebEventFactorymm">trunk/Source/WebKit2/Shared/mac/WebEventFactory.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKNavigationActionmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationAction.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaWebAutomationSessionCocoamm">trunk/Source/WebKit2/UIProcess/Cocoa/WebAutomationSessionCocoa.mm</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreemacEventSendingControllermm">trunk/Tools/DumpRenderTree/mac/EventSendingController.mm</a></li>
<li><a href="#trunkToolsTestWebKitAPImacPlatformWebViewMacmm">trunk/Tools/TestWebKitAPI/mac/PlatformWebViewMac.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleEventSendingControllercpp">trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnermacEventSenderProxymm">trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (206827 => 206828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-10-05 20:46:15 UTC (rev 206827)
+++ trunk/LayoutTests/ChangeLog        2016-10-05 21:12:51 UTC (rev 206828)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-10-05 Chris Dumez <cdumez@apple.com>
+
+ KeyboardEvent.getModifierState() should support "CapsLock" modifier
+ https://bugs.webkit.org/show_bug.cgi?id=162861
+
+ Reviewed by Darin Adler.
+
+ Extend layout test coverage to cover 'Caps Lock' modifier.
+
+ * fast/events/special-key-events-in-input-text-expected.txt:
+ * fast/events/special-key-events-in-input-text.html:
+
</ins><span class="cx"> 2016-10-05 Zalan Bujtas <zalan@apple.com>
</span><span class="cx">
</span><span class="cx"> Missing quotation mark when <q> gets reparented.
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventsspecialkeyeventsininputtextexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/special-key-events-in-input-text-expected.txt (206827 => 206828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/special-key-events-in-input-text-expected.txt        2016-10-05 20:46:15 UTC (rev 206827)
+++ trunk/LayoutTests/fast/events/special-key-events-in-input-text-expected.txt        2016-10-05 21:12:51 UTC (rev 206828)
</span><span class="lines">@@ -1,49 +1,55 @@
</span><span class="cx"> This test verifies that the correct sequence of keyboard events is generated for a keypress for certain special keys. To test manually, press keys and compare results to other browsers.
</span><span class="cx">
</span><span class="cx">
</span><del>-target - type - ctrlKey,altKey,shiftKey,metaKey - key - code - keyIdentifier - keyCode - charCode
</del><ins>+target - type - ctrlKey,altKey,shiftKey,metaKey,capsLockKey - key - code - keyIdentifier - keyCode - charCode
</ins><span class="cx">
</span><span class="cx"> Ampersand:
</span><del>-INPUT - keydown - false,false,true,false - 7 - Digit7 - U+0037 - 55 - 0. Value: "".
-INPUT - keypress - false,false,true,false - 7 - Digit7 - - 55 - 55. Value: "".
</del><ins>+INPUT - keydown - false,false,true,false,false - 7 - Digit7 - U+0037 - 55 - 0. Value: "".
+INPUT - keypress - false,false,true,false,false - 7 - Digit7 - - 55 - 55. Value: "".
</ins><span class="cx"> INPUT - textInput - 7. Value: "".
</span><del>-INPUT - keyup - false,false,true,false - 7 - Digit7 - U+0037 - 55 - 0. Value: "7".
</del><ins>+INPUT - keyup - false,false,true,false,false - 7 - Digit7 - U+0037 - 55 - 0. Value: "7".
</ins><span class="cx">
</span><span class="cx"> Backspace:
</span><del>-INPUT - keydown - false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: "7".
-INPUT - keyup - false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: "".
</del><ins>+INPUT - keydown - false,false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: "7".
+INPUT - keyup - false,false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: "".
</ins><span class="cx">
</span><span class="cx"> Percent:
</span><del>-INPUT - keydown - false,false,true,false - 5 - Digit5 - U+0035 - 53 - 0. Value: "".
-INPUT - keypress - false,false,true,false - 5 - Digit5 - - 53 - 53. Value: "".
</del><ins>+INPUT - keydown - false,false,true,false,false - 5 - Digit5 - U+0035 - 53 - 0. Value: "".
+INPUT - keypress - false,false,true,false,false - 5 - Digit5 - - 53 - 53. Value: "".
</ins><span class="cx"> INPUT - textInput - 5. Value: "".
</span><del>-INPUT - keyup - false,false,true,false - 5 - Digit5 - U+0035 - 53 - 0. Value: "5".
</del><ins>+INPUT - keyup - false,false,true,false,false - 5 - Digit5 - U+0035 - 53 - 0. Value: "5".
</ins><span class="cx">
</span><span class="cx"> Backspace:
</span><del>-INPUT - keydown - false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: "5".
-INPUT - keyup - false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: "".
</del><ins>+INPUT - keydown - false,false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: "5".
+INPUT - keyup - false,false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: "".
</ins><span class="cx">
</span><span class="cx"> Left parenthesis:
</span><del>-INPUT - keydown - false,false,true,false - 9 - Digit9 - U+0039 - 57 - 0. Value: "".
-INPUT - keypress - false,false,true,false - 9 - Digit9 - - 57 - 57. Value: "".
</del><ins>+INPUT - keydown - false,false,true,false,false - 9 - Digit9 - U+0039 - 57 - 0. Value: "".
+INPUT - keypress - false,false,true,false,false - 9 - Digit9 - - 57 - 57. Value: "".
</ins><span class="cx"> INPUT - textInput - 9. Value: "".
</span><del>-INPUT - keyup - false,false,true,false - 9 - Digit9 - U+0039 - 57 - 0. Value: "9".
</del><ins>+INPUT - keyup - false,false,true,false,false - 9 - Digit9 - U+0039 - 57 - 0. Value: "9".
</ins><span class="cx">
</span><span class="cx"> Backspace:
</span><del>-INPUT - keydown - false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: "9".
-INPUT - keyup - false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: "".
</del><ins>+INPUT - keydown - false,false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: "9".
+INPUT - keyup - false,false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: "".
</ins><span class="cx">
</span><span class="cx"> Right parenthesis:
</span><del>-INPUT - keydown - false,false,true,false - 0 - Digit0 - U+0030 - 48 - 0. Value: "".
-INPUT - keypress - false,false,true,false - 0 - Digit0 - - 48 - 48. Value: "".
</del><ins>+INPUT - keydown - false,false,true,false,false - 0 - Digit0 - U+0030 - 48 - 0. Value: "".
+INPUT - keypress - false,false,true,false,false - 0 - Digit0 - - 48 - 48. Value: "".
</ins><span class="cx"> INPUT - textInput - 0. Value: "".
</span><del>-INPUT - keyup - false,false,true,false - 0 - Digit0 - U+0030 - 48 - 0. Value: "0".
</del><ins>+INPUT - keyup - false,false,true,false,false - 0 - Digit0 - U+0030 - 48 - 0. Value: "0".
</ins><span class="cx">
</span><span class="cx"> Backspace:
</span><del>-INPUT - keydown - false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: "0".
-INPUT - keyup - false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: "".
</del><ins>+INPUT - keydown - false,false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: "0".
+INPUT - keyup - false,false,false,false,false - Backspace - Backspace - U+0008 - 8 - 0. Value: "".
</ins><span class="cx">
</span><span class="cx"> Print screen:
</span><del>-INPUT - keydown - false,false,false,false - PrintScreen - KeyA - PrintScreen - 44 - 0. Value: "".
-INPUT - keyup - false,false,false,false - PrintScreen - KeyA - PrintScreen - 44 - 0. Value: "".
</del><ins>+INPUT - keydown - false,false,false,false,false - PrintScreen - KeyA - PrintScreen - 44 - 0. Value: "".
+INPUT - keyup - false,false,false,false,false - PrintScreen - KeyA - PrintScreen - 44 - 0. Value: "".
</ins><span class="cx">
</span><ins>+'a' key with Caps Lock:
+INPUT - keydown - false,false,false,false,true - a - KeyA - U+0041 - 65 - 0. Value: "".
+INPUT - keypress - false,false,false,false,true - a - KeyA - - 97 - 97. Value: "".
+INPUT - textInput - a. Value: "".
+INPUT - keyup - false,false,false,false,true - a - KeyA - U+0041 - 65 - 0. Value: "a".
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfasteventsspecialkeyeventsininputtexthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/special-key-events-in-input-text.html (206827 => 206828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/special-key-events-in-input-text.html        2016-10-05 20:46:15 UTC (rev 206827)
+++ trunk/LayoutTests/fast/events/special-key-events-in-input-text.html        2016-10-05 21:12:51 UTC (rev 206828)
</span><span class="lines">@@ -17,7 +17,7 @@
</span><span class="cx"> if (type == "textInput") {
</span><span class="cx"> info += e.data;
</span><span class="cx"> } else if (type == "keydown" || type == "keypress" || type == "keyup") {
</span><del>- info += [e.ctrlKey, e.altKey, e.shiftKey, e.metaKey] +
</del><ins>+ info += [e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.getModifierState('CapsLock')] +
</ins><span class="cx"> ' - ' + e.key +
</span><span class="cx"> ' - ' + e.code +
</span><span class="cx"> ' - ' + e.keyIdentifier +
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> log(info);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-log("target - type - " + ["ctrlKey", "altKey", "shiftKey", "metaKey"]
</del><ins>+log("target - type - " + ["ctrlKey", "altKey", "shiftKey", "metaKey", "capsLockKey"]
</ins><span class="cx"> + ' - ' + "key"
</span><span class="cx"> + ' - ' + "code"
</span><span class="cx"> + ' - ' + "keyIdentifier"
</span><span class="lines">@@ -62,6 +62,8 @@
</span><span class="cx"> eventSender.keyDown("\x08", []);
</span><span class="cx"> log("<br>Print screen:");
</span><span class="cx"> eventSender.keyDown("printScreen", []);
</span><ins>+ log("<br>'a' key with Caps Lock:");
+ eventSender.keyDown("a", ["capsLockKey"]);
</ins><span class="cx"> }
</span><span class="cx"> </script>
</span><span class="cx"> </body></html>
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (206827 => 206828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-05 20:46:15 UTC (rev 206827)
+++ trunk/Source/WebCore/ChangeLog        2016-10-05 21:12:51 UTC (rev 206828)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2016-10-05 Chris Dumez <cdumez@apple.com>
+
+ KeyboardEvent.getModifierState() should support "CapsLock" modifier
+ https://bugs.webkit.org/show_bug.cgi?id=162861
+
+ Reviewed by Darin Adler.
+
+ Add support for "CapsLock" modifier on Mac / iOS for KeyboardEvent's
+ getModifierState() API, as per:
+ - https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate
+
+ No new tests, updated existing test.
+
+ * dom/KeyboardEvent.cpp:
+ (WebCore::KeyboardEvent::KeyboardEvent):
+ (WebCore::KeyboardEvent::getModifierState):
+ * dom/KeyboardEvent.h:
+ * platform/PlatformEvent.h:
+ * platform/ios/PlatformEventFactoryIOS.mm:
+ (WebCore::modifiersForEvent):
+ * platform/mac/PlatformEventFactoryMac.mm:
+ (WebCore::keyIdentifierForKeyEvent):
+
</ins><span class="cx"> 2016-10-05 Michael Catanzaro <mcatanzaro@igalia.com>
</span><span class="cx">
</span><span class="cx"> [GTK] Improve OS X UA quirk
</span></span></pre></div>
<a id="trunkSourceWebCoredomKeyboardEventcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/KeyboardEvent.cpp (206827 => 206828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/KeyboardEvent.cpp        2016-10-05 20:46:15 UTC (rev 206827)
+++ trunk/Source/WebCore/dom/KeyboardEvent.cpp        2016-10-05 21:12:51 UTC (rev 206828)
</span><span class="lines">@@ -108,6 +108,7 @@
</span><span class="cx"> , m_location(keyLocationCode(key))
</span><span class="cx"> , m_repeat(key.isAutoRepeat())
</span><span class="cx"> , m_altGraphKey(false)
</span><ins>+ , m_capsLockKey(key.modifiers().contains(PlatformEvent::Modifier::CapsLockKey))
</ins><span class="cx"> , m_isComposing(view && view->frame() && view->frame()->editor().hasComposition())
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> #if USE(APPKIT)
</span><span class="lines">@@ -137,7 +138,8 @@
</span><span class="cx"> , m_keyIdentifier(initializer.keyIdentifier)
</span><span class="cx"> , m_location(initializer.location)
</span><span class="cx"> , m_repeat(initializer.repeat)
</span><del>- , m_altGraphKey(false)
</del><ins>+ , m_altGraphKey(false) // FIXME: should be initialized from initializer.modifierAltGraph.
+ , m_capsLockKey(false) // FIXME: should be initialized from initializer.modifierCapsLock.
</ins><span class="cx"> , m_isComposing(initializer.isComposing)
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> , m_handledByInputMethod(false)
</span><span class="lines">@@ -179,7 +181,9 @@
</span><span class="cx"> return metaKey();
</span><span class="cx"> if (keyIdentifier == "AltGraph")
</span><span class="cx"> return altGraphKey();
</span><del>- // FIXME: We should support CapsLock, Fn, FnLock, Hyper, NumLock, Super, ScrollLock, Symbol, SymbolLock.
</del><ins>+ if (keyIdentifier == "CapsLock")
+ return m_capsLockKey;
+ // FIXME: The specification also has Fn, FnLock, Hyper, NumLock, Super, ScrollLock, Symbol, SymbolLock.
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomKeyboardEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/KeyboardEvent.h (206827 => 206828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/KeyboardEvent.h        2016-10-05 20:46:15 UTC (rev 206827)
+++ trunk/Source/WebCore/dom/KeyboardEvent.h        2016-10-05 21:12:51 UTC (rev 206828)
</span><span class="lines">@@ -136,6 +136,7 @@
</span><span class="cx"> unsigned m_location { DOM_KEY_LOCATION_STANDARD };
</span><span class="cx"> bool m_repeat { false };
</span><span class="cx"> bool m_altGraphKey { false };
</span><ins>+ bool m_capsLockKey { false };
</ins><span class="cx"> bool m_isComposing { false };
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformPlatformEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/PlatformEvent.h (206827 => 206828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/PlatformEvent.h        2016-10-05 20:46:15 UTC (rev 206827)
+++ trunk/Source/WebCore/platform/PlatformEvent.h        2016-10-05 21:12:51 UTC (rev 206828)
</span><span class="lines">@@ -74,6 +74,7 @@
</span><span class="cx"> CtrlKey = 1 << 1,
</span><span class="cx"> MetaKey = 1 << 2,
</span><span class="cx"> ShiftKey = 1 << 3,
</span><ins>+ CapsLockKey = 1 << 4,
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> Type type() const { return static_cast<Type>(m_type); }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosPlatformEventFactoryIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm (206827 => 206828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm        2016-10-05 20:46:15 UTC (rev 206827)
+++ trunk/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm        2016-10-05 21:12:51 UTC (rev 206828)
</span><span class="lines">@@ -47,6 +47,8 @@
</span><span class="cx"> modifiers |= PlatformEvent::Modifier::AltKey;
</span><span class="cx"> if (event.modifierFlags & WebEventFlagMaskCommand)
</span><span class="cx"> modifiers |= PlatformEvent::Modifier::MetaKey;
</span><ins>+ if (event.modifierFlags & WebEventFlagMaskAlphaShift)
+ modifiers |= PlatformEvent::Modifier::CapsLockKey;
</ins><span class="cx">
</span><span class="cx"> return modifiers;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacPlatformEventFactoryMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm (206827 => 206828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm        2016-10-05 20:46:15 UTC (rev 206827)
+++ trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm        2016-10-05 21:12:51 UTC (rev 206828)
</span><span class="lines">@@ -690,9 +690,20 @@
</span><span class="cx">
</span><span class="cx"> static inline OptionSet<PlatformEvent::Modifier> modifiersForEvent(NSEvent *event)
</span><span class="cx"> {
</span><del>-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
</del><span class="cx"> OptionSet<PlatformEvent::Modifier> modifiers;
</span><ins>+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
+ if (event.modifierFlags & NSEventModifierFlagShift)
+ modifiers |= PlatformEvent::Modifier::ShiftKey;
+ if (event.modifierFlags & NSEventModifierFlagControl)
+ modifiers |= PlatformEvent::Modifier::CtrlKey;
+ if (event.modifierFlags & NSEventModifierFlagOption)
+ modifiers |= PlatformEvent::Modifier::AltKey;
+ if (event.modifierFlags & NSEventModifierFlagCommand)
+ modifiers |= PlatformEvent::Modifier::MetaKey;
+ if (event.modifierFlags & NSEventModifierFlagCapsLock)
+ modifiers |= PlatformEvent::Modifier::CapsLockKey;
+#else
</ins><span class="cx"> if (event.modifierFlags & NSShiftKeyMask)
</span><span class="cx"> modifiers |= PlatformEvent::Modifier::ShiftKey;
</span><span class="cx"> if (event.modifierFlags & NSControlKeyMask)
</span><span class="lines">@@ -701,7 +712,10 @@
</span><span class="cx"> modifiers |= PlatformEvent::Modifier::AltKey;
</span><span class="cx"> if (event.modifierFlags & NSCommandKeyMask)
</span><span class="cx"> modifiers |= PlatformEvent::Modifier::MetaKey;
</span><del>-#pragma clang diagnostic pop
</del><ins>+ if (event.modifierFlags & NSAlphaShiftKeyMask)
+ modifiers |= PlatformEvent::Modifier::CapsLockKey;
+#endif
+
</ins><span class="cx"> return modifiers;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (206827 => 206828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-10-05 20:46:15 UTC (rev 206827)
+++ trunk/Source/WebKit2/ChangeLog        2016-10-05 21:12:51 UTC (rev 206828)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2016-10-05 Chris Dumez <cdumez@apple.com>
+
+ KeyboardEvent.getModifierState() should support "CapsLock" modifier
+ https://bugs.webkit.org/show_bug.cgi?id=162861
+
+ Reviewed by Darin Adler.
+
+ Add support for CapsLock modifier on events.
+
+ * Shared/API/c/WKEvent.h:
+ * Shared/API/c/WKSharedAPICast.h:
+ (WebKit::toAPI):
+ * Shared/WebEventConversion.cpp:
+ (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
+ (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
+ (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
+ (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
+ (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):
+ * Shared/efl/WebEventFactory.cpp:
+ (WebKit::toWebEventModifiers):
+ * Shared/ios/WebIOSEventFactory.mm:
+ (modifiersForEvent):
+ * Shared/mac/WebEventFactory.mm:
+ (WebKit::modifiersForEvent):
+ * UIProcess/API/Cocoa/WKNavigationAction.mm:
+ (toNSEventModifierFlags):
+ * UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
+ (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
+
</ins><span class="cx"> 2016-10-05 Zan Dobersek <zdobersek@igalia.com>
</span><span class="cx">
</span><span class="cx"> Rename ENABLE_ENCRYPTED_MEDIA_V2 to ENABLE_LEGACY_ENCRYPTED_MEDIA
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedAPIcWKEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/API/c/WKEvent.h (206827 => 206828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/API/c/WKEvent.h        2016-10-05 20:46:15 UTC (rev 206827)
+++ trunk/Source/WebKit2/Shared/API/c/WKEvent.h        2016-10-05 21:12:51 UTC (rev 206828)
</span><span class="lines">@@ -36,7 +36,8 @@
</span><span class="cx"> kWKEventModifiersShiftKey = 1 << 0,
</span><span class="cx"> kWKEventModifiersControlKey = 1 << 1,
</span><span class="cx"> kWKEventModifiersAltKey = 1 << 2,
</span><del>- kWKEventModifiersMetaKey = 1 << 3
</del><ins>+ kWKEventModifiersMetaKey = 1 << 3,
+ kWKEventModifiersCapsLockKey = 1 << 4
</ins><span class="cx"> };
</span><span class="cx"> typedef uint32_t WKEventModifiers;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedAPIcWKSharedAPICasth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/API/c/WKSharedAPICast.h (206827 => 206828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/API/c/WKSharedAPICast.h        2016-10-05 20:46:15 UTC (rev 206827)
+++ trunk/Source/WebKit2/Shared/API/c/WKSharedAPICast.h        2016-10-05 21:12:51 UTC (rev 206828)
</span><span class="lines">@@ -294,6 +294,8 @@
</span><span class="cx"> wkModifiers |= kWKEventModifiersAltKey;
</span><span class="cx"> if (modifiers & WebEvent::MetaKey)
</span><span class="cx"> wkModifiers |= kWKEventModifiersMetaKey;
</span><ins>+ if (modifiers & WebEvent::CapsLockKey)
+ wkModifiers |= kWKEventModifiersCapsLockKey;
</ins><span class="cx"> return wkModifiers;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebEventConversioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebEventConversion.cpp (206827 => 206828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebEventConversion.cpp        2016-10-05 20:46:15 UTC (rev 206827)
+++ trunk/Source/WebKit2/Shared/WebEventConversion.cpp        2016-10-05 21:12:51 UTC (rev 206828)
</span><span class="lines">@@ -76,6 +76,8 @@
</span><span class="cx"> m_modifiers |= Modifier::AltKey;
</span><span class="cx"> if (webEvent.metaKey())
</span><span class="cx"> m_modifiers |= Modifier::MetaKey;
</span><ins>+ if (webEvent.capsLockKey())
+ m_modifiers |= Modifier::CapsLockKey;
</ins><span class="cx">
</span><span class="cx"> m_timestamp = webEvent.timestamp();
</span><span class="cx">
</span><span class="lines">@@ -127,6 +129,8 @@
</span><span class="cx"> m_modifiers |= Modifier::AltKey;
</span><span class="cx"> if (webEvent.metaKey())
</span><span class="cx"> m_modifiers |= Modifier::MetaKey;
</span><ins>+ if (webEvent.capsLockKey())
+ m_modifiers |= Modifier::CapsLockKey;
</ins><span class="cx">
</span><span class="cx"> m_timestamp = webEvent.timestamp();
</span><span class="cx">
</span><span class="lines">@@ -185,6 +189,8 @@
</span><span class="cx"> m_modifiers |= Modifier::AltKey;
</span><span class="cx"> if (webEvent.metaKey())
</span><span class="cx"> m_modifiers |= Modifier::MetaKey;
</span><ins>+ if (webEvent.capsLockKey())
+ m_modifiers |= Modifier::CapsLockKey;
</ins><span class="cx">
</span><span class="cx"> m_timestamp = webEvent.timestamp();
</span><span class="cx">
</span><span class="lines">@@ -324,6 +330,8 @@
</span><span class="cx"> m_modifiers |= Modifier::AltKey;
</span><span class="cx"> if (webEvent.metaKey())
</span><span class="cx"> m_modifiers |= Modifier::MetaKey;
</span><ins>+ if (webEvent.capsLockKey())
+ m_modifiers |= Modifier::CapsLockKey;
</ins><span class="cx">
</span><span class="cx"> m_timestamp = webEvent.timestamp();
</span><span class="cx">
</span><span class="lines">@@ -381,6 +389,8 @@
</span><span class="cx"> m_modifiers |= Modifier::AltKey;
</span><span class="cx"> if (webEvent.metaKey())
</span><span class="cx"> m_modifiers |= Modifier::MetaKey;
</span><ins>+ if (webEvent.capsLockKey())
+ m_modifiers |= Modifier::CapsLockKey;
</ins><span class="cx">
</span><span class="cx"> m_timestamp = webEvent.timestamp();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedeflWebEventFactorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/efl/WebEventFactory.cpp (206827 => 206828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/efl/WebEventFactory.cpp        2016-10-05 20:46:15 UTC (rev 206827)
+++ trunk/Source/WebKit2/Shared/efl/WebEventFactory.cpp        2016-10-05 21:12:51 UTC (rev 206828)
</span><span class="lines">@@ -258,6 +258,8 @@
</span><span class="cx"> result |= WebEvent::AltKey;
</span><span class="cx"> if (modifiers & kWKEventModifiersMetaKey)
</span><span class="cx"> result |= WebEvent::MetaKey;
</span><ins>+ if (modifiers & kWKEventModifiersCapsLockKey)
+ result |= WebEvent::CapsLockKey;
</ins><span class="cx">
</span><span class="cx"> return static_cast<WebEvent::Modifiers>(result);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2SharediosWebIOSEventFactorymm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/ios/WebIOSEventFactory.mm (206827 => 206828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/ios/WebIOSEventFactory.mm        2016-10-05 20:46:15 UTC (rev 206827)
+++ trunk/Source/WebKit2/Shared/ios/WebIOSEventFactory.mm        2016-10-05 21:12:51 UTC (rev 206828)
</span><span class="lines">@@ -44,6 +44,8 @@
</span><span class="cx"> modifiers |= WebKit::WebEvent::AltKey;
</span><span class="cx"> if (eventModifierFlags & WebEventFlagMaskCommand)
</span><span class="cx"> modifiers |= WebKit::WebEvent::MetaKey;
</span><ins>+ if (eventModifierFlags & WebEventFlagMaskAlphaShift)
+ modifiers |= WebKit::WebEvent::CapsLockKey;
</ins><span class="cx">
</span><span class="cx"> return static_cast<WebKit::WebEvent::Modifiers>(modifiers);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacWebEventFactorymm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/WebEventFactory.mm (206827 => 206828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/WebEventFactory.mm        2016-10-05 20:46:15 UTC (rev 206827)
+++ trunk/Source/WebKit2/Shared/mac/WebEventFactory.mm        2016-10-05 21:12:51 UTC (rev 206828)
</span><span class="lines">@@ -338,8 +338,19 @@
</span><span class="cx"> static inline WebEvent::Modifiers modifiersForEvent(NSEvent *event)
</span><span class="cx"> {
</span><span class="cx"> unsigned modifiers = 0;
</span><del>-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
</del><ins>+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
+ if ([event modifierFlags] & NSEventModifierFlagCapsLock)
+ modifiers |= WebEvent::CapsLockKey;
+ if ([event modifierFlags] & NSEventModifierFlagShift)
+ modifiers |= WebEvent::ShiftKey;
+ if ([event modifierFlags] & NSEventModifierFlagControl)
+ modifiers |= WebEvent::ControlKey;
+ if ([event modifierFlags] & NSEventModifierFlagOption)
+ modifiers |= WebEvent::AltKey;
+ if ([event modifierFlags] & NSEventModifierFlagCommand)
+ modifiers |= WebEvent::MetaKey;
+#else
</ins><span class="cx"> if ([event modifierFlags] & NSAlphaShiftKeyMask)
</span><span class="cx"> modifiers |= WebEvent::CapsLockKey;
</span><span class="cx"> if ([event modifierFlags] & NSShiftKeyMask)
</span><span class="lines">@@ -350,7 +361,8 @@
</span><span class="cx"> modifiers |= WebEvent::AltKey;
</span><span class="cx"> if ([event modifierFlags] & NSCommandKeyMask)
</span><span class="cx"> modifiers |= WebEvent::MetaKey;
</span><del>-#pragma clang diagnostic pop
</del><ins>+#endif
+
</ins><span class="cx"> return (WebEvent::Modifiers)modifiers;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKNavigationActionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationAction.mm (206827 => 206828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationAction.mm        2016-10-05 20:46:15 UTC (rev 206827)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationAction.mm        2016-10-05 21:12:51 UTC (rev 206828)
</span><span class="lines">@@ -79,9 +79,19 @@
</span><span class="cx"> {
</span><span class="cx"> NSEventModifierFlags modifierFlags = 0;
</span><span class="cx">
</span><del>-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
</del><ins>+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
</ins><span class="cx"> if (modifiers & WebKit::WebEvent::CapsLockKey)
</span><ins>+ modifierFlags |= NSEventModifierFlagCapsLock;
+ if (modifiers & WebKit::WebEvent::ShiftKey)
+ modifierFlags |= NSEventModifierFlagShift;
+ if (modifiers & WebKit::WebEvent::ControlKey)
+ modifierFlags |= NSEventModifierFlagControl;
+ if (modifiers & WebKit::WebEvent::AltKey)
+ modifierFlags |= NSEventModifierFlagOption;
+ if (modifiers & WebKit::WebEvent::MetaKey)
+ modifierFlags |= NSEventModifierFlagCommand;
+#else
+ if (modifiers & WebKit::WebEvent::CapsLockKey)
</ins><span class="cx"> modifierFlags |= NSAlphaShiftKeyMask;
</span><span class="cx"> if (modifiers & WebKit::WebEvent::ShiftKey)
</span><span class="cx"> modifierFlags |= NSShiftKeyMask;
</span><span class="lines">@@ -91,7 +101,8 @@
</span><span class="cx"> modifierFlags |= NSAlternateKeyMask;
</span><span class="cx"> if (modifiers & WebKit::WebEvent::MetaKey)
</span><span class="cx"> modifierFlags |= NSCommandKeyMask;
</span><del>-#pragma clang diagnostic pop
</del><ins>+#endif
+
</ins><span class="cx"> return modifierFlags;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaWebAutomationSessionCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebAutomationSessionCocoa.mm (206827 => 206828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WebAutomationSessionCocoa.mm        2016-10-05 20:46:15 UTC (rev 206827)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebAutomationSessionCocoa.mm        2016-10-05 21:12:51 UTC (rev 206828)
</span><span class="lines">@@ -107,6 +107,8 @@
</span><span class="cx"> modifiers |= NSEventModifierFlagControl;
</span><span class="cx"> if (keyModifiers & WebEvent::ShiftKey)
</span><span class="cx"> modifiers |= NSEventModifierFlagShift;
</span><ins>+ if (keyModifiers & WebEvent::CapsLockKey)
+ modifiers |= NSEventModifierFlagCapsLock;
</ins><span class="cx">
</span><span class="cx"> NSTimeInterval timestamp = [NSDate timeIntervalSinceReferenceDate];
</span><span class="cx"> NSWindow *window = page.platformWindow();
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (206827 => 206828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-10-05 20:46:15 UTC (rev 206827)
+++ trunk/Tools/ChangeLog        2016-10-05 21:12:51 UTC (rev 206828)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2016-10-05 Chris Dumez <cdumez@apple.com>
+
+ KeyboardEvent.getModifierState() should support "CapsLock" modifier
+ https://bugs.webkit.org/show_bug.cgi?id=162861
+
+ Reviewed by Darin Adler.
+
+ Add support for 'capsLockKey' modifier for EventSender.keyDown() so
+ that we can test this new modifier support for layout tests.
+
+ * TestWebKitAPI/mac/PlatformWebViewMac.mm:
+ (TestWebKitAPI::modifierFlagsForWKModifiers):
+ * WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
+ (WTR::parseModifier):
+ * WebKitTestRunner/mac/EventSenderProxy.mm:
+ (WTR::buildModifierFlags):
+
</ins><span class="cx"> 2016-10-05 Jeremy Jones <jeremyj@apple.com>
</span><span class="cx">
</span><span class="cx"> Add MobileMiniBrowser tests for control center and looping fullscreen.
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacEventSendingControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/EventSendingController.mm (206827 => 206828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/EventSendingController.mm        2016-10-05 20:46:15 UTC (rev 206827)
+++ trunk/Tools/DumpRenderTree/mac/EventSendingController.mm        2016-10-05 21:12:51 UTC (rev 206828)
</span><span class="lines">@@ -437,11 +437,13 @@
</span><span class="cx"> const int shiftKeyMask = NSShiftKeyMask;
</span><span class="cx"> const int alternateKeyMask = NSAlternateKeyMask;
</span><span class="cx"> const int commandKeyMask = NSCommandKeyMask;
</span><ins>+ const int capsLockKeyMask = NSAlphaShiftKeyMask;
</ins><span class="cx"> #else
</span><span class="cx"> const int controlKeyMask = WebEventFlagMaskControl;
</span><span class="cx"> const int shiftKeyMask = WebEventFlagMaskShift;
</span><span class="cx"> const int alternateKeyMask = WebEventFlagMaskAlternate;
</span><span class="cx"> const int commandKeyMask = WebEventFlagMaskCommand;
</span><ins>+ const int capsLockKeyMask = WebEventFlagMaskAlphaShift;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> int flags = 0;
</span><span class="lines">@@ -453,6 +455,8 @@
</span><span class="cx"> flags |= alternateKeyMask;
</span><span class="cx"> else if ([modifierName isEqual:@"metaKey"] || [modifierName isEqual:@"addSelectionKey"])
</span><span class="cx"> flags |= commandKeyMask;
</span><ins>+ else if ([modifierName isEqual:@"capsLockKey"])
+ flags |= capsLockKeyMask;
</ins><span class="cx">
</span><span class="cx"> return flags;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPImacPlatformWebViewMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/mac/PlatformWebViewMac.mm (206827 => 206828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/mac/PlatformWebViewMac.mm        2016-10-05 20:46:15 UTC (rev 206827)
+++ trunk/Tools/TestWebKitAPI/mac/PlatformWebViewMac.mm        2016-10-05 21:12:51 UTC (rev 206828)
</span><span class="lines">@@ -220,6 +220,8 @@
</span><span class="cx"> returnVal |= NSAlternateKeyMask;
</span><span class="cx"> if (modifiers & kWKEventModifiersMetaKey)
</span><span class="cx"> returnVal |= NSCommandKeyMask;
</span><ins>+ if (modifiers & kWKEventModifiersCapsLockKey)
+ returnVal |= NSAlphaShiftKeyMask;
</ins><span class="cx">
</span><span class="cx"> return returnVal;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleEventSendingControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp (206827 => 206828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp        2016-10-05 20:46:15 UTC (rev 206827)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp        2016-10-05 21:12:51 UTC (rev 206828)
</span><span class="lines">@@ -116,6 +116,8 @@
</span><span class="cx"> return kWKEventModifiersAltKey;
</span><span class="cx"> if (JSStringIsEqualToUTF8CString(modifier, "metaKey"))
</span><span class="cx"> return kWKEventModifiersMetaKey;
</span><ins>+ if (JSStringIsEqualToUTF8CString(modifier, "capsLockKey"))
+ return kWKEventModifiersCapsLockKey;
</ins><span class="cx"> if (JSStringIsEqualToUTF8CString(modifier, "addSelectionKey")) {
</span><span class="cx"> #if OS(MAC_OS_X)
</span><span class="cx"> return kWKEventModifiersMetaKey;
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnermacEventSenderProxymm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm (206827 => 206828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm        2016-10-05 20:46:15 UTC (rev 206827)
+++ trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm        2016-10-05 21:12:51 UTC (rev 206828)
</span><span class="lines">@@ -250,6 +250,8 @@
</span><span class="cx"> flags |= NSAlternateKeyMask;
</span><span class="cx"> if (modifiers & kWKEventModifiersMetaKey)
</span><span class="cx"> flags |= NSCommandKeyMask;
</span><ins>+ if (modifiers & kWKEventModifiersCapsLockKey)
+ flags |= NSAlphaShiftKeyMask;
</ins><span class="cx"> return flags;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>