<!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>[238047] 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/238047">238047</a></dd>
<dt>Author</dt> <dd>dbates@webkit.org</dd>
<dt>Date</dt> <dd>2018-11-09 11:10:27 -0800 (Fri, 09 Nov 2018)</dd>
</dl>

<h3>Log Message</h3>
<pre>[iOS] Draw caps lock indicator in password fields
https://bugs.webkit.org/show_bug.cgi?id=190565
<rdar://problem/45262343>

Reviewed by Dean Jackson.

Source/WebCore:

Draw the caps lock indicator in a focused password field on iOS. This makes the behavior of password
fields on iOS more closely match the behavior of password fields on Mac. For now, we only draw the
indicator when caps locks is enabled via the hardware keyboard. We will look to support the software
keyboard in a subsequent commit (see <https://bugs.webkit.org/show_bug.cgi?id=191475>).

The majority of this patch is implementing PlatformKeyboardEvent::currentCapsLockState() for iOS.
In Legacy WebKit, the implementation boils down to calling call -[::WebEvent modifierFlags]. In
Modern WebKit the UIProcess is responsible for -[::WebEvent modifierFlags] and passing it the
WebProcess to store such that invocations of PlatformKeyboardEvent::currentCapsLockState() consult
the store in the WebProcess. A smaller part of this patch is having both the legacy and modern
web views listen for keyboard availability changes so as to update the the caps lock state when
a hardware keyboard is detached or attached.

* WebCore.xcodeproj/project.pbxproj:
* page/EventHandler.cpp:
(WebCore::EventHandler::capsLockStateMayHaveChanged const): Extracted from EventHandler::internalKeyEvent()
so that it can shared between WebCore, Modern WebKit, and Legacy WebKit code.
(WebCore::EventHandler::internalKeyEvent): Modified to call capsLockStateMayHaveChanged().
* page/EventHandler.h:
* platform/cocoa/KeyEventCocoa.mm:
(WebCore::PlatformKeyboardEvent::currentCapsLockState): Moved from KeyEventMac.mm.
(WebCore::PlatformKeyboardEvent::getCurrentModifierState): Moved from KeyEventMac.mm.
* platform/ios/KeyEventIOS.mm:
(WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys): Fetch the current modifier state.
(WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; we now use the Cocoa implementation.
(WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; we now use the Cocoa implementation.
* platform/ios/WebEvent.h:
* platform/ios/WebEvent.mm:
(+[WebEvent modifierFlags]): Added.
* platform/mac/KeyEventMac.mm:
(WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; moved to KeyEventCocoa.mm to be shared
by both Mac and iOS.
(WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; moved to KeyEventCocoa.mm to be shared
by both Mac and iOS.
* rendering/RenderThemeCocoa.h:
* rendering/RenderThemeCocoa.mm:
(WebCore::RenderThemeCocoa::shouldHaveCapsLockIndicator const): Moved from RenderThemeMac.mm.
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::shouldHaveCapsLockIndicator const): Deleted.
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::shouldHaveCapsLockIndicator const): Deleted; moved to RenderThemeCocoa.mm to be
shared by both Mac and iOS.

Source/WebCore/PAL:

Forward declare some more SPI.

* pal/spi/ios/GraphicsServicesSPI.h:
* pal/spi/ios/UIKitSPI.h:

Source/WebKit:

Notify the WebContent process with the current modifer state on window activation changes. Notify
the WebContent process when hardware keyboard availability changes (e.g. a keyboard is attached).

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]): Register for hardware keyboard availability changed notifications.
(-[WKWebView dealloc]): Unregister from hardware availability changed notifications.
(hardwareKeyboardAvailabilityChangedCallback): Added.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateCurrentModifierState): Compile this code when building for iOS.
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _handleKeyUIEvent:]): Update the current modifier state if this event is a hardware
keyboard flags changed event.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged): Added.

* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::hardwareKeyboardAvailabilityChanged):
Added new message HardwareKeyboardAvailabilityChanged. Notify the focused HTML input element (if we have
one) that the caps lock state may have changed when we receive message HardwareKeyboardAvailabilityChanged
so that we toggle visibility of the caps lock indicator.

Source/WebKitLegacy/mac:

Update the caps lock state when a hardware keyboard is attached or detached.

* WebView/WebHTMLView.mm:
(hardwareKeyboardAvailabilityChangedCallback): Added.
(-[WebHTMLView initWithFrame:]): Register for hardware keyboard availability changed notifications.
(-[WebHTMLView dealloc]): Unregister from hardware keyboard availability changed notifications.

WebKitLibraries:

Expose some more symbols.

* WebKitPrivateFrameworkStubs/iOS/12/GraphicsServices.framework/GraphicsServices.tbd:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePALChangeLog">trunk/Source/WebCore/PAL/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePALpalspiiosGraphicsServicesSPIh">trunk/Source/WebCore/PAL/pal/spi/ios/GraphicsServicesSPI.h</a></li>
<li><a href="#trunkSourceWebCorePALpalspiiosUIKitSPIh">trunk/Source/WebCore/PAL/pal/spi/ios/UIKitSPI.h</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorepageEventHandlercpp">trunk/Source/WebCore/page/EventHandler.cpp</a></li>
<li><a href="#trunkSourceWebCorepageEventHandlerh">trunk/Source/WebCore/page/EventHandler.h</a></li>
<li><a href="#trunkSourceWebCoreplatformcocoaKeyEventCocoamm">trunk/Source/WebCore/platform/cocoa/KeyEventCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosKeyEventIOSmm">trunk/Source/WebCore/platform/ios/KeyEventIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebEventh">trunk/Source/WebCore/platform/ios/WebEvent.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebEventmm">trunk/Source/WebCore/platform/ios/WebEvent.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacKeyEventMacmm">trunk/Source/WebCore/platform/mac/KeyEventMac.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeCocoah">trunk/Source/WebCore/rendering/RenderThemeCocoa.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeCocoamm">trunk/Source/WebCore/rendering/RenderThemeCocoa.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeIOSh">trunk/Source/WebCore/rendering/RenderThemeIOS.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeIOSmm">trunk/Source/WebCore/rendering/RenderThemeIOS.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeMach">trunk/Source/WebCore/rendering/RenderThemeMac.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeMacmm">trunk/Source/WebCore/rendering/RenderThemeMac.mm</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebPageProxycpp">trunk/Source/WebKit/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebPageProxyh">trunk/Source/WebKit/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessiosWKContentViewInteractionmm">trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessiosWebPageProxyIOSmm">trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebPageh">trunk/Source/WebKit/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebPagemessagesin">trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageiosWebPageIOSmm">trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
<li><a href="#trunkSourceWebKitLegacymacChangeLog">trunk/Source/WebKitLegacy/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitLegacymacWebViewWebHTMLViewmm">trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm</a></li>
<li><a href="#trunkWebKitLibrariesChangeLog">trunk/WebKitLibraries/ChangeLog</a></li>
<li><a href="#trunkWebKitLibrariesWebKitPrivateFrameworkStubsiOS12GraphicsServicesframeworkGraphicsServicestbd">trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/12/GraphicsServices.framework/GraphicsServices.tbd</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebCore/ChangeLog      2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -1,3 +1,56 @@
</span><ins>+2018-11-09  Daniel Bates  <dabates@apple.com>
+
+        [iOS] Draw caps lock indicator in password fields
+        https://bugs.webkit.org/show_bug.cgi?id=190565
+        <rdar://problem/45262343>
+
+        Reviewed by Dean Jackson.
+
+        Draw the caps lock indicator in a focused password field on iOS. This makes the behavior of password
+        fields on iOS more closely match the behavior of password fields on Mac. For now, we only draw the
+        indicator when caps locks is enabled via the hardware keyboard. We will look to support the software
+        keyboard in a subsequent commit (see <https://bugs.webkit.org/show_bug.cgi?id=191475>).
+
+        The majority of this patch is implementing PlatformKeyboardEvent::currentCapsLockState() for iOS.
+        In Legacy WebKit, the implementation boils down to calling call -[::WebEvent modifierFlags]. In
+        Modern WebKit the UIProcess is responsible for -[::WebEvent modifierFlags] and passing it the
+        WebProcess to store such that invocations of PlatformKeyboardEvent::currentCapsLockState() consult
+        the store in the WebProcess. A smaller part of this patch is having both the legacy and modern
+        web views listen for keyboard availability changes so as to update the the caps lock state when
+        a hardware keyboard is detached or attached.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::capsLockStateMayHaveChanged const): Extracted from EventHandler::internalKeyEvent()
+        so that it can shared between WebCore, Modern WebKit, and Legacy WebKit code.
+        (WebCore::EventHandler::internalKeyEvent): Modified to call capsLockStateMayHaveChanged().
+        * page/EventHandler.h:
+        * platform/cocoa/KeyEventCocoa.mm:
+        (WebCore::PlatformKeyboardEvent::currentCapsLockState): Moved from KeyEventMac.mm.
+        (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Moved from KeyEventMac.mm.
+        * platform/ios/KeyEventIOS.mm:
+        (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys): Fetch the current modifier state.
+        (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; we now use the Cocoa implementation.
+        (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; we now use the Cocoa implementation.
+        * platform/ios/WebEvent.h:
+        * platform/ios/WebEvent.mm:
+        (+[WebEvent modifierFlags]): Added.
+        * platform/mac/KeyEventMac.mm:
+        (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; moved to KeyEventCocoa.mm to be shared
+        by both Mac and iOS.
+        (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; moved to KeyEventCocoa.mm to be shared
+        by both Mac and iOS.
+        * rendering/RenderThemeCocoa.h:
+        * rendering/RenderThemeCocoa.mm:
+        (WebCore::RenderThemeCocoa::shouldHaveCapsLockIndicator const): Moved from RenderThemeMac.mm.
+        * rendering/RenderThemeIOS.h:
+        * rendering/RenderThemeIOS.mm:
+        (WebCore::RenderThemeIOS::shouldHaveCapsLockIndicator const): Deleted.
+        * rendering/RenderThemeMac.h:
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::shouldHaveCapsLockIndicator const): Deleted; moved to RenderThemeCocoa.mm to be
+        shared by both Mac and iOS.
+
</ins><span class="cx"> 2018-11-09  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Unreviewed attempt to fix WinCairo build after r238039.
</span></span></pre></div>
<a id="trunkSourceWebCorePALChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PAL/ChangeLog (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PAL/ChangeLog       2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebCore/PAL/ChangeLog  2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2018-11-09  Daniel Bates  <dabates@apple.com>
+
+        [iOS] Draw caps lock indicator in password fields
+        https://bugs.webkit.org/show_bug.cgi?id=190565
+        <rdar://problem/45262343>
+
+        Reviewed by Dean Jackson.
+
+        Forward declare some more SPI.
+
+        * pal/spi/ios/GraphicsServicesSPI.h:
+        * pal/spi/ios/UIKitSPI.h:
+
</ins><span class="cx"> 2018-11-08  Megan Gardner  <megan_gardner@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Adopt Reveal Framework to replace Lookup
</span></span></pre></div>
<a id="trunkSourceWebCorePALpalspiiosGraphicsServicesSPIh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PAL/pal/spi/ios/GraphicsServicesSPI.h (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PAL/pal/spi/ios/GraphicsServicesSPI.h       2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebCore/PAL/pal/spi/ios/GraphicsServicesSPI.h  2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2014-2018 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -43,6 +43,12 @@
</span><span class="cx"> void GSFontInitialize(void);
</span><span class="cx"> void GSFontPurgeFontCache(void);
</span><span class="cx"> 
</span><ins>+typedef struct __GSKeyboard* GSKeyboardRef;
+uint32_t GSKeyboardGetModifierState(GSKeyboardRef);
+Boolean GSEventIsHardwareKeyboardAttached();
+
+extern const char *kGSEventHardwareKeyboardAvailabilityChangedNotification;
+
</ins><span class="cx"> WTF_EXTERN_C_END
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorePALpalspiiosUIKitSPIh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PAL/pal/spi/ios/UIKitSPI.h (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PAL/pal/spi/ios/UIKitSPI.h  2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebCore/PAL/pal/spi/ios/UIKitSPI.h     2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -23,6 +23,10 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><ins>+WTF_EXTERN_C_BEGIN
+typedef struct __GSKeyboard* GSKeyboardRef;
+WTF_EXTERN_C_END
+
</ins><span class="cx"> #if USE(APPLE_INTERNAL_SDK)
</span><span class="cx"> 
</span><span class="cx"> #import <UIKit/NSParagraphStyle_Private.h>
</span><span class="lines">@@ -44,6 +48,7 @@
</span><span class="cx"> 
</span><span class="cx"> @interface UIApplication ()
</span><span class="cx"> + (UIApplicationSceneClassicMode)_classicMode;
</span><ins>+- (GSKeyboardRef)_hardwareKeyboard;
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> #else
</span><span class="lines">@@ -75,10 +80,9 @@
</span><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @interface UIApplication ()
</span><del>-
</del><span class="cx"> - (BOOL)_isClassic;
</span><span class="cx"> + (UIApplicationSceneClassicMode)_classicMode;
</span><del>-
</del><ins>+- (GSKeyboardRef)_hardwareKeyboard;
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @interface UIColor ()
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj   2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj      2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -13687,6 +13687,7 @@
</span><span class="cx">          CE2849881CA3614600B4A57F /* ContentSecurityPolicyDirectiveNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ContentSecurityPolicyDirectiveNames.cpp; path = csp/ContentSecurityPolicyDirectiveNames.cpp; sourceTree = "<group>"; };
</span><span class="cx">          CE5CB1B314EDAB6F00BB2795 /* EventSender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventSender.h; sourceTree = "<group>"; };
</span><span class="cx">          CE5FA253209E48C50051D700 /* ContentSecurityPolicyClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ContentSecurityPolicyClient.h; path = csp/ContentSecurityPolicyClient.h; sourceTree = "<group>"; };
</span><ins>+               CE68C8FF21924EE5001230B3 /* PlatformKeyboardEvent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformKeyboardEvent.cpp; sourceTree = "<group>"; };
</ins><span class="cx">           CE6D89294C7AACE0AD89B3DD /* MathMLMencloseElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLMencloseElement.h; sourceTree = "<group>"; };
</span><span class="cx">          CE6DADF71C591E6A003F6A88 /* ContentSecurityPolicyResponseHeaders.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ContentSecurityPolicyResponseHeaders.cpp; path = csp/ContentSecurityPolicyResponseHeaders.cpp; sourceTree = "<group>"; };
</span><span class="cx">          CE6DADF81C591E6A003F6A88 /* ContentSecurityPolicyResponseHeaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ContentSecurityPolicyResponseHeaders.h; path = csp/ContentSecurityPolicyResponseHeaders.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -25089,6 +25090,7 @@
</span><span class="cx">                          A14978701ABAF3A500CEF7E4 /* PlatformContentFilter.h */,
</span><span class="cx">                          BC5C76291497FE1400BC4775 /* PlatformEvent.h */,
</span><span class="cx">                          A723F77A1484CA4C008C6DBE /* PlatformExportMacros.h */,
</span><ins>+                               CE68C8FF21924EE5001230B3 /* PlatformKeyboardEvent.cpp */,
</ins><span class="cx">                           935C476609AC4D4300A6AAB4 /* PlatformKeyboardEvent.h */,
</span><span class="cx">                          935C476709AC4D4300A6AAB4 /* PlatformMouseEvent.h */,
</span><span class="cx">                          C5BAC16F14E30E4700008837 /* PlatformPasteboard.h */,
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventHandler.cpp (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventHandler.cpp       2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebCore/page/EventHandler.cpp  2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -3162,6 +3162,14 @@
</span><span class="cx">     return wasHandled;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void EventHandler::capsLockStateMayHaveChanged() const
+{
+    auto* focusedElement = m_frame.document()->focusedElement();
+    if (!is<HTMLInputElement>(focusedElement))
+        return;
+    downcast<HTMLInputElement>(*focusedElement).capsLockStateMayHaveChanged();
+}
+
</ins><span class="cx"> bool EventHandler::internalKeyEvent(const PlatformKeyboardEvent& initialKeyEvent)
</span><span class="cx"> {
</span><span class="cx">     Ref<Frame> protectedFrame(m_frame);
</span><span class="lines">@@ -3194,12 +3202,8 @@
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    if (initialKeyEvent.windowsVirtualKeyCode() == VK_CAPITAL) {
-        if (auto* element = m_frame.document()->focusedElement()) {
-            if (is<HTMLInputElement>(*element))
-                downcast<HTMLInputElement>(*element).capsLockStateMayHaveChanged();
-        }
-    }
</del><ins>+    if (initialKeyEvent.windowsVirtualKeyCode() == VK_CAPITAL)
+        capsLockStateMayHaveChanged();
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(PAN_SCROLLING)
</span><span class="cx">     if (m_frame.mainFrame().eventHandler().panScrollInProgress()) {
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventHandlerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventHandler.h (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventHandler.h 2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebCore/page/EventHandler.h    2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -256,6 +256,7 @@
</span><span class="cx">     WEBCORE_EXPORT bool handleAccessKey(const PlatformKeyboardEvent&);
</span><span class="cx">     WEBCORE_EXPORT bool keyEvent(const PlatformKeyboardEvent&);
</span><span class="cx">     void defaultKeyboardEventHandler(KeyboardEvent&);
</span><ins>+    WEBCORE_EXPORT void capsLockStateMayHaveChanged() const;
</ins><span class="cx"> 
</span><span class="cx">     bool accessibilityPreventsEventPropagation(KeyboardEvent&);
</span><span class="cx">     WEBCORE_EXPORT void handleKeyboardSelectionMovementForAccessibility(KeyboardEvent&);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcocoaKeyEventCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cocoa/KeyEventCocoa.mm (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cocoa/KeyEventCocoa.mm     2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebCore/platform/cocoa/KeyEventCocoa.mm        2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #import "KeyEventCocoa.h"
</span><span class="cx"> 
</span><span class="cx"> #import "Logging.h"
</span><ins>+#import "PlatformKeyboardEvent.h"
</ins><span class="cx"> #import "WindowsKeyboardCodes.h"
</span><span class="cx"> #import <wtf/ASCIICType.h>
</span><span class="cx"> #import <wtf/text/WTFString.h>
</span><span class="lines">@@ -39,6 +40,20 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+bool PlatformKeyboardEvent::currentCapsLockState()
+{
+    return currentStateOfModifierKeys().contains(PlatformEvent::Modifier::CapsLockKey);
+}
+
+void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey)
+{
+    auto currentModifiers = currentStateOfModifierKeys();
+    shiftKey = currentModifiers.contains(PlatformEvent::Modifier::ShiftKey);
+    ctrlKey = currentModifiers.contains(PlatformEvent::Modifier::CtrlKey);
+    altKey = currentModifiers.contains(PlatformEvent::Modifier::AltKey);
+    metaKey = currentModifiers.contains(PlatformEvent::Modifier::MetaKey);
+}
+
</ins><span class="cx"> // https://w3c.github.io/uievents-key/
</span><span class="cx"> String keyForCharCode(unichar charCode)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosKeyEventIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/KeyEventIOS.mm (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/KeyEventIOS.mm 2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebCore/platform/ios/KeyEventIOS.mm    2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -31,8 +31,10 @@
</span><span class="cx"> #import "KeyEventCocoa.h"
</span><span class="cx"> #import "KeyEventCodesIOS.h"
</span><span class="cx"> #import "NotImplemented.h"
</span><ins>+#import "WebEvent.h"
</ins><span class="cx"> #import "WindowsKeyboardCodes.h"
</span><span class="cx"> #import <pal/spi/cocoa/IOKitSPI.h>
</span><ins>+#import <wtf/MainThread.h>
</ins><span class="cx"> 
</span><span class="cx"> using namespace WTF;
</span><span class="cx"> 
</span><span class="lines">@@ -312,19 +314,29 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool PlatformKeyboardEvent::currentCapsLockState()
</del><ins>+OptionSet<PlatformEvent::Modifier> PlatformKeyboardEvent::currentStateOfModifierKeys()
</ins><span class="cx"> {
</span><del>-    notImplemented();
-    return false;
-}
</del><ins>+    // s_currentModifiers is only set in the WebContent process, not in the UI process.
+    if (s_currentModifiers) {
+        ASSERT(isMainThread());
+        return *s_currentModifiers;
+    }
</ins><span class="cx"> 
</span><del>-void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey)
-{
-    notImplemented();
-    shiftKey = false;
-    ctrlKey = false;
-    altKey = false;
-    metaKey = false;
</del><ins>+    ::WebEventFlags currentModifiers = [::WebEvent modifierFlags];
+
+    OptionSet<PlatformEvent::Modifier> modifiers;
+    if (currentModifiers & ::WebEventFlagMaskShiftKey)
+        modifiers.add(PlatformEvent::Modifier::ShiftKey);
+    if (currentModifiers & ::WebEventFlagMaskControlKey)
+        modifiers.add(PlatformEvent::Modifier::CtrlKey);
+    if (currentModifiers & ::WebEventFlagMaskOptionKey)
+        modifiers.add(PlatformEvent::Modifier::AltKey);
+    if (currentModifiers & ::WebEventFlagMaskCommandKey)
+        modifiers.add(PlatformEvent::Modifier::MetaKey);
+    if (currentModifiers & ::WebEventFlagMaskLeftCapsLockKey)
+        modifiers.add(PlatformEvent::Modifier::CapsLockKey);
+
+    return modifiers;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/WebEvent.h (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebEvent.h     2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebCore/platform/ios/WebEvent.h        2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -216,6 +216,8 @@
</span><span class="cx"> 
</span><span class="cx"> @property(nonatomic) BOOL wasHandled;
</span><span class="cx"> 
</span><ins>+@property (class, readonly) WebEventFlags modifierFlags;
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> #endif // TARGET_OS_IPHONE
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebEventmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/WebEvent.mm (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebEvent.mm    2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebCore/platform/ios/WebEvent.mm       2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -36,7 +36,15 @@
</span><span class="cx"> #import "KeyEventCodesIOS.h"
</span><span class="cx"> #import "WAKAppKitStubs.h"
</span><span class="cx"> #import <pal/spi/cocoa/IOKitSPI.h>
</span><ins>+#import <pal/spi/ios/GraphicsServicesSPI.h>
+#import <pal/spi/ios/UIKitSPI.h>
+#import <wtf/SoftLinking.h>
</ins><span class="cx"> 
</span><ins>+SOFT_LINK_FRAMEWORK(UIKit)
+SOFT_LINK_CLASS(UIKit, UIApplication);
+
+#define UIApplication getUIApplicationClass()
+
</ins><span class="cx"> using WebCore::windowsKeyCodeForKeyCode;
</span><span class="cx"> using WebCore::windowsKeyCodeForCharCode;
</span><span class="cx"> 
</span><span class="lines">@@ -491,6 +499,11 @@
</span><span class="cx">     return _gestureRotation;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>++ (WebEventFlags)modifierFlags
+{
+    return GSEventIsHardwareKeyboardAttached() ? GSKeyboardGetModifierState([UIApplication sharedApplication]._hardwareKeyboard) : 0;
+}
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> #endif // PLATFORM(IOS_FAMILY)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacKeyEventMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/KeyEventMac.mm (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/KeyEventMac.mm 2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebCore/platform/mac/KeyEventMac.mm    2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -258,21 +258,6 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool PlatformKeyboardEvent::currentCapsLockState()
-{
-    auto currentModifiers = currentStateOfModifierKeys();
-    return currentModifiers.contains(PlatformEvent::Modifier::CapsLockKey);
-}
-
-void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey)
-{
-    auto currentModifiers = currentStateOfModifierKeys();
-    shiftKey = currentModifiers.contains(PlatformEvent::Modifier::ShiftKey);
-    ctrlKey = currentModifiers.contains(PlatformEvent::Modifier::CtrlKey);
-    altKey = currentModifiers.contains(PlatformEvent::Modifier::AltKey);
-    metaKey = currentModifiers.contains(PlatformEvent::Modifier::MetaKey);
-}
-
</del><span class="cx"> OptionSet<PlatformEvent::Modifier> PlatformKeyboardEvent::currentStateOfModifierKeys()
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeCocoah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeCocoa.h (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeCocoa.h        2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebCore/rendering/RenderThemeCocoa.h   2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -36,6 +36,8 @@
</span><span class="cx"> 
</span><span class="cx"> class RenderThemeCocoa : public RenderTheme {
</span><span class="cx"> private:
</span><ins>+    bool shouldHaveCapsLockIndicator(const HTMLInputElement&) const final;
+
</ins><span class="cx"> #if ENABLE(APPLE_PAY)
</span><span class="cx">     void adjustApplePayButtonStyle(StyleResolver&, RenderStyle&, const Element*) const override;
</span><span class="cx">     bool paintApplePayButton(const RenderObject&, const PaintInfo&, const IntRect&) override;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeCocoa.mm (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeCocoa.mm       2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebCore/rendering/RenderThemeCocoa.mm  2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #import "RenderThemeCocoa.h"
</span><span class="cx"> 
</span><span class="cx"> #import "GraphicsContextCG.h"
</span><ins>+#import "HTMLInputElement.h"
</ins><span class="cx"> #import "RenderText.h"
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(APPLE_PAY)
</span><span class="lines">@@ -51,6 +52,11 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+bool RenderThemeCocoa::shouldHaveCapsLockIndicator(const HTMLInputElement& element) const
+{
+    return element.isPasswordField();
+}
+
</ins><span class="cx"> #if ENABLE(APPLE_PAY)
</span><span class="cx"> 
</span><span class="cx"> static const auto applePayButtonMinimumWidth = 140;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.h (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeIOS.h  2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.h     2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -117,7 +117,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     bool shouldHaveSpinButton(const HTMLInputElement&) const override;
</span><del>-    bool shouldHaveCapsLockIndicator(const HTMLInputElement&) const override;
</del><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx">     String mediaControlsStyleSheet() override;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.mm (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeIOS.mm 2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.mm    2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -1135,11 +1135,6 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RenderThemeIOS::shouldHaveCapsLockIndicator(const HTMLInputElement&) const
-{
-    return false;
-}
-
</del><span class="cx"> FontCascadeDescription& RenderThemeIOS::cachedSystemFontDescription(CSSValueID valueID) const
</span><span class="cx"> {
</span><span class="cx">     static NeverDestroyed<FontCascadeDescription> systemFont;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeMac.h (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeMac.h  2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.h     2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -164,8 +164,6 @@
</span><span class="cx">     bool supportsClosedCaptioning() const final { return true; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    bool shouldHaveCapsLockIndicator(const HTMLInputElement&) const final;
-
</del><span class="cx">     bool paintSnapshottedPluginOverlay(const RenderObject&, const PaintInfo&, const IntRect&) final;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(ATTACHMENT_ELEMENT)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeMac.mm 2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm    2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -2342,11 +2342,6 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RenderThemeMac::shouldHaveCapsLockIndicator(const HTMLInputElement& element) const
-{
-    return element.isPasswordField();
-}
-
</del><span class="cx"> NSPopUpButtonCell* RenderThemeMac::popupButton() const
</span><span class="cx"> {
</span><span class="cx">     if (!m_popupButton) {
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebKit/ChangeLog       2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2018-11-09  Daniel Bates  <dabates@apple.com>
+
+        [iOS] Draw caps lock indicator in password fields
+        https://bugs.webkit.org/show_bug.cgi?id=190565
+        <rdar://problem/45262343>
+
+        Reviewed by Dean Jackson.
+
+        Notify the WebContent process with the current modifer state on window activation changes. Notify
+        the WebContent process when hardware keyboard availability changes (e.g. a keyboard is attached).
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _initializeWithConfiguration:]): Register for hardware keyboard availability changed notifications.
+        (-[WKWebView dealloc]): Unregister from hardware availability changed notifications.
+        (hardwareKeyboardAvailabilityChangedCallback): Added.
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::updateCurrentModifierState): Compile this code when building for iOS.
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _handleKeyUIEvent:]): Update the current modifier state if this event is a hardware
+        keyboard flags changed event.
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged): Added.
+
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::hardwareKeyboardAvailabilityChanged):
+        Added new message HardwareKeyboardAvailabilityChanged. Notify the focused HTML input element (if we have
+        one) that the caps lock state may have changed when we receive message HardwareKeyboardAvailabilityChanged
+        so that we toggle visibility of the caps lock indicator.
+
</ins><span class="cx"> 2018-11-09  Tim Horton  <timothy_horton@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Make use of _UIRemoteView instead of CALayerHost if possible for WKRemoteView
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm     2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm        2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -153,6 +153,7 @@
</span><span class="cx"> #import <WebCore/WebSQLiteDatabaseTrackerClient.h>
</span><span class="cx"> #import <pal/spi/cg/CoreGraphicsSPI.h>
</span><span class="cx"> #import <pal/spi/cocoa/QuartzCoreSPI.h>
</span><ins>+#import <pal/spi/ios/GraphicsServicesSPI.h>
</ins><span class="cx"> #import <wtf/cocoa/Entitlements.h>
</span><span class="cx"> 
</span><span class="cx"> #define RELEASE_LOG_IF_ALLOWED(...) RELEASE_LOG_IF(_page && _page->isAlwaysOnLoggingAllowed(), ViewState, __VA_ARGS__)
</span><span class="lines">@@ -705,6 +706,8 @@
</span><span class="cx"> 
</span><span class="cx">     [[_configuration _contentProviderRegistry] addPage:*_page];
</span><span class="cx">     _page->setForceAlwaysUserScalable([_configuration ignoresViewportScaleLimits]);
</span><ins>+
+    CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), (__bridge const void *)(self), hardwareKeyboardAvailabilityChangedCallback, (CFStringRef)[NSString stringWithUTF8String:kGSEventHardwareKeyboardAvailabilityChangedNotification], nullptr, CFNotificationSuspensionBehaviorCoalesce);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="lines">@@ -842,6 +845,8 @@
</span><span class="cx">     [[_configuration _contentProviderRegistry] removePage:*_page];
</span><span class="cx">     [[NSNotificationCenter defaultCenter] removeObserver:self];
</span><span class="cx">     [_scrollView setInternalDelegate:nil];
</span><ins>+
+    CFNotificationCenterRemoveObserver(CFNotificationCenterGetDarwinNotifyCenter(), (__bridge const void *)(self), (CFStringRef)[NSString stringWithUTF8String:kGSEventHardwareKeyboardAvailabilityChangedNotification], nullptr);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(ACCESSIBILITY_EVENTS)
</span><span class="lines">@@ -3102,6 +3107,13 @@
</span><span class="cx">     [self _keyboardChangedWithInfo:notification.userInfo adjustScrollView:YES];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static void hardwareKeyboardAvailabilityChangedCallback(CFNotificationCenterRef, void* observer, CFStringRef, const void*, CFDictionaryRef)
+{
+    ASSERT(observer);
+    WKWebView *webView = (__bridge WKWebView *)observer;
+    webView._page->hardwareKeyboardAvailabilityChanged();
+}
+
</ins><span class="cx"> - (void)_windowDidRotate:(NSNotification *)notification
</span><span class="cx"> {
</span><span class="cx">     if (!_overridesInterfaceOrientation)
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp   2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp      2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -8132,7 +8132,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WebPageProxy::updateCurrentModifierState()
</span><span class="cx"> {
</span><del>-#if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
</del><ins>+#if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) || PLATFORM(IOS_FAMILY)
</ins><span class="cx">     auto modifiers = PlatformKeyboardEvent::currentStateOfModifierKeys();
</span><span class="cx">     m_process->send(Messages::WebPage::UpdateCurrentModifierState(modifiers), m_pageID);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebPageProxy.h     2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h        2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -645,6 +645,7 @@
</span><span class="cx">     void storeSelectionForAccessibility(bool);
</span><span class="cx">     void startAutoscrollAtPosition(const WebCore::FloatPoint& positionInWindow);
</span><span class="cx">     void cancelAutoscroll();
</span><ins>+    void hardwareKeyboardAvailabilityChanged();
</ins><span class="cx"> #if ENABLE(DATA_INTERACTION)
</span><span class="cx">     void didHandleStartDataInteractionRequest(bool started);
</span><span class="cx">     void didHandleAdditionalDragItemsRequest(bool added);
</span><span class="lines">@@ -1365,6 +1366,8 @@
</span><span class="cx">     void didCloseSuggestions();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    void updateCurrentModifierState();
+
</ins><span class="cx"> private:
</span><span class="cx">     WebPageProxy(PageClient&, WebProcessProxy&, uint64_t pageID, Ref<API::PageConfiguration>&&);
</span><span class="cx">     void platformInitialize();
</span><span class="lines">@@ -1847,8 +1850,6 @@
</span><span class="cx">     void stopDisplayLink(unsigned observerID);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    void updateCurrentModifierState();
-
</del><span class="cx">     void reportPageLoadResult(const WebCore::ResourceError& = { });
</span><span class="cx"> 
</span><span class="cx">     void continueNavigationInNewProcess(API::Navigation&, Ref<WebProcessProxy>&&);
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessiosWKContentViewInteractionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm    2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm       2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -3756,9 +3756,13 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_handleKeyUIEvent:(::UIEvent *)event
</span><span class="cx"> {
</span><ins>+    bool isHardwareKeyboardEvent = !!event._hidEvent;
+    if (isHardwareKeyboardEvent && ((UIPhysicalKeyboardEvent *)event)._inputFlags & kUIKeyboardInputModifierFlagsChanged)
+        _page->updateCurrentModifierState();
+
</ins><span class="cx">     // We only want to handle key event from the hardware keyboard when we are
</span><span class="cx">     // first responder and we are not interacting with editable content.
</span><del>-    if ([self isFirstResponder] && event._hidEvent && !_page->editorState().isContentEditable) {
</del><ins>+    if ([self isFirstResponder] && isHardwareKeyboardEvent && !_page->editorState().isContentEditable) {
</ins><span class="cx">         [self handleKeyEvent:event];
</span><span class="cx">         return;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessiosWebPageProxyIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm     2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm        2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -1089,6 +1089,12 @@
</span><span class="cx">         m_validationBubble->show();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPageProxy::hardwareKeyboardAvailabilityChanged()
+{
+    updateCurrentModifierState();
+    m_process->send(Messages::WebPage::HardwareKeyboardAvailabilityChanged(), m_pageID);
+}
+
</ins><span class="cx"> #if ENABLE(DATA_INTERACTION)
</span><span class="cx"> 
</span><span class="cx"> void WebPageProxy::didHandleStartDataInteractionRequest(bool started)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h    2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -913,6 +913,8 @@
</span><span class="cx"> 
</span><span class="cx">     bool platformPrefersTextLegibilityBasedZoomScaling() const;
</span><span class="cx">     const WebCore::ViewportConfiguration& viewportConfiguration() const { return m_viewportConfiguration; }
</span><ins>+
+    void hardwareKeyboardAvailabilityChanged();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(IOS_TOUCH_EVENTS)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebPagemessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in       2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in  2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -106,6 +106,7 @@
</span><span class="cx">     StartAutoscrollAtPosition(WebCore::FloatPoint positionInWindow)
</span><span class="cx">     CancelAutoscroll()
</span><span class="cx">     RequestAssistedNodeInformation(WebKit::CallbackID callbackID)
</span><ins>+    HardwareKeyboardAvailabilityChanged()
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     SetControlledByAutomation(bool controlled)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm 2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm    2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -3087,6 +3087,12 @@
</span><span class="cx">     return String();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPage::hardwareKeyboardAvailabilityChanged()
+{
+    if (auto* focusedFrame = m_page->focusController().focusedFrame())
+        focusedFrame->eventHandler().capsLockStateMayHaveChanged();
+}
+
</ins><span class="cx"> #if USE(QUICK_LOOK)
</span><span class="cx"> void WebPage::didReceivePasswordForQuickLookDocument(const String& password)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKitLegacymacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/mac/ChangeLog  2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog     2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -1,5 +1,20 @@
</span><span class="cx"> 2018-11-09  Daniel Bates  <dabates@apple.com>
</span><span class="cx"> 
</span><ins>+        [iOS] Draw caps lock indicator in password fields
+        https://bugs.webkit.org/show_bug.cgi?id=190565
+        <rdar://problem/45262343>
+
+        Reviewed by Dean Jackson.
+
+        Update the caps lock state when a hardware keyboard is attached or detached.
+
+        * WebView/WebHTMLView.mm:
+        (hardwareKeyboardAvailabilityChangedCallback): Added.
+        (-[WebHTMLView initWithFrame:]): Register for hardware keyboard availability changed notifications.
+        (-[WebHTMLView dealloc]): Unregister from hardware keyboard availability changed notifications.
+
+2018-11-09  Daniel Bates  <dabates@apple.com>
+
</ins><span class="cx">         [iOS] Pressing forward delete key in text field does nothing and we should not invoke an editor
</span><span class="cx">         action when forward delete is pressed outside a text field
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=190566
</span></span></pre></div>
<a id="trunkSourceWebKitLegacymacWebViewWebHTMLViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm     2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm        2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -164,7 +164,9 @@
</span><span class="cx"> #import <WebCore/WAKScrollView.h>
</span><span class="cx"> #import <WebCore/WAKWindow.h>
</span><span class="cx"> #import <WebCore/WKGraphics.h>
</span><ins>+#import <WebCore/WebCoreThreadRun.h>
</ins><span class="cx"> #import <WebCore/WebEvent.h>
</span><ins>+#import <pal/spi/ios/GraphicsServicesSPI.h>
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="lines">@@ -814,6 +816,16 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS_FAMILY)
</span><span class="cx"> static NSString * const WebMarkedTextUpdatedNotification = @"WebMarkedTextUpdated";
</span><ins>+
+static void hardwareKeyboardAvailabilityChangedCallback(CFNotificationCenterRef, void* observer, CFStringRef, const void*, CFDictionaryRef)
+{
+    ASSERT(observer);
+    WebThreadRun(^{
+        WebHTMLView *webView = (__bridge WebHTMLView *)observer;
+        if (Frame* coreFrame = core([webView _frame]))
+            coreFrame->eventHandler().capsLockStateMayHaveChanged();
+    });
+}
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> @interface WebHTMLView (WebHTMLViewFileInternal)
</span><span class="lines">@@ -2610,6 +2622,7 @@
</span><span class="cx">     [[NSNotificationCenter defaultCenter] 
</span><span class="cx">             addObserver:self selector:@selector(markedTextUpdate:) 
</span><span class="cx">                    name:WebMarkedTextUpdatedNotification object:nil];
</span><ins>+    CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), (__bridge const void *)(self), hardwareKeyboardAvailabilityChangedCallback, (CFStringRef)[NSString stringWithUTF8String:kGSEventHardwareKeyboardAvailabilityChangedNotification], nullptr, CFNotificationSuspensionBehaviorCoalesce);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="lines">@@ -2626,6 +2639,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS_FAMILY)
</span><span class="cx">     [[NSNotificationCenter defaultCenter] removeObserver:self name:WebMarkedTextUpdatedNotification object:nil];
</span><ins>+    CFNotificationCenterRemoveObserver(CFNotificationCenterGetDarwinNotifyCenter(), (__bridge const void *)(self), (CFStringRef)[NSString stringWithUTF8String:kGSEventHardwareKeyboardAvailabilityChangedNotification], nullptr);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     // We can't assert that close has already been called because
</span></span></pre></div>
<a id="trunkWebKitLibrariesChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKitLibraries/ChangeLog (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitLibraries/ChangeLog  2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/WebKitLibraries/ChangeLog     2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2018-11-09  Daniel Bates  <dabates@apple.com>
+
+        [iOS] Draw caps lock indicator in password fields
+        https://bugs.webkit.org/show_bug.cgi?id=190565
+        <rdar://problem/45262343>
+
+        Reviewed by Dean Jackson.
+
+        Expose some more symbols.
+
+        * WebKitPrivateFrameworkStubs/iOS/12/GraphicsServices.framework/GraphicsServices.tbd:
+
</ins><span class="cx"> 2018-06-27  Jonathan Bedard  <jbedard@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Enable WebKit iOS 12 build
</span></span></pre></div>
<a id="trunkWebKitLibrariesWebKitPrivateFrameworkStubsiOS12GraphicsServicesframeworkGraphicsServicestbd"></a>
<div class="modfile"><h4>Modified: trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/12/GraphicsServices.framework/GraphicsServices.tbd (238046 => 238047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/12/GraphicsServices.framework/GraphicsServices.tbd 2018-11-09 19:04:01 UTC (rev 238046)
+++ trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/12/GraphicsServices.framework/GraphicsServices.tbd    2018-11-09 19:10:27 UTC (rev 238047)
</span><span class="lines">@@ -15,10 +15,13 @@
</span><span class="cx">       - x86_64
</span><span class="cx">     symbols:
</span><span class="cx">       - _GSCurrentEventTimestamp
</span><ins>+      - _GSEventIsHardwareKeyboardAttached
</ins><span class="cx">       - _GSFontInitialize
</span><span class="cx">       - _GSFontPurgeFontCache
</span><span class="cx">       - _GSInitialize
</span><ins>+      - _GSKeyboardGetModifierState
</ins><span class="cx">       - _GSSystemRootDirectory
</span><ins>+      - _kGSEventHardwareKeyboardAvailabilityChangedNotification
</ins><span class="cx"> install-name: /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
</span><span class="cx"> objc-constraint: none
</span><span class="cx"> platform: ios
</span></span></pre>
</div>
</div>

</body>
</html>