Changeset 239262 in webkit
- Timestamp:
- Dec 16, 2018 4:44:23 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 6 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r239261 r239262 1 2018-12-16 Chris Fleizach <cfleizach@apple.com> 2 3 AX: Support keyboard access preference for iOS in WebKit 4 https://bugs.webkit.org/show_bug.cgi?id=192373 5 <rdar://problem/46462670> 6 7 Reviewed by Tim Horton. 8 9 * Platform/spi/ios/AccessibilitySupportSPI.h: 10 * PlatformMac.cmake: 11 * SourcesCocoa.txt: 12 * UIProcess/Cocoa/WKFullKeyboardAccessWatcher.h: Added. 13 * UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm: Added. 14 (platformIsFullKeyboardAccessEnabled): 15 (-[WKFullKeyboardAccessWatcher notifyAllProcessPools]): 16 (-[WKFullKeyboardAccessWatcher retrieveKeyboardUIModeFromPreferences:]): 17 (-[WKFullKeyboardAccessWatcher init]): 18 (+[WKFullKeyboardAccessWatcher fullKeyboardAccessEnabled]): 19 * UIProcess/ios/WebProcessProxyIOS.mm: 20 (WebKit::WebProcessProxy::fullKeyboardAccessEnabled): 21 * UIProcess/mac/WKFullKeyboardAccessWatcher.h: Removed. 22 * UIProcess/mac/WKFullKeyboardAccessWatcher.mm: Removed. 23 * WebKit.xcodeproj/project.pbxproj: 24 1 25 2018-12-16 Adrian Perez de Castro <aperez@igalia.com> 2 26 -
trunk/Source/WebKit/Platform/spi/ios/AccessibilitySupportSPI.h
r238834 r239262 39 39 extern CFStringRef kAXSWebAccessibilityEventsEnabledNotification; 40 40 extern Boolean _AXSWebAccessibilityEventsEnabled(); 41 extern CFStringRef kAXSFullKeyboardAccessEnabledNotification; 42 extern Boolean _AXSFullKeyboardAccessEnabled(); 41 43 42 44 WTF_EXTERN_C_END -
trunk/Source/WebKit/PlatformMac.cmake
r238350 r239262 257 257 UIProcess/Cocoa/VersionChecks.mm 258 258 UIProcess/Cocoa/ViewGestureController.cpp 259 UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm 259 260 UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm 260 261 UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm … … 297 298 UIProcess/mac/ViewGestureControllerMac.mm 298 299 UIProcess/mac/ViewSnapshotStore.mm 299 UIProcess/mac/WKFullKeyboardAccessWatcher.mm300 300 UIProcess/mac/WKFullScreenWindowController.mm 301 301 UIProcess/mac/WKImmediateActionController.mm -
trunk/Source/WebKit/SourcesCocoa.txt
r238739 r239262 339 339 UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm 340 340 UIProcess/Cocoa/WebViewImpl.mm 341 UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm 341 342 UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm 342 343 UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm … … 426 427 UIProcess/mac/WebProcessProxyMac.mm 427 428 UIProcess/mac/WindowServerConnection.mm 428 UIProcess/mac/WKFullKeyboardAccessWatcher.mm429 429 UIProcess/mac/WKFullScreenWindowController.mm 430 430 UIProcess/mac/WKImmediateActionController.mm -
trunk/Source/WebKit/UIProcess/Cocoa/WKFullKeyboardAccessWatcher.h
r239261 r239262 24 24 */ 25 25 26 #ifndef WKFullKeyboardAccessWatcher_h 27 #define WKFullKeyboardAccessWatcher_h 26 #pragma once 28 27 29 #if PLATFORM( MAC)28 #if PLATFORM(COCOA) 30 29 31 30 @interface WKFullKeyboardAccessWatcher : NSObject { … … 38 37 @end; 39 38 40 #endif // PLATFORM(MAC) 41 42 #endif // WKFullKeyboardAccessWatcher_h 39 #endif // PLATFORM(COCOA) -
trunk/Source/WebKit/UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm
r239261 r239262 1 1 /* 2 * Copyright (C) 2011 Apple Inc. All rights reserved.2 * Copyright (C) 2011, 2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 27 27 #import "WKFullKeyboardAccessWatcher.h" 28 28 29 #if PLATFORM( MAC)29 #if PLATFORM(COCOA) 30 30 31 #import "AccessibilitySupportSPI.h" 31 32 #import "WebProcessPool.h" 32 33 33 NSString * const KeyboardUIModeDidChangeNotification = @"com.apple.KeyboardUIModeDidChange"; 34 const CFStringRef AppleKeyboardUIMode = CFSTR("AppleKeyboardUIMode"); 34 #if PLATFORM(MAC) 35 static NSString * const KeyboardUIModeDidChangeNotification = @"com.apple.KeyboardUIModeDidChange"; 36 static const CFStringRef AppleKeyboardUIMode = CFSTR("AppleKeyboardUIMode"); 37 #endif 35 38 36 39 @implementation WKFullKeyboardAccessWatcher 40 41 static inline BOOL platformIsFullKeyboardAccessEnabled() 42 { 43 BOOL fullKeyboardAccessEnabled = NO; 44 #if PLATFORM(MAC) 45 CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication); 46 47 Boolean keyExistsAndHasValidFormat; 48 int mode = CFPreferencesGetAppIntegerValue(AppleKeyboardUIMode, kCFPreferencesCurrentApplication, &keyExistsAndHasValidFormat); 49 if (keyExistsAndHasValidFormat) { 50 // The keyboard access mode has two bits: 51 // Bit 0 is set if user can set the focus to menus, the dock, and various windows using the keyboard. 52 // Bit 1 is set if controls other than text fields are included in the tab order (WebKit also always includes lists). 53 fullKeyboardAccessEnabled = (mode & 0x2); 54 } 55 #elif PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000 56 fullKeyboardAccessEnabled = _AXSFullKeyboardAccessEnabled(); 57 #endif 58 59 return fullKeyboardAccessEnabled; 60 } 37 61 38 62 - (void)notifyAllProcessPools … … 46 70 BOOL oldValue = fullKeyboardAccessEnabled; 47 71 48 CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication); 49 50 Boolean keyExistsAndHasValidFormat; 51 int mode = CFPreferencesGetAppIntegerValue(AppleKeyboardUIMode, kCFPreferencesCurrentApplication, &keyExistsAndHasValidFormat); 52 if (keyExistsAndHasValidFormat) { 53 // The keyboard access mode has two bits: 54 // Bit 0 is set if user can set the focus to menus, the dock, and various windows using the keyboard. 55 // Bit 1 is set if controls other than text fields are included in the tab order (WebKit also always includes lists). 56 fullKeyboardAccessEnabled = (mode & 0x2); 57 } 58 72 fullKeyboardAccessEnabled = platformIsFullKeyboardAccessEnabled(); 73 59 74 if (fullKeyboardAccessEnabled != oldValue) 60 75 [self notifyAllProcessPools]; … … 69 84 [self retrieveKeyboardUIModeFromPreferences:nil]; 70 85 71 [[NSDistributedNotificationCenter defaultCenter] 72 addObserver:self selector:@selector(retrieveKeyboardUIModeFromPreferences:) 73 name:KeyboardUIModeDidChangeNotification object:nil]; 86 NSNotificationCenter *notificationCenter = nil; 87 NSString *notitificationName = nil; 88 89 #if PLATFORM(MAC) 90 notificationCenter = [NSDistributedNotificationCenter defaultCenter]; 91 notitificationName = KeyboardUIModeDidChangeNotification; 92 #elif PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000 93 notificationCenter = [NSNotificationCenter defaultCenter]; 94 notitificationName = (NSString *)kAXSFullKeyboardAccessEnabledNotification; 95 #endif 96 97 if (notitificationName) 98 [notificationCenter addObserver:self selector:@selector(retrieveKeyboardUIModeFromPreferences:) name:notitificationName object:nil]; 74 99 75 100 return self; … … 84 109 @end 85 110 86 #endif // PLATFORM( MAC)111 #endif // PLATFORM(COCOA) -
trunk/Source/WebKit/UIProcess/ios/WebProcessProxyIOS.mm
r237266 r239262 29 29 #if PLATFORM(IOS_FAMILY) 30 30 31 #import <WebCore/NotImplemented.h> 32 31 #import "WKFullKeyboardAccessWatcher.h" 33 32 #import "WebProcessMessages.h" 34 33 … … 37 36 bool WebProcessProxy::fullKeyboardAccessEnabled() 38 37 { 39 notImplemented(); 40 return false; 38 return [WKFullKeyboardAccessWatcher fullKeyboardAccessEnabled]; 41 39 } 42 40 -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r239219 r239262 5333 5333 2DFC7DB91BCCC19500C1548C /* WebViewImpl.h */, 5334 5334 2DFC7DBA1BCCC19500C1548C /* WebViewImpl.mm */, 5335 E1AEA22D14687BDB00804569 /* WKFullKeyboardAccessWatcher.h */, 5336 E1AEA22E14687BDB00804569 /* WKFullKeyboardAccessWatcher.mm */, 5335 5337 1AD01BCB1905D54900C9C45F /* WKReloadFrameErrorRecoveryAttempter.h */, 5336 5338 1AD01BCA1905D54900C9C45F /* WKReloadFrameErrorRecoveryAttempter.mm */, … … 8164 8166 868160CD18763D4B0021E79D /* WindowServerConnection.h */, 8165 8167 868160CF187645370021E79D /* WindowServerConnection.mm */, 8166 E1AEA22D14687BDB00804569 /* WKFullKeyboardAccessWatcher.h */,8167 E1AEA22E14687BDB00804569 /* WKFullKeyboardAccessWatcher.mm */,8168 8168 CDCA85C7132ABA4E00E961DF /* WKFullScreenWindowController.h */, 8169 8169 CDCA85C6132ABA4E00E961DF /* WKFullScreenWindowController.mm */,
Note: See TracChangeset
for help on using the changeset viewer.