2015-10-29 20:01:20 +00:00
|
|
|
find_library(COCOA_LIBRARY Cocoa)
|
|
|
|
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
|
|
|
|
find_library(READLINE_LIBRARY Readline)
|
|
|
|
list(APPEND WTF_LIBRARIES
|
|
|
|
${COREFOUNDATION_LIBRARY}
|
|
|
|
${COCOA_LIBRARY}
|
|
|
|
${READLINE_LIBRARY}
|
|
|
|
)
|
|
|
|
|
2018-03-13 03:19:21 +00:00
|
|
|
list(APPEND WTF_PUBLIC_HEADERS
|
2018-12-27 16:13:47 +00:00
|
|
|
WeakObjCPtr.h
|
|
|
|
|
2018-12-01 03:28:36 +00:00
|
|
|
cf/CFURLExtras.h
|
2021-06-28 15:34:32 +00:00
|
|
|
cf/SpanCF.h
|
2018-01-30 20:02:17 +00:00
|
|
|
cf/TypeCastsCF.h
|
|
|
|
|
2019-11-05 19:36:12 +00:00
|
|
|
cocoa/CrashReporter.h
|
2018-06-07 23:14:04 +00:00
|
|
|
cocoa/Entitlements.h
|
2018-12-01 03:28:36 +00:00
|
|
|
cocoa/NSURLExtras.h
|
2020-03-13 23:33:33 +00:00
|
|
|
cocoa/RuntimeApplicationChecksCocoa.h
|
2018-01-30 20:02:17 +00:00
|
|
|
cocoa/SoftLinking.h
|
2021-06-28 15:34:32 +00:00
|
|
|
cocoa/SpanCocoa.h
|
[Cocoa] Simplify NSArray, NSDictionary, and NSNumber idioms throughout WebKit
https://bugs.webkit.org/show_bug.cgi?id=210138
Reviewed by Alex Christensen.
Source/JavaScriptCore:
* API/JSValue.mm:
(valueToObjectWithoutCopy): Use @().
(valueToNumber): Ditto.
* API/tests/testapi.mm:
(-[TestObject callback:]): Use @[], @(), and @{}.
(-[TextXYZ click]): Ditto.
(testObjectiveCAPIMain): Ditto.
Source/WebCore:
- Added createNSArray and makeVector.
- Use createNSArray and makeVector<String> in many places where we convert
between NSArray and Vector, replacing multiple existing functions that were
doing the same job before; later can use them even more.
- Use @[] many places where we create an autoreleased NSArray.
- Use @{} many places where we create an autoreleased NSDictionary.
- Use @() many places where we create an autoreleased NSNumber.
* PlatformMac.cmake: Moved Float/IntRectMac.mm to Float/IntRectCocoa.mm.
* SourcesCocoa.txt: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(AXAttributeStringSetBlockquoteLevel): Use @().
(AXAttributeStringSetHeadingLevel): Use @().
(-[WebAccessibilityObjectWrapper textMarkerRangeForSelection]): Use @[].
(-[WebAccessibilityObjectWrapper _stringFromStartMarker:toEndMarker:attributed:]): Use @[].
(-[WebAccessibilityObjectWrapper elementsForRange:]): Use @[].
(-[WebAccessibilityObjectWrapper textMarkersForRange:]): Use @[].
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::textReplacementChangeDictionary): Use @().
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(makeVectorElement): Aded overload for AccessibilitySearchKey.
(accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute):
Use makeVector<AccessibilitySearchKey>.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(accessibilityTextCriteriaForParameterizedAttribute): Use makeVector<String>.
(accessibilitySearchTextCriteriaForParameterizedAttribute): Use makeVector<String>.
(AXAttributeStringSetStyle): Use @().
(AXAttributeStringSetBlockquoteLevel): Use @().
(AXAttributeStringSetHeadingLevel): Use @().
(-[WebAccessibilityObjectWrapper accessibilityActionNames]): Use @[].
(convertStringsToNSArray): Deleted.
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
Use @(), @[], and createNSArray.
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
Ditto.
* bridge/objc/WebScriptObject.mm:
(+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
Use @().
* editing/cocoa/AlternativeTextUIController.mm:
(WebCore::AlternativeTextUIController::alternativesForContext):
Use makeVector<String>.
* editing/cocoa/HTMLConverter.mm:
(defaultParagraphStyle): Use @[].
(HTMLConverter::computedAttributesForElement): Use @().
(HTMLConverter::_processMetaElementWithName): Use @().
(HTMLConverter::_addTableForElement): Use @().
* page/ios/FrameIOS.mm:
(WebCore::Frame::interpretationsForCurrentRoot const): Use @[].
* platform/cocoa/MIMETypeRegistryCocoa.mm:
(WebCore::MIMETypeRegistry::getExtensionsForMIMEType): Use makeVector<String>.
* platform/graphics/FloatRect.h: Added makeNSArrayElement overload so we can
convert Vector<FloatRect> into NSArray<NSValue>.
* platform/graphics/IntRect.h: Similarly for IntRect.
* platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
(WebCore::MediaSelectionGroupAVFObjC::updateOptions): Use createNSArray.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::mediaDescriptionForKind): Use @[].
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Use @().
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Use @().
(WebCore::MediaPlayerPrivateAVFoundationObjC::checkPlayability): Use @[].
(WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput): Use @{} and @().
* platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
(WebCore::PlatformCAAnimationCocoa::valueFunction const):
(WebCore::PlatformCAAnimationCocoa::setFromValue):
(WebCore::PlatformCAAnimationCocoa::copyFromValueFrom):
(WebCore::PlatformCAAnimationCocoa::setToValue):
(WebCore::PlatformCAAnimationCocoa::copyToValueFrom):
(WebCore::PlatformCAAnimationCocoa::setValues):
(WebCore::PlatformCAAnimationCocoa::copyValuesFrom):
(WebCore::PlatformCAAnimationCocoa::setKeyTimes):
(WebCore::PlatformCAAnimationCocoa::copyKeyTimesFrom):
(WebCore::PlatformCAAnimationCocoa::setTimingFunctions):
(WebCore::PlatformCAAnimationCocoa::copyTimingFunctionsFrom):
Use @(), @[], modern for loops, auto, and allocate with capacity.
* platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
(WebCore::PlatformCAFilters::filterValueForOperation): Use @().
* platform/graphics/cocoa/FloatRectCocoa.mm: Moved from mac/FloatRectMac.mm.
(WebCore::makeNSArrayElement): Added so we can convert Vector<FloatRect>
into NSArray<NSValue>.
* platform/graphics/cocoa/IntRectCocoa.mm: Moved from mac/IntRectMac.mm.
(WebCore::makeNSArrayElement): Similarly for IntRect.
(WebCore::enclosingIntRect): Use clampTo to be consistent with what
enclosingIntRect(FloatRect) does (while fixing check-webkit-style complaint).
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer display]): Add WebCore namespace prefix; needed depending on
how sources get unified (and was affecting my local build when it temporarily
had an additional source file).
(-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]): Ditto.
(-[WebGLLayer bindFramebufferToNextAvailableSurface]): Ditto.
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::systemFontModificationAttributes): Use @().
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::getTypes): Use makeVector<String>.
(WebCore::createItemProviderRegistrationList): Use createNSArray.
(WebCore::PlatformPasteboard::updateSupportedTypeIdentifiers): Use createNSArray.
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderPasteboard setItemProviders:]): Use @[].
* platform/ios/wak/WAKView.mm:
(-[WAKView subviews]): Dittto.
* platform/mac/PlatformPasteboardMac.mm:
(WebCore::PlatformPasteboard::getTypes): Use makeVector<String>.
(WebCore::PlatformPasteboard::getPathnamesForType const): Use makeVector<String>.
(WebCore::PlatformPasteboard::addTypes): Use makeVector<String>.
(WebCore::PlatformPasteboard::setTypes): Use makeVector<String>.
* platform/mac/StringUtilities.h: Removed
webCoreStringVectorFromNSStringArray, replaced by makeVector<String>
* platform/mac/StringUtilities.mm:
(WebCore::webCoreStringVectorFromNSStringArray): Deleted.
* platform/mac/WebCoreNSURLExtras.mm: Removed unneeded include.
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
(WebCore::MediaRecorderPrivateWriter::setVideoInput): Use @().
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::setupCaptureSession): Use @().
* platform/network/cocoa/CookieCocoa.mm:
(WebCore::Cookie::operator NSHTTPCookie * _Nullable const): Use @().
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::setCookiesFromDOM const): Use @{}.
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::doUpdatePlatformRequest): Use @YES/@NO.
Source/WebKit:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm: Remove uneeded include.
* Platform/mac/StringUtilities.mm: Ditto.
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::replacedNSConcreteTask_launch): Use makeVector<String>.
(WebKit::replacedNSWorkspace_launchApplicationAtURL_options_configuration_error):
Ditto.
* Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toSupportedNetworks): Deleted.
(WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Use createNSArray.
* Shared/mac/PasteboardTypes.mm:
(WebKit::PasteboardTypes::forEditing): Use @[].
(WebKit::PasteboardTypes::forURL): Ditto.
(WebKit::PasteboardTypes::forImages): Ditto.
(WebKit::PasteboardTypes::forImagesWithArchive): Ditto.
(WebKit::PasteboardTypes::forSelection): Ditto.
* UIProcess/API/Cocoa/WKContentRuleListStore.mm:
(-[WKContentRuleListStore getAvailableContentRuleListIdentifiers:]): Use createNSArray.
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _getActivePagesOriginsInWebProcessForTesting:completionHandler:]): Ditto.
* UIProcess/API/Cocoa/WKUserScript.mm:
(-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]):
(-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:associatedURL:userContentWorld:]):
(-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:contentWorld:]):
(-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:associatedURL:contentWorld:]):
(-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:associatedURL:contentWorld:deferRunningUntilNotification:]):
Use makeVector<String>.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setupPageConfiguration:]): Use makeVector<String>.
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration _corsDisablingPatterns]): Use createNSArray.
(-[WKWebViewConfiguration _setCORSDisablingPatterns:]): Use makeVector<String>.
* UIProcess/API/Cocoa/WKWebViewTesting.mm:
(-[WKWebView _contentsOfUserInterfaceItem:]): Use @().
* UIProcess/API/Cocoa/_WKContentRuleListAction.mm:
(-[_WKContentRuleListAction notifications]): Use createNSArray.
* UIProcess/API/Cocoa/_WKCustomHeaderFields.mm:
(-[_WKCustomHeaderFields thirdPartyDomains]): Use createNSArray.
(-[_WKCustomHeaderFields setThirdPartyDomains:]): Use makeVector<String>.
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration cachePartitionedURLSchemes]): Use createNSArray.
(-[_WKProcessPoolConfiguration setCachePartitionedURLSchemes:]): Use makeVector<String>.
(-[_WKProcessPoolConfiguration alwaysRevalidatedURLSchemes]): Use createNSArray.
(-[_WKProcessPoolConfiguration setAlwaysRevalidatedURLSchemes:]): Use makeVector<String>.
* UIProcess/API/Cocoa/_WKUserContentWorldInternal.h:
(API::toStringVector): Deleted.
* UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
(-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]):
(-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]):
Use makeVector<String>.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::accessibilityAttributeValue): Use @[].
(WebKit::WebViewImpl::performDragOperation): Use makeVector<String>.
(WebKit::WebViewImpl::namesOfPromisedFilesDroppedAtDestination): Use @[].
(WebKit::WebViewImpl::collectKeyboardLayoutCommandsForEvent): Use @[].
* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::PluginProcessProxy::launchProcess): Use createNSArray.
(WebKit::isJavaUpdaterURL): Use @[].
(WebKit::PluginProcessProxy::launchApplicationAtURL): Use @{} and createNSArray.
(WebKit::isSilverlightPreferencesURL): Use @[].
* UIProcess/WebAuthentication/Cocoa/HidService.mm:
(WebKit::HidService::HidService): Use @() and fixed an over-release mistake.
This code was doing adoptNS on the result of +[NSNumberWithInt:], which is incorrect.
* UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
(WebKit::MockLocalConnection::getAttestation const): Use @[].
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView textStylingAtPosition:inDirection:]): Use @().
(-[WKContentView requestRectsToEvadeForSelectionCommandsWithCompletionHandler:]): Use createNSArray.
(-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationLists:stagedDragSource:]):
Fixed a wasteful call to autorelease where we are adding an item to a dictionary. Calling get
is more efficient and still correct.
* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel imagePickerController:didFinishPickingMediaWithInfo:]): Use @[].
* UIProcess/ios/forms/WKFormColorPicker.mm:
(-[WKColorMatrixView initWithFrame:colorMatrix:]): Removed uneeded RetainPtr
local variable.
* UIProcess/mac/CorrectionPanel.mm:
(WebKit::CorrectionPanel::show): Use createNSArray.
* UIProcess/mac/TextCheckerMac.mm:
(WebKit::TextChecker::updateSpellingUIWithGrammarString): Use createNSArray.
(WebKit::TextChecker::getGuessesForWord): Use makeVector<String>.
* UIProcess/mac/WKPrintingView.mm:
(-[WKPrintingView _adjustPrintingMarginsForHeaderAndFooter]): Use @().
* UIProcess/mac/WKTextFinderClient.mm:
(arrayFromRects): Deleted.
(-[WKTextFinderClient didFindStringMatchesWithRects:didWrapAround:]): Use createNSArray.
* UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
(-[WKDataListSuggestionsController notifyAccessibilityClients:]): Use @{}
and fix a bug where this was creating a backwards dictionary. So this never
could have been working before, making me wonder how we test it.
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::searchTheWeb): Use @[].
* WebProcess/InjectedBundle/API/mac/WKDOMInternals.h: Removed toNSArray.
* WebProcess/InjectedBundle/API/mac/WKDOMInternals.mm:
(WebKit::toNSArray): Deleted.
* WebProcess/InjectedBundle/API/mac/WKDOMNode.mm:
(-[WKDOMNode textRects]): Use createNSArray.
* WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
(-[WKDOMRange textRects]): Ditto.
* WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
(WebKit::InjectedBundle::setBundleParameter): Use @{}.
* WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:
(WebKit::makeRenderLayer): Use @[].
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::writeItemsToPasteboard): Use makeVector<String>.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::applicationDidEnterBackground): Use @().
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::suspendPainting): Use @{}.
(WebKit::TiledCoreAnimationDrawingArea::resumePainting): Use @{}.
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
Removed an unneeded include.
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: Ditto.
(-[WKAccessibilityWebPageObject accessibilityActionNames]): Use @[].
(-[WKAccessibilityWebPageObject accessibilityChildren]): Use @[].
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::getActivePagesOriginsForTesting): Use makeVector<String>.
Source/WebKitLegacy/ios:
* WebCoreSupport/WebChromeClientIOS.mm:
(WebChromeClientIOS::runOpenPanel): Use createNSArray.
* WebCoreSupport/WebVisiblePosition.mm:
(-[WebVisiblePosition enclosingRangeWithDictationPhraseAlternatives:]):
Use createNSArray.
* WebCoreSupport/WebVisiblePositionInternal.h:
Added #if so that this correctly doesn't compile anything on Mac.
* WebView/WebPDFViewIOS.mm:
(+[WebPDFView supportedMIMETypes]): Use @[].
Source/WebKitLegacy/mac:
* DOM/DOM.mm:
(kit): Deleted overload that takes Vector<IntRect>.
(-[DOMNode textRects]): Use createNSArray.
(-[DOMRange textRects]): Ditto.
* DOM/ExceptionHandlers.mm:
(raiseDOMErrorException): Use @().
* History/WebBackForwardList.mm:
(-[WebBackForwardList dictionaryRepresentation]): Use @{}.
* History/WebHistory.mm:
(+[WebHistoryPrivate initialize]): Use @{}.
(-[WebHistory _sendNotification:entries:]): Use @{}.
* History/WebHistoryItem.mm:
(-[WebHistoryItem initFromDictionaryRepresentation:]): Use makeVector<String>.
(-[WebHistoryItem dictionaryRepresentation:]): Use createNSArray and @().
* History/WebURLsWithTitles.m:
(+[WebURLsWithTitles arrayWithIFURLsWithTitlesPboardType]): Use @[].
(+[WebURLsWithTitles writeURLs:andTitles:toPasteboard:]): Use @[].
* Misc/WebCache.mm:
(+[WebCache statistics]): Use @[], @{}, and @().
* Misc/WebCoreStatistics.mm:
(+[WebCoreStatistics memoryStatistics]): Ditto.
* Misc/WebKitErrors.m:
(-[NSError _webkit_initWithDomain:code:URL:]): Use @().
(+[NSError _registerWebKitErrors]): Use @().
(-[NSError _initWithPluginErrorCode:contentURL:pluginPageURL:pluginName:MIMEType:]): Use @().
* Misc/WebKitNSStringExtras.mm:
(-[NSString _web_drawAtPoint:font:textColor:]): Use @{}.
(-[NSString _web_widthWithFont:]): Use @{}.
* Misc/WebNSFileManagerExtras.mm: Removed unneeded include.
* Misc/WebNSPasteboardExtras.mm:
(+[NSPasteboard _web_dragTypesForURL]): Use @[].
(-[NSPasteboard _web_writeURL:andTitle:types:]): Use @[].
(+[NSPasteboard _web_setFindPasteboardString:withOwner:]): Use @[].
* Misc/WebNSURLExtras.mm: Removed unneeded include.
* Plugins/Hosted/NetscapePluginHostManager.mm:
(WebKit::NetscapePluginHostManager::spawnPluginHost): Use @{}.
* Plugins/Hosted/NetscapePluginHostProxy.mm:
(WKPCIdentifierInfo): Use @().
* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::addValueToArray): Use @().
* Plugins/Hosted/WebHostedNetscapePluginView.mm: Removed unneeded include.
* Plugins/WebBasePluginPackage.mm: Ditto.
* Plugins/WebPluginContainerCheck.mm:
(-[WebPluginContainerCheck _actionInformationWithURL:]): Use @{}.
* Plugins/WebPluginDatabase.mm:
(+[WebPluginDatabase _defaultPlugInPaths]): Use @[].
* Storage/WebDatabaseManager.mm:
(-[WebDatabaseManager databasesWithOrigin:]): Use createNSArray.
* WebCoreSupport/CorrectionPanel.mm:
(CorrectionPanel::show): Use createNSArray.
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::addMessageToConsole): Use @().
* WebCoreSupport/WebEditorClient.mm:
(attributesForAttributedStringConversion): Use @().
(WebEditorClient::getGuessesForWord): Use makeVector<String>.
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::actionDictionary const): Use @().
(kit): Deleted overload that takes Vector<String>.
(pluginView): Use @{}.
(WebFrameLoaderClient::createPlugin): Use createNSArray, @{}, and @().
(WebFrameLoaderClient::createJavaAppletWidget): Use createNSArray.
* WebCoreSupport/WebOpenPanelResultListener.mm:
(-[WebOpenPanelResultListener chooseFilenames:]): Use makeVector<String>.
(-[WebOpenPanelResultListener chooseFilename:displayString:iconImage:]): Use @[].
(-[WebOpenPanelResultListener chooseFilenames:displayString:iconImage:]): Use makeVector<String>.
* WebCoreSupport/WebSelectionServiceController.mm:
(WebSelectionServiceController::handleSelectionServiceClick):
Comment out an unused argument.
* WebView/WebFrame.mm:
(-[WebFrame _rectsForRange:]): Use createNSArrray.
(-[WebFrame _computePageRectsWithPrintScaleFactor:pageSize:]): Use createNSArray and @[].
(-[WebFrame childFrames]): Use @[].
* WebView/WebHTMLView.mm:
(+[WebHTMLView _selectionPasteboardTypes]): Use @[].
(-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Use @[].
(-[WebHTMLView knowsPageRange:]): Use @[].
(-[WebHTMLView accessibilityAttributeValue:]): Use @[].
(-[WebHTMLView copyFont:]): Use @[].
(-[WebHTMLView _interpretKeyEvent:savingCommands:]): Use @[].
(-[WebHTMLView selectionTextRects]): Use createNSArray.
(-[WebHTMLView rectsForTextMatches]): Use createNSArray and @[].
* WebView/WebPDFRepresentation.mm: Removed unneeded include.
(+[WebPDFRepresentation postScriptMIMETypes]): Use @[].
(+[WebPDFRepresentation supportedMIMETypes]): Use @[].
* WebView/WebPDFView.mm:
(-[WebPDFView elementAtPoint:]): Use @{} and @().
(-[WebPDFView viewState]): Use @().
(-[WebPDFView selectionTextRects]): Use @[].
(-[WebPDFView pasteboardTypesForSelection]): Use @[].
(-[WebPDFView _menuItemsFromPDFKitForEvent:]): Use @().
(-[WebPDFView _openWithFinder:]): Use @{} and @().
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]): Use @().
(-[WebPreferences _setUnsignedIntValue:forKey:]): Use @().
(+[WebPreferences _setInitialDefaultTextEncodingToSystemEncoding]): Use @().
(-[WebPreferences setStorageBlockingPolicy:]): Use @{} and @().
* WebView/WebScriptDebugger.mm:
(WebScriptDebugger::sourceParsed): Use @().
* WebView/WebTextCompletionController.mm:
(-[WebTextCompletionController _placePopupWindow:]): Use @{}.
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]): Use makeVector<String>.
(-[WebView _contentsOfUserInterfaceItem:]): Use @().
(toStringVector): Deleted.
(+[WebView _addUserScriptToGroup:world:source:url:whitelist:blacklist:injectionTime:injectedFrames:]):
Use makeVector<String>.
(+[WebView _addUserStyleSheetToGroup:world:source:url:whitelist:blacklist:injectedFrames:]):
Use makeVector<String>.
(-[WebView _elementAtWindowPoint:]): Use @{}.
(-[WebView pasteboardTypesForSelection]): Use @[].
(-[WebView pasteboardTypesForElement:]): Use @[].
(-[WebView rectsForTextMatches]): Use @[].
(-[WebView _searchWithGoogleFromMenu:]): Use @[].
(-[WebView _setFontWhitelist:]): Use makeVector<String>.
Source/WTF:
* WTF.xcodeproj/project.pbxproj: Added VectorCocoa.h.
* wtf/PlatformMac.cmake: Ditto.
* wtf/cocoa/NSURLExtras.mm: Removed unneeded include.
* wtf/cocoa/URLCocoa.mm: Ditto.
* wtf/cocoa/VectorCocoa.h: Added. Contains createNSArray and makeVector
function templates for converting NSArray to and from Vector.
* wtf/text/WTFString.h: Added makeNSArrayElement and makeVectorElement
functions, making createNSArray and makeVector compatible with String.
* wtf/text/cocoa/StringCocoa.mm:
(WTF::makeNSArrayElement): Added.
(WTF::makeVectorElement): Added.
Tools:
* DumpRenderTree/AccessibilityController.h: Remove use of NotificationHandler
type; it's just "id".
* DumpRenderTree/AccessibilityUIElement.cpp:
(convertElementsToObjectArray): Moved this up in the file, removed unneeded
use of JSValueToObject and unused exception argument.
(elementsForRangeCallback): Use convertElementsToObjectArray.
(columnHeadersCallback): Updated for removed exception argument.
(rowHeadersCallback): Ditto.
(uiElementArrayAttributeValueCallback): Ditto.
* DumpRenderTree/AccessibilityUIElement.h: Changed to use RetainPtr.
* DumpRenderTree/TestNetscapePlugIn/PluginObjectMac.mm:
(createCoreAnimationLayer): Use @{}.
* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(AccessibilityUIElement::AccessibilityUIElement): Removed some unneeded
code now that we use RetainPtr.
(AccessibilityUIElement::~AccessibilityUIElement): Deleted.
(AccessibilityUIElement::lineTextMarkerRangeForTextMarker): Use @[].
(AccessibilityUIElement::textMarkerRangeForMarkers): Use @[].
(AccessibilityUIElement::textMarkerRangeMatchesTextNearMarkers): Use @[].
* DumpRenderTree/ios/TextInputControllerIOS.m:
(-[TextInputController markedRange]): Use @[].
* DumpRenderTree/mac/AccessibilityCommonMac.mm:
(searchPredicateParameterizedAttributeForSearchCriteria): Tweak a little.
* DumpRenderTree/mac/AccessibilityNotificationHandler.mm:
(-[NSString createJSStringRef]): Deleted. Duplicate of a method already
implemented in anothe file.
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(makeVectorElement): Added overloads to make both
makeVector<AccessibilityTextMarkerRange> and
makeVector<AccessibilityUIElement> work.
(AccessibilityUIElement::AccessibilityUIElement): Removed some unneeded
code now that we use RetainPtr.
(convertVectorToObjectArray): Removed unneeded use of JSValueToObject
and unneeded exception argument.
(convertNSArrayToVector): Deleted.
(AccessibilityUIElement::getLinkedUIElements): Use
makeVector<AccessibilityUIElement>.
(AccessibilityUIElement::getDocumentLinks): Ditto.
(AccessibilityUIElement::getChildren): Ditto.
(AccessibilityUIElement::getChildrenWithRange): Ditto.
(AccessibilityUIElement::rowHeaders const): Ditto.
(AccessibilityUIElement::columnHeaders const): Ditto.
(AccessibilityUIElement::uiElementArrayAttributeValue const): Ditto.
(AccessibilityUIElement::role): Updated since m_element is a RetainPtr.
(AccessibilityUIElement::subrole): Ditto.
(AccessibilityUIElement::roleDescription): Ditto.
(AccessibilityUIElement::computedRoleString): Ditto.
(AccessibilityUIElement::title): Ditto.
(AccessibilityUIElement::description): Ditto.
(AccessibilityUIElement::orientation const): Ditto.
(AccessibilityUIElement::stringValue): Ditto.
(AccessibilityUIElement::language): Ditto.
(AccessibilityUIElement::helpText const): Ditto.
(AccessibilityUIElement::lineForIndex): Use @().
(AccessibilityUIElement::rangeForLine): Use @().
(AccessibilityUIElement::searchTextWithCriteria): Use
makeVector<AccessibilityTextMarkerRange>.
(AccessibilityUIElement::attributesOfColumnHeaders): Use
makeVector<AccessibilityUIElement>.
(AccessibilityUIElement::attributesOfRowHeaders): Ditto.
(AccessibilityUIElement::attributesOfColumns): Ditto.
(AccessibilityUIElement::attributesOfRows): Ditto.
(AccessibilityUIElement::attributesOfVisibleCells): Ditto.
(AccessibilityUIElement::cellForColumnAndRow): Use @[] and @().
(AccessibilityUIElement::setSelectedChild const): Use @[].
(AccessibilityUIElement::setSelectedChildAtIndex const): Use @[].
(AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions):
Use @{}, @YES, and @NO.
(AccessibilityUIElement::textMarkerRangeForMarkers): Use @[].
* DumpRenderTree/mac/DumpRenderTree.mm:
(addTestPluginsToPluginSearchPath): Use @[].
(resetWebViewToConsistentStateBeforeTesting): Use @[].
* DumpRenderTree/mac/DumpRenderTreePasteboard.mm:
(-[DumpRenderTreePasteboard declareType:owner:]): Use @[].
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController beginDragWithFiles:]): Use @().
(-[EventSendingController sentTouchEventOfType:]): Use @().
* DumpRenderTree/mac/MockWebNotificationProvider.mm:
(-[MockWebNotificationProvider cancelNotification:]): Use @[].
* DumpRenderTree/mac/ObjCController.m:
(-[ObjCController objectOfClass:]): Use @().
(-[ObjCController arrayOfString]): Use @[].
(-[ObjCController testWrapperRoundTripping:]): Use @().
(-[ObjCController testArray]): Use @[].
* DumpRenderTree/mac/TestRunnerMac.mm:
(originsArrayToJS): Removed unneeded use of JSValueToObject.
* DumpRenderTree/mac/TextInputControllerMac.m:
(-[TextInputController markedRange]): Use @[] and @().
(-[TextInputController selectedRange]): Use @[] and @().
(-[TextInputController firstRectForCharactersFrom:length:]):
Use @[] and @().
(-[TextInputController dictatedStringWithPrimaryString:alternative:alternativeOffset:alternativeLength:]):
Use @[].
(-[TextInputController interpretKeyEvents:withSender:]): Use @[].
* DumpRenderTree/mac/UIScriptControllerMac.mm:
(WTR::UIScriptControllerMac::copyText): Use [].
* DumpRenderTree/win/AccessibilityUIElementWin.cpp: Deleted an
unneeded copy constructor and destructor.
* TestRunnerShared/cocoa/LayoutTestSpellChecker.mm:
(-[LayoutTestSpellChecker setResultsFromJSObject:inContext:]): Use @{}.
* TestWebKitAPI/Tests/WebKitCocoa/ContentRuleListNotification.mm:
(toVector): Deleted.
(-[ContentRuleListNotificationDelegate _webView:contentRuleListWithIdentifier:performedAction:forURL:]):
Use makeVector<String>.
* TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:
(TestWebKitAPI::TEST): Use @[].
* TestWebKitAPI/Tests/WebKitCocoa/PasteImage.mm:
(writeImageDataToPasteboard): Use @[] and @{}.
(writeBundleFileToPasteboard): Use @[].
* TestWebKitAPI/Tests/WebKitCocoa/PasteWebArchive.mm:
(TestWebKitAPI::TEST): Use @[].
* TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm:
(TestWebKitAPI::TEST): Use @[].
* TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
(TestWebKitAPI::TEST): Use @[].
* TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm:
(TestWebKitAPI::TEST): Use @[].
* TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm:
(TestWebKitAPI::TEST): Use @[].
* TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:
(runWebsiteDataStoreCustomPaths): Use @[].
* TestWebKitAPI/Tests/mac/WebViewCanPasteURL.mm:
(TestWebKitAPI::TEST): Use @[].
* TestWebKitAPI/Tests/mac/WebViewCanPasteZeroPng.mm:
(TestWebKitAPI::TEST): Use @[].
* TestWebKitAPI/Tests/mac/WebViewDidCreateJavaScriptContext.mm:
(-[DidCreateJavaScriptContextFrameLoadDelegate webView:didCreateJavaScriptContext:forFrame:]):
Use @[].
* TestWebKitAPI/ios/mainIOS.mm:
(main): Use @{}.
* TestWebKitAPI/mac/InjectedBundleControllerMac.mm:
(TestWebKitAPI::InjectedBundleController::platformInitialize): Use @{} and @().
* TestWebKitAPI/mac/mainMac.mm:
(main): Use {}.
* WebKitTestRunner/InjectedBundle/AccessibilityController.h:
Use id instead of NotificationHandler.
* WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.h:
Use id for PlatformTextMarkerRange. Added an overload of makeVectorElement
to make makeVector<RefPtr<AccessibilityTextMarkerRange>> work.
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
Use RetainPtr. Added an overload of makeVectorElement to make
makeVector<RefPtr<AccessibilityUIElement>> work.
* WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm:
Removed unneeded include.
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::convertNSArrayToVector): Deleted.
(WTR::AccessibilityUIElement::AccessibilityUIElement): Simplified
since we use RetainPtr.
(WTR::AccessibilityUIElement::~AccessibilityUIElement): Ditto.
(WTR::convertElementsToObjectArray): Removed unneeded use of
JSValueToObject.
(WTR::AccessibilityUIElement::elementsForRange): Use
makeVector<RefPtr<AccessibilityUIElement>>.
(WTR::AccessibilityUIElement::lineTextMarkerRangeForTextMarker):
Use @[].
(WTR::AccessibilityUIElement::textMarkerRangeForMarkers): Use @[].
(WTR::AccessibilityUIElement::textMarkerRangeMatchesTextNearMarkers):
* WebKitTestRunner/InjectedBundle/ios/InjectedBundleIOS.mm:
(WTR::InjectedBundle::platformInitialize): Use @{}.
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::AccessibilityUIElement): Simplified
since we use RetainPtr.
(WTR::AccessibilityUIElement::~AccessibilityUIElement): Ditto.
(WTR::convertNSArrayToVector): Deleted.
(WTR::AccessibilityUIElement::getLinkedUIElements): Use
makeVector<RefPtr<AccessibilityUIElement>>.
(WTR::AccessibilityUIElement::getDocumentLinks): Ditto.
(WTR::AccessibilityUIElement::getUIElementsWithAttribute const): Ditto.
(WTR::AccessibilityUIElement::getChildren): Ditto.
(WTR::AccessibilityUIElement::getChildrenWithRange): Ditto.
(WTR::AccessibilityUIElement::rowHeaders const): Ditto.
(WTR::AccessibilityUIElement::columnHeaders const): Ditto.
(WTR::AccessibilityUIElement::allAttributes): Updated since m_element
is a RetainPtr.
(WTR::AccessibilityUIElement::stringDescriptionOfAttributeValue): Ditto.
(WTR::AccessibilityUIElement::role): Ditto.
(WTR::AccessibilityUIElement::subrole): Ditto.
(WTR::AccessibilityUIElement::roleDescription): Ditto.
(WTR::AccessibilityUIElement::computedRoleString): Ditto.
(WTR::AccessibilityUIElement::title): Ditto.
(WTR::AccessibilityUIElement::description): Ditto.
(WTR::AccessibilityUIElement::orientation const): Ditto.
(WTR::AccessibilityUIElement::stringValue): Ditto.
(WTR::AccessibilityUIElement::language): Ditto.
(WTR::AccessibilityUIElement::helpText const): Ditto.
(WTR::AccessibilityUIElement::lineForIndex): Use @().
(WTR::AccessibilityUIElement::rangeForLine): Use @().
(WTR::AccessibilityUIElement::searchTextWithCriteria): Use
makeVector<RefPtr<AccessibilityTextMarkerRange>>.
(WTR::AccessibilityUIElement::attributesOfColumnHeaders): Ditto.
(WTR::AccessibilityUIElement::attributesOfRowHeaders): Ditto.
(WTR::AccessibilityUIElement::attributesOfColumns): Ditto.
(WTR::AccessibilityUIElement::attributesOfRows): Ditto.
(WTR::AccessibilityUIElement::attributesOfVisibleCells): Ditto.
(WTR::AccessibilityUIElement::cellForColumnAndRow): Use @[] and @().
(WTR::AccessibilityUIElement::setSelectedChild const): Use @[].
(WTR::AccessibilityUIElement::setSelectedChildAtIndex const): Use @[].
(WTR::AccessibilityUIElement::textMarkerRangeForMarkers): Use @[].
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveAllStorageAccessEntries): Take Vector&&.
(WTR::TestInvocation::didReceiveWebViewCategory): Take String&&.
* WebKitTestRunner/TestInvocation.h: Updated for the above.
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::cocoaPlatformInitialize): Use @{}and @().
(WTR::TestController::getAllStorageAccessEntries): Use makeVector<String>.
(WTR::TestController::loadedThirdPartyDomains): Use makeVector<String>.
(WTR::TestController::getWebViewCategory): Update to pass String&&.
(WTR::TestController::setAllowedMenuActions): Use createNSArray.
* WebKitTestRunner/ios/HIDEventGenerator.mm:
(-[HIDEventGenerator interpolatedEvents:]): Use @().
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::changeWindowScaleIfNeeded): Use @{} and @().
* WebKitTestRunner/mac/TestControllerMac.mm: Removed unneeded include.
* WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::UIScriptControllerMac::copyText): Use @[].
* WebKitTestRunner/mac/WebKitTestRunnerPasteboard.mm:
(-[WebKitTestRunnerPasteboard declareType:owner:]): Use @[].
Canonical link: https://commits.webkit.org/223199@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259843 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-10 02:11:30 +00:00
|
|
|
cocoa/VectorCocoa.h
|
2018-01-30 20:02:17 +00:00
|
|
|
|
|
|
|
darwin/WeakLinking.h
|
|
|
|
|
|
|
|
spi/cf/CFBundleSPI.h
|
|
|
|
spi/cf/CFStringSPI.h
|
|
|
|
|
2018-12-27 16:13:47 +00:00
|
|
|
spi/cocoa/CFXPCBridgeSPI.h
|
2019-11-05 19:36:12 +00:00
|
|
|
spi/cocoa/CrashReporterClientSPI.h
|
2019-07-25 03:42:09 +00:00
|
|
|
spi/cocoa/MachVMSPI.h
|
REGRESSION(r185816): In the Hong Kong locale, navigator.language reports it's in the Taiwan locale
https://bugs.webkit.org/show_bug.cgi?id=200043
Source/WTF:
<rdar://problem/44119496>
Reviewed by Dean Jackson.
We ask the system for the current locale using CFLocaleCopyPreferredLanguages(), and then round-trip
it through CFBundleGetLocalizationInfoForLocalization() / CFBundleCopyLocalizationForLocalizationInfo().
This was to work around the fact that CFLocaleCopyPreferredLanguages() previously didn't report BCP47
language codes. However, that round-tripping was introducing errors, such as "zh-Hant-HK" was getting
turned into "zh-Hant-TW" which is clearly wrong. The CFBundle functions were never supposed to be used
in this way.
Instead, we can use CFLocaleCreateCanonicalLanguageIdentifierFromString() which is intended to
canonicalize locale identifiers, and does return BCP47 language codes. However, this function preserves
more fingerprinting entropy than the old code path, so we pass the input through new NSLocale SPI to
minimize the entropy revealed.
* WTF.xcodeproj/project.pbxproj:
* wtf/Language.h:
* wtf/Platform.h:
* wtf/PlatformMac.cmake:
* wtf/cf/LanguageCF.cpp:
(WTF::httpStyleLanguageCode):
(WTF::platformUserPreferredLanguages):
* wtf/cocoa/LanguageCocoa.mm: Added.
(WTF::minimizedLanguagesFromLanguages):
* wtf/spi/cocoa/NSLocaleSPI.h: Added.
Tools:
Reviewed by Dean Jackson.
Migrate system language tests to LayoutTests, to match the rest of our system language tests.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/mac/NavigatorLanguage.mm: Removed.
LayoutTests:
<rdar://problem/44119496>
Reviewed by Dean Jackson.
Migrate and update tests from TestWebKitAPI to LayoutTests, to match the rest of our system language tests.
* platform/mac/TestExpectations: Mark these tests as possibly failing on older versions of macOS.
* fast/text/international/system-language/navigator-language/navigator-language-en-GB-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-en-GB.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-en-US-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-en-US.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-en-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-en.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-es-419-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-es-419.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-es-ES-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-es-ES.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-es-MX-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-es-MX.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-es-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-es.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-fr-CA-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-fr-CA.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-fr-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-fr.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-hi-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-hi.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-ja-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-ja.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-pt-BR-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-pt-BR.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-pt-PT-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-pt-PT.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-ru-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-ru.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-zh-HK-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-zh-HK.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-zh-Hans-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-zh-Hans.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-zh-Hant-HK-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-zh-Hant-HK.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-zh-Hant-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-zh-Hant.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-zh-TW-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-zh-TW.html: Added.
* js/dom/navigator-language-expected.txt:
Canonical link: https://commits.webkit.org/219222@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-11 03:05:30 +00:00
|
|
|
spi/cocoa/NSLocaleSPI.h
|
2018-01-30 20:02:17 +00:00
|
|
|
spi/cocoa/SecuritySPI.h
|
2018-08-08 02:39:12 +00:00
|
|
|
spi/cocoa/objcSPI.h
|
2018-01-30 20:02:17 +00:00
|
|
|
|
2019-06-05 21:11:39 +00:00
|
|
|
spi/darwin/DataVaultSPI.h
|
2020-03-03 05:14:21 +00:00
|
|
|
spi/darwin/OSVariantSPI.h
|
2019-10-01 06:29:13 +00:00
|
|
|
spi/darwin/ProcessMemoryFootprint.h
|
2018-01-30 20:02:17 +00:00
|
|
|
spi/darwin/SandboxSPI.h
|
|
|
|
spi/darwin/XPCSPI.h
|
|
|
|
spi/darwin/dyldSPI.h
|
|
|
|
|
2019-01-24 17:25:57 +00:00
|
|
|
spi/mac/MetadataSPI.h
|
|
|
|
|
Move CFStringRef and NSString support from StringBuilder into StringConcatenateCF
https://bugs.webkit.org/show_bug.cgi?id=225839
Reviewed by Sam Weinig.
Source/JavaScriptCore:
* inspector/ConsoleMessage.cpp:
(Inspector::ConsoleMessage::ConsoleMessage): Use StringBuilder::clear instead of
StringBuilder::resize; no advantage to the latter after calling StringBuilder::toString.
* runtime/JSONObject.cpp:
(JSC::Stringifier::Holder::appendNextProperty): Update for name change of
StringBuilder::resize to StringBuilder::shrink.
* runtime/TypeSet.cpp:
(JSC::StructureShape::stringRepresentation): Ditto.
Source/WebCore:
* Modules/airplay/WebMediaSessionManager.cpp:
(WebCore::mediaProducerStateString): Use StringBuilder exclusively instead of
mixing it with makeString. Also updated for StringBuilder::shrink name.
* html/HTMLTextFormControlElement.cpp:
(WebCore::stripTrailingNewline): Updated for StringBuilder::shrink name.
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::captionsTextColor const): Tweaked
coding style a bit.
(WebCore::appendCSS): Use variadic StringBuilder::append instead of many
separate calls.
(WebCore::CaptionUserPreferencesMediaAF::captionsDefaultFontCSS const):
Tweaked coding style a bit, and use variadic StrinBuilder::append calls
to reduce the number of calls and streamline the code.
(WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride const):
Ditto. Also removed unnecessary checks that strings are empty before appending.
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText):
Updated for StringBuilder::shrink name.
* platform/LayoutUnit.h: Updated for saturatedSum/Difference names.
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::cookiesForSession const): Tweaked codin
style a bit, and use variadic StrinBuilder::append calls to reduce the
number of calls and streamline the code.
* rendering/RenderCounter.cpp:
(WebCore::planCounter): Updated for saturatedSum name.
* style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyValueCounter): Ditto.
* svg/SVGPathStringBuilder.cpp:
(WebCore::SVGPathStringBuilder::result): Updated for StringBuilder::shrink name.
* testing/Internals.cpp:
(WebCore::Internals::pageMediaState): Ditto.
* xml/XSLTProcessorLibxslt.cpp:
(WebCore::saveResultToString): Ditto.
Source/WebKit:
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::platformSetNetworkParameters): Use makeString instead
of StringBuilder.
Source/WTF:
The new header makes CFStringRef and NSString work with string concatenation,
which means it now works with the variadic StringBuilder::append and makeString,
and still works with the single-argument StringBuilder::append. More efficient
that the old version because it does not allocate a temporary WTF::String for
the 16-bit character path.
Also made many other small improvements to the StringBuilder implementation.
* WTF.xcodeproj/project.pbxproj: Added StringConcatenateCF.h.
* wtf/CheckedArithmetic.h: Removed ConditionalCrashOnOverflow, which was only
here for use by StringBuilder, which does not use CheckedArithmetic any more.
* wtf/PlatformFTW.cmake: Added StringConcatenateCF.h..
* wtf/PlatformMac.cmake: Ditto.
* wtf/PlatformWin.cmake: Ditto.
* wtf/SaturatedArithmetic.h: Moved the contents of this file inside the
WTF namespace.
(WTF::signedAddInt32Overflows): Renamed this function. The type here is
important, and we are not doing anything to prevent type conversion or
create ambiguity, so it's good to be explicit in the function name.
(WTF::saturatedSum<int32_t>): Renamed this from saturatedAddition for
clarity. The function returns a sum, so that's a better name than calling
it "addition". Also, it's clearer to be explicit about the return type.
(WTF::signedSubtractInt32Overflows): Renamed. Same reason as above.
(WTF::saturatedDifference<int32_t>): Ditto.
(WTF::saturatedSum): Added. Does unsigned integer saturated addition.
This one can be written in a portable manner and still get really
efficient code on at least Intel and ARM64.
(WTF::saturatedSum): Added a function template that lets callers pass
larger number of arguments to saturatedSum, rather than exactly two.
* wtf/text/StringBuilder.cpp:
(WTF::expandedCapacity): Renamed to use the term capacity rather than
length for the new required capacity.
(WTF::StringBuilder::didOverflow): Implement the new approach to
overflow, meaning we need to write the CRASH() here explicitly and
in the non-crashing mode, set m_length.
(WTF::StringBuilder::reifyString const): Changed the overflow check
into a RELEASE_ASSERT. This is now responsible for doing the check that
callers were doing earlier, so we want it in production builds. Also
simplified this since our m_length member is a simple integer now,
and removed the unused m_isReified.
(WTF::StringBuilder::shrink): Renamed this to shrink to match the
Vector::shrink function, since this has never supported making the
builder larger. Removed unnecessary overflow checks, since shrinking
cannot cause overflow.
(WTF::StringBuilder::allocateBuffer): Replaced two separate functions
with a single simpler function template. Removed extra overflow checks
because the StringImpl::tryCreateUninitialized function already does
the only overflow check we need. Also move to StringImpl::copyCharacters
for copying characters rather than using std::memcpy directly.
Removed code to set m_is8Bit and m_bufferCharacters.
(WTF::StringBuilder::reallocateBuffer): Replaced two separate
functions with a function template and a cover that calls the
appropriate instance of the template for places where we aren't
already in character-type-specific code paths. This version now
supports allocating a buffer for the first time in cases where
we have m_string and not m_buffer, which used to be handled at
the higher level. Removed code to set m_bufferCharacters.
(WTF::StringBuilder::reserveCapacity): Rewrote for simplicity.
By relying on the overflow checking inside reallocateBuffer and
allocateBuffer we no longer need checking of the passed-in value
at this level.
(WTF::StringBuilder::extendBufferForAppending): Removed the
version of this that takes additionalLength since it's
potentially confusing to have a family of functions that have the
same name and take the same type of argument, but interpret it
subtly differently. Streamlined the code using std::exchange.
This function now also includes the logic from the function named
extendBufferForAppendingWithoutOverflowCheck, which was subtly
misnamed since that was not the only semantic difference. Also
removed the ALWAYS_INLINE because the compiler will do the right
thing without such heavy handed advice.
(WTF::StringBuilder::extendBufferForAppendingSlowCase): Streamlined
this by using std::exchange and removed additional overflow checks
at this level since reallocateBuffer already does them. Also added
a check for the case where the new total length is 0, which would
not be handled correctly and efficiently by reallocateBuffer.
(WTF::StringBuilder::extendBufferForAppendingLChar): Renamed this
from extendBufferForAppending8, since it's now identical to calling
extendBufferForAppending<LChar>, except for inlining and linkage.
(WTF::StringBuilder::extendBufferForAppendingWithUpconvert):
Renamed this from extendBufferForAppending16. It is different from
the other extendBuffer functions because is supports upconverting
from LChar to UChar. Like the others it relies on allocateBuffer
for the overflow checking.
(WTF::StringBuilder::appendCharacters): Removed an unnecessary
assertion that the characters pointer is non-null; that will fail
in an obvious way without an assertion. Simplified the logic and
removed some invariant assertions that don't help us much. Changed
overflow checking by using saturatedSum to compute the new length.
In overflow cases, the new sum will be larger than the maximum
string length, but will fit in an unsigned, so we can pass it
down to lower levels and let functions like reallocateBuffer do
the actual overflow checking. Also use StringImpl::copyCharacters.
(WTF::StringBuilder::append): Removed the CFStringRef overload.
(WTF::StringBuilder::shouldShrinkToFit const): Rename this from
canShrink. Simplify the function a bit and remove the vague FIXME
that says "this should be tuned". That may be so, but the FIXME
is not really driving us to action.
(WTF::StringBuilder::shrinkToFit): Simplify by using the new
reallocateBuffer and std::exchange. Removed unneeded assertion
about overflow that doesn't help us maintain the invariant.
(WTF::StringBuilder::isAllASCII const): Was tempted to remove
this function, but for now just made it use the StringView
version for brevity.
* wtf/text/StringBuilder.h: Removed many unneeded includes, and
notably included SaturatedArithmetic.h instead of
CheckedArithmetic.h because we now use the former instead of the
latter. Changed the overflow checking implementation to work
more simply based on saturated addition rather than Checked.
This allowed us to get rid of dependency on our own unique mode
for Checked, called ConditionalCrashOnOverflow. Removed a
comment about making a templatized version of StringBuilder.
We can do it if we like, but does not seem urgent. Moved
fucntion bodies out of the class definition so it's easier to
see what's going on in the class. Since m_length is now an
ordinary integer, the check for overflowed simply checks to see
if the length is larger than the maximum string length. When we
encounter overflow that is not about length computation, we set
the length to the maximum integer to indicate the failure.
Deleted the append overloads for CFStringRef and NSString.
Removed m_bufferCharacters, m_is8Bit, and m_isReified.
(WTF::StringBuilder::StringBuilder): Simplified the constructor
since we only have to initialize the m_shouldCrashOnOverflow member.
(WTF::StringBuilder::clear): Fixed a mistake where this was not
resetting the m_isReified flag.
(WTF::StringBuilder::swap): Updated for changes in the data members.
(WTF::StringBuilder::operator StringView const): Moved out of line.
Made sure to call the length() function so we crash if this is
called after overflow.
(WTF::StringBuilder::append): Remove some of the unnecessary checks
and special cases in the various versions of append. Most of the
checking is done inside appendCharacters, with only a few exceptions.
(WTF::StringBuilder::appendSubstring): Moved out of the class
definition without making significant changes.
(WTF::StringBuilder::appendCharacter): Ditto.
(WTF::StringBuilder::toString): Greatly simplified this function
by relying on overflow checking in the reifyString function instead
of doing it here and removing unneeded invariant assertions.
(WTF::StringBuilder::toStringPreserveCapacity const): Ditto.
(WTF::StringBuilder::toAtomString const): Rewrote this to streamline,
removing explicit overflow checks.
(WTF::StringBuilder::length const): Moved out of the class
definition without making significant changes.
(WTF::StringBuilder::capacity const): Ditto.
(WTF::StringBuilder::operator[] const): Ditto.
(WTF::StringBuilder::characters const): Implemented this operation
in the function template. Now rather than having this call the
characters8 and characters16 functions, they can call it.
(WTF::StringBuilder::getBufferCharacters<LChar>): Deleted.
(WTF::StringBuilder::getBufferCharacters<UChar>): Deleted.
(WTF::StringBuilder::appendFromAdapters): Use saturatedSum to
compute the required length, which allows the extendBuffer
functions to do overflow checking without having to take special
checked integer types for arguments.
(WTF::StringBuilder::equal): Implement using StringView.
* wtf/text/StringBuilderJSON.cpp:
(WTF::StringBuilder::appendQuotedJSONString): Simplified the checked
arithmetic for computing the required capacity. Updated since we
removed m_bufferCharacters and changed the type of m_length.
* wtf/text/cf/StringConcatenateCF.h: Added. Specializes StringTypeAdapter for
both CFStringRef and NSString *. If CFStringGetCStringPtr works for Latin-1, then
does the 8-bit code path, otherwise the 16-bit.
* wtf/text/cocoa/TextStreamCocoa.mm: Include StringConcatenateCF.h, since it's
now needed to use CFStringRef with StringBuilder.
Tools:
* TestWebKitAPI/Tests/WTF/SaturatedArithmeticOperations.cpp: Updated
tests for changes to SaturatedArithmetic.h.
* TestWebKitAPI/Tests/WTF/StringBuilder.cpp: Updated tests for changes
to StringBuilder.
* TestWebKitAPI/Tests/WebKit/GetUserMedia.mm:
(TestWebKitAPI::wkMediaCaptureStateString): Ditto.
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
Added include of StringConcatenateCF.h.
Added StringTypeAdapter for WKStringRef.
(WTR::styleDecToStr): Use ASCIILiteral instead of StringBuilder.
(WTR::string): Removed unneeded toWTFString since the WKStringRef
StringTypeAdapter takes care of it.
(WTR::string): Renamed from frameToStr. Use makeString.
(WTR::dumpResourceURL): Use append instead of appendLiteral.
(WTR::dumpFrameDescriptionSuitableForTestResult): Deleted.
(WTR::dumpLoadEvent): Use makeString.
(WTR::string): Renamed from a longer name. Return a String
instead of building in a StringBuilder. Use makeString.
(WTR::string): Ditto.
(WTR::dumpErrorDescriptionSuitableForTestResult): Removed
unneeded toWTFString.
(WTR::dumpFrameScrollPosition): Ditto.
(WTR::dumpDescendantFramesText): Ditto.
(WTR::InjectedBundlePage::dumpDOMAsWebArchive): Removed an
unneeded local variable.
(WTR::InjectedBundlePage::dump): Removed unneeded toWTFString.
(WTR::InjectedBundlePage::didReceiveTitleForFrame): Ditto.
(WTR::InjectedBundlePage::didFinishDocumentLoadForFrame):
Updated for functon name change.
(WTR::InjectedBundlePage::willSendRequestForFrame): Ditto.
Also use variadic append. Also use makeString.
(WTR::InjectedBundlePage::didReceiveResponseForResource): Ditto.
(WTR::InjectedBundlePage::didFinishLoadForResource): Ditto.
(WTR::InjectedBundlePage::didFailLoadForResource): Ditto.
(WTR::InjectedBundlePage::decidePolicyForNavigationAction): Ditto.
(WTR::InjectedBundlePage::decidePolicyForResponse): Ditto.
(WTR::InjectedBundlePage::willAddMessageToConsole): Ditto.
(WTR::InjectedBundlePage::willSetStatusbarText): Ditto.
(WTR::InjectedBundlePage::willRunJavaScriptPrompt): Ditto.
(WTR::InjectedBundlePage::didExceedDatabaseQuota): Ditto.
(WTR::InjectedBundlePage::shouldInsertNode): Ditto.
(WTR::InjectedBundlePage::shouldInsertText): Ditto.
(WTR::InjectedBundlePage::shouldDeleteRange): Ditto.
(WTR::InjectedBundlePage::shouldChangeSelectedRange): Ditto.
(WTR::InjectedBundlePage::shouldApplyStyle): Ditto.
(WTR::InjectedBundlePage::didBeginEditing): Ditto.
(WTR::InjectedBundlePage::didEndEditing): Ditto.
(WTR::InjectedBundlePage::didChange): Ditto.
(WTR::InjectedBundlePage::didChangeSelection): Ditto.
(WTR::InjectedBundlePage::dumpHistory): Ditto.
Canonical link: https://commits.webkit.org/237916@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277744 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-19 19:37:21 +00:00
|
|
|
text/cf/StringConcatenateCF.h
|
2018-01-30 20:02:17 +00:00
|
|
|
text/cf/TextBreakIteratorCF.h
|
|
|
|
)
|
|
|
|
|
2014-08-05 00:30:15 +00:00
|
|
|
list(APPEND WTF_SOURCES
|
WTF should know about Language
https://bugs.webkit.org/show_bug.cgi?id=157756
Source/JavaScriptCore:
Reviewed by Geoffrey Garen.
Teach our scripts that a ObjC class beginning with WTF is totally cool.
* JavaScriptCore.xcodeproj/project.pbxproj:
Source/WebCore:
Reviewed by Geoffrey Garen.
No new tests because this does not change behavior.
This change is all about moving some language functionality to WTF. Quoting the WTF
ChangeLog, this contains two changes:
- Move everything that WebCore's logic for getting the platform user preferred language
depended on into WTF. This means CFBundleSPI.h and BlockObjCExceptions.h|cpp.
- Move WebCore::platformUserPreferredLanguages() to WTF::platformUserPreferredLanguages().
This is needed by https://bugs.webkit.org/show_bug.cgi?id=157755, which will make JSC
use this to detect the platform user preferred language when running standalone.
The changes in WebCore are mostly about rewiring #includes and #imports and removing the
code that we moved to WTF. But there is one logic change: previously,
platformUserPreferredLanguages() would call WebCore::languageDidChange(). It can't do that
directly anymore, but WTF gives WebCore some API for registering the callback. So in
Language.cpp we now register languageDidChange anytime we do something that would
necessitate it, like calling platformUserPreferredLanguages(). This also registers the
callback inside addLanguageChangeObserver(), since it's possible for that to be called
after JSC had called platformUserPreferredLanguages() but before WebCore does so.
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformWin.cmake:
* WebCore.xcodeproj/project.pbxproj:
* bindings/objc/DOMCustomXPathNSResolver.mm:
* editing/ios/EditorIOS.mm:
* editing/mac/DictionaryLookup.mm:
* editing/mac/EditorMac.mm:
* page/CaptionUserPreferencesMediaAF.cpp:
* page/ios/EventHandlerIOS.mm:
* page/ios/FrameIOS.mm:
* page/mac/ChromeMac.mm:
* page/mac/EventHandlerMac.mm:
* platform/Language.cpp:
(WebCore::registerLanguageDidChangeCallbackIfNecessary):
(WebCore::observerMap):
(WebCore::addLanguageChangeObserver):
(WebCore::overrideUserPreferredLanguages):
(WebCore::userPreferredLanguages):
* platform/Language.h:
* platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
* platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
* platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
* platform/graphics/cocoa/FontCocoa.mm:
* platform/graphics/mac/ColorMac.mm:
* platform/graphics/mac/GraphicsContext3DMac.mm:
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
* platform/ios/PlatformSpeechSynthesizerIOS.mm:
* platform/ios/ScrollViewIOS.mm:
* platform/ios/WidgetIOS.mm:
* platform/mac/BlockExceptions.h: Removed.
* platform/mac/BlockExceptions.mm: Removed.
* platform/mac/CursorMac.mm:
* platform/mac/Language.mm: Removed.
* platform/mac/ScrollAnimatorMac.mm:
* platform/mac/ScrollViewMac.mm:
* platform/mac/ScrollbarThemeMac.mm:
* platform/mac/ThemeMac.mm:
* platform/mac/WidgetMac.mm:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
* platform/network/mac/CookieJarMac.mm:
* platform/network/mac/ResourceErrorMac.mm:
* platform/network/mac/ResourceHandleMac.mm:
* platform/spi/cf/CFBundleSPI.h: Removed.
* platform/unix/LanguageUnix.cpp: Removed.
* platform/win/LanguageWin.cpp: Removed.
Source/WebKit/mac:
Reviewed by Geoffrey Garen.
Rewires a bunch of includes/imports.
* WebCoreSupport/PopupMenuMac.mm:
* WebCoreSupport/WebChromeClient.mm:
* WebCoreSupport/WebFrameLoaderClient.mm:
* WebCoreSupport/WebGeolocationClient.mm:
* WebCoreSupport/WebNotificationClient.mm:
* WebCoreSupport/WebPlatformStrategies.mm:
* WebCoreSupport/WebUserMediaClient.mm:
* WebCoreSupport/WebVisitedLinkStore.mm:
* WebView/WebHTMLView.mm:
Source/WebKit2:
Reviewed by Geoffrey Garen and Alexey Proskuryakov.
Rewires a bunch of includes/imports.
* Shared/mac/RemoteLayerTreePropertyApplier.mm:
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
* WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
Source/WTF:
Reviewed by Geoffrey Garen.
This contains two changes:
- Move everything that WebCore's logic for getting the platform user preferred language
depended on into WTF. This means CFBundleSPI.h and BlockObjCExceptions.h|cpp.
- Move WebCore::platformUserPreferredLanguages() to WTF::platformUserPreferredLanguages().
This is needed by https://bugs.webkit.org/show_bug.cgi?id=157755, which will make JSC
use this to detect the platform user preferred language when running standalone.
Moving the dependencies accounts for a huge chunk of this change, since we have to rewire
all of the references to those headers in all of WebKit.
Moving platformUserPreferredLanguages() is mostly easy except for the weird callback.
That function would call languageDidChange(), which needs to stay in WebCore. So, this
gives WebCore the ability to register a languageDidChange callback. Other than this new
logic, the code being added to WTF is just being lifted out of WebCore.
* WTF.xcodeproj/project.pbxproj:
* wtf/BlockObjCExceptions.h: Added.
* wtf/BlockObjCExceptions.mm: Added.
(ReportBlockedObjCException):
* wtf/PlatformEfl.cmake:
* wtf/PlatformGTK.cmake:
* wtf/PlatformJSCOnly.cmake:
* wtf/PlatformMac.cmake:
* wtf/PlatformUserPreferredLanguages.h: Added.
* wtf/PlatformUserPreferredLanguagesMac.mm: Added.
(WTF::setPlatformUserPreferredLanguagesChangedCallback):
(WTF::preferredLanguages):
(+[WTFLanguageChangeObserver languagePreferencesDidChange:]):
(WTF::httpStyleLanguageCode):
(WTF::isValidICUCountryCode):
(WTF::platformUserPreferredLanguages):
* wtf/PlatformUserPreferredLanguagesUnix.cpp: Added.
(WTF::setPlatformUserPreferredLanguagesChangedCallback):
(WTF::platformLanguage):
(WTF::platformUserPreferredLanguages):
* wtf/PlatformUserPreferredLanguagesWin.cpp: Added.
(WTF::setPlatformUserPreferredLanguagesChangedCallback):
(WTF::localeInfo):
(WTF::platformLanguage):
(WTF::platformUserPreferredLanguages):
* wtf/PlatformWin.cmake:
* wtf/spi/cf: Added.
* wtf/spi/cf/CFBundleSPI.h: Added.
Canonical link: https://commits.webkit.org/175929@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201038 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-17 19:38:51 +00:00
|
|
|
BlockObjCExceptions.mm
|
2021-04-06 03:19:14 +00:00
|
|
|
TranslatedProcess.cpp
|
2015-03-26 22:53:46 +00:00
|
|
|
|
2018-12-01 03:28:36 +00:00
|
|
|
cf/CFURLExtras.cpp
|
2019-01-24 17:25:57 +00:00
|
|
|
cf/FileSystemCF.cpp
|
2017-09-07 23:11:21 +00:00
|
|
|
cf/LanguageCF.cpp
|
2015-03-26 22:53:46 +00:00
|
|
|
cf/RunLoopCF.cpp
|
2019-01-29 04:00:08 +00:00
|
|
|
cf/SchedulePairCF.cpp
|
2018-12-01 03:28:36 +00:00
|
|
|
cf/URLCF.cpp
|
2015-03-26 22:53:46 +00:00
|
|
|
|
2018-06-30 00:23:43 +00:00
|
|
|
cocoa/AutodrainedPool.cpp
|
|
|
|
cocoa/CPUTimeCocoa.cpp
|
2019-11-05 19:36:12 +00:00
|
|
|
cocoa/CrashReporter.cpp
|
2018-12-27 16:13:47 +00:00
|
|
|
cocoa/Entitlements.mm
|
2019-01-24 17:25:57 +00:00
|
|
|
cocoa/FileSystemCocoa.mm
|
REGRESSION(r185816): In the Hong Kong locale, navigator.language reports it's in the Taiwan locale
https://bugs.webkit.org/show_bug.cgi?id=200043
Source/WTF:
<rdar://problem/44119496>
Reviewed by Dean Jackson.
We ask the system for the current locale using CFLocaleCopyPreferredLanguages(), and then round-trip
it through CFBundleGetLocalizationInfoForLocalization() / CFBundleCopyLocalizationForLocalizationInfo().
This was to work around the fact that CFLocaleCopyPreferredLanguages() previously didn't report BCP47
language codes. However, that round-tripping was introducing errors, such as "zh-Hant-HK" was getting
turned into "zh-Hant-TW" which is clearly wrong. The CFBundle functions were never supposed to be used
in this way.
Instead, we can use CFLocaleCreateCanonicalLanguageIdentifierFromString() which is intended to
canonicalize locale identifiers, and does return BCP47 language codes. However, this function preserves
more fingerprinting entropy than the old code path, so we pass the input through new NSLocale SPI to
minimize the entropy revealed.
* WTF.xcodeproj/project.pbxproj:
* wtf/Language.h:
* wtf/Platform.h:
* wtf/PlatformMac.cmake:
* wtf/cf/LanguageCF.cpp:
(WTF::httpStyleLanguageCode):
(WTF::platformUserPreferredLanguages):
* wtf/cocoa/LanguageCocoa.mm: Added.
(WTF::minimizedLanguagesFromLanguages):
* wtf/spi/cocoa/NSLocaleSPI.h: Added.
Tools:
Reviewed by Dean Jackson.
Migrate system language tests to LayoutTests, to match the rest of our system language tests.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/mac/NavigatorLanguage.mm: Removed.
LayoutTests:
<rdar://problem/44119496>
Reviewed by Dean Jackson.
Migrate and update tests from TestWebKitAPI to LayoutTests, to match the rest of our system language tests.
* platform/mac/TestExpectations: Mark these tests as possibly failing on older versions of macOS.
* fast/text/international/system-language/navigator-language/navigator-language-en-GB-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-en-GB.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-en-US-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-en-US.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-en-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-en.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-es-419-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-es-419.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-es-ES-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-es-ES.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-es-MX-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-es-MX.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-es-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-es.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-fr-CA-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-fr-CA.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-fr-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-fr.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-hi-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-hi.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-ja-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-ja.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-pt-BR-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-pt-BR.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-pt-PT-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-pt-PT.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-ru-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-ru.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-zh-HK-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-zh-HK.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-zh-Hans-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-zh-Hans.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-zh-Hant-HK-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-zh-Hant-HK.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-zh-Hant-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-zh-Hant.html: Added.
* fast/text/international/system-language/navigator-language/navigator-language-zh-TW-expected.txt: Added.
* fast/text/international/system-language/navigator-language/navigator-language-zh-TW.html: Added.
* js/dom/navigator-language-expected.txt:
Canonical link: https://commits.webkit.org/219222@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-11 03:05:30 +00:00
|
|
|
cocoa/LanguageCocoa.mm
|
2021-08-09 21:14:53 +00:00
|
|
|
cocoa/LoggingCocoa.mm
|
2018-04-04 19:43:01 +00:00
|
|
|
cocoa/MachSendRight.cpp
|
2018-09-28 22:32:34 +00:00
|
|
|
cocoa/MainThreadCocoa.mm
|
2017-05-12 05:21:41 +00:00
|
|
|
cocoa/MemoryFootprintCocoa.cpp
|
2017-03-01 09:38:44 +00:00
|
|
|
cocoa/MemoryPressureHandlerCocoa.mm
|
2018-12-01 03:28:36 +00:00
|
|
|
cocoa/NSURLExtras.mm
|
2019-07-25 03:42:09 +00:00
|
|
|
cocoa/ResourceUsageCocoa.cpp
|
2020-03-13 23:33:33 +00:00
|
|
|
cocoa/RuntimeApplicationChecksCocoa.cpp
|
2020-03-03 05:14:21 +00:00
|
|
|
cocoa/SystemTracingCocoa.cpp
|
2018-12-01 03:28:36 +00:00
|
|
|
cocoa/URLCocoa.mm
|
2015-03-26 22:53:46 +00:00
|
|
|
cocoa/WorkQueueCocoa.cpp
|
|
|
|
|
2019-01-24 17:25:57 +00:00
|
|
|
mac/FileSystemMac.mm
|
2019-01-29 04:00:08 +00:00
|
|
|
mac/SchedulePairMac.mm
|
2019-01-24 17:25:57 +00:00
|
|
|
|
|
|
|
posix/FileSystemPOSIX.cpp
|
2019-01-29 04:00:08 +00:00
|
|
|
posix/OSAllocatorPOSIX.cpp
|
|
|
|
posix/ThreadingPOSIX.cpp
|
2014-08-05 00:30:15 +00:00
|
|
|
|
2019-06-17 01:48:13 +00:00
|
|
|
text/cf/AtomStringImplCF.cpp
|
2014-08-05 00:30:15 +00:00
|
|
|
text/cf/StringCF.cpp
|
|
|
|
text/cf/StringImplCF.cpp
|
|
|
|
text/cf/StringViewCF.cpp
|
|
|
|
|
2018-08-29 19:24:39 +00:00
|
|
|
text/cocoa/StringCocoa.mm
|
2018-06-30 00:23:43 +00:00
|
|
|
text/cocoa/StringImplCocoa.mm
|
|
|
|
text/cocoa/StringViewCocoa.mm
|
2018-08-29 19:24:39 +00:00
|
|
|
text/cocoa/TextBreakIteratorInternalICUCocoa.cpp
|
2014-08-05 00:30:15 +00:00
|
|
|
)
|
2015-04-01 18:36:43 +00:00
|
|
|
|
2019-04-09 19:32:08 +00:00
|
|
|
file(COPY mac/MachExceptions.defs DESTINATION ${WTF_DERIVED_SOURCES_DIR})
|
2017-06-17 01:10:42 +00:00
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT
|
2019-04-09 19:32:08 +00:00
|
|
|
${WTF_DERIVED_SOURCES_DIR}/MachExceptionsServer.h
|
|
|
|
${WTF_DERIVED_SOURCES_DIR}/mach_exc.h
|
|
|
|
${WTF_DERIVED_SOURCES_DIR}/mach_excServer.c
|
|
|
|
${WTF_DERIVED_SOURCES_DIR}/mach_excUser.c
|
2017-06-17 01:10:42 +00:00
|
|
|
MAIN_DEPENDENCY mac/MachExceptions.defs
|
2019-04-09 19:32:08 +00:00
|
|
|
WORKING_DIRECTORY ${WTF_DERIVED_SOURCES_DIR}
|
2017-06-17 01:10:42 +00:00
|
|
|
COMMAND mig -sheader MachExceptionsServer.h MachExceptions.defs
|
|
|
|
VERBATIM)
|
|
|
|
list(APPEND WTF_SOURCES
|
2019-04-09 19:32:08 +00:00
|
|
|
${WTF_DERIVED_SOURCES_DIR}/mach_excServer.c
|
|
|
|
${WTF_DERIVED_SOURCES_DIR}/mach_excUser.c
|
2017-06-17 01:10:42 +00:00
|
|
|
)
|