Changeset 238047 in webkit
- Timestamp:
- Nov 9, 2018 11:10:27 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r238046 r238047 1 2018-11-09 Daniel Bates <dabates@apple.com> 2 3 [iOS] Draw caps lock indicator in password fields 4 https://bugs.webkit.org/show_bug.cgi?id=190565 5 <rdar://problem/45262343> 6 7 Reviewed by Dean Jackson. 8 9 Draw the caps lock indicator in a focused password field on iOS. This makes the behavior of password 10 fields on iOS more closely match the behavior of password fields on Mac. For now, we only draw the 11 indicator when caps locks is enabled via the hardware keyboard. We will look to support the software 12 keyboard in a subsequent commit (see <https://bugs.webkit.org/show_bug.cgi?id=191475>). 13 14 The majority of this patch is implementing PlatformKeyboardEvent::currentCapsLockState() for iOS. 15 In Legacy WebKit, the implementation boils down to calling call -[::WebEvent modifierFlags]. In 16 Modern WebKit the UIProcess is responsible for -[::WebEvent modifierFlags] and passing it the 17 WebProcess to store such that invocations of PlatformKeyboardEvent::currentCapsLockState() consult 18 the store in the WebProcess. A smaller part of this patch is having both the legacy and modern 19 web views listen for keyboard availability changes so as to update the the caps lock state when 20 a hardware keyboard is detached or attached. 21 22 * WebCore.xcodeproj/project.pbxproj: 23 * page/EventHandler.cpp: 24 (WebCore::EventHandler::capsLockStateMayHaveChanged const): Extracted from EventHandler::internalKeyEvent() 25 so that it can shared between WebCore, Modern WebKit, and Legacy WebKit code. 26 (WebCore::EventHandler::internalKeyEvent): Modified to call capsLockStateMayHaveChanged(). 27 * page/EventHandler.h: 28 * platform/cocoa/KeyEventCocoa.mm: 29 (WebCore::PlatformKeyboardEvent::currentCapsLockState): Moved from KeyEventMac.mm. 30 (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Moved from KeyEventMac.mm. 31 * platform/ios/KeyEventIOS.mm: 32 (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys): Fetch the current modifier state. 33 (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; we now use the Cocoa implementation. 34 (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; we now use the Cocoa implementation. 35 * platform/ios/WebEvent.h: 36 * platform/ios/WebEvent.mm: 37 (+[WebEvent modifierFlags]): Added. 38 * platform/mac/KeyEventMac.mm: 39 (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; moved to KeyEventCocoa.mm to be shared 40 by both Mac and iOS. 41 (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; moved to KeyEventCocoa.mm to be shared 42 by both Mac and iOS. 43 * rendering/RenderThemeCocoa.h: 44 * rendering/RenderThemeCocoa.mm: 45 (WebCore::RenderThemeCocoa::shouldHaveCapsLockIndicator const): Moved from RenderThemeMac.mm. 46 * rendering/RenderThemeIOS.h: 47 * rendering/RenderThemeIOS.mm: 48 (WebCore::RenderThemeIOS::shouldHaveCapsLockIndicator const): Deleted. 49 * rendering/RenderThemeMac.h: 50 * rendering/RenderThemeMac.mm: 51 (WebCore::RenderThemeMac::shouldHaveCapsLockIndicator const): Deleted; moved to RenderThemeCocoa.mm to be 52 shared by both Mac and iOS. 53 1 54 2018-11-09 Chris Dumez <cdumez@apple.com> 2 55 -
trunk/Source/WebCore/PAL/ChangeLog
r238014 r238047 1 2018-11-09 Daniel Bates <dabates@apple.com> 2 3 [iOS] Draw caps lock indicator in password fields 4 https://bugs.webkit.org/show_bug.cgi?id=190565 5 <rdar://problem/45262343> 6 7 Reviewed by Dean Jackson. 8 9 Forward declare some more SPI. 10 11 * pal/spi/ios/GraphicsServicesSPI.h: 12 * pal/spi/ios/UIKitSPI.h: 13 1 14 2018-11-08 Megan Gardner <megan_gardner@apple.com> 2 15 -
trunk/Source/WebCore/PAL/pal/spi/ios/GraphicsServicesSPI.h
r237266 r238047 1 1 /* 2 * Copyright (C) 2014 Apple Inc. All rights reserved.2 * Copyright (C) 2014-2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 44 44 void GSFontPurgeFontCache(void); 45 45 46 typedef struct __GSKeyboard* GSKeyboardRef; 47 uint32_t GSKeyboardGetModifierState(GSKeyboardRef); 48 Boolean GSEventIsHardwareKeyboardAttached(); 49 50 extern const char *kGSEventHardwareKeyboardAvailabilityChangedNotification; 51 46 52 WTF_EXTERN_C_END 47 53 -
trunk/Source/WebCore/PAL/pal/spi/ios/UIKitSPI.h
r237739 r238047 24 24 */ 25 25 26 WTF_EXTERN_C_BEGIN 27 typedef struct __GSKeyboard* GSKeyboardRef; 28 WTF_EXTERN_C_END 29 26 30 #if USE(APPLE_INTERNAL_SDK) 27 31 … … 45 49 @interface UIApplication () 46 50 + (UIApplicationSceneClassicMode)_classicMode; 51 - (GSKeyboardRef)_hardwareKeyboard; 47 52 @end 48 53 … … 76 81 77 82 @interface UIApplication () 78 79 83 - (BOOL)_isClassic; 80 84 + (UIApplicationSceneClassicMode)_classicMode; 81 85 - (GSKeyboardRef)_hardwareKeyboard; 82 86 @end 83 87 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r238014 r238047 13688 13688 CE5CB1B314EDAB6F00BB2795 /* EventSender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventSender.h; sourceTree = "<group>"; }; 13689 13689 CE5FA253209E48C50051D700 /* ContentSecurityPolicyClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ContentSecurityPolicyClient.h; path = csp/ContentSecurityPolicyClient.h; sourceTree = "<group>"; }; 13690 CE68C8FF21924EE5001230B3 /* PlatformKeyboardEvent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformKeyboardEvent.cpp; sourceTree = "<group>"; }; 13690 13691 CE6D89294C7AACE0AD89B3DD /* MathMLMencloseElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLMencloseElement.h; sourceTree = "<group>"; }; 13691 13692 CE6DADF71C591E6A003F6A88 /* ContentSecurityPolicyResponseHeaders.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ContentSecurityPolicyResponseHeaders.cpp; path = csp/ContentSecurityPolicyResponseHeaders.cpp; sourceTree = "<group>"; }; … … 25090 25091 BC5C76291497FE1400BC4775 /* PlatformEvent.h */, 25091 25092 A723F77A1484CA4C008C6DBE /* PlatformExportMacros.h */, 25093 CE68C8FF21924EE5001230B3 /* PlatformKeyboardEvent.cpp */, 25092 25094 935C476609AC4D4300A6AAB4 /* PlatformKeyboardEvent.h */, 25093 25095 935C476709AC4D4300A6AAB4 /* PlatformMouseEvent.h */, -
trunk/Source/WebCore/page/EventHandler.cpp
r237944 r238047 3163 3163 } 3164 3164 3165 void EventHandler::capsLockStateMayHaveChanged() const 3166 { 3167 auto* focusedElement = m_frame.document()->focusedElement(); 3168 if (!is<HTMLInputElement>(focusedElement)) 3169 return; 3170 downcast<HTMLInputElement>(*focusedElement).capsLockStateMayHaveChanged(); 3171 } 3172 3165 3173 bool EventHandler::internalKeyEvent(const PlatformKeyboardEvent& initialKeyEvent) 3166 3174 { … … 3195 3203 #endif 3196 3204 3197 if (initialKeyEvent.windowsVirtualKeyCode() == VK_CAPITAL) { 3198 if (auto* element = m_frame.document()->focusedElement()) { 3199 if (is<HTMLInputElement>(*element)) 3200 downcast<HTMLInputElement>(*element).capsLockStateMayHaveChanged(); 3201 } 3202 } 3205 if (initialKeyEvent.windowsVirtualKeyCode() == VK_CAPITAL) 3206 capsLockStateMayHaveChanged(); 3203 3207 3204 3208 #if ENABLE(PAN_SCROLLING) -
trunk/Source/WebCore/page/EventHandler.h
r237266 r238047 257 257 WEBCORE_EXPORT bool keyEvent(const PlatformKeyboardEvent&); 258 258 void defaultKeyboardEventHandler(KeyboardEvent&); 259 WEBCORE_EXPORT void capsLockStateMayHaveChanged() const; 259 260 260 261 bool accessibilityPreventsEventPropagation(KeyboardEvent&); -
trunk/Source/WebCore/platform/cocoa/KeyEventCocoa.mm
r237266 r238047 28 28 29 29 #import "Logging.h" 30 #import "PlatformKeyboardEvent.h" 30 31 #import "WindowsKeyboardCodes.h" 31 32 #import <wtf/ASCIICType.h> … … 39 40 40 41 namespace WebCore { 42 43 bool PlatformKeyboardEvent::currentCapsLockState() 44 { 45 return currentStateOfModifierKeys().contains(PlatformEvent::Modifier::CapsLockKey); 46 } 47 48 void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey) 49 { 50 auto currentModifiers = currentStateOfModifierKeys(); 51 shiftKey = currentModifiers.contains(PlatformEvent::Modifier::ShiftKey); 52 ctrlKey = currentModifiers.contains(PlatformEvent::Modifier::CtrlKey); 53 altKey = currentModifiers.contains(PlatformEvent::Modifier::AltKey); 54 metaKey = currentModifiers.contains(PlatformEvent::Modifier::MetaKey); 55 } 41 56 42 57 // https://w3c.github.io/uievents-key/ -
trunk/Source/WebCore/platform/ios/KeyEventIOS.mm
r237266 r238047 32 32 #import "KeyEventCodesIOS.h" 33 33 #import "NotImplemented.h" 34 #import "WebEvent.h" 34 35 #import "WindowsKeyboardCodes.h" 35 36 #import <pal/spi/cocoa/IOKitSPI.h> 37 #import <wtf/MainThread.h> 36 38 37 39 using namespace WTF; … … 313 315 } 314 316 315 bool PlatformKeyboardEvent::currentCapsLockState() 316 { 317 notImplemented(); 318 return false; 319 } 320 321 void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey) 322 { 323 notImplemented(); 324 shiftKey = false; 325 ctrlKey = false; 326 altKey = false; 327 metaKey = false; 317 OptionSet<PlatformEvent::Modifier> PlatformKeyboardEvent::currentStateOfModifierKeys() 318 { 319 // s_currentModifiers is only set in the WebContent process, not in the UI process. 320 if (s_currentModifiers) { 321 ASSERT(isMainThread()); 322 return *s_currentModifiers; 323 } 324 325 ::WebEventFlags currentModifiers = [::WebEvent modifierFlags]; 326 327 OptionSet<PlatformEvent::Modifier> modifiers; 328 if (currentModifiers & ::WebEventFlagMaskShiftKey) 329 modifiers.add(PlatformEvent::Modifier::ShiftKey); 330 if (currentModifiers & ::WebEventFlagMaskControlKey) 331 modifiers.add(PlatformEvent::Modifier::CtrlKey); 332 if (currentModifiers & ::WebEventFlagMaskOptionKey) 333 modifiers.add(PlatformEvent::Modifier::AltKey); 334 if (currentModifiers & ::WebEventFlagMaskCommandKey) 335 modifiers.add(PlatformEvent::Modifier::MetaKey); 336 if (currentModifiers & ::WebEventFlagMaskLeftCapsLockKey) 337 modifiers.add(PlatformEvent::Modifier::CapsLockKey); 338 339 return modifiers; 328 340 } 329 341 -
trunk/Source/WebCore/platform/ios/WebEvent.h
r237738 r238047 217 217 @property(nonatomic) BOOL wasHandled; 218 218 219 @property (class, readonly) WebEventFlags modifierFlags; 220 219 221 @end 220 222 -
trunk/Source/WebCore/platform/ios/WebEvent.mm
r237739 r238047 37 37 #import "WAKAppKitStubs.h" 38 38 #import <pal/spi/cocoa/IOKitSPI.h> 39 #import <pal/spi/ios/GraphicsServicesSPI.h> 40 #import <pal/spi/ios/UIKitSPI.h> 41 #import <wtf/SoftLinking.h> 42 43 SOFT_LINK_FRAMEWORK(UIKit) 44 SOFT_LINK_CLASS(UIKit, UIApplication); 45 46 #define UIApplication getUIApplicationClass() 39 47 40 48 using WebCore::windowsKeyCodeForKeyCode; … … 492 500 } 493 501 502 + (WebEventFlags)modifierFlags 503 { 504 return GSEventIsHardwareKeyboardAttached() ? GSKeyboardGetModifierState([UIApplication sharedApplication]._hardwareKeyboard) : 0; 505 } 506 494 507 @end 495 508 -
trunk/Source/WebCore/platform/mac/KeyEventMac.mm
r237886 r238047 259 259 } 260 260 261 bool PlatformKeyboardEvent::currentCapsLockState()262 {263 auto currentModifiers = currentStateOfModifierKeys();264 return currentModifiers.contains(PlatformEvent::Modifier::CapsLockKey);265 }266 267 void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey)268 {269 auto currentModifiers = currentStateOfModifierKeys();270 shiftKey = currentModifiers.contains(PlatformEvent::Modifier::ShiftKey);271 ctrlKey = currentModifiers.contains(PlatformEvent::Modifier::CtrlKey);272 altKey = currentModifiers.contains(PlatformEvent::Modifier::AltKey);273 metaKey = currentModifiers.contains(PlatformEvent::Modifier::MetaKey);274 }275 276 261 OptionSet<PlatformEvent::Modifier> PlatformKeyboardEvent::currentStateOfModifierKeys() 277 262 { -
trunk/Source/WebCore/rendering/RenderThemeCocoa.h
r237765 r238047 37 37 class RenderThemeCocoa : public RenderTheme { 38 38 private: 39 bool shouldHaveCapsLockIndicator(const HTMLInputElement&) const final; 40 39 41 #if ENABLE(APPLE_PAY) 40 42 void adjustApplePayButtonStyle(StyleResolver&, RenderStyle&, const Element*) const override; -
trunk/Source/WebCore/rendering/RenderThemeCocoa.mm
r237765 r238047 28 28 29 29 #import "GraphicsContextCG.h" 30 #import "HTMLInputElement.h" 30 31 #import "RenderText.h" 31 32 … … 51 52 52 53 namespace WebCore { 54 55 bool RenderThemeCocoa::shouldHaveCapsLockIndicator(const HTMLInputElement& element) const 56 { 57 return element.isPasswordField(); 58 } 53 59 54 60 #if ENABLE(APPLE_PAY) -
trunk/Source/WebCore/rendering/RenderThemeIOS.h
r237842 r238047 118 118 119 119 bool shouldHaveSpinButton(const HTMLInputElement&) const override; 120 bool shouldHaveCapsLockIndicator(const HTMLInputElement&) const override;121 120 122 121 #if ENABLE(VIDEO) -
trunk/Source/WebCore/rendering/RenderThemeIOS.mm
r237842 r238047 1136 1136 } 1137 1137 1138 bool RenderThemeIOS::shouldHaveCapsLockIndicator(const HTMLInputElement&) const1139 {1140 return false;1141 }1142 1143 1138 FontCascadeDescription& RenderThemeIOS::cachedSystemFontDescription(CSSValueID valueID) const 1144 1139 { -
trunk/Source/WebCore/rendering/RenderThemeMac.h
r238001 r238047 165 165 #endif 166 166 167 bool shouldHaveCapsLockIndicator(const HTMLInputElement&) const final;168 169 167 bool paintSnapshottedPluginOverlay(const RenderObject&, const PaintInfo&, const IntRect&) final; 170 168 -
trunk/Source/WebCore/rendering/RenderThemeMac.mm
r238001 r238047 2343 2343 } 2344 2344 2345 bool RenderThemeMac::shouldHaveCapsLockIndicator(const HTMLInputElement& element) const2346 {2347 return element.isPasswordField();2348 }2349 2350 2345 NSPopUpButtonCell* RenderThemeMac::popupButton() const 2351 2346 { -
trunk/Source/WebKit/ChangeLog
r238045 r238047 1 2018-11-09 Daniel Bates <dabates@apple.com> 2 3 [iOS] Draw caps lock indicator in password fields 4 https://bugs.webkit.org/show_bug.cgi?id=190565 5 <rdar://problem/45262343> 6 7 Reviewed by Dean Jackson. 8 9 Notify the WebContent process with the current modifer state on window activation changes. Notify 10 the WebContent process when hardware keyboard availability changes (e.g. a keyboard is attached). 11 12 * UIProcess/API/Cocoa/WKWebView.mm: 13 (-[WKWebView _initializeWithConfiguration:]): Register for hardware keyboard availability changed notifications. 14 (-[WKWebView dealloc]): Unregister from hardware availability changed notifications. 15 (hardwareKeyboardAvailabilityChangedCallback): Added. 16 * UIProcess/WebPageProxy.cpp: 17 (WebKit::WebPageProxy::updateCurrentModifierState): Compile this code when building for iOS. 18 * UIProcess/WebPageProxy.h: 19 * UIProcess/ios/WKContentViewInteraction.mm: 20 (-[WKContentView _handleKeyUIEvent:]): Update the current modifier state if this event is a hardware 21 keyboard flags changed event. 22 * UIProcess/ios/WebPageProxyIOS.mm: 23 (WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged): Added. 24 25 * WebProcess/WebPage/WebPage.h: 26 * WebProcess/WebPage/WebPage.messages.in: 27 * WebProcess/WebPage/ios/WebPageIOS.mm: 28 (WebKit::WebPage::hardwareKeyboardAvailabilityChanged): 29 Added new message HardwareKeyboardAvailabilityChanged. Notify the focused HTML input element (if we have 30 one) that the caps lock state may have changed when we receive message HardwareKeyboardAvailabilityChanged 31 so that we toggle visibility of the caps lock indicator. 32 1 33 2018-11-09 Tim Horton <timothy_horton@apple.com> 2 34 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r238015 r238047 154 154 #import <pal/spi/cg/CoreGraphicsSPI.h> 155 155 #import <pal/spi/cocoa/QuartzCoreSPI.h> 156 #import <pal/spi/ios/GraphicsServicesSPI.h> 156 157 #import <wtf/cocoa/Entitlements.h> 157 158 … … 706 707 [[_configuration _contentProviderRegistry] addPage:*_page]; 707 708 _page->setForceAlwaysUserScalable([_configuration ignoresViewportScaleLimits]); 709 710 CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), (__bridge const void *)(self), hardwareKeyboardAvailabilityChangedCallback, (CFStringRef)[NSString stringWithUTF8String:kGSEventHardwareKeyboardAvailabilityChangedNotification], nullptr, CFNotificationSuspensionBehaviorCoalesce); 708 711 #endif 709 712 … … 843 846 [[NSNotificationCenter defaultCenter] removeObserver:self]; 844 847 [_scrollView setInternalDelegate:nil]; 848 849 CFNotificationCenterRemoveObserver(CFNotificationCenterGetDarwinNotifyCenter(), (__bridge const void *)(self), (CFStringRef)[NSString stringWithUTF8String:kGSEventHardwareKeyboardAvailabilityChangedNotification], nullptr); 845 850 #endif 846 851 … … 3101 3106 3102 3107 [self _keyboardChangedWithInfo:notification.userInfo adjustScrollView:YES]; 3108 } 3109 3110 static void hardwareKeyboardAvailabilityChangedCallback(CFNotificationCenterRef, void* observer, CFStringRef, const void*, CFDictionaryRef) 3111 { 3112 ASSERT(observer); 3113 WKWebView *webView = (__bridge WKWebView *)observer; 3114 webView._page->hardwareKeyboardAvailabilityChanged(); 3103 3115 } 3104 3116 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r238015 r238047 8133 8133 void WebPageProxy::updateCurrentModifierState() 8134 8134 { 8135 #if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) 8135 #if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) || PLATFORM(IOS_FAMILY) 8136 8136 auto modifiers = PlatformKeyboardEvent::currentStateOfModifierKeys(); 8137 8137 m_process->send(Messages::WebPage::UpdateCurrentModifierState(modifiers), m_pageID); -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r238015 r238047 646 646 void startAutoscrollAtPosition(const WebCore::FloatPoint& positionInWindow); 647 647 void cancelAutoscroll(); 648 void hardwareKeyboardAvailabilityChanged(); 648 649 #if ENABLE(DATA_INTERACTION) 649 650 void didHandleStartDataInteractionRequest(bool started); … … 1365 1366 void didCloseSuggestions(); 1366 1367 #endif 1368 1369 void updateCurrentModifierState(); 1367 1370 1368 1371 private: … … 1848 1851 #endif 1849 1852 1850 void updateCurrentModifierState();1851 1852 1853 void reportPageLoadResult(const WebCore::ResourceError& = { }); 1853 1854 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r238033 r238047 3757 3757 - (void)_handleKeyUIEvent:(::UIEvent *)event 3758 3758 { 3759 bool isHardwareKeyboardEvent = !!event._hidEvent; 3760 if (isHardwareKeyboardEvent && ((UIPhysicalKeyboardEvent *)event)._inputFlags & kUIKeyboardInputModifierFlagsChanged) 3761 _page->updateCurrentModifierState(); 3762 3759 3763 // We only want to handle key event from the hardware keyboard when we are 3760 3764 // first responder and we are not interacting with editable content. 3761 if ([self isFirstResponder] && event._hidEvent && !_page->editorState().isContentEditable) {3765 if ([self isFirstResponder] && isHardwareKeyboardEvent && !_page->editorState().isContentEditable) { 3762 3766 [self handleKeyEvent:event]; 3763 3767 return; -
trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
r237266 r238047 1090 1090 } 1091 1091 1092 void WebPageProxy::hardwareKeyboardAvailabilityChanged() 1093 { 1094 updateCurrentModifierState(); 1095 m_process->send(Messages::WebPage::HardwareKeyboardAvailabilityChanged(), m_pageID); 1096 } 1097 1092 1098 #if ENABLE(DATA_INTERACTION) 1093 1099 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r237886 r238047 914 914 bool platformPrefersTextLegibilityBasedZoomScaling() const; 915 915 const WebCore::ViewportConfiguration& viewportConfiguration() const { return m_viewportConfiguration; } 916 917 void hardwareKeyboardAvailabilityChanged(); 916 918 #endif 917 919 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in
r237886 r238047 107 107 CancelAutoscroll() 108 108 RequestAssistedNodeInformation(WebKit::CallbackID callbackID) 109 HardwareKeyboardAvailabilityChanged() 109 110 #endif 110 111 -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r237935 r238047 3088 3088 } 3089 3089 3090 void WebPage::hardwareKeyboardAvailabilityChanged() 3091 { 3092 if (auto* focusedFrame = m_page->focusController().focusedFrame()) 3093 focusedFrame->eventHandler().capsLockStateMayHaveChanged(); 3094 } 3095 3090 3096 #if USE(QUICK_LOOK) 3091 3097 void WebPage::didReceivePasswordForQuickLookDocument(const String& password) -
trunk/Source/WebKitLegacy/mac/ChangeLog
r238033 r238047 1 2018-11-09 Daniel Bates <dabates@apple.com> 2 3 [iOS] Draw caps lock indicator in password fields 4 https://bugs.webkit.org/show_bug.cgi?id=190565 5 <rdar://problem/45262343> 6 7 Reviewed by Dean Jackson. 8 9 Update the caps lock state when a hardware keyboard is attached or detached. 10 11 * WebView/WebHTMLView.mm: 12 (hardwareKeyboardAvailabilityChangedCallback): Added. 13 (-[WebHTMLView initWithFrame:]): Register for hardware keyboard availability changed notifications. 14 (-[WebHTMLView dealloc]): Unregister from hardware keyboard availability changed notifications. 15 1 16 2018-11-09 Daniel Bates <dabates@apple.com> 2 17 -
trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm
r238033 r238047 165 165 #import <WebCore/WAKWindow.h> 166 166 #import <WebCore/WKGraphics.h> 167 #import <WebCore/WebCoreThreadRun.h> 167 168 #import <WebCore/WebEvent.h> 169 #import <pal/spi/ios/GraphicsServicesSPI.h> 168 170 #endif 169 171 … … 815 817 #if PLATFORM(IOS_FAMILY) 816 818 static NSString * const WebMarkedTextUpdatedNotification = @"WebMarkedTextUpdated"; 819 820 static void hardwareKeyboardAvailabilityChangedCallback(CFNotificationCenterRef, void* observer, CFStringRef, const void*, CFDictionaryRef) 821 { 822 ASSERT(observer); 823 WebThreadRun(^{ 824 WebHTMLView *webView = (__bridge WebHTMLView *)observer; 825 if (Frame* coreFrame = core([webView _frame])) 826 coreFrame->eventHandler().capsLockStateMayHaveChanged(); 827 }); 828 } 817 829 #endif 818 830 … … 2611 2623 addObserver:self selector:@selector(markedTextUpdate:) 2612 2624 name:WebMarkedTextUpdatedNotification object:nil]; 2625 CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), (__bridge const void *)(self), hardwareKeyboardAvailabilityChangedCallback, (CFStringRef)[NSString stringWithUTF8String:kGSEventHardwareKeyboardAvailabilityChangedNotification], nullptr, CFNotificationSuspensionBehaviorCoalesce); 2613 2626 #endif 2614 2627 … … 2627 2640 #if PLATFORM(IOS_FAMILY) 2628 2641 [[NSNotificationCenter defaultCenter] removeObserver:self name:WebMarkedTextUpdatedNotification object:nil]; 2642 CFNotificationCenterRemoveObserver(CFNotificationCenterGetDarwinNotifyCenter(), (__bridge const void *)(self), (CFStringRef)[NSString stringWithUTF8String:kGSEventHardwareKeyboardAvailabilityChangedNotification], nullptr); 2629 2643 #endif 2630 2644 -
trunk/WebKitLibraries/ChangeLog
r233266 r238047 1 2018-11-09 Daniel Bates <dabates@apple.com> 2 3 [iOS] Draw caps lock indicator in password fields 4 https://bugs.webkit.org/show_bug.cgi?id=190565 5 <rdar://problem/45262343> 6 7 Reviewed by Dean Jackson. 8 9 Expose some more symbols. 10 11 * WebKitPrivateFrameworkStubs/iOS/12/GraphicsServices.framework/GraphicsServices.tbd: 12 1 13 2018-06-27 Jonathan Bedard <jbedard@apple.com> 2 14 -
trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/12/GraphicsServices.framework/GraphicsServices.tbd
r233266 r238047 16 16 symbols: 17 17 - _GSCurrentEventTimestamp 18 - _GSEventIsHardwareKeyboardAttached 18 19 - _GSFontInitialize 19 20 - _GSFontPurgeFontCache 20 21 - _GSInitialize 22 - _GSKeyboardGetModifierState 21 23 - _GSSystemRootDirectory 24 - _kGSEventHardwareKeyboardAvailabilityChangedNotification 22 25 install-name: /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices 23 26 objc-constraint: none
Note: See TracChangeset
for help on using the changeset viewer.