Log Message
Consistently use Obj-C boolean literals https://bugs.webkit.org/show_bug.cgi?id=200405 <rdar://problem/53880043>
Reviewed by Simon Fraser, Joseph Pecoraro. There are places where we use equivalent but different expressions for Obj-C boolean objects. For example, we use both [NSNumber numberWithBool:YES] and @YES. There are places where both are used in the same function, such as -[WebPreferences initialize]. The boolean literal is in greater use and is more succinct, so standardize on that. Also, change @(YES/NO) to @YES/NO. Examples: * NetscapeCoreAnimationMoviePlugin/main.m: (NPP_GetValue): Source/WebCore: No new tests -- no new or changed functionality. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): * platform/graphics/cv/ImageTransferSessionVT.mm: (WebCore::ImageTransferSessionVT::ImageTransferSessionVT): (WebCore::ImageTransferSessionVT::setSize): (WebCore::ImageTransferSessionVT::ioSurfacePixelBufferCreationOptions): * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferPool): * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm: (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): * platform/network/mac/ResourceHandleMac.mm: (WebCore::ResourceHandle::applySniffingPoliciesIfNeeded): Source/WebKit: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm: (WebKit::LocalConnection::getAttestation const): Source/WebKitLegacy/mac: * History/WebHistoryItem.mm: * WebView/WebFrame.mm: (-[WebFrame _cacheabilityDictionary]): * WebView/WebPreferences.mm: (+[WebPreferences initialize]): Tools: * DumpRenderTree/mac/ObjCController.m: (-[ObjCController objectOfClass:]): * TestWebKitAPI/Tests/WebKitCocoa/BundleEditingDelegate.mm: (TEST): * TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm: (overrideAddObserverForName): * TestWebKitAPI/ios/mainIOS.mm: (main): * TestWebKitAPI/mac/InjectedBundleControllerMac.mm: (TestWebKitAPI::InjectedBundleController::platformInitialize): * TestWebKitAPI/mac/mainMac.mm: (main): * WebKitLauncher/WebKitNightlyEnabler.m: (enableWebKitNightlyBehaviour):
Modified Paths
- trunk/Examples/ChangeLog
- trunk/Examples/NetscapeCoreAnimationMoviePlugin/main.m
- trunk/Source/WebCore/ChangeLog
- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm
- trunk/Source/WebCore/platform/graphics/cv/ImageTransferSessionVT.mm
- trunk/Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm
- trunk/Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm
- trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm
- trunk/Source/WebKit/ChangeLog
- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm
- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
- trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalConnection.mm
- trunk/Source/WebKitLegacy/mac/ChangeLog
- trunk/Source/WebKitLegacy/mac/History/WebHistoryItem.mm
- trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm
- trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm
- trunk/Tools/ChangeLog
- trunk/Tools/DumpRenderTree/mac/ObjCController.m
- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/BundleEditingDelegate.mm
- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm
- trunk/Tools/TestWebKitAPI/ios/mainIOS.mm
- trunk/Tools/TestWebKitAPI/mac/InjectedBundleControllerMac.mm
- trunk/Tools/TestWebKitAPI/mac/mainMac.mm
- trunk/Tools/WebKitLauncher/WebKitNightlyEnabler.m
Diff
Modified: trunk/Examples/ChangeLog (248189 => 248190)
--- trunk/Examples/ChangeLog 2019-08-02 23:20:31 UTC (rev 248189)
+++ trunk/Examples/ChangeLog 2019-08-02 23:44:46 UTC (rev 248190)
@@ -1,3 +1,21 @@
+2019-08-02 Keith Rollin <[email protected]>
+
+ Consistently use Obj-C boolean literals
+ https://bugs.webkit.org/show_bug.cgi?id=200405
+ <rdar://problem/53880043>
+
+ Reviewed by Simon Fraser, Joseph Pecoraro.
+
+ There are places where we use equivalent but different expressions for
+ Obj-C boolean objects. For example, we use both [NSNumber
+ numberWithBool:YES] and @YES. There are places where both are used in
+ the same function, such as -[WebPreferences initialize]. The boolean
+ literal is in greater use and is more succinct, so standardize on
+ that. Also, change @(YES/NO) to @YES/NO.
+
+ * NetscapeCoreAnimationMoviePlugin/main.m:
+ (NPP_GetValue):
+
2014-12-03 Ada Chan <[email protected]>
Add a sample plugin to demonstrate the mute plugin API.
Modified: trunk/Examples/NetscapeCoreAnimationMoviePlugin/main.m (248189 => 248190)
--- trunk/Examples/NetscapeCoreAnimationMoviePlugin/main.m 2019-08-02 23:20:31 UTC (rev 248189)
+++ trunk/Examples/NetscapeCoreAnimationMoviePlugin/main.m 2019-08-02 23:44:46 UTC (rev 248190)
@@ -364,8 +364,8 @@
if (obj->movieURL) {
NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:obj->movieURL, QTMovieURLAttribute,
- [NSNumber numberWithBool:YES], QTMovieOpenForPlaybackAttribute,
- [NSNumber numberWithBool:YES], QTMovieLoopsAttribute,
+ @YES, QTMovieOpenForPlaybackAttribute,
+ @YES, QTMovieLoopsAttribute,
nil];
obj->movie = [QTMovie movieWithAttributes:attributes error:nil];
Modified: trunk/Source/WebCore/ChangeLog (248189 => 248190)
--- trunk/Source/WebCore/ChangeLog 2019-08-02 23:20:31 UTC (rev 248189)
+++ trunk/Source/WebCore/ChangeLog 2019-08-02 23:44:46 UTC (rev 248190)
@@ -1,3 +1,33 @@
+2019-08-02 Keith Rollin <[email protected]>
+
+ Consistently use Obj-C boolean literals
+ https://bugs.webkit.org/show_bug.cgi?id=200405
+ <rdar://problem/53880043>
+
+ Reviewed by Simon Fraser, Joseph Pecoraro.
+
+ There are places where we use equivalent but different expressions for
+ Obj-C boolean objects. For example, we use both [NSNumber
+ numberWithBool:YES] and @YES. There are places where both are used in
+ the same function, such as -[WebPreferences initialize]. The boolean
+ literal is in greater use and is more succinct, so standardize on
+ that. Also, change @(YES/NO) to @YES/NO.
+
+ No new tests -- no new or changed functionality.
+
+ * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
+ (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
+ * platform/graphics/cv/ImageTransferSessionVT.mm:
+ (WebCore::ImageTransferSessionVT::ImageTransferSessionVT):
+ (WebCore::ImageTransferSessionVT::setSize):
+ (WebCore::ImageTransferSessionVT::ioSurfacePixelBufferCreationOptions):
+ * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
+ (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferPool):
+ * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
+ (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
+ * platform/network/mac/ResourceHandleMac.mm:
+ (WebCore::ResourceHandle::applySniffingPoliciesIfNeeded):
+
2019-08-02 Andres Gonzalez <[email protected]>
Add accessibility object method to determine whether an element is inside a table cell. Needed for iOS accessibility client.
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm (248189 => 248190)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm 2019-08-02 23:20:31 UTC (rev 248189)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm 2019-08-02 23:44:46 UTC (rev 248190)
@@ -1131,7 +1131,7 @@
CMSampleBufferRef rawSampleCopy;
CMSampleBufferCreateCopy(kCFAllocatorDefault, platformSample.sample.cmSampleBuffer, &rawSampleCopy);
auto sampleCopy = adoptCF(rawSampleCopy);
- CMSetAttachment(sampleCopy.get(), kCMSampleBufferAttachmentKey_PostNotificationWhenConsumed, (__bridge CFDictionaryRef)@{ (__bridge NSString *)kCMSampleBufferAttachmentKey_PostNotificationWhenConsumed : @(YES) }, kCMAttachmentMode_ShouldNotPropagate);
+ CMSetAttachment(sampleCopy.get(), kCMSampleBufferAttachmentKey_PostNotificationWhenConsumed, (__bridge CFDictionaryRef)@{ (__bridge NSString *)kCMSampleBufferAttachmentKey_PostNotificationWhenConsumed : @YES }, kCMAttachmentMode_ShouldNotPropagate);
[m_displayLayer enqueueSampleBuffer:sampleCopy.get()];
#if PLATFORM(IOS_FAMILY)
m_mediaSource->player()->setHasAvailableVideoFrame(true);
Modified: trunk/Source/WebCore/platform/graphics/cv/ImageTransferSessionVT.mm (248189 => 248190)
--- trunk/Source/WebCore/platform/graphics/cv/ImageTransferSessionVT.mm 2019-08-02 23:20:31 UTC (rev 248189)
+++ trunk/Source/WebCore/platform/graphics/cv/ImageTransferSessionVT.mm 2019-08-02 23:44:46 UTC (rev 248190)
@@ -63,16 +63,16 @@
if (status != kCVReturnSuccess)
RELEASE_LOG(Media, "ImageTransferSessionVT::ImageTransferSessionVT: VTSessionSetProperty(kVTPixelTransferPropertyKey_ScalingMode) failed with error %d", static_cast<int>(status));
- status = VTSessionSetProperty(transferSession, kVTPixelTransferPropertyKey_EnableHighSpeedTransfer, @(YES));
+ status = VTSessionSetProperty(transferSession, kVTPixelTransferPropertyKey_EnableHighSpeedTransfer, @YES);
if (status != kCVReturnSuccess)
RELEASE_LOG(Media, "ImageTransferSessionVT::ImageTransferSessionVT: VTSessionSetProperty(kVTPixelTransferPropertyKey_EnableHighSpeedTransfer) failed with error %d", static_cast<int>(status));
- status = VTSessionSetProperty(transferSession, kVTPixelTransferPropertyKey_RealTime, @(YES));
+ status = VTSessionSetProperty(transferSession, kVTPixelTransferPropertyKey_RealTime, @YES);
if (status != kCVReturnSuccess)
RELEASE_LOG(Media, "ImageTransferSessionVT::ImageTransferSessionVT: VTSessionSetProperty(kVTPixelTransferPropertyKey_RealTime) failed with error %d", static_cast<int>(status));
#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
- status = VTSessionSetProperty(transferSession, kVTPixelTransferPropertyKey_EnableHardwareAcceleratedTransfer, @(YES));
+ status = VTSessionSetProperty(transferSession, kVTPixelTransferPropertyKey_EnableHardwareAcceleratedTransfer, @YES);
if (status != kCVReturnSuccess)
RELEASE_LOG(Media, "ImageTransferSessionVT::ImageTransferSessionVT: VTSessionSetProperty(kVTPixelTransferPropertyKey_EnableHardwareAcceleratedTransfer) failed with error %d", static_cast<int>(status));
#endif
@@ -89,7 +89,7 @@
(__bridge NSString *)kCVPixelBufferWidthKey : @(size.width()),
(__bridge NSString *)kCVPixelBufferHeightKey : @(size.height()),
(__bridge NSString *)kCVPixelBufferPixelFormatTypeKey : @(m_pixelFormat),
- (__bridge NSString *)cvPixelFormatOpenGLKey() : @(YES),
+ (__bridge NSString *)cvPixelFormatOpenGLKey() : @YES,
(__bridge NSString *)kCVPixelBufferIOSurfacePropertiesKey : @{ /*empty dictionary*/ },
};
@@ -280,7 +280,7 @@
return m_ioSurfaceBufferAttributes.get();
m_ioSurfaceBufferAttributes = (__bridge CFDictionaryRef) @{
- (__bridge NSString *)cvPixelFormatOpenGLKey() : @(YES),
+ (__bridge NSString *)cvPixelFormatOpenGLKey() : @YES,
};
#if PLATFORM(MAC)
@@ -295,7 +295,7 @@
&& (IOSurfaceGetBytesPerRowOfPlane(surface, 1) >= width + extendedRight)
&& (IOSurfaceGetAllocSize(surface) >= (height + extendedBottom) * IOSurfaceGetBytesPerRowOfPlane(surface, 0) * 3 / 2)) {
m_ioSurfaceBufferAttributes = (__bridge CFDictionaryRef) @{
- (__bridge NSString *)kCVPixelBufferOpenGLCompatibilityKey : @(YES),
+ (__bridge NSString *)kCVPixelBufferOpenGLCompatibilityKey : @YES,
(__bridge NSString *)kCVPixelBufferExtendedPixelsRightKey : @(extendedRight),
(__bridge NSString *)kCVPixelBufferExtendedPixelsBottomKey : @(extendedBottom)
};
Modified: trunk/Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm (248189 => 248190)
--- trunk/Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm 2019-08-02 23:20:31 UTC (rev 248189)
+++ trunk/Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm 2019-08-02 23:44:46 UTC (rev 248190)
@@ -100,11 +100,11 @@
(__bridge NSString *)kCVPixelBufferWidthKey: @(width),
(__bridge NSString *)kCVPixelBufferHeightKey: @(height),
(__bridge NSString *)kCVPixelBufferPixelFormatTypeKey: @(videoCaptureFormat),
- (__bridge NSString *)kCVPixelBufferCGImageCompatibilityKey: @(NO),
+ (__bridge NSString *)kCVPixelBufferCGImageCompatibilityKey: @NO,
#if PLATFORM(IOS_FAMILY)
- (__bridge NSString *)kCVPixelFormatOpenGLESCompatibility : @(YES),
+ (__bridge NSString *)kCVPixelFormatOpenGLESCompatibility : @YES,
#else
- (__bridge NSString *)kCVPixelBufferOpenGLCompatibilityKey : @(YES),
+ (__bridge NSString *)kCVPixelBufferOpenGLCompatibilityKey : @YES,
#endif
(__bridge NSString *)kCVPixelBufferIOSurfacePropertiesKey : @{ }
};
Modified: trunk/Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm (248189 => 248190)
--- trunk/Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm 2019-08-02 23:20:31 UTC (rev 248189)
+++ trunk/Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm 2019-08-02 23:44:46 UTC (rev 248190)
@@ -149,7 +149,7 @@
(__bridge NSString *)kCGDisplayStreamMinimumFrameTime : @(1 / frameRate()),
(__bridge NSString *)kCGDisplayStreamQueueDepth : @(screenQueueMaximumLength),
(__bridge NSString *)kCGDisplayStreamColorSpace : (__bridge id)sRGBColorSpaceRef(),
- (__bridge NSString *)kCGDisplayStreamShowCursor : @(YES),
+ (__bridge NSString *)kCGDisplayStreamShowCursor : @YES,
};
auto weakThis = makeWeakPtr(*this);
Modified: trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm (248189 => 248190)
--- trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm 2019-08-02 23:20:31 UTC (rev 248189)
+++ trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm 2019-08-02 23:44:46 UTC (rev 248190)
@@ -124,11 +124,11 @@
#if USE(CFNETWORK_CONTENT_ENCODING_SNIFFING_OVERRIDE)
if (!shouldContentEncodingSniff)
- [mutableRequest _setProperty:@(YES) forKey:(__bridge NSString *)kCFURLRequestContentDecoderSkipURLCheck];
+ [mutableRequest _setProperty:@YES forKey:(__bridge NSString *)kCFURLRequestContentDecoderSkipURLCheck];
#endif
if (!shouldContentSniff)
- [mutableRequest _setProperty:@(NO) forKey:(__bridge NSString *)_kCFURLConnectionPropertyShouldSniff];
+ [mutableRequest _setProperty:@NO forKey:(__bridge NSString *)_kCFURLConnectionPropertyShouldSniff];
return mutableRequest.autorelease();
}
Modified: trunk/Source/WebKit/ChangeLog (248189 => 248190)
--- trunk/Source/WebKit/ChangeLog 2019-08-02 23:20:31 UTC (rev 248189)
+++ trunk/Source/WebKit/ChangeLog 2019-08-02 23:44:46 UTC (rev 248190)
@@ -1,3 +1,25 @@
+2019-08-02 Keith Rollin <[email protected]>
+
+ Consistently use Obj-C boolean literals
+ https://bugs.webkit.org/show_bug.cgi?id=200405
+ <rdar://problem/53880043>
+
+ Reviewed by Simon Fraser, Joseph Pecoraro.
+
+ There are places where we use equivalent but different expressions for
+ Obj-C boolean objects. For example, we use both [NSNumber
+ numberWithBool:YES] and @YES. There are places where both are used in
+ the same function, such as -[WebPreferences initialize]. The boolean
+ literal is in greater use and is more succinct, so standardize on
+ that. Also, change @(YES/NO) to @YES/NO.
+
+ * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
+ (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
+ * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+ (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
+ * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
+ (WebKit::LocalConnection::getAttestation const):
+
2019-08-02 Sihui Liu <[email protected]>
API tests using permanent credentials should clear credentials left by previous tests
Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm (248189 => 248190)
--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm 2019-08-02 23:20:31 UTC (rev 248189)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm 2019-08-02 23:44:46 UTC (rev 248190)
@@ -98,11 +98,11 @@
#if USE(CFNETWORK_CONTENT_ENCODING_SNIFFING_OVERRIDE)
if (!shouldContentEncodingSniff)
- [mutableRequest _setProperty:@(YES) forKey:(NSString *)kCFURLRequestContentDecoderSkipURLCheck];
+ [mutableRequest _setProperty:@YES forKey:(NSString *)kCFURLRequestContentDecoderSkipURLCheck];
#endif
if (!shouldContentSniff)
- [mutableRequest _setProperty:@(NO) forKey:(NSString *)_kCFURLConnectionPropertyShouldSniff];
+ [mutableRequest _setProperty:@NO forKey:(NSString *)_kCFURLConnectionPropertyShouldSniff];
if (!cocoaSession.m_boundInterfaceIdentifier.isNull())
[mutableRequest setBoundInterfaceIdentifier:cocoaSession.m_boundInterfaceIdentifier];
Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (248189 => 248190)
--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm 2019-08-02 23:20:31 UTC (rev 248189)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm 2019-08-02 23:44:46 UTC (rev 248190)
@@ -988,7 +988,7 @@
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000)
// FIXME: Replace @"kCFStreamPropertyAutoErrorOnSystemChange" with a constant from the SDK once rdar://problem/40650244 is in a build.
if (networkProcess.suppressesConnectionTerminationOnSystemChange())
- configuration._socketStreamProperties = @{ @"kCFStreamPropertyAutoErrorOnSystemChange" : @(NO) };
+ configuration._socketStreamProperties = @{ @"kCFStreamPropertyAutoErrorOnSystemChange" : @NO };
#endif
#if PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 60000
Modified: trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalConnection.mm (248189 => 248190)
--- trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalConnection.mm 2019-08-02 23:20:31 UTC (rev 248189)
+++ trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalConnection.mm 2019-08-02 23:44:46 UTC (rev 248190)
@@ -103,10 +103,10 @@
kMAOptionsBAAKeychainLabel: label,
// FIXME(rdar://problem/38489134): Need a formal name.
kMAOptionsBAAKeychainAccessGroup: @"com.apple.safari.WebAuthN.credentials",
- kMAOptionsBAAIgnoreExistingKeychainItems: @(YES),
+ kMAOptionsBAAIgnoreExistingKeychainItems: @YES,
// FIXME(rdar://problem/38489134): Determine a proper lifespan.
kMAOptionsBAAValidity: @(1440), // Last one day.
- kMAOptionsBAASCRTAttestation: @(NO),
+ kMAOptionsBAASCRTAttestation: @NO,
kMAOptionsBAANonce: [NSData dataWithBytes:hash.data() length:hash.size()],
kMAOptionsBAAAccessControls: (id)accessControlRef.get(),
kMAOptionsBAAOIDSToInclude: @[kMAOptionsBAAOIDNonce]
Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (248189 => 248190)
--- trunk/Source/WebKitLegacy/mac/ChangeLog 2019-08-02 23:20:31 UTC (rev 248189)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog 2019-08-02 23:44:46 UTC (rev 248190)
@@ -1,3 +1,24 @@
+2019-08-02 Keith Rollin <[email protected]>
+
+ Consistently use Obj-C boolean literals
+ https://bugs.webkit.org/show_bug.cgi?id=200405
+ <rdar://problem/53880043>
+
+ Reviewed by Simon Fraser, Joseph Pecoraro.
+
+ There are places where we use equivalent but different expressions for
+ Obj-C boolean objects. For example, we use both [NSNumber
+ numberWithBool:YES] and @YES. There are places where both are used in
+ the same function, such as -[WebPreferences initialize]. The boolean
+ literal is in greater use and is more succinct, so standardize on
+ that. Also, change @(YES/NO) to @YES/NO.
+
+ * History/WebHistoryItem.mm:
+ * WebView/WebFrame.mm:
+ (-[WebFrame _cacheabilityDictionary]):
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]):
+
2019-08-01 Alex Christensen <[email protected]>
Move FormData zip file generation to NetworkProcess and enable it for all WebKit clients for uploading directories
Modified: trunk/Source/WebKitLegacy/mac/History/WebHistoryItem.mm (248189 => 248190)
--- trunk/Source/WebKitLegacy/mac/History/WebHistoryItem.mm 2019-08-02 23:20:31 UTC (rev 248189)
+++ trunk/Source/WebKitLegacy/mac/History/WebHistoryItem.mm 2019-08-02 23:44:46 UTC (rev 248190)
@@ -436,7 +436,7 @@
forKey:lastVisitedTimeIntervalKey];
}
if (coreItem->lastVisitWasFailure())
- [dict setObject:[NSNumber numberWithBool:YES] forKey:lastVisitWasFailureKey];
+ [dict setObject:@YES forKey:lastVisitWasFailureKey];
if (Vector<String>* redirectURLs = _private->_redirectURLs.get()) {
size_t size = redirectURLs->size();
ASSERT(size);
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm (248189 => 248190)
--- trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm 2019-08-02 23:20:31 UTC (rev 248189)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm 2019-08-02 23:44:46 UTC (rev 248190)
@@ -2051,20 +2051,20 @@
[result setObject:(NSError *)documentLoader->mainDocumentError() forKey:WebFrameMainDocumentError];
if (frameLoader.subframeLoader().containsPlugins())
- [result setObject:[NSNumber numberWithBool:YES] forKey:WebFrameHasPlugins];
+ [result setObject:@YES forKey:WebFrameHasPlugins];
if (DOMWindow* domWindow = _private->coreFrame->document()->domWindow()) {
if (domWindow->hasEventListeners(eventNames().unloadEvent))
- [result setObject:[NSNumber numberWithBool:YES] forKey:WebFrameHasUnloadListener];
+ [result setObject:@YES forKey:WebFrameHasUnloadListener];
if (domWindow->optionalApplicationCache())
- [result setObject:[NSNumber numberWithBool:YES] forKey:WebFrameUsesApplicationCache];
+ [result setObject:@YES forKey:WebFrameUsesApplicationCache];
}
if (Document* document = _private->coreFrame->document()) {
if (DatabaseManager::singleton().hasOpenDatabases(*document))
- [result setObject:[NSNumber numberWithBool:YES] forKey:WebFrameUsesDatabases];
+ [result setObject:@YES forKey:WebFrameUsesDatabases];
if (!document->canSuspendActiveDOMObjectsForDocumentSuspension())
- [result setObject:[NSNumber numberWithBool:YES] forKey:WebFrameCanSuspendActiveDOMObjects];
+ [result setObject:@YES forKey:WebFrameCanSuspendActiveDOMObjects];
}
return result;
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm (248189 => 248190)
--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm 2019-08-02 23:20:31 UTC (rev 248189)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm 2019-08-02 23:44:46 UTC (rev 248190)
@@ -398,93 +398,93 @@
#endif
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
- @"Times", WebKitStandardFontPreferenceKey,
- @"Courier", WebKitFixedFontPreferenceKey,
- @"Times", WebKitSerifFontPreferenceKey,
- @"Helvetica", WebKitSansSerifFontPreferenceKey,
+ @"Times", WebKitStandardFontPreferenceKey,
+ @"Courier", WebKitFixedFontPreferenceKey,
+ @"Times", WebKitSerifFontPreferenceKey,
+ @"Helvetica", WebKitSansSerifFontPreferenceKey,
#if !PLATFORM(IOS_FAMILY)
- @"Apple Chancery", WebKitCursiveFontPreferenceKey,
+ @"Apple Chancery", WebKitCursiveFontPreferenceKey,
#else
- @"Snell Roundhand", WebKitCursiveFontPreferenceKey,
+ @"Snell Roundhand", WebKitCursiveFontPreferenceKey,
#endif
- @"Papyrus", WebKitFantasyFontPreferenceKey,
+ @"Papyrus", WebKitFantasyFontPreferenceKey,
#if PLATFORM(IOS_FAMILY)
- @"AppleColorEmoji", WebKitPictographFontPreferenceKey,
+ @"AppleColorEmoji", WebKitPictographFontPreferenceKey,
#else
- @"Apple Color Emoji", WebKitPictographFontPreferenceKey,
+ @"Apple Color Emoji", WebKitPictographFontPreferenceKey,
#endif
- @"0", WebKitMinimumFontSizePreferenceKey,
- @"9", WebKitMinimumLogicalFontSizePreferenceKey,
- @"16", WebKitDefaultFontSizePreferenceKey,
- @"13", WebKitDefaultFixedFontSizePreferenceKey,
- @"ISO-8859-1", WebKitDefaultTextEncodingNamePreferenceKey,
- [NSNumber numberWithBool:NO], WebKitUsesEncodingDetectorPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitUserStyleSheetEnabledPreferenceKey,
- @"", WebKitUserStyleSheetLocationPreferenceKey,
+ @"0", WebKitMinimumFontSizePreferenceKey,
+ @"9", WebKitMinimumLogicalFontSizePreferenceKey,
+ @"16", WebKitDefaultFontSizePreferenceKey,
+ @"13", WebKitDefaultFixedFontSizePreferenceKey,
+ @"ISO-8859-1", WebKitDefaultTextEncodingNamePreferenceKey,
+ @NO, WebKitUsesEncodingDetectorPreferenceKey,
+ @NO, WebKitUserStyleSheetEnabledPreferenceKey,
+ @"", WebKitUserStyleSheetLocationPreferenceKey,
#if !PLATFORM(IOS_FAMILY)
- [NSNumber numberWithBool:NO], WebKitShouldPrintBackgroundsPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitTextAreasAreResizablePreferenceKey,
+ @NO, WebKitShouldPrintBackgroundsPreferenceKey,
+ @NO, WebKitTextAreasAreResizablePreferenceKey,
#endif
- [NSNumber numberWithBool:NO], WebKitShrinksStandaloneImagesToFitPreferenceKey,
+ @NO, WebKitShrinksStandaloneImagesToFitPreferenceKey,
#if !PLATFORM(IOS_FAMILY)
- [NSNumber numberWithBool:YES], WebKitJavaEnabledPreferenceKey,
+ @YES, WebKitJavaEnabledPreferenceKey,
#endif
- [NSNumber numberWithBool:YES], WebKitJavaScriptEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitJavaScriptMarkupEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitWebSecurityEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitAllowUniversalAccessFromFileURLsPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitAllowFileAccessFromFileURLsPreferenceKey,
+ @YES, WebKitJavaScriptEnabledPreferenceKey,
+ @YES, WebKitJavaScriptMarkupEnabledPreferenceKey,
+ @YES, WebKitWebSecurityEnabledPreferenceKey,
+ @YES, WebKitAllowUniversalAccessFromFileURLsPreferenceKey,
+ @YES, WebKitAllowFileAccessFromFileURLsPreferenceKey,
#if PLATFORM(IOS_FAMILY)
- [NSNumber numberWithBool:NO], WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey,
+ @NO, WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey,
#else
- [NSNumber numberWithBool:YES], WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey,
+ @YES, WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey,
#endif
- [NSNumber numberWithBool:YES], WebKitPluginsEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitDatabasesEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitHTTPEquivEnabledPreferenceKey,
+ @YES, WebKitPluginsEnabledPreferenceKey,
+ @YES, WebKitDatabasesEnabledPreferenceKey,
+ @YES, WebKitHTTPEquivEnabledPreferenceKey,
#if PLATFORM(IOS_FAMILY)
- [NSNumber numberWithBool:NO], WebKitStorageTrackerEnabledPreferenceKey,
+ @NO, WebKitStorageTrackerEnabledPreferenceKey,
#endif
- [NSNumber numberWithBool:YES], WebKitLocalStorageEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitExperimentalNotificationsEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitAllowAnimatedImagesPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitAllowAnimatedImageLoopingPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitDisplayImagesKey,
- [NSNumber numberWithBool:NO], WebKitLoadSiteIconsKey,
- @"1800", WebKitBackForwardCacheExpirationIntervalKey,
+ @YES, WebKitLocalStorageEnabledPreferenceKey,
+ @NO, WebKitExperimentalNotificationsEnabledPreferenceKey,
+ @YES, WebKitAllowAnimatedImagesPreferenceKey,
+ @YES, WebKitAllowAnimatedImageLoopingPreferenceKey,
+ @YES, WebKitDisplayImagesKey,
+ @NO, WebKitLoadSiteIconsKey,
+ @"1800", WebKitBackForwardCacheExpirationIntervalKey,
#if !PLATFORM(IOS_FAMILY)
- [NSNumber numberWithBool:NO], WebKitTabToLinksPreferenceKey,
+ @NO, WebKitTabToLinksPreferenceKey,
#endif
- [NSNumber numberWithBool:NO], WebKitPrivateBrowsingEnabledPreferenceKey,
+ @NO, WebKitPrivateBrowsingEnabledPreferenceKey,
#if !PLATFORM(IOS_FAMILY)
- [NSNumber numberWithBool:NO], WebKitRespectStandardStyleKeyEquivalentsPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitShowsURLsInToolTipsPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitShowsToolTipOverTruncatedTextPreferenceKey,
- @"1", WebKitPDFDisplayModePreferenceKey,
- @"0", WebKitPDFScaleFactorPreferenceKey,
+ @NO, WebKitRespectStandardStyleKeyEquivalentsPreferenceKey,
+ @NO, WebKitShowsURLsInToolTipsPreferenceKey,
+ @NO, WebKitShowsToolTipOverTruncatedTextPreferenceKey,
+ @"1", WebKitPDFDisplayModePreferenceKey,
+ @"0", WebKitPDFScaleFactorPreferenceKey,
#endif
- @"0", WebKitUseSiteSpecificSpoofingPreferenceKey,
+ @"0", WebKitUseSiteSpecificSpoofingPreferenceKey,
[NSNumber numberWithInt:WebKitEditableLinkDefaultBehavior], WebKitEditableLinkBehaviorPreferenceKey,
#if !PLATFORM(IOS_FAMILY)
[NSNumber numberWithInt:WebTextDirectionSubmenuAutomaticallyIncluded],
WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitDOMPasteAllowedPreferenceKey,
+ @NO, WebKitDOMPasteAllowedPreferenceKey,
#endif
- [NSNumber numberWithBool:YES], WebKitUsesPageCachePreferenceKey,
+ @YES, WebKitUsesPageCachePreferenceKey,
[NSNumber numberWithInt:cacheModelForMainBundle()], WebKitCacheModelPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitPageCacheSupportsPluginsPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitDeveloperExtrasEnabledPreferenceKey,
+ @YES, WebKitPageCacheSupportsPluginsPreferenceKey,
+ @NO, WebKitDeveloperExtrasEnabledPreferenceKey,
[NSNumber numberWithUnsignedInt:0], WebKitJavaScriptRuntimeFlagsPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitAuthorAndUserStylesEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitDOMTimersThrottlingEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitWebArchiveDebugModeEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitLocalFileContentSniffingEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitOfflineWebApplicationCacheEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitZoomsTextOnlyPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitJavaScriptCanAccessClipboardPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitXSSAuditorEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitAcceleratedCompositingEnabledPreferenceKey,
+ @YES, WebKitAuthorAndUserStylesEnabledPreferenceKey,
+ @YES, WebKitDOMTimersThrottlingEnabledPreferenceKey,
+ @NO, WebKitWebArchiveDebugModeEnabledPreferenceKey,
+ @NO, WebKitLocalFileContentSniffingEnabledPreferenceKey,
+ @NO, WebKitOfflineWebApplicationCacheEnabledPreferenceKey,
+ @YES, WebKitZoomsTextOnlyPreferenceKey,
+ @NO, WebKitJavaScriptCanAccessClipboardPreferenceKey,
+ @YES, WebKitXSSAuditorEnabledPreferenceKey,
+ @YES, WebKitAcceleratedCompositingEnabledPreferenceKey,
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
#define DEFAULT_SUBPIXEL_ANTIALIASED_LAYER_TEXT_ENABLED YES
@@ -493,67 +493,67 @@
#endif
[NSNumber numberWithBool:DEFAULT_SUBPIXEL_ANTIALIASED_LAYER_TEXT_ENABLED], WebKitSubpixelAntialiasedLayerTextEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitDisplayListDrawingEnabledPreferenceKey,
+ @NO, WebKitDisplayListDrawingEnabledPreferenceKey,
#if PLATFORM(IOS_FAMILY) && !PLATFORM(IOS_FAMILY_SIMULATOR)
- [NSNumber numberWithBool:YES], WebKitAcceleratedDrawingEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitCanvasUsesAcceleratedDrawingPreferenceKey,
+ @YES, WebKitAcceleratedDrawingEnabledPreferenceKey,
+ @YES, WebKitCanvasUsesAcceleratedDrawingPreferenceKey,
#else
- [NSNumber numberWithBool:NO], WebKitAcceleratedDrawingEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitCanvasUsesAcceleratedDrawingPreferenceKey,
+ @NO, WebKitAcceleratedDrawingEnabledPreferenceKey,
+ @NO, WebKitCanvasUsesAcceleratedDrawingPreferenceKey,
#endif
- [NSNumber numberWithBool:NO], WebKitShowDebugBordersPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitSimpleLineLayoutEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitSimpleLineLayoutDebugBordersEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitShowRepaintCounterPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitWebGLEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitForceWebGLUsesLowPowerPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitAccelerated2dCanvasEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitSubpixelCSSOMElementMetricsEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitResourceLoadStatisticsEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitLargeImageAsyncDecodingEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitAnimatedImageAsyncDecodingEnabledPreferenceKey,
+ @NO, WebKitShowDebugBordersPreferenceKey,
+ @YES, WebKitSimpleLineLayoutEnabledPreferenceKey,
+ @NO, WebKitSimpleLineLayoutDebugBordersEnabledPreferenceKey,
+ @NO, WebKitShowRepaintCounterPreferenceKey,
+ @YES, WebKitWebGLEnabledPreferenceKey,
+ @YES, WebKitForceWebGLUsesLowPowerPreferenceKey,
+ @NO, WebKitAccelerated2dCanvasEnabledPreferenceKey,
+ @NO, WebKitSubpixelCSSOMElementMetricsEnabledPreferenceKey,
+ @NO, WebKitResourceLoadStatisticsEnabledPreferenceKey,
+ @YES, WebKitLargeImageAsyncDecodingEnabledPreferenceKey,
+ @YES, WebKitAnimatedImageAsyncDecodingEnabledPreferenceKey,
#if PLATFORM(IOS_FAMILY)
[NSNumber numberWithUnsignedInt:static_cast<uint32_t>(FrameFlattening::FullyEnabled)], WebKitFrameFlatteningPreferenceKey,
#else
[NSNumber numberWithUnsignedInt:static_cast<uint32_t>(FrameFlattening::Disabled)], WebKitFrameFlatteningPreferenceKey,
#endif
- [NSNumber numberWithBool:NO], WebKitAsyncFrameScrollingEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitSpatialNavigationEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitDNSPrefetchingEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitFullScreenEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitAsynchronousSpellCheckingEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitHyperlinkAuditingEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitUsePreHTML5ParserQuirksKey,
- [NSNumber numberWithBool:YES], WebKitAVFoundationEnabledKey,
- [NSNumber numberWithBool:YES], WebKitAVFoundationNSURLSessionEnabledKey,
- [NSNumber numberWithBool:NO], WebKitSuppressesIncrementalRenderingKey,
+ @NO, WebKitAsyncFrameScrollingEnabledPreferenceKey,
+ @NO, WebKitSpatialNavigationEnabledPreferenceKey,
+ @NO, WebKitDNSPrefetchingEnabledPreferenceKey,
+ @NO, WebKitFullScreenEnabledPreferenceKey,
+ @NO, WebKitAsynchronousSpellCheckingEnabledPreferenceKey,
+ @YES, WebKitHyperlinkAuditingEnabledPreferenceKey,
+ @NO, WebKitUsePreHTML5ParserQuirksKey,
+ @YES, WebKitAVFoundationEnabledKey,
+ @YES, WebKitAVFoundationNSURLSessionEnabledKey,
+ @NO, WebKitSuppressesIncrementalRenderingKey,
[NSNumber numberWithBool:attachmentElementEnabled], WebKitAttachmentElementEnabledPreferenceKey,
#if !PLATFORM(IOS_FAMILY)
- [NSNumber numberWithBool:YES], WebKitAllowsInlineMediaPlaybackPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitAllowsInlineMediaPlaybackAfterFullscreenPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitInlineMediaPlaybackRequiresPlaysInlineAttributeKey,
- [NSNumber numberWithBool:YES], WebKitMediaControlsScaleWithPageZoomPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitWebAudioEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitBackspaceKeyNavigationEnabledKey,
- [NSNumber numberWithBool:NO], WebKitShouldDisplaySubtitlesPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitShouldDisplayCaptionsPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitShouldDisplayTextDescriptionsPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitNotificationsEnabledKey,
- [NSNumber numberWithBool:NO], WebKitShouldRespectImageOrientationKey,
- [NSNumber numberWithBool:YES], WebKitMediaDataLoadsAutomaticallyPreferenceKey,
+ @YES, WebKitAllowsInlineMediaPlaybackPreferenceKey,
+ @NO, WebKitAllowsInlineMediaPlaybackAfterFullscreenPreferenceKey,
+ @NO, WebKitInlineMediaPlaybackRequiresPlaysInlineAttributeKey,
+ @YES, WebKitMediaControlsScaleWithPageZoomPreferenceKey,
+ @NO, WebKitWebAudioEnabledPreferenceKey,
+ @YES, WebKitBackspaceKeyNavigationEnabledKey,
+ @NO, WebKitShouldDisplaySubtitlesPreferenceKey,
+ @NO, WebKitShouldDisplayCaptionsPreferenceKey,
+ @NO, WebKitShouldDisplayTextDescriptionsPreferenceKey,
+ @YES, WebKitNotificationsEnabledKey,
+ @NO, WebKitShouldRespectImageOrientationKey,
+ @YES, WebKitMediaDataLoadsAutomaticallyPreferenceKey,
#else
- [NSNumber numberWithBool:allowsInlineMediaPlayback], WebKitAllowsInlineMediaPlaybackPreferenceKey,
- [NSNumber numberWithBool:allowsInlineMediaPlaybackAfterFullscreen], WebKitAllowsInlineMediaPlaybackAfterFullscreenPreferenceKey,
+ [NSNumber numberWithBool:allowsInlineMediaPlayback], WebKitAllowsInlineMediaPlaybackPreferenceKey,
+ [NSNumber numberWithBool:allowsInlineMediaPlaybackAfterFullscreen], WebKitAllowsInlineMediaPlaybackAfterFullscreenPreferenceKey,
[NSNumber numberWithBool:requiresPlaysInlineAttribute], WebKitInlineMediaPlaybackRequiresPlaysInlineAttributeKey,
- [NSNumber numberWithBool:NO], WebKitMediaControlsScaleWithPageZoomPreferenceKey,
- [NSNumber numberWithUnsignedInt:AudioSession::None], WebKitAudioSessionCategoryOverride,
- [NSNumber numberWithBool:NO], WebKitMediaDataLoadsAutomaticallyPreferenceKey,
+ @NO, WebKitMediaControlsScaleWithPageZoomPreferenceKey,
+ [NSNumber numberWithUnsignedInt:AudioSession::None], WebKitAudioSessionCategoryOverride,
+ @NO, WebKitMediaDataLoadsAutomaticallyPreferenceKey,
#if HAVE(AVKIT)
- [NSNumber numberWithBool:YES], WebKitAVKitEnabled,
+ @YES, WebKitAVKitEnabled,
#endif
- [NSNumber numberWithBool:YES], WebKitRequiresUserGestureForMediaPlaybackPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitRequiresUserGestureForVideoPlaybackPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitRequiresUserGestureForAudioPlaybackPreferenceKey,
+ @YES, WebKitRequiresUserGestureForMediaPlaybackPreferenceKey,
+ @NO, WebKitRequiresUserGestureForVideoPlaybackPreferenceKey,
+ @NO, WebKitRequiresUserGestureForAudioPlaybackPreferenceKey,
[NSNumber numberWithLongLong:WebCore::ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,
// Per-Origin Quota on iOS is 25MB. When the quota is reached for a particular origin
@@ -561,32 +561,32 @@
[NSNumber numberWithLongLong:(25 * 1024 * 1024)], WebKitApplicationCacheDefaultOriginQuota,
// Enable WebAudio by default in all iOS UIWebViews
- [NSNumber numberWithBool:YES], WebKitWebAudioEnabledPreferenceKey,
+ @YES, WebKitWebAudioEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitShouldRespectImageOrientationKey,
+ @YES, WebKitShouldRespectImageOrientationKey,
#endif // PLATFORM(IOS_FAMILY)
#if ENABLE(WIRELESS_TARGET_PLAYBACK)
- [NSNumber numberWithBool:YES], WebKitAllowsAirPlayForMediaPlaybackPreferenceKey,
+ @YES, WebKitAllowsAirPlayForMediaPlaybackPreferenceKey,
#endif
- [NSNumber numberWithBool:YES], WebKitAllowsPictureInPictureMediaPlaybackPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitRequestAnimationFrameEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitWantsBalancedSetDefersLoadingBehaviorKey,
- [NSNumber numberWithBool:NO], WebKitDiagnosticLoggingEnabledKey,
+ @YES, WebKitAllowsPictureInPictureMediaPlaybackPreferenceKey,
+ @YES, WebKitRequestAnimationFrameEnabledPreferenceKey,
+ @NO, WebKitWantsBalancedSetDefersLoadingBehaviorKey,
+ @NO, WebKitDiagnosticLoggingEnabledKey,
[NSNumber numberWithInt:WebAllowAllStorage], WebKitStorageBlockingPolicyKey,
- [NSNumber numberWithBool:NO], WebKitPlugInSnapshottingEnabledPreferenceKey,
+ @NO, WebKitPlugInSnapshottingEnabledPreferenceKey,
#if PLATFORM(IOS_FAMILY)
- [NSNumber numberWithBool:YES], WebKitContentChangeObserverEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitTelephoneParsingEnabledPreferenceKey,
- [NSNumber numberWithInt:-1], WebKitLayoutIntervalPreferenceKey,
+ @YES, WebKitContentChangeObserverEnabledPreferenceKey,
+ @NO, WebKitTelephoneParsingEnabledPreferenceKey,
+ [NSNumber numberWithInt:-1], WebKitLayoutIntervalPreferenceKey,
[NSNumber numberWithFloat:-1.0f], WebKitMaxParseDurationPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitAllowMultiElementImplicitFormSubmissionPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitAlwaysRequestGeolocationPermissionPreferenceKey,
+ @NO, WebKitAllowMultiElementImplicitFormSubmissionPreferenceKey,
+ @NO, WebKitAlwaysRequestGeolocationPermissionPreferenceKey,
[NSNumber numberWithInt:InterpolationLow], WebKitInterpolationQualityPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitPasswordEchoEnabledPreferenceKey,
- [NSNumber numberWithFloat:2.0f], WebKitPasswordEchoDurationPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitNetworkDataUsageTrackingEnabledPreferenceKey,
- @"", WebKitNetworkInterfaceNamePreferenceKey,
+ @YES, WebKitPasswordEchoEnabledPreferenceKey,
+ [NSNumber numberWithFloat:2.0f], WebKitPasswordEchoDurationPreferenceKey,
+ @NO, WebKitNetworkDataUsageTrackingEnabledPreferenceKey,
+ @"", WebKitNetworkInterfaceNamePreferenceKey,
#endif
#if ENABLE(TEXT_AUTOSIZING)
[NSNumber numberWithFloat:Settings::defaultMinimumZoomFontSize()], WebKitMinimumZoomFontSizePreferenceKey,
@@ -594,56 +594,56 @@
#endif
[NSNumber numberWithLongLong:ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,
[NSNumber numberWithLongLong:ApplicationCacheStorage::noQuota()], WebKitApplicationCacheDefaultOriginQuota,
- [NSNumber numberWithBool:NO], WebKitHiddenPageDOMTimerThrottlingEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitHiddenPageCSSAnimationSuspensionEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitLowPowerVideoAudioBufferSizeEnabledPreferenceKey,
+ @NO, WebKitHiddenPageDOMTimerThrottlingEnabledPreferenceKey,
+ @NO, WebKitHiddenPageCSSAnimationSuspensionEnabledPreferenceKey,
+ @NO, WebKitLowPowerVideoAudioBufferSizeEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitUseLegacyTextAlignPositionedElementBehaviorPreferenceKey,
+ @NO, WebKitUseLegacyTextAlignPositionedElementBehaviorPreferenceKey,
#if ENABLE(MEDIA_SOURCE)
- [NSNumber numberWithBool:YES], WebKitMediaSourceEnabledPreferenceKey,
+ @YES, WebKitMediaSourceEnabledPreferenceKey,
@YES, WebKitSourceBufferChangeTypeEnabledPreferenceKey,
#endif
#if ENABLE(SERVICE_CONTROLS)
- [NSNumber numberWithBool:NO], WebKitImageControlsEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitServiceControlsEnabledPreferenceKey,
+ @NO, WebKitImageControlsEnabledPreferenceKey,
+ @NO, WebKitServiceControlsEnabledPreferenceKey,
#endif
- [NSNumber numberWithBool:NO], WebKitEnableInheritURIQueryComponentPreferenceKey,
+ @NO, WebKitEnableInheritURIQueryComponentPreferenceKey,
#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
@"~/Library/WebKit/MediaKeys", WebKitMediaKeysStorageDirectoryKey,
#endif
#if ENABLE(MEDIA_STREAM)
- [NSNumber numberWithBool:NO], WebKitMockCaptureDevicesEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitMockCaptureDevicesPromptEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitMediaCaptureRequiresSecureConnectionPreferenceKey,
+ @NO, WebKitMockCaptureDevicesEnabledPreferenceKey,
+ @YES, WebKitMockCaptureDevicesPromptEnabledPreferenceKey,
+ @YES, WebKitMediaCaptureRequiresSecureConnectionPreferenceKey,
#endif
- [NSNumber numberWithBool:YES], WebKitShadowDOMEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitCustomElementsEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitDataTransferItemsEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitCustomPasteboardDataEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitDialogElementEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitModernMediaControlsEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitWebAnimationsCSSIntegrationEnabledPreferenceKey,
+ @YES, WebKitShadowDOMEnabledPreferenceKey,
+ @YES, WebKitCustomElementsEnabledPreferenceKey,
+ @YES, WebKitDataTransferItemsEnabledPreferenceKey,
+ @NO, WebKitCustomPasteboardDataEnabledPreferenceKey,
+ @NO, WebKitDialogElementEnabledPreferenceKey,
+ @YES, WebKitModernMediaControlsEnabledPreferenceKey,
+ @NO, WebKitWebAnimationsCSSIntegrationEnabledPreferenceKey,
#if ENABLE(WEBGL2)
- [NSNumber numberWithBool:NO], WebKitWebGL2EnabledPreferenceKey,
+ @NO, WebKitWebGL2EnabledPreferenceKey,
#endif
#if ENABLE(WEBGPU)
- [NSNumber numberWithBool:NO], WebKitWebGPUEnabledPreferenceKey,
+ @NO, WebKitWebGPUEnabledPreferenceKey,
#endif
- [NSNumber numberWithBool:NO], WebKitCacheAPIEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitFetchAPIEnabledPreferenceKey,
+ @NO, WebKitCacheAPIEnabledPreferenceKey,
+ @YES, WebKitFetchAPIEnabledPreferenceKey,
#if ENABLE(STREAMS_API)
- [NSNumber numberWithBool:NO], WebKitReadableByteStreamAPIEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitWritableStreamAPIEnabledPreferenceKey,
+ @NO, WebKitReadableByteStreamAPIEnabledPreferenceKey,
+ @NO, WebKitWritableStreamAPIEnabledPreferenceKey,
#endif
#if ENABLE(DOWNLOAD_ATTRIBUTE)
- [NSNumber numberWithBool:NO], WebKitDownloadAttributeEnabledPreferenceKey,
+ @NO, WebKitDownloadAttributeEnabledPreferenceKey,
#endif
- [NSNumber numberWithBool:NO], WebKitDirectoryUploadEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitWebAnimationsEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitPointerEventsEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitSyntheticEditingCommandsEnabledPreferenceKey,
+ @NO, WebKitDirectoryUploadEnabledPreferenceKey,
+ @YES, WebKitWebAnimationsEnabledPreferenceKey,
+ @YES, WebKitPointerEventsEnabledPreferenceKey,
+ @YES, WebKitSyntheticEditingCommandsEnabledPreferenceKey,
#if PLATFORM(IOS_FAMILY)
@NO, WebKitVisualViewportAPIEnabledPreferenceKey,
@@ -651,20 +651,20 @@
@YES, WebKitVisualViewportAPIEnabledPreferenceKey,
#endif
- [NSNumber numberWithBool:YES], WebKitCSSOMViewScrollingAPIEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitNeedsStorageAccessFromFileURLsQuirkKey,
- [NSNumber numberWithBool:NO], WebKitAllowCrossOriginSubresourcesToAskForCredentialsKey,
+ @YES, WebKitCSSOMViewScrollingAPIEnabledPreferenceKey,
+ @YES, WebKitNeedsStorageAccessFromFileURLsQuirkKey,
+ @NO, WebKitAllowCrossOriginSubresourcesToAskForCredentialsKey,
#if ENABLE(MEDIA_STREAM)
- [NSNumber numberWithBool:NO], WebKitMediaDevicesEnabledPreferenceKey,
- [NSNumber numberWithBool:YES], WebKitMediaStreamEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitMediaRecorderEnabledPreferenceKey,
+ @NO, WebKitMediaDevicesEnabledPreferenceKey,
+ @YES, WebKitMediaStreamEnabledPreferenceKey,
+ @NO, WebKitMediaRecorderEnabledPreferenceKey,
#endif
#if ENABLE(WEB_RTC)
- [NSNumber numberWithBool:YES], WebKitPeerConnectionEnabledPreferenceKey,
+ @YES, WebKitPeerConnectionEnabledPreferenceKey,
#endif
- [NSNumber numberWithBool:YES], WebKitSelectionAcrossShadowBoundariesEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitCSSLogicalEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitAdClickAttributionEnabledPreferenceKey,
+ @YES, WebKitSelectionAcrossShadowBoundariesEnabledPreferenceKey,
+ @NO, WebKitCSSLogicalEnabledPreferenceKey,
+ @NO, WebKitAdClickAttributionEnabledPreferenceKey,
#if ENABLE(INTERSECTION_OBSERVER)
@NO, WebKitIntersectionObserverEnabledPreferenceKey,
#endif
Modified: trunk/Tools/ChangeLog (248189 => 248190)
--- trunk/Tools/ChangeLog 2019-08-02 23:20:31 UTC (rev 248189)
+++ trunk/Tools/ChangeLog 2019-08-02 23:44:46 UTC (rev 248190)
@@ -1,3 +1,33 @@
+2019-08-02 Keith Rollin <[email protected]>
+
+ Consistently use Obj-C boolean literals
+ https://bugs.webkit.org/show_bug.cgi?id=200405
+ <rdar://problem/53880043>
+
+ Reviewed by Simon Fraser, Joseph Pecoraro.
+
+ There are places where we use equivalent but different expressions for
+ Obj-C boolean objects. For example, we use both [NSNumber
+ numberWithBool:YES] and @YES. There are places where both are used in
+ the same function, such as -[WebPreferences initialize]. The boolean
+ literal is in greater use and is more succinct, so standardize on
+ that. Also, change @(YES/NO) to @YES/NO.
+
+ * DumpRenderTree/mac/ObjCController.m:
+ (-[ObjCController objectOfClass:]):
+ * TestWebKitAPI/Tests/WebKitCocoa/BundleEditingDelegate.mm:
+ (TEST):
+ * TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm:
+ (overrideAddObserverForName):
+ * TestWebKitAPI/ios/mainIOS.mm:
+ (main):
+ * TestWebKitAPI/mac/InjectedBundleControllerMac.mm:
+ (TestWebKitAPI::InjectedBundleController::platformInitialize):
+ * TestWebKitAPI/mac/mainMac.mm:
+ (main):
+ * WebKitLauncher/WebKitNightlyEnabler.m:
+ (enableWebKitNightlyBehaviour):
+
2019-08-02 Wenson Hsieh <[email protected]>
TextAutosizingBoost.ChangeAutosizingBoostAtRuntime fails on iPad Simulator
Modified: trunk/Tools/DumpRenderTree/mac/ObjCController.m (248189 => 248190)
--- trunk/Tools/DumpRenderTree/mac/ObjCController.m 2019-08-02 23:20:31 UTC (rev 248189)
+++ trunk/Tools/DumpRenderTree/mac/ObjCController.m 2019-08-02 23:44:46 UTC (rev 248190)
@@ -144,7 +144,7 @@
if ([aClass isEqualToString:@"WebUndefined"])
return [WebUndefined undefined];
if ([aClass isEqualToString:@"NSCFBoolean"])
- return [NSNumber numberWithBool:true];
+ return @YES;
if ([aClass isEqualToString:@"NSCFNumber"])
return [NSNumber numberWithInt:1];
if ([aClass isEqualToString:@"NSCFString"])
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/BundleEditingDelegate.mm (248189 => 248190)
--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/BundleEditingDelegate.mm 2019-08-02 23:20:31 UTC (rev 248189)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/BundleEditingDelegate.mm 2019-08-02 23:44:46 UTC (rev 248190)
@@ -72,7 +72,7 @@
TEST(WebKit, WKWebProcessPlugInEditingDelegate)
{
RetainPtr<WKWebViewConfiguration> configuration = retainPtr([WKWebViewConfiguration _test_configurationWithTestPlugInClassName:@"BundleEditingDelegatePlugIn"]);
- [[configuration processPool] _setObject:[NSNumber numberWithBool:NO] forBundleParameter:@"EditingDelegateShouldInsertText"];
+ [[configuration processPool] _setObject:@NO forBundleParameter:@"EditingDelegateShouldInsertText"];
RetainPtr<WKWebView> webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm (248189 => 248190)
--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm 2019-08-02 23:20:31 UTC (rev 248189)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm 2019-08-02 23:44:46 UTC (rev 248190)
@@ -274,7 +274,7 @@
{
if ([name isEqual:NSWindowWillCloseNotification])
gNotificationCallback = makeBlockPtr(block);
- return [NSNumber numberWithBool:YES];
+ return @YES;
}
#endif
Modified: trunk/Tools/TestWebKitAPI/ios/mainIOS.mm (248189 => 248190)
--- trunk/Tools/TestWebKitAPI/ios/mainIOS.mm 2019-08-02 23:20:31 UTC (rev 248189)
+++ trunk/Tools/TestWebKitAPI/ios/mainIOS.mm 2019-08-02 23:44:46 UTC (rev 248190)
@@ -38,7 +38,7 @@
argumentDomain = [[NSMutableDictionary alloc] init];
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSNumber numberWithBool:YES], @"WebKitLinkedOnOrAfterEverything",
+ @YES, @"WebKitLinkedOnOrAfterEverything",
nil];
[argumentDomain addEntriesFromDictionary:dict];
Modified: trunk/Tools/TestWebKitAPI/mac/InjectedBundleControllerMac.mm (248189 => 248190)
--- trunk/Tools/TestWebKitAPI/mac/InjectedBundleControllerMac.mm 2019-08-02 23:20:31 UTC (rev 248189)
+++ trunk/Tools/TestWebKitAPI/mac/InjectedBundleControllerMac.mm 2019-08-02 23:44:46 UTC (rev 248190)
@@ -40,8 +40,8 @@
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInteger:4], @"AppleAntiAliasingThreshold",
[NSNumber numberWithInteger:0], @"AppleFontSmoothing",
- [NSNumber numberWithBool:NO], @"NSScrollAnimationEnabled",
- [NSNumber numberWithBool:NO], @"NSOverlayScrollersEnabled",
+ @NO, @"NSScrollAnimationEnabled",
+ @NO, @"NSOverlayScrollersEnabled",
@"Always", @"AppleShowScrollBars",
nil];
Modified: trunk/Tools/TestWebKitAPI/mac/mainMac.mm (248189 => 248190)
--- trunk/Tools/TestWebKitAPI/mac/mainMac.mm 2019-08-02 23:20:31 UTC (rev 248189)
+++ trunk/Tools/TestWebKitAPI/mac/mainMac.mm 2019-08-02 23:44:46 UTC (rev 248190)
@@ -40,7 +40,7 @@
argumentDomain = [[NSMutableDictionary alloc] init];
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSNumber numberWithBool:YES], @"WebKitLinkedOnOrAfterEverything",
+ @YES, @"WebKitLinkedOnOrAfterEverything",
nil];
[argumentDomain addEntriesFromDictionary:dict];
Modified: trunk/Tools/WebKitLauncher/WebKitNightlyEnabler.m (248189 => 248190)
--- trunk/Tools/WebKitLauncher/WebKitNightlyEnabler.m 2019-08-02 23:20:31 UTC (rev 248189)
+++ trunk/Tools/WebKitLauncher/WebKitNightlyEnabler.m 2019-08-02 23:44:46 UTC (rev 248190)
@@ -157,7 +157,7 @@
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
NSDictionary *defaultPrefs = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:RunStateShutDown], WKNERunState,
- [NSNumber numberWithBool:YES], WKNEShouldMonitorShutdowns,
+ @YES, WKNEShouldMonitorShutdowns,
disabledInputManagers, @"NSDisabledInputManagers", nil];
[userDefaults registerDefaults:defaultPrefs];
if ([userDefaults boolForKey:WKNEShouldMonitorShutdowns]) {
_______________________________________________ webkit-changes mailing list [email protected] https://lists.webkit.org/mailman/listinfo/webkit-changes
