Changeset 261157 in webkit
- Timestamp:
- May 5, 2020, 2:03:21 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r261155 r261157 1 2020-05-05 Tim Horton <timothy_horton@apple.com> 2 3 Excessive error logging from daemons trying to use WebKit, under -[UIDevice currentDevice] 4 https://bugs.webkit.org/show_bug.cgi?id=211397 5 <rdar://problem/61635403> 6 7 Reviewed by Simon Fraser. 8 9 * Shared/UserInterfaceIdiom.mm: 10 (WebKit::userInterfaceIdiomIsPad): 11 Adjust userInterfaceIdiomIsPad so that in daemons, it consults only MobileGestalt, 12 which returns the actual hardware model, and does not try to use UIDevice. 13 UIDevice is more accurate for applications because it will report that 14 the device is an iPhone when called inside an iPhone app running on iPad, 15 but it cannot be used in daemons that do not have a UIApplication. 16 17 For the behaviors we gate on this bit, it makes sense to use iPhone 18 behaviors on iPad in the iPhone app jail, so we continue using 19 UIDevice if possible. 20 21 * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: 22 (-[WKWebViewConfiguration init]): 23 Make use of the new mechanism instead of going straight to MobileGestalt, 24 for the aforementioned reasons. 25 1 26 2020-05-04 Tim Horton <timothy_horton@apple.com> 2 27 -
trunk/Source/WebKit/Shared/UserInterfaceIdiom.mm
r261135 r261157 29 29 #if PLATFORM(IOS_FAMILY) 30 30 31 #if USE(APPLE_INTERNAL_SDK) 32 #import <UIKit/UIDevice_Private.h> 33 #else 34 #import <UIKit/UIDevice.h> 35 #endif 31 #import "UIKitSPI.h" 32 #import <WebCore/Device.h> 36 33 37 34 namespace WebKit { … … 45 42 static UserInterfaceIdiomState userInterfaceIdiomIsPadState = UserInterfaceIdiomState::Unknown; 46 43 47 #if PLATFORM(IOS_FAMILY)48 44 static inline bool userInterfaceIdiomIsPad() 49 45 { 46 // If we are in a daemon, we cannot use UIDevice. Fall back to checking the hardware itself. 47 // Since daemons don't ever run in an iPhone-app-on-iPad jail, this will be accurate in the daemon case, 48 // but is not sufficient in the application case. 49 if (![UIApplication sharedApplication]) 50 return WebCore::deviceClass() == MGDeviceClassiPad; 51 50 52 // This inline function exists to thwart unreachable code 51 53 // detection on platforms where UICurrentUserInterfaceIdiomIsPad … … 57 59 #endif 58 60 } 59 #endif60 61 61 62 bool currentUserInterfaceIdiomIsPad() -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm
r261135 r261157 28 28 29 29 #import "APIPageConfiguration.h" 30 #import "UserInterfaceIdiom.h" 30 31 #import "VersionChecks.h" 31 32 #import "WKPreferences.h" … … 193 194 _allowsPictureInPictureMediaPlayback = YES; 194 195 #endif 195 _allowsInlineMediaPlayback = Web Core::deviceClass() == MGDeviceClassiPad;196 _allowsInlineMediaPlayback = WebKit::currentUserInterfaceIdiomIsPad(); 196 197 _inlineMediaPlaybackRequiresPlaysInlineAttribute = !_allowsInlineMediaPlayback; 197 198 _allowsInlineMediaPlaybackAfterFullscreen = !_allowsInlineMediaPlayback; -
trunk/Tools/ChangeLog
r261153 r261157 1 2020-05-05 Tim Horton <timothy_horton@apple.com> 2 3 Excessive error logging from daemons trying to use WebKit, under -[UIDevice currentDevice] 4 https://bugs.webkit.org/show_bug.cgi?id=211397 5 <rdar://problem/61635403> 6 7 Reviewed by Simon Fraser. 8 9 * TestWebKitAPI/ios/UserInterfaceSwizzler.h: 10 We need a UIApplication or WebKit won't look at UIDevice. 11 1 12 2020-05-04 Darin Adler <darin@apple.com> 2 13 -
trunk/Tools/TestWebKitAPI/ios/UserInterfaceSwizzler.h
r260449 r261157 29 29 30 30 #import "InstanceMethodSwizzler.h" 31 #import "UIKitSPI.h" 31 32 #import <UIKit/UIKit.h> 32 33 … … 39 40 : InstanceMethodSwizzler { UIDevice.class, @selector(userInterfaceIdiom), reinterpret_cast<IMP>(effectiveUserInterfaceIdiom) } 40 41 { 42 if (!UIApplication.sharedApplication) { 43 UIApplicationInitialize(); 44 UIApplicationInstantiateSingleton(UIApplication.class); 45 } 41 46 } 42 47
Note:
See TracChangeset
for help on using the changeset viewer.