Title: [269869] trunk/Source
Revision
269869
Author
[email protected]
Date
2020-11-16 12:14:05 -0800 (Mon, 16 Nov 2020)

Log Message

Ignore deprecation warnings for the uniform types C API
https://bugs.webkit.org/show_bug.cgi?id=218989

Reviewed by Tim Horton.

These should eventually be replaced with the ObjC API `UniformTypeIdentifiers.framework`.
See <https://developer.apple.com/documentation/uniformtypeidentifiers>.

Source/WebCore:

* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::mimeTypeFromContentType):
(WebCore::attachmentForFilePath):
* editing/mac/EditorMac.mm:
(WebCore::Editor::dataSelectionForPasteboard):
* fileapi/FileCocoa.mm:
(WebCore::File::shouldReplaceFile):
* page/mac/DragControllerMac.mm:
(WebCore::DragController::updateSupportedTypeIdentifiersForDragHandlingMethod const):
* platform/cocoa/DragDataCocoa.mm:
(WebCore::rtfPasteboardType):
(WebCore::rtfdPasteboardType):
(WebCore::stringPasteboardType):
(WebCore::urlPasteboardType):
(WebCore::htmlPasteboardType):
(WebCore::pdfPasteboardType):
(WebCore::tiffPasteboardType):
(WebCore::DragData::containsCompatibleContent const):
* platform/cocoa/MIMETypeRegistryCocoa.mm:
(WebCore::extensionsForMIMETypeMap):
* platform/cocoa/PasteboardCocoa.mm:
(WebCore::cocoaTypeToImageType):
(WebCore::Pasteboard::fileContentState):
* platform/cocoa/PlatformPasteboardCocoa.mm:
(WebCore::PlatformPasteboard::urlStringSuitableForLoading):
* platform/graphics/cg/ImageBufferUtilitiesCG.cpp:
(WebCore::jpegUTI):
(WebCore::utiFromImageBufferMIMEType):
* platform/graphics/cg/ImageSourceCGMac.mm:
(WebCore::preferredExtensionForImageType):
* platform/graphics/mac/ImageMac.mm:
(WebCore::BitmapImage::tiffRepresentation):
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::writePlainText):
(WebCore::Pasteboard::read):
(WebCore::supportedImageTypes):
(WebCore::isTypeAllowedByReadingPolicy):
(WebCore::Pasteboard::readPasteboardWebContentDataForType):
(WebCore::readURLAlongsideAttachmentIfNecessary):
(WebCore::prefersAttachmentRepresentation):
(WebCore::Pasteboard::supportedWebContentPasteboardTypes):
(WebCore::Pasteboard::supportedFileUploadPasteboardTypes):
(WebCore::utiTypeFromCocoaType):
(WebCore::Pasteboard::readPlatformValuesAsStrings):
(WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::safeTypeForDOMToReadAndWriteForPlatformType):
(WebCore::webSafeTypes):
(WebCore::PlatformPasteboard::informationForItemAtIndex):
(WebCore::PlatformPasteboard::stringForType const):
(WebCore::PlatformPasteboard::platformPasteboardTypeForSafeTypeForDOMToReadAndWrite):
(WebCore::addRepresentationsForPlainText):
(WebCore::PlatformPasteboard::allowReadingURLAtIndex const):
(WebCore::PlatformPasteboard::write):
(WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
(WebCore::createItemProviderRegistrationList):
(WebCore::PlatformPasteboard::readString const):
(WebCore::PlatformPasteboard::readURL const):
(WebCore::PlatformPasteboard::containsURLStringSuitableForLoading):
* platform/ios/WebItemProviderPasteboard.mm:
(typeConformsToTypes):
(-[NSItemProvider web_containsFileURLAndFileUploadContent]):
(-[NSItemProvider web_fileUploadContentTypes]):
(-[WebItemProviderPasteboard _preLoadedDataConformingToType:forItemProviderAtIndex:]):
(classForTypeIdentifier):
(linkTemporaryItemProviderFilesToDropStagingDirectory):
(-[WebItemProviderPasteboard typeIdentifiersToLoad:]):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::write):
(WebCore::Pasteboard::read):
(WebCore::cocoaTypeFromHTMLClipboardType):
(WebCore::utiTypeFromCocoaType):
(WebCore::Pasteboard::writeString):
* platform/mac/PasteboardWriter.mm:
(WebCore::toUTI):
(WebCore::toUTIUnlessAlreadyUTI):
(WebCore::createPasteboardWriter):
* platform/mac/PlatformPasteboardMac.mm:
(WebCore::canWritePasteboardType):
(WebCore::urlStringsFromPasteboard):
(WebCore::typeIdentifierForPasteboardType):
(WebCore::PlatformPasteboard::allStringsForType const):
(WebCore::safeTypeForDOMToReadAndWriteForPlatformType):
(WebCore::PlatformPasteboard::setStringForType):
* platform/network/ios/WebCoreURLResponseIOS.mm:
(WebCore::adjustMIMETypeIfNecessary):
* platform/network/mac/UTIUtilities.mm:
(WebCore::MIMETypeFromUTI):
(WebCore::MIMETypeFromUTITree):
(WebCore::UTIFromMIMETypeCachePolicy::createValueForKey):
(WebCore::isDeclaredUTI):
(WebCore::UTIFromTag):
* platform/network/mac/WebCoreURLResponse.mm:
(WebCore::adjustMIMETypeIfNecessary):
* rendering/RenderThemeMac.mm:
(WebCore::iconForAttachment):

Source/WebKit:

* Shared/ios/WebIconUtilities.mm:
(WebKit::iconForFile):
* Shared/mac/PasteboardTypes.mm:
(WebKit::PasteboardTypes::forEditing):
(WebKit::PasteboardTypes::forSelection):
* UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
(API::isDeclaredOrDynamicTypeIdentifier):
(API::Attachment::mimeType const):
(API::Attachment::utiType const):
(API::Attachment::setFileWrapperAndUpdateContentType):
* UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm:
(WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::setPromisedDataForImage):
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _commonInitializationWithProcessPool:configuration:]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView supportedPasteboardTypesForCurrentSelection]):
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView actionSheetAssistant:performAction:]):
* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel currentAvailableActionTitles]):
(-[WKFileUploadPanel contextMenuInteraction:configurationForMenuAtLocation:]):
(-[WKFileUploadPanel showFilePickerMenu]):
(-[WKFileUploadPanel showDocumentPickerMenu]):
(-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::setupServicesMenu):

Source/WebKitLegacy/mac:

* WebView/WebHTMLView.mm:
(-[WebHTMLView _documentFragmentFromPasteboard:inContext:allowPlainText:]):
(+[WebHTMLView _insertablePasteboardTypes]):
(-[WebHTMLView _documentFragmentFromPasteboard:forType:inContext:subresources:]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (269868 => 269869)


--- trunk/Source/WebCore/ChangeLog	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebCore/ChangeLog	2020-11-16 20:14:05 UTC (rev 269869)
@@ -1,3 +1,110 @@
+2020-11-16  Devin Rousso  <[email protected]>
+
+        Ignore deprecation warnings for the uniform types C API
+        https://bugs.webkit.org/show_bug.cgi?id=218989
+
+        Reviewed by Tim Horton.
+
+        These should eventually be replaced with the ObjC API `UniformTypeIdentifiers.framework`.
+        See <https://developer.apple.com/documentation/uniformtypeidentifiers>.
+
+        * editing/cocoa/WebContentReaderCocoa.mm:
+        (WebCore::mimeTypeFromContentType):
+        (WebCore::attachmentForFilePath):
+        * editing/mac/EditorMac.mm:
+        (WebCore::Editor::dataSelectionForPasteboard):
+        * fileapi/FileCocoa.mm:
+        (WebCore::File::shouldReplaceFile):
+        * page/mac/DragControllerMac.mm:
+        (WebCore::DragController::updateSupportedTypeIdentifiersForDragHandlingMethod const):
+        * platform/cocoa/DragDataCocoa.mm:
+        (WebCore::rtfPasteboardType):
+        (WebCore::rtfdPasteboardType):
+        (WebCore::stringPasteboardType):
+        (WebCore::urlPasteboardType):
+        (WebCore::htmlPasteboardType):
+        (WebCore::pdfPasteboardType):
+        (WebCore::tiffPasteboardType):
+        (WebCore::DragData::containsCompatibleContent const):
+        * platform/cocoa/MIMETypeRegistryCocoa.mm:
+        (WebCore::extensionsForMIMETypeMap):
+        * platform/cocoa/PasteboardCocoa.mm:
+        (WebCore::cocoaTypeToImageType):
+        (WebCore::Pasteboard::fileContentState):
+        * platform/cocoa/PlatformPasteboardCocoa.mm:
+        (WebCore::PlatformPasteboard::urlStringSuitableForLoading):
+        * platform/graphics/cg/ImageBufferUtilitiesCG.cpp:
+        (WebCore::jpegUTI):
+        (WebCore::utiFromImageBufferMIMEType):
+        * platform/graphics/cg/ImageSourceCGMac.mm:
+        (WebCore::preferredExtensionForImageType):
+        * platform/graphics/mac/ImageMac.mm:
+        (WebCore::BitmapImage::tiffRepresentation):
+        * platform/ios/PasteboardIOS.mm:
+        (WebCore::Pasteboard::writePlainText):
+        (WebCore::Pasteboard::read):
+        (WebCore::supportedImageTypes):
+        (WebCore::isTypeAllowedByReadingPolicy):
+        (WebCore::Pasteboard::readPasteboardWebContentDataForType):
+        (WebCore::readURLAlongsideAttachmentIfNecessary):
+        (WebCore::prefersAttachmentRepresentation):
+        (WebCore::Pasteboard::supportedWebContentPasteboardTypes):
+        (WebCore::Pasteboard::supportedFileUploadPasteboardTypes):
+        (WebCore::utiTypeFromCocoaType):
+        (WebCore::Pasteboard::readPlatformValuesAsStrings):
+        (WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType):
+        * platform/ios/PlatformPasteboardIOS.mm:
+        (WebCore::safeTypeForDOMToReadAndWriteForPlatformType):
+        (WebCore::webSafeTypes):
+        (WebCore::PlatformPasteboard::informationForItemAtIndex):
+        (WebCore::PlatformPasteboard::stringForType const):
+        (WebCore::PlatformPasteboard::platformPasteboardTypeForSafeTypeForDOMToReadAndWrite):
+        (WebCore::addRepresentationsForPlainText):
+        (WebCore::PlatformPasteboard::allowReadingURLAtIndex const):
+        (WebCore::PlatformPasteboard::write):
+        (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
+        (WebCore::createItemProviderRegistrationList):
+        (WebCore::PlatformPasteboard::readString const):
+        (WebCore::PlatformPasteboard::readURL const):
+        (WebCore::PlatformPasteboard::containsURLStringSuitableForLoading):
+        * platform/ios/WebItemProviderPasteboard.mm:
+        (typeConformsToTypes):
+        (-[NSItemProvider web_containsFileURLAndFileUploadContent]):
+        (-[NSItemProvider web_fileUploadContentTypes]):
+        (-[WebItemProviderPasteboard _preLoadedDataConformingToType:forItemProviderAtIndex:]):
+        (classForTypeIdentifier):
+        (linkTemporaryItemProviderFilesToDropStagingDirectory):
+        (-[WebItemProviderPasteboard typeIdentifiersToLoad:]):
+        * platform/mac/PasteboardMac.mm:
+        (WebCore::Pasteboard::write):
+        (WebCore::Pasteboard::read):
+        (WebCore::cocoaTypeFromHTMLClipboardType):
+        (WebCore::utiTypeFromCocoaType):
+        (WebCore::Pasteboard::writeString):
+        * platform/mac/PasteboardWriter.mm:
+        (WebCore::toUTI):
+        (WebCore::toUTIUnlessAlreadyUTI):
+        (WebCore::createPasteboardWriter):
+        * platform/mac/PlatformPasteboardMac.mm:
+        (WebCore::canWritePasteboardType):
+        (WebCore::urlStringsFromPasteboard):
+        (WebCore::typeIdentifierForPasteboardType):
+        (WebCore::PlatformPasteboard::allStringsForType const):
+        (WebCore::safeTypeForDOMToReadAndWriteForPlatformType):
+        (WebCore::PlatformPasteboard::setStringForType):
+        * platform/network/ios/WebCoreURLResponseIOS.mm:
+        (WebCore::adjustMIMETypeIfNecessary):
+        * platform/network/mac/UTIUtilities.mm:
+        (WebCore::MIMETypeFromUTI):
+        (WebCore::MIMETypeFromUTITree):
+        (WebCore::UTIFromMIMETypeCachePolicy::createValueForKey):
+        (WebCore::isDeclaredUTI):
+        (WebCore::UTIFromTag):
+        * platform/network/mac/WebCoreURLResponse.mm:
+        (WebCore::adjustMIMETypeIfNecessary):
+        * rendering/RenderThemeMac.mm:
+        (WebCore::iconForAttachment):
+
 2020-11-16  Don Olmstead  <[email protected]>
 
         Non-unified build fixes, mid November 2020 edition

Modified: trunk/Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm (269868 => 269869)


--- trunk/Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -217,6 +217,7 @@
 
 static String mimeTypeFromContentType(const String& contentType)
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if (contentType == String(kUTTypeVCard)) {
         // CoreServices erroneously reports that "public.vcard" maps to "text/directory", rather
         // than either "text/vcard" or "text/x-vcard". Work around this by special casing the
@@ -223,6 +224,7 @@
         // "public.vcard" UTI type. See <rdar://problem/49478229> for more detail.
         return "text/vcard"_s;
     }
+ALLOW_DEPRECATED_DECLARATIONS_END
     return isDeclaredUTI(contentType) ? MIMETypeFromUTI(contentType) : contentType;
 }
 
@@ -713,6 +715,7 @@
     bool isDirectory = FileSystem::fileIsDirectory(path, FileSystem::ShouldFollowSymbolicLinks::Yes);
     String contentType = typeForAttachmentElement(explicitContentType);
     if (contentType.isEmpty()) {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         if (isDirectory)
             contentType = kUTTypeDirectory;
         else {
@@ -720,6 +723,7 @@
             if (contentType.isEmpty())
                 contentType = kUTTypeData;
         }
+ALLOW_DEPRECATED_DECLARATIONS_END
     }
 
     Optional<uint64_t> fileSizeForDisplay;

Modified: trunk/Source/WebCore/editing/mac/EditorMac.mm (269868 => 269869)


--- trunk/Source/WebCore/editing/mac/EditorMac.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebCore/editing/mac/EditorMac.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -181,8 +181,10 @@
     if (!canCopy())
         return nullptr;
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if (pasteboardType == WebArchivePboardType || pasteboardType == String(kUTTypeWebArchive))
         return selectionInWebArchiveFormat();
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     if (pasteboardType == String(legacyRTFDPasteboardType()))
         return dataInRTFDFormat(attributedString(*adjustedSelectionRange()).string.get());

Modified: trunk/Source/WebCore/fileapi/FileCocoa.mm (269868 => 269869)


--- trunk/Source/WebCore/fileapi/FileCocoa.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebCore/fileapi/FileCocoa.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -54,7 +54,9 @@
         return false;
     }
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     return UTTypeConformsTo((__bridge CFStringRef)uti, kUTTypePackage);
+ALLOW_DEPRECATED_DECLARATIONS_END
 }
 
 void File::computeNameAndContentTypeForReplacedFile(const String& path, const String& nameOverride, String& effectiveName, String& effectiveContentType)

Modified: trunk/Source/WebCore/page/mac/DragControllerMac.mm (269868 => 269869)


--- trunk/Source/WebCore/page/mac/DragControllerMac.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebCore/page/mac/DragControllerMac.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -117,6 +117,7 @@
 void DragController::updateSupportedTypeIdentifiersForDragHandlingMethod(DragHandlingMethod dragHandlingMethod, const DragData& dragData) const
 {
     Vector<String> supportedTypes;
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     switch (dragHandlingMethod) {
     case DragHandlingMethod::PageLoad:
         supportedTypes.append(kUTTypeURL);
@@ -143,6 +144,7 @@
             supportedTypes.append(type);
         break;
     }
+ALLOW_DEPRECATED_DECLARATIONS_END
     platformStrategies()->pasteboardStrategy()->updateSupportedTypeIdentifiers(supportedTypes, dragData.pasteboardName());
 }
 

Modified: trunk/Source/WebCore/platform/cocoa/DragDataCocoa.mm (269868 => 269869)


--- trunk/Source/WebCore/platform/cocoa/DragDataCocoa.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebCore/platform/cocoa/DragDataCocoa.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -47,7 +47,9 @@
 static inline String rtfPasteboardType()
 {
 #if PLATFORM(IOS_FAMILY)
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     return String(kUTTypeRTF);
+ALLOW_DEPRECATED_DECLARATIONS_END
 #else
     return String(legacyRTFPasteboardType());
 #endif
@@ -56,7 +58,9 @@
 static inline String rtfdPasteboardType()
 {
 #if PLATFORM(IOS_FAMILY)
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     return String(kUTTypeFlatRTFD);
+ALLOW_DEPRECATED_DECLARATIONS_END
 #else
     return String(legacyRTFDPasteboardType());
 #endif
@@ -65,7 +69,9 @@
 static inline String stringPasteboardType()
 {
 #if PLATFORM(IOS_FAMILY)
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     return String(kUTTypeText);
+ALLOW_DEPRECATED_DECLARATIONS_END
 #else
     return String(legacyStringPasteboardType());
 #endif
@@ -74,7 +80,9 @@
 static inline String urlPasteboardType()
 {
 #if PLATFORM(IOS_FAMILY)
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     return String(kUTTypeURL);
+ALLOW_DEPRECATED_DECLARATIONS_END
 #else
     return String(legacyURLPasteboardType());
 #endif
@@ -83,7 +91,9 @@
 static inline String htmlPasteboardType()
 {
 #if PLATFORM(IOS_FAMILY)
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     return String(kUTTypeHTML);
+ALLOW_DEPRECATED_DECLARATIONS_END
 #else
     return String(legacyHTMLPasteboardType());
 #endif
@@ -101,7 +111,9 @@
 static inline String pdfPasteboardType()
 {
 #if PLATFORM(IOS_FAMILY)
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     return String(kUTTypePDF);
+ALLOW_DEPRECATED_DECLARATIONS_END
 #else
     return String(legacyPDFPasteboardType());
 #endif
@@ -110,7 +122,9 @@
 static inline String tiffPasteboardType()
 {
 #if PLATFORM(IOS_FAMILY)
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     return String(kUTTypeTIFF);
+ALLOW_DEPRECATED_DECLARATIONS_END
 #else
     return String(legacyTIFFPasteboardType());
 #endif
@@ -235,6 +249,7 @@
 
     Vector<String> types;
     platformStrategies()->pasteboardStrategy()->getTypes(types, m_pasteboardName);
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     return types.contains(String(WebArchivePboardType))
         || types.contains(htmlPasteboardType())
         || types.contains(String(kUTTypeWebArchive))
@@ -252,6 +267,7 @@
         || types.contains(colorPasteboardType())
         || types.contains(String(kUTTypeJPEG))
         || types.contains(String(kUTTypePNG));
+ALLOW_DEPRECATED_DECLARATIONS_END
 }
 
 bool DragData::containsPromise() const

Modified: trunk/Source/WebCore/platform/cocoa/MIMETypeRegistryCocoa.mm (269868 => 269869)


--- trunk/Source/WebCore/platform/cocoa/MIMETypeRegistryCocoa.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebCore/platform/cocoa/MIMETypeRegistryCocoa.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -58,6 +58,7 @@
 
         auto allUTIs = adoptCF(_UTCopyDeclaredTypeIdentifiers());
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         for (NSString *uti in (__bridge NSArray<NSString *> *)allUTIs.get()) {
             auto type = adoptCF(UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)uti, kUTTagClassMIMEType));
             if (!type)
@@ -67,6 +68,7 @@
                 continue;
             addExtensions(type.get(), (__bridge NSArray<NSString *> *)extensions.get());
         }
+ALLOW_DEPRECATED_DECLARATIONS_END
 
         return map;
     }());

Modified: trunk/Source/WebCore/platform/cocoa/PasteboardCocoa.mm (269868 => 269869)


--- trunk/Source/WebCore/platform/cocoa/PasteboardCocoa.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebCore/platform/cocoa/PasteboardCocoa.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -61,6 +61,7 @@
 
 static ImageType cocoaTypeToImageType(const String& cocoaType)
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
 #if PLATFORM(MAC)
     if (cocoaType == String(legacyTIFFPasteboardType()))
         return ImageType::TIFF;
@@ -77,6 +78,7 @@
         return ImageType::JPEG;
     if (cocoaType == String(kUTTypeGIF))
         return ImageType::GIF;
+ALLOW_DEPRECATED_DECLARATIONS_END
     return ImageType::Invalid;
 }
 
@@ -164,7 +166,9 @@
             if (cocoaType == String(legacyURLPasteboardType()))
                 return true;
 #endif
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
             return cocoaType == String(kUTTypeURL);
+ALLOW_DEPRECATED_DECLARATIONS_END
         });
         mayContainFilePaths = indexOfURL != notFound && !platformStrategies()->pasteboardStrategy()->containsStringSafeForDOMToReadForType(cocoaTypes[indexOfURL], m_pasteboardName);
     }

Modified: trunk/Source/WebCore/platform/cocoa/PlatformPasteboardCocoa.mm (269868 => 269869)


--- trunk/Source/WebCore/platform/cocoa/PlatformPasteboardCocoa.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebCore/platform/cocoa/PlatformPasteboardCocoa.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -74,8 +74,10 @@
 
 #if PLATFORM(IOS_FAMILY)
     UNUSED_PARAM(title);
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     String urlPasteboardType = kUTTypeURL;
     String stringPasteboardType = kUTTypeText;
+ALLOW_DEPRECATED_DECLARATIONS_END
 #else
     String urlPasteboardType = legacyURLPasteboardType();
     String stringPasteboardType = legacyStringPasteboardType();

Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferUtilitiesCG.cpp (269868 => 269869)


--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferUtilitiesCG.cpp	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferUtilitiesCG.cpp	2020-11-16 20:14:05 UTC (rev 269869)
@@ -54,14 +54,17 @@
 
 CFStringRef jpegUTI()
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
 #if PLATFORM(IOS_FAMILY) || PLATFORM(WIN)
     static const CFStringRef kUTTypeJPEG = CFSTR("public.jpeg");
 #endif
     return kUTTypeJPEG;
+ALLOW_DEPRECATED_DECLARATIONS_END
 }
 
 RetainPtr<CFStringRef> utiFromImageBufferMIMEType(const String& mimeType)
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     // FIXME: Why doesn't iOS use the CoreServices version?
 #if PLATFORM(MAC)
     return UTIFromMIMEType(mimeType).createCFString();
@@ -83,6 +86,7 @@
     ASSERT_NOT_REACHED();
     return kUTTypePNG;
 #endif
+ALLOW_DEPRECATED_DECLARATIONS_END
 }
 
 bool encodeImage(CGImageRef image, CFStringRef uti, Optional<double> quality, CFMutableDataRef data)

Modified: trunk/Source/WebCore/platform/graphics/cg/ImageSourceCGMac.mm (269868 => 269869)


--- trunk/Source/WebCore/platform/graphics/cg/ImageSourceCGMac.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageSourceCGMac.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -43,7 +43,9 @@
 
 String preferredExtensionForImageType(const String& uti)
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     return adoptCF(UTTypeCopyPreferredTagWithClass(uti.createCFString().get(), kUTTagClassFilenameExtension)).get();
+ALLOW_DEPRECATED_DECLARATIONS_END
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/mac/ImageMac.mm (269868 => 269869)


--- trunk/Source/WebCore/platform/graphics/mac/ImageMac.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebCore/platform/graphics/mac/ImageMac.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -83,7 +83,10 @@
         return nullptr;
 
     RetainPtr<CFMutableDataRef> data = "" 0));
+
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     RetainPtr<CGImageDestinationRef> destination = adoptCF(CGImageDestinationCreateWithData(data.get(), kUTTypeTIFF, nativeImages.size(), 0));
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     if (!destination)
         return nullptr;

Modified: trunk/Source/WebCore/platform/ios/PasteboardIOS.mm (269868 => 269869)


--- trunk/Source/WebCore/platform/ios/PasteboardIOS.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebCore/platform/ios/PasteboardIOS.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -129,7 +129,9 @@
 {
     // FIXME: We vend "public.text" here for backwards compatibility with pre-iOS 11 apps. In the future, we should stop vending this UTI,
     // and instead set data for concrete plain text types. See <https://bugs.webkit.org/show_bug.cgi?id=173317>.
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     platformStrategies()->pasteboardStrategy()->writeToPasteboard(kUTTypeText, text, m_pasteboardName);
+ALLOW_DEPRECATED_DECLARATIONS_END
 }
 
 void Pasteboard::write(const PasteboardURL& pasteboardURL)
@@ -163,7 +165,9 @@
     PasteboardStrategy& strategy = *platformStrategies()->pasteboardStrategy();
 
     if (allowURL == PlainTextURLReadingPolicy::AllowURL) {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         text.text = strategy.readStringFromPasteboard(itemIndexToQuery, kUTTypeURL, m_pasteboardName);
+ALLOW_DEPRECATED_DECLARATIONS_END
         if (!text.text.isEmpty()) {
             text.isURL = true;
             return;
@@ -174,9 +178,11 @@
     // plain text for this abstract UTI. In almost all cases, the more correct choice would be to write to
     // one of the concrete "public.plain-text" representations (e.g. kUTTypeUTF8PlainText). In the future, we
     // should consider removing support for reading plain text from "public.text".
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     text.text = strategy.readStringFromPasteboard(itemIndexToQuery, kUTTypePlainText, m_pasteboardName);
     if (text.text.isEmpty())
         text.text = strategy.readStringFromPasteboard(itemIndexToQuery, kUTTypeText, m_pasteboardName);
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     text.isURL = false;
 }
@@ -183,11 +189,14 @@
 
 static NSArray* supportedImageTypes()
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     return @[(__bridge NSString *)kUTTypePNG, (__bridge NSString *)kUTTypeTIFF, (__bridge NSString *)kUTTypeJPEG, (__bridge NSString *)kUTTypeGIF];
+ALLOW_DEPRECATED_DECLARATIONS_END
 }
 
 static bool isTypeAllowedByReadingPolicy(NSString *type, WebContentReadingPolicy policy)
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     return policy == WebContentReadingPolicy::AnyType
         || [type isEqualToString:WebArchivePboardType]
         || [type isEqualToString:(__bridge NSString *)kUTTypeWebArchive]
@@ -194,10 +203,12 @@
         || [type isEqualToString:(__bridge NSString *)kUTTypeHTML]
         || [type isEqualToString:(__bridge NSString *)kUTTypeRTF]
         || [type isEqualToString:(__bridge NSString *)kUTTypeFlatRTFD];
+ALLOW_DEPRECATED_DECLARATIONS_END
 }
 
 Pasteboard::ReaderResult Pasteboard::readPasteboardWebContentDataForType(PasteboardWebContentReader& reader, PasteboardStrategy& strategy, NSString *type, const PasteboardItemInfo& itemInfo, int itemIndex)
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if ([type isEqualToString:WebArchivePboardType] || [type isEqualToString:(__bridge NSString *)kUTTypeWebArchive]) {
         auto buffer = strategy.readBufferFromPasteboard(itemIndex, type, m_pasteboardName);
         if (m_changeCount != changeCount())
@@ -264,6 +275,7 @@
             return ReaderResult::PasteboardWasChangedExternally;
         return !string.isNull() && reader.readPlainText(string) ? ReaderResult::ReadType : ReaderResult::DidNotReadType;
     }
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     return ReaderResult::DidNotReadType;
 }
@@ -270,8 +282,10 @@
 
 static void readURLAlongsideAttachmentIfNecessary(PasteboardWebContentReader& reader, PasteboardStrategy& strategy, const String& typeIdentifier, const String& pasteboardName, int itemIndex)
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if (!UTTypeConformsTo(typeIdentifier.createCFString().get(), kUTTypeVCard))
         return;
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     String title;
     auto url = "" pasteboardName, title);
@@ -288,7 +302,9 @@
     if (info.preferredPresentationStyle == PasteboardItemPresentationStyle::Inline)
         return false;
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     return info.canBeTreatedAsAttachmentOrFile() || UTTypeConformsTo(contentTypeForHighestFidelityItem.createCFString().get(), kUTTypeVCard);
+ALLOW_DEPRECATED_DECLARATIONS_END
 }
 
 void Pasteboard::read(PasteboardWebContentReader& reader, WebContentReadingPolicy policy, Optional<size_t> itemIndex)
@@ -403,6 +419,7 @@
 
 NSArray *Pasteboard::supportedWebContentPasteboardTypes()
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     return @[
 #if !PLATFORM(MACCATALYST)
         WebArchivePboardType,
@@ -420,11 +437,14 @@
         (__bridge NSString *)kUTTypeURL,
         (__bridge NSString *)kUTTypeText
     ];
+ALLOW_DEPRECATED_DECLARATIONS_END
 }
 
 NSArray *Pasteboard::supportedFileUploadPasteboardTypes()
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     return @[ (__bridge NSString *)kUTTypeItem, (__bridge NSString *)kUTTypeContent, (__bridge NSString *)kUTTypeZipArchive ];
+ALLOW_DEPRECATED_DECLARATIONS_END
 }
 
 bool Pasteboard::hasData()
@@ -434,10 +454,12 @@
 
 static String utiTypeFromCocoaType(NSString *type)
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     RetainPtr<CFStringRef> utiType = adoptCF(UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, (CFStringRef)type, NULL));
     if (!utiType)
         return String();
     return String(adoptCF(UTTypeCopyPreferredTagWithClass(utiType.get(), kUTTagClassMIMEType)).get());
+ALLOW_DEPRECATED_DECLARATIONS_END
 }
 
 static RetainPtr<NSString> cocoaTypeFromHTMLClipboardType(const String& type)
@@ -481,11 +503,13 @@
         return { };
 
     auto values = strategy.allStringsForType(cocoaType.get(), pasteboardName);
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if ([cocoaType isEqualToString:(__bridge NSString *)kUTTypePlainText]) {
         values = values.map([&] (auto& value) -> String {
             return [value precomposedStringWithCanonicalMapping];
         });
     }
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     // Enforce changeCount ourselves for security. We check after reading instead of before to be
     // sure it doesn't change between our testing the change count and accessing the data.
@@ -497,6 +521,7 @@
 
 void Pasteboard::addHTMLClipboardTypesForCocoaType(ListHashSet<String>& resultTypes, const String& cocoaType)
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     // UTI may not do these right, so make sure we get the right, predictable result.
     if ([cocoaType isEqualToString:(NSString *)kUTTypePlainText]
         || [cocoaType isEqualToString:(NSString *)kUTTypeUTF8PlainText]
@@ -512,6 +537,7 @@
         resultTypes.add("text/html"_s);
         // We don't return here for App compatibility.
     }
+ALLOW_DEPRECATED_DECLARATIONS_END
     if (Pasteboard::shouldTreatCocoaTypeAsFile(cocoaType))
         return;
     String utiType = utiTypeFromCocoaType(cocoaType);

Modified: trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm (269868 => 269869)


--- trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -109,6 +109,7 @@
 static const char *safeTypeForDOMToReadAndWriteForPlatformType(const String& platformType, PlatformPasteboard::IncludeImageTypes includeImageTypes)
 {
     auto cfType = platformType.createCFString();
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if (UTTypeConformsTo(cfType.get(), kUTTypePlainText))
         return "text/plain"_s;
 
@@ -121,6 +122,7 @@
 
     if (includeImageTypes == PlatformPasteboard::IncludeImageTypes::Yes && UTTypeConformsTo(cfType.get(), kUTTypePNG))
         return "image/png"_s;
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     return nullptr;
 }
@@ -139,8 +141,10 @@
 
         if (auto* coercedType = safeTypeForDOMToReadAndWriteForPlatformType(type, includeImageTypes)) {
             auto domTypeAsString = String::fromUTF8(coercedType);
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
             if (domTypeAsString == "text/uri-list"_s && ([platformTypes containsObject:(__bridge NSString *)kUTTypeFileURL] || shouldAvoidExposingURLType()))
                 continue;
+ALLOW_DEPRECATED_DECLARATIONS_END
 
             domPasteboardTypes.add(WTFMove(domTypeAsString));
         }
@@ -218,6 +222,7 @@
     for (NSString *typeIdentifier in registeredTypeIdentifiers) {
         info.platformTypesByFidelity.uncheckedAppend(typeIdentifier);
         CFStringRef cfTypeIdentifier = (CFStringRef)typeIdentifier;
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         if (!UTTypeIsDeclared(cfTypeIdentifier))
             continue;
 
@@ -232,12 +237,15 @@
 
         if (UTTypeConformsTo(cfTypeIdentifier, kUTTypeFlatRTFD))
             continue;
+ALLOW_DEPRECATED_DECLARATIONS_END
 
         info.isNonTextType = true;
     }
 
     info.webSafeTypesByFidelity = webSafeTypes(registeredTypeIdentifiers, IncludeImageTypes::Yes, [&] {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         return shouldTreatAtLeastOneTypeAsFile(registeredTypeIdentifiers) && !Pasteboard::canExposeURLToDOMWhenPasteboardContainsFiles(readString(index, kUTTypeURL));
+ALLOW_DEPRECATED_DECLARATIONS_END
     });
 
     return info;
@@ -265,10 +273,12 @@
 {
     auto result = readString(0, type);
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if (pasteboardMayContainFilePaths(m_pasteboard.get()) && type == String { kUTTypeURL }) {
         if (!Pasteboard::canExposeURLToDOMWhenPasteboardContainsFiles(result))
             result = { };
     }
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     return result;
 }
@@ -322,6 +332,7 @@
 
 String PlatformPasteboard::platformPasteboardTypeForSafeTypeForDOMToReadAndWrite(const String& domType, IncludeImageTypes includeImageTypes)
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if (domType == "text/plain")
         return kUTTypePlainText;
 
@@ -333,6 +344,7 @@
 
     if (includeImageTypes == IncludeImageTypes::Yes && domType == "image/png")
         return kUTTypePNG;
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     return { };
 }
@@ -396,7 +408,9 @@
     if (URL(platformURL).isValid())
         [itemsToRegister addRepresentingObject:platformURL];
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     [itemsToRegister addData:[(NSString *)plainText dataUsingEncoding:NSUTF8StringEncoding] forType:(NSString *)kUTTypeUTF8PlainText];
+ALLOW_DEPRECATED_DECLARATIONS_END
 }
 
 bool PlatformPasteboard::allowReadingURLAtIndex(const URL& url, int index) const
@@ -403,8 +417,10 @@
 {
     NSItemProvider *itemProvider = (NSUInteger)index < [m_pasteboard itemProviders].count ? [[m_pasteboard itemProviders] objectAtIndex:index] : nil;
     for (NSString *type in itemProvider.registeredTypeIdentifiers) {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         if (UTTypeConformsTo((CFStringRef)type, kUTTypeURL))
             return true;
+ALLOW_DEPRECATED_DECLARATIONS_END
     }
 
     return url.isValid();
@@ -425,7 +441,9 @@
     if (content.dataInWebArchiveFormat) {
         auto webArchiveData = content.dataInWebArchiveFormat->createNSData();
 #if PLATFORM(MACCATALYST)
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         NSString *webArchiveType = (__bridge NSString *)kUTTypeWebArchive;
+ALLOW_DEPRECATED_DECLARATIONS_END
 #else
         // FIXME: We should additionally register "com.apple.webarchive" once <rdar://problem/46830277> is fixed.
         NSString *webArchiveType = WebArchivePboardType;
@@ -438,6 +456,7 @@
             [representationsToRegister addRepresentingObject:attributedString];
     }
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if (content.dataInRTFDFormat)
         [representationsToRegister addData:content.dataInRTFDFormat->createNSData().get() forType:(NSString *)kUTTypeFlatRTFD];
 
@@ -448,6 +467,7 @@
         NSData *htmlAsData = [(NSString *)content.dataInHTMLFormat dataUsingEncoding:NSUTF8StringEncoding];
         [representationsToRegister addData:htmlAsData forType:(NSString *)kUTTypeHTML];
     }
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     if (!content.dataInStringFormat.isEmpty())
         addRepresentationsForPlainText(representationsToRegister.get(), content.dataInStringFormat);
@@ -502,10 +522,12 @@
     NSString *pasteboardTypeAsNSString = pasteboardType;
     if (!text.isEmpty() && pasteboardTypeAsNSString.length) {
         auto pasteboardTypeAsCFString = (CFStringRef)pasteboardTypeAsNSString;
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         if (UTTypeConformsTo(pasteboardTypeAsCFString, kUTTypeURL) || UTTypeConformsTo(pasteboardTypeAsCFString, kUTTypeText))
             addRepresentationsForPlainText(representationsToRegister.get(), text);
         else
             [representationsToRegister addData:[pasteboardTypeAsNSString dataUsingEncoding:NSUTF8StringEncoding] forType:pasteboardType];
+ALLOW_DEPRECATED_DECLARATIONS_END
     }
 
     registerItemToPasteboard(representationsToRegister.get(), m_pasteboard.get());
@@ -569,7 +591,9 @@
 
     auto webSafePasteboardTypes = webSafeTypes([m_pasteboard pasteboardTypes], IncludeImageTypes::No, [&] {
         BOOL ableToDetermineProtocolOfPasteboardURL = ![m_pasteboard isKindOfClass:[WebItemProviderPasteboard class]];
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         return ableToDetermineProtocolOfPasteboardURL && stringForType(kUTTypeURL).isEmpty();
+ALLOW_DEPRECATED_DECLARATIONS_END
     });
 
     for (auto& type : webSafePasteboardTypes)
@@ -610,6 +634,7 @@
 
             NSString *nsStringValue = WTF::get<String>(value);
             auto cfType = cocoaType.createCFString();
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
             if (UTTypeConformsTo(cfType.get(), kUTTypeURL))
                 [representationsToRegister addRepresentingObject:[NSURL URLWithString:nsStringValue]];
             else if (UTTypeConformsTo(cfType.get(), kUTTypePlainText))
@@ -616,6 +641,7 @@
                 [representationsToRegister addRepresentingObject:nsStringValue];
             else
                 [representationsToRegister addData:[nsStringValue dataUsingEncoding:NSUTF8StringEncoding] forType:(NSString *)cocoaType];
+ALLOW_DEPRECATED_DECLARATIONS_END
             return;
         }
 
@@ -709,6 +735,7 @@
 
 String PlatformPasteboard::readString(size_t index, const String& type) const
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if (type == String(kUTTypeURL)) {
         String title;
         return [(NSURL *)readURL(index, title) absoluteString];
@@ -736,6 +763,7 @@
         if ([value isKindOfClass:[NSAttributedString class]])
             return [(NSAttributedString *)value string];
     }
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     return String();
 }
@@ -745,7 +773,9 @@
     if ((NSInteger)index < 0 || (NSInteger)index >= [m_pasteboard numberOfItems])
         return { };
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     id value = [m_pasteboard valuesForPasteboardType:(__bridge NSString *)kUTTypeURL inItemSet:[NSIndexSet indexSetWithIndex:index]].firstObject;
+ALLOW_DEPRECATED_DECLARATIONS_END
     if (!value)
         return { };
 
@@ -783,10 +813,12 @@
 {
     Vector<String> types;
     getTypes(types);
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if (!types.contains(String(kUTTypeURL)))
         return false;
 
     auto urlString = stringForType(kUTTypeURL);
+ALLOW_DEPRECATED_DECLARATIONS_END
     if (urlString.isEmpty()) {
         // On iOS, we don't get access to the contents of NSItemProviders until we perform the drag operation.
         // Thus, we consider DragData to contain an URL if it contains the `public.url` UTI type. Later down the

Modified: trunk/Source/WebCore/platform/ios/WebItemProviderPasteboard.mm (269868 => 269869)


--- trunk/Source/WebCore/platform/ios/WebItemProviderPasteboard.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebCore/platform/ios/WebItemProviderPasteboard.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -52,8 +52,10 @@
 static BOOL typeConformsToTypes(NSString *type, NSArray *conformsToTypes)
 {
     for (NSString *conformsToType in conformsToTypes) {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         if (UTTypeConformsTo((__bridge CFStringRef)type, (__bridge CFStringRef)conformsToType))
             return YES;
+ALLOW_DEPRECATED_DECLARATIONS_END
     }
     return NO;
 }
@@ -63,8 +65,10 @@
 - (BOOL)web_containsFileURLAndFileUploadContent
 {
     for (NSString *identifier in self.registeredTypeIdentifiers) {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         if (UTTypeConformsTo((__bridge CFStringRef)identifier, kUTTypeFileURL))
             return self.web_fileUploadContentTypes.count;
+ALLOW_DEPRECATED_DECLARATIONS_END
     }
     return NO;
 }
@@ -73,8 +77,10 @@
 {
     auto types = adoptNS([NSMutableArray new]);
     for (NSString *identifier in self.registeredTypeIdentifiers) {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         if (UTTypeConformsTo((__bridge CFStringRef)identifier, kUTTypeURL))
             continue;
+ALLOW_DEPRECATED_DECLARATIONS_END
 
         if ([identifier isEqualToString:@"com.apple.mapkit.map-item"]) {
             // This type conforms to "public.content", yet the corresponding data is only a serialization of MKMapItem and isn't suitable for file uploads.
@@ -543,8 +549,10 @@
 
     WebItemProviderLoadResult *loadResult = _loadResults[index].get();
     for (NSString *loadedType in loadResult.loadedTypeIdentifiers) {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         if (!UTTypeConformsTo((CFStringRef)loadedType, (CFStringRef)typeIdentifier))
             continue;
+ALLOW_DEPRECATED_DECLARATIONS_END
 
         // We've already loaded data relevant for this UTI type onto disk, so there's no need to ask the NSItemProvider for the same data again.
         if (NSData *result = [NSData dataWithContentsOfURL:[loadResult fileURLForType:loadedType] options:NSDataReadingMappedIfSafe error:nil])
@@ -593,11 +601,13 @@
 
     // If we were unable to load any object, check if the given type identifier is still something
     // WebKit knows how to handle.
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if ([typeIdentifier isEqualToString:(NSString *)kUTTypeHTML]) {
         // Load kUTTypeHTML as a plain text HTML string.
         outTypeIdentifierToLoad = (NSString *)kUTTypePlainText;
         return [NSString class];
     }
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     return nil;
 }
@@ -702,7 +712,9 @@
         return nil;
 
     NSURL *destination = nil;
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     BOOL isFolder = UTTypeConformsTo((CFStringRef)typeIdentifier, kUTTypeFolder);
+ALLOW_DEPRECATED_DECLARATIONS_END
     NSFileManager *fileManager = [NSFileManager defaultManager];
 
     if (!suggestedName)
@@ -717,6 +729,7 @@
 
 - (NSArray<NSString *> *)typeIdentifiersToLoad:(NSItemProvider *)itemProvider
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     auto typesToLoad = adoptNS([[NSMutableOrderedSet alloc] init]);
     NSString *highestFidelitySupportedType = nil;
     NSString *highestFidelityContentType = nil;
@@ -758,6 +771,7 @@
             || UTTypeConformsTo((__bridge CFStringRef)registeredTypeIdentifier, kUTTypePlainText))
             [typesToLoad addObject:registeredTypeIdentifier];
     }
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     return [typesToLoad array];
 }

Modified: trunk/Source/WebCore/platform/mac/PasteboardMac.mm (269868 => 269869)


--- trunk/Source/WebCore/platform/mac/PasteboardMac.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebCore/platform/mac/PasteboardMac.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -136,7 +136,10 @@
         types.append(WebSmartPastePboardType);
     if (content.dataInWebArchiveFormat) {
         types.append(WebArchivePboardType);
+
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         types.append(kUTTypeWebArchive);
+ALLOW_DEPRECATED_DECLARATIONS_END
     }
     if (content.dataInRTFDFormat)
         types.append(String(legacyRTFDPasteboardType()));
@@ -161,7 +164,10 @@
         m_changeCount = platformStrategies()->pasteboardStrategy()->setBufferForType(nullptr, WebSmartPastePboardType, m_pasteboardName);
     if (content.dataInWebArchiveFormat) {
         m_changeCount = platformStrategies()->pasteboardStrategy()->setBufferForType(content.dataInWebArchiveFormat.get(), WebArchivePboardType, m_pasteboardName);
+
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         m_changeCount = platformStrategies()->pasteboardStrategy()->setBufferForType(content.dataInWebArchiveFormat.get(), kUTTypeWebArchive, m_pasteboardName);
+ALLOW_DEPRECATED_DECLARATIONS_END
     }
     if (content.dataInRTFDFormat)
         m_changeCount = platformStrategies()->pasteboardStrategy()->setBufferForType(content.dataInRTFDFormat.get(), legacyRTFDPasteboardType(), m_pasteboardName);
@@ -272,7 +278,10 @@
     auto types = writableTypesForImage();
     if (pasteboardImage.dataInWebArchiveFormat) {
         types.append(WebArchivePboardType);
+
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         types.append(kUTTypeWebArchive);
+ALLOW_DEPRECATED_DECLARATIONS_END
     }
 
     m_changeCount = writeURLForTypes(types, m_pasteboardName, pasteboardImage.url);
@@ -279,7 +288,10 @@
     m_changeCount = platformStrategies()->pasteboardStrategy()->setBufferForType(SharedBuffer::create(imageData).ptr(), legacyTIFFPasteboardType(), m_pasteboardName);
     if (auto archiveData = pasteboardImage.dataInWebArchiveFormat) {
         m_changeCount = platformStrategies()->pasteboardStrategy()->setBufferForType(archiveData.get(), WebArchivePboardType, m_pasteboardName);
+
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         m_changeCount = platformStrategies()->pasteboardStrategy()->setBufferForType(archiveData.get(), kUTTypeWebArchive, m_pasteboardName);
+ALLOW_DEPRECATED_DECLARATIONS_END
     }
     if (!pasteboardImage.dataInHTMLFormat.isEmpty())
         m_changeCount = platformStrategies()->pasteboardStrategy()->setStringForType(pasteboardImage.dataInHTMLFormat, legacyHTMLPasteboardType(), m_pasteboardName);
@@ -429,6 +441,7 @@
         }
     }
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if (types.contains(String(kUTTypeWebArchive))) {
         if (auto buffer = readBufferAtPreferredItemIndex(kUTTypeWebArchive, itemIndex, strategy, m_pasteboardName)) {
             if (m_changeCount != changeCount() || reader.readWebArchive(*buffer))
@@ -435,6 +448,7 @@
                 return;
         }
     }
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     if (policy == WebContentReadingPolicy::AnyType && types.contains(String(legacyFilesPromisePasteboardType()))) {
         if (m_changeCount != changeCount() || reader.readFilePaths(m_promisedFilePaths))
@@ -519,6 +533,7 @@
         }
     }
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if (types.contains(String(kUTTypePNG))) {
         if (auto buffer = readBufferAtPreferredItemIndex(kUTTypePNG, itemIndex, strategy, m_pasteboardName)) {
             if (m_changeCount != changeCount() || reader.readImage(buffer.releaseNonNull(), "image/png"_s))
@@ -525,7 +540,9 @@
                 return;
         }
     }
+ALLOW_DEPRECATED_DECLARATIONS_END
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if (types.contains(String(kUTTypeJPEG))) {
         if (auto buffer = readBufferAtPreferredItemIndex(kUTTypeJPEG, itemIndex, strategy, m_pasteboardName)) {
             if (m_changeCount != changeCount() || reader.readImage(buffer.releaseNonNull(), "image/jpeg"_s))
@@ -532,6 +549,7 @@
                 return;
         }
     }
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     if (types.contains(String(legacyURLPasteboardType()))) {
         URL url = ""
@@ -546,11 +564,13 @@
             return;
     }
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if (types.contains(String(kUTTypeUTF8PlainText))) {
         String string = strategy.stringForType(kUTTypeUTF8PlainText, m_pasteboardName);
         if (m_changeCount != changeCount() || (!string.isNull() && reader.readPlainText(string)))
             return;
     }
+ALLOW_DEPRECATED_DECLARATIONS_END
 }
 
 bool Pasteboard::hasData()
@@ -573,8 +593,10 @@
 
     auto utiType = UTIFromMIMEType(type);
     if (!utiType.isEmpty()) {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         if (auto pbType = adoptCF(UTTypeCopyPreferredTagWithClass(utiType.createCFString().get(), kUTTagClassNSPboardType)))
             return pbType.get();
+ALLOW_DEPRECATED_DECLARATIONS_END
     }
 
     // No mapping, just pass the whole string though
@@ -613,10 +635,12 @@
 
 static String utiTypeFromCocoaType(const String& type)
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if (RetainPtr<CFStringRef> utiType = adoptCF(UTTypeCreatePreferredIdentifierForTag(kUTTagClassNSPboardType, type.createCFString().get(), 0))) {
         if (RetainPtr<CFStringRef> mimeType = adoptCF(UTTypeCopyPreferredTagWithClass(utiType.get(), kUTTagClassMIMEType)))
             return String(mimeType.get());
     }
+ALLOW_DEPRECATED_DECLARATIONS_END
     return String();
 }
 
@@ -650,6 +674,7 @@
     const String& cocoaType = cocoaTypeFromHTMLClipboardType(type);
     String cocoaData = data;
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if (cocoaType == String(legacyURLPasteboardType()) || cocoaType == String(kUTTypeFileURL)) {
         NSURL *url = "" URLWithString:cocoaData];
         if ([url isFileURL])
@@ -662,6 +687,7 @@
 
         return;
     }
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     if (!cocoaType.isEmpty()) {
         // everything else we know of goes on the pboard as a string

Modified: trunk/Source/WebCore/platform/mac/PasteboardWriter.mm (269868 => 269869)


--- trunk/Source/WebCore/platform/mac/PasteboardWriter.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebCore/platform/mac/PasteboardWriter.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -38,15 +38,19 @@
 
 static RetainPtr<NSString> toUTI(NSString *pasteboardType)
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     return adoptNS((__bridge NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassNSPboardType, (__bridge CFStringRef)pasteboardType, nullptr));
+ALLOW_DEPRECATED_DECLARATIONS_END
 }
 
 static RetainPtr<NSString> toUTIUnlessAlreadyUTI(NSString *type)
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if (UTTypeIsDeclared((__bridge CFStringRef)type) || UTTypeIsDynamic((__bridge CFStringRef)type)) {
         // This is already a UTI.
         return type;
     }
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     return toUTI(type);
 }
@@ -58,7 +62,9 @@
     if (auto& plainText = data.plainText()) {
         [pasteboardItem setString:plainText->text forType:NSPasteboardTypeString];
         if (plainText->canSmartCopyOrDelete) {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
             auto smartPasteType = adoptNS((__bridge NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassNSPboardType, (__bridge CFStringRef)_NXSmartPaste, nullptr));
+ALLOW_DEPRECATED_DECLARATIONS_END
             [pasteboardItem setData:[NSData data] forType:smartPasteType.get()];
         }
     }
@@ -85,9 +91,11 @@
         else
             [pasteboardItem setPropertyList:@[ @"", @"" ] forType:toUTI(WebCore::legacyURLPasteboardType()).get()];
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         if (cocoaURL.fileURL)
             [pasteboardItem setString:cocoaURL.absoluteString forType:(NSString *)kUTTypeFileURL];
         [pasteboardItem setString:userVisibleString forType:(NSString *)kUTTypeURL];
+ALLOW_DEPRECATED_DECLARATIONS_END
 
         // WebURLNamePboardType.
         [pasteboardItem setString:title forType:@"public.url-name"];
@@ -98,11 +106,15 @@
 
     if (auto& webContent = data.webContent()) {
         if (webContent->canSmartCopyOrDelete) {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
             auto smartPasteType = adoptNS((__bridge NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassNSPboardType, (__bridge CFStringRef)_NXSmartPaste, nullptr));
+ALLOW_DEPRECATED_DECLARATIONS_END
             [pasteboardItem setData:[NSData data] forType:smartPasteType.get()];
         }
         if (webContent->dataInWebArchiveFormat) {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
             auto webArchiveType = adoptNS((__bridge NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassNSPboardType, (__bridge CFStringRef)@"Apple Web Archive pasteboard type", nullptr));
+ALLOW_DEPRECATED_DECLARATIONS_END
             [pasteboardItem setData:webContent->dataInWebArchiveFormat->createNSData().get() forType:webArchiveType.get()];
         }
         if (webContent->dataInRTFDFormat)

Modified: trunk/Source/WebCore/platform/mac/PlatformPasteboardMac.mm (269868 => 269869)


--- trunk/Source/WebCore/platform/mac/PlatformPasteboardMac.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebCore/platform/mac/PlatformPasteboardMac.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -44,8 +44,10 @@
 static bool canWritePasteboardType(const String& type)
 {
     auto cfString = type.createCFString();
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if (UTTypeIsDeclared(cfString.get()) || UTTypeIsDynamic(cfString.get()))
         return true;
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     return [(__bridge NSString *)cfString.get() lengthOfBytesUsingEncoding:NSString.defaultCStringEncoding];
 }
@@ -129,10 +131,12 @@
     urlStrings.reserveInitialCapacity(items.count);
     if (items.count > 1) {
         for (NSPasteboardItem *item in items) {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
             if (id propertyList = [item propertyListForType:(__bridge NSString *)kUTTypeURL]) {
                 if (auto urlFromItem = adoptNS([[NSURL alloc] initWithPasteboardPropertyList:propertyList ofType:(__bridge NSString *)kUTTypeURL]))
                     urlStrings.uncheckedAppend([urlFromItem absoluteString]);
             }
+ALLOW_DEPRECATED_DECLARATIONS_END
         }
     } else if (NSURL *urlFromPasteboard = [NSURL URLFromPasteboard:pasteboard])
         urlStrings.uncheckedAppend(urlFromPasteboard.absoluteString);
@@ -149,6 +153,7 @@
 
 static String typeIdentifierForPasteboardType(const String& pasteboardType)
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if (UTTypeIsDeclared(pasteboardType.createCFString().get()))
         return pasteboardType;
 
@@ -160,6 +165,7 @@
 
     if (pasteboardType == String(legacyURLPasteboardType()))
         return kUTTypeURL;
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     return { };
 }
@@ -167,8 +173,10 @@
 Vector<String> PlatformPasteboard::allStringsForType(const String& pasteboardType) const
 {
     auto typeIdentifier = typeIdentifierForPasteboardType(pasteboardType);
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if (typeIdentifier == String(kUTTypeURL))
         return urlStringsFromPasteboard(m_pasteboard.get());
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     NSArray<NSPasteboardItem *> *items = [m_pasteboard pasteboardItems];
     Vector<String> strings;
@@ -192,9 +200,11 @@
     if (platformType == String(legacyURLPasteboardType()))
         return "text/uri-list"_s;
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if (platformType == String(legacyHTMLPasteboardType()) || platformType == String(WebArchivePboardType) || platformType == String(kUTTypeWebArchive)
         || platformType == String(legacyRTFDPasteboardType()) || platformType == String(legacyRTFPasteboardType()))
         return "text/html"_s;
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     return nullptr;
 }
@@ -382,6 +392,7 @@
                 return 0;
         }
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         if ([[m_pasteboard.get() types] containsObject:(NSString *)kUTTypeURL]) {
             didWriteData = [m_pasteboard.get() setString:[url absoluteString] forType:(NSString *)kUTTypeURL];
             if (!didWriteData)
@@ -393,6 +404,7 @@
             if (!didWriteData)
                 return 0;
         }
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     } else {
         didWriteData = [m_pasteboard.get() setString:string forType:pasteboardType];

Modified: trunk/Source/WebCore/platform/network/ios/WebCoreURLResponseIOS.mm (269868 => 269869)


--- trunk/Source/WebCore/platform/network/ios/WebCoreURLResponseIOS.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebCore/platform/network/ios/WebCoreURLResponseIOS.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -87,7 +87,9 @@
             if ([(NSURL *)url isFileURL]) {
                 RetainPtr<CFStringRef> extension = adoptCF(CFURLCopyPathExtension(url));
                 if (extension) {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
                     RetainPtr<CFStringRef> uti = adoptCF(UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, extension.get(), nullptr));
+ALLOW_DEPRECATED_DECLARATIONS_END
                     String MIMEType = MIMETypeFromUTITree(uti.get());
                     if (!MIMEType.isEmpty())
                         quickLookMIMEType = MIMEType.createCFString();

Modified: trunk/Source/WebCore/platform/network/mac/UTIUtilities.mm (269868 => 269869)


--- trunk/Source/WebCore/platform/network/mac/UTIUtilities.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebCore/platform/network/mac/UTIUtilities.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -39,7 +39,9 @@
 
 String MIMETypeFromUTI(const String& uti)
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     return adoptCF(UTTypeCopyPreferredTagWithClass(uti.createCFString().get(), kUTTagClassMIMEType)).get();
+ALLOW_DEPRECATED_DECLARATIONS_END
 }
 
 String MIMETypeFromUTITree(const String& uti)
@@ -46,6 +48,7 @@
 {
     auto utiCF = uti.createCFString();
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     // Check if this UTI has a MIME type.
     RetainPtr<CFStringRef> mimeType = adoptCF(UTTypeCopyPreferredTagWithClass(utiCF.get(), kUTTagClassMIMEType));
     if (mimeType)
@@ -56,6 +59,7 @@
     if (!decl)
         return emptyString();
     CFTypeRef value = CFDictionaryGetValue(decl.get(), kUTTypeConformsToKey);
+ALLOW_DEPRECATED_DECLARATIONS_END
     if (!value)
         return emptyString();
     CFTypeID typeID = CFGetTypeID(value);
@@ -112,7 +116,9 @@
 public:
     static String createValueForKey(const String& mimeType)
     {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         auto type = adoptCF(UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, mimeType.createCFString().get(), 0));
+ALLOW_DEPRECATED_DECLARATIONS_END
         if (type)
             return type.get();
         return UTIFromUnknownMIMEType(mimeType);
@@ -133,12 +139,16 @@
 
 bool isDeclaredUTI(const String& UTI)
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     return UTTypeIsDeclared(UTI.createCFString().get());
+ALLOW_DEPRECATED_DECLARATIONS_END
 }
 
 String UTIFromTag(const String& tagClass, const String& tag, const String& conformingToUTI)
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     auto u = adoptCF(UTTypeCreatePreferredIdentifierForTag(tagClass.createCFString().get(), tag.createCFString().get(), conformingToUTI.createCFString().get()));
+ALLOW_DEPRECATED_DECLARATIONS_END
     return String(u.get());
 }
 

Modified: trunk/Source/WebCore/platform/network/mac/WebCoreURLResponse.mm (269868 => 269869)


--- trunk/Source/WebCore/platform/network/mac/WebCoreURLResponse.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebCore/platform/network/mac/WebCoreURLResponse.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -311,7 +311,9 @@
                 if (!result) {
                     // If the Gatekeeper-based map doesn't have a MIME type, we'll try to figure out what it should be by
                     // looking up the file extension in the UTI maps.
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
                     RetainPtr<CFStringRef> uti = adoptCF(UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, extension.get(), 0));
+ALLOW_DEPRECATED_DECLARATIONS_END
                     String MIMEType = MIMETypeFromUTITree(uti.get());
                     if (!MIMEType.isEmpty())
                         result = MIMEType.createCFString();

Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (269868 => 269869)


--- trunk/Source/WebCore/rendering/RenderThemeMac.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -2592,8 +2592,10 @@
     
     if (!attachmentType.isEmpty()) {
         if (equalIgnoringASCIICase(attachmentType, "multipart/x-folder") || equalIgnoringASCIICase(attachmentType, "application/vnd.apple.folder")) {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
             if (auto icon = Icon::createIconForUTI(kUTTypeFolder))
                 return icon;
+ALLOW_DEPRECATED_DECLARATIONS_END
         } else {
             String UTI;
             if (isDeclaredUTI(attachmentType))

Modified: trunk/Source/WebKit/ChangeLog (269868 => 269869)


--- trunk/Source/WebKit/ChangeLog	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebKit/ChangeLog	2020-11-16 20:14:05 UTC (rev 269869)
@@ -1,3 +1,42 @@
+2020-11-16  Devin Rousso  <[email protected]>
+
+        Ignore deprecation warnings for the uniform types C API
+        https://bugs.webkit.org/show_bug.cgi?id=218989
+
+        Reviewed by Tim Horton.
+
+        These should eventually be replaced with the ObjC API `UniformTypeIdentifiers.framework`.
+        See <https://developer.apple.com/documentation/uniformtypeidentifiers>.
+
+        * Shared/ios/WebIconUtilities.mm:
+        (WebKit::iconForFile):
+        * Shared/mac/PasteboardTypes.mm:
+        (WebKit::PasteboardTypes::forEditing):
+        (WebKit::PasteboardTypes::forSelection):
+        * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
+        (API::isDeclaredOrDynamicTypeIdentifier):
+        (API::Attachment::mimeType const):
+        (API::Attachment::utiType const):
+        (API::Attachment::setFileWrapperAndUpdateContentType):
+        * UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm:
+        (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (WebKit::WebViewImpl::setPromisedDataForImage):
+        * UIProcess/ios/WKContentView.mm:
+        (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView supportedPasteboardTypesForCurrentSelection]):
+        * UIProcess/ios/WKPDFView.mm:
+        (-[WKPDFView actionSheetAssistant:performAction:]):
+        * UIProcess/ios/forms/WKFileUploadPanel.mm:
+        (-[WKFileUploadPanel currentAvailableActionTitles]):
+        (-[WKFileUploadPanel contextMenuInteraction:configurationForMenuAtLocation:]):
+        (-[WKFileUploadPanel showFilePickerMenu]):
+        (-[WKFileUploadPanel showDocumentPickerMenu]):
+        (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
+        * UIProcess/mac/WebContextMenuProxyMac.mm:
+        (WebKit::WebContextMenuProxyMac::setupServicesMenu):
+
 2020-11-16  Don Olmstead  <[email protected]>
 
         Non-unified build fixes, mid November 2020 edition

Modified: trunk/Source/WebKit/Shared/ios/WebIconUtilities.mm (269868 => 269869)


--- trunk/Source/WebKit/Shared/ios/WebIconUtilities.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebKit/Shared/ios/WebIconUtilities.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -141,6 +141,7 @@
     if (!fileExtension.length)
         return nil;
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     RetainPtr<CFStringRef> fileUTI = adoptCF(UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (CFStringRef)fileExtension, 0));
 
     if (UTTypeConformsTo(fileUTI.get(), kUTTypeImage))
@@ -148,6 +149,7 @@
 
     if (UTTypeConformsTo(fileUTI.get(), kUTTypeMovie))
         return iconForVideoFile(file);
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     return fallbackIconForFile(file);
 }

Modified: trunk/Source/WebKit/Shared/mac/PasteboardTypes.mm (269868 => 269869)


--- trunk/Source/WebKit/Shared/mac/PasteboardTypes.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebKit/Shared/mac/PasteboardTypes.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -46,8 +46,10 @@
     
 NSArray* PasteboardTypes::forEditing()
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN 
     static NSArray *types = retain(@[WebArchivePboardType, (__bridge NSString *)kUTTypeWebArchive, WebCore::legacyHTMLPasteboardType(), WebCore::legacyFilenamesPasteboardType(), WebCore::legacyTIFFPasteboardType(), WebCore::legacyPDFPasteboardType(),
         WebCore::legacyURLPasteboardType(), WebCore::legacyRTFDPasteboardType(), WebCore::legacyRTFPasteboardType(), WebCore::legacyStringPasteboardType(), WebCore::legacyColorPasteboardType(), (__bridge NSString *)kUTTypePNG]);
+ALLOW_DEPRECATED_DECLARATIONS_END
     return types;
 }
 
@@ -71,7 +73,9 @@
 
 NSArray* PasteboardTypes::forSelection()
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN 
     static NSArray *types = retain(@[WebArchivePboardType, (__bridge NSString *)kUTTypeWebArchive, WebCore::legacyRTFDPasteboardType(), WebCore::legacyRTFPasteboardType(), WebCore::legacyStringPasteboardType()]);
+ALLOW_DEPRECATED_DECLARATIONS_END
     return types;
 }
     

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/APIAttachmentCocoa.mm (269868 => 269869)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/APIAttachmentCocoa.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/APIAttachmentCocoa.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -48,7 +48,9 @@
 
 static BOOL isDeclaredOrDynamicTypeIdentifier(NSString *type)
 {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     return UTTypeIsDeclared((__bridge CFStringRef)type) || UTTypeIsDynamic((__bridge CFStringRef)type);
+ALLOW_DEPRECATED_DECLARATIONS_END
 }
 
 NSFileWrapper *Attachment::fileWrapper() const
@@ -73,7 +75,9 @@
     if (!isDeclaredOrDynamicTypeIdentifier(contentType))
         return contentType;
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     return adoptCF(UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)contentType, kUTTagClassMIMEType)).get();
+ALLOW_DEPRECATED_DECLARATIONS_END
 }
 
 WTF::String Attachment::utiType() const
@@ -84,7 +88,9 @@
     if (isDeclaredOrDynamicTypeIdentifier(contentType))
         return contentType;
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     return adoptCF(UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, (__bridge CFStringRef)contentType, nullptr)).get();
+ALLOW_DEPRECATED_DECLARATIONS_END
 }
 
 WTF::String Attachment::fileName() const
@@ -100,6 +106,7 @@
 void Attachment::setFileWrapperAndUpdateContentType(NSFileWrapper *fileWrapper, NSString *contentType)
 {
     if (!contentType.length) {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         if (fileWrapper.directory)
             contentType = (NSString *)kUTTypeDirectory;
         else if (fileWrapper.regularFile) {
@@ -108,6 +115,7 @@
             if (!contentType.length)
                 contentType = (NSString *)kUTTypeData;
         }
+ALLOW_DEPRECATED_DECLARATIONS_END
     }
 
     setContentType(contentType);

Modified: trunk/Source/WebKit/UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm (269868 => 269869)


--- trunk/Source/WebKit/UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebKit/UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -47,7 +47,9 @@
 
     RetainPtr<CGImageRef> cgImage = bitmap->makeCGImage();
     RetainPtr<NSMutableData> imageData = adoptNS([[NSMutableData alloc] init]);
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     RetainPtr<CGImageDestinationRef> destination = adoptCF(CGImageDestinationCreateWithData((CFMutableDataRef)imageData.get(), kUTTypePNG, 1, 0));
+ALLOW_DEPRECATED_DECLARATIONS_END
     if (!destination)
         return WTF::nullopt;
 

Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm (269868 => 269869)


--- trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -4356,7 +4356,9 @@
 
     if (archiveBuffer) {
         auto nsData = archiveBuffer->createNSData();
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         [pasteboard setData:nsData.get() forType:(__bridge NSString *)kUTTypeWebArchive];
+ALLOW_DEPRECATED_DECLARATIONS_END
         [pasteboard setData:nsData.get() forType:PasteboardTypes::WebArchivePboardType];
     }
 

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentView.mm (269868 => 269869)


--- trunk/Source/WebKit/UIProcess/ios/WKContentView.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentView.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -197,7 +197,9 @@
     self.layer.hitTestsAsOpaque = YES;
 
 #if PLATFORM(MACCATALYST)
+    ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     [self _setFocusRingType:UIFocusRingTypeNone];
+    ALLOW_DEPRECATED_DECLARATIONS_END
 #endif
 
 #if HAVE(VISIBILITY_PROPAGATION_VIEW)

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (269868 => 269869)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -3013,7 +3013,9 @@
     static NSMutableArray *plainTextTypes = nil;
     if (!plainTextTypes) {
         plainTextTypes = [[NSMutableArray alloc] init];
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         [plainTextTypes addObject:(id)kUTTypeURL];
+ALLOW_DEPRECATED_DECLARATIONS_END
         [plainTextTypes addObjectsFromArray:UIPasteboardTypeListString];
 
         richTypes = [[NSMutableArray alloc] init];

Modified: trunk/Source/WebKit/UIProcess/ios/WKPDFView.mm (269868 => 269869)


--- trunk/Source/WebKit/UIProcess/ios/WKPDFView.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebKit/UIProcess/ios/WKPDFView.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -528,10 +528,12 @@
     if (action != WebKit::SheetAction::Copy)
         return;
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     NSDictionary *representations = @{
         (NSString *)kUTTypeUTF8PlainText : (NSString *)_positionInformation.url.string(),
         (NSString *)kUTTypeURL : (NSURL *)_positionInformation.url,
     };
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     [UIPasteboard generalPasteboard].items = @[ representations ];
 }

Modified: trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm (269868 => 269869)


--- trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -317,8 +317,10 @@
     NSMutableArray<NSString *> *actionTitles = [NSMutableArray array];
 
     NSArray *mediaTypes = UTIsForMIMETypes(_mimeTypes.get()).allObjects;
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     BOOL allowsImageMediaType = !mediaTypes.count || arrayContainsUTIThatConformsTo(mediaTypes, kUTTypeImage);
     BOOL allowsVideoMediaType = !mediaTypes.count || arrayContainsUTIThatConformsTo(mediaTypes, kUTTypeMovie);
+ALLOW_DEPRECATED_DECLARATIONS_END
     if (allowsImageMediaType || allowsVideoMediaType) {
         [actionTitles addObject:@"Photo Library"];
         if (allowsImageMediaType && allowsVideoMediaType)
@@ -338,6 +340,7 @@
 {
     NSMutableSet *mediaTypes = [NSMutableSet set];
     for (NSString *mimeType in mimeTypes) {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         if ([mimeType caseInsensitiveCompare:@"image/*"] == NSOrderedSame)
             [mediaTypes addObject:(__bridge NSString *)kUTTypeImage];
         else if ([mimeType caseInsensitiveCompare:@"video/*"] == NSOrderedSame)
@@ -351,6 +354,7 @@
             if (!uti.isEmpty())
                 [mediaTypes addObject:(__bridge NSString *)uti];
         }
+ALLOW_DEPRECATED_DECLARATIONS_END
     }
     return mediaTypes;
 }
@@ -427,8 +431,10 @@
         NSArray *actions;
         NSArray *mediaTypes = UTIsForMIMETypes(_mimeTypes.get()).allObjects;
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         BOOL allowsImageMediaType = !mediaTypes.count || arrayContainsUTIThatConformsTo(mediaTypes, kUTTypeImage);
         BOOL allowsVideoMediaType = !mediaTypes.count || arrayContainsUTIThatConformsTo(mediaTypes, kUTTypeMovie);
+ALLOW_DEPRECATED_DECLARATIONS_END
         auto strongSelf = weakSelf.get();
         
         if (!strongSelf)
@@ -494,7 +500,9 @@
 - (void)showFilePickerMenu
 {
     NSArray *mediaTypes = UTIsForMIMETypes(_mimeTypes.get()).allObjects;
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     NSArray *documentTypes = mediaTypes.count ? mediaTypes : @[(__bridge NSString *)kUTTypeItem];
+ALLOW_DEPRECATED_DECLARATIONS_END
     
     _documentPickerController = adoptNS([[UIDocumentPickerViewController alloc] initWithDocumentTypes:documentTypes inMode:UIDocumentPickerModeImport]);
     [_documentPickerController setAllowsMultipleSelection:_allowMultipleFiles];
@@ -510,8 +518,10 @@
     // FIXME 49961589: Support picking media with UIImagePickerController
 #if HAVE(UICONTEXTMENU_LOCATION)
     NSArray *mediaTypes = UTIsForMIMETypes(_mimeTypes.get()).allObjects;
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     BOOL allowsImageMediaType = !mediaTypes.count || arrayContainsUTIThatConformsTo(mediaTypes, kUTTypeImage);
     BOOL allowsVideoMediaType = !mediaTypes.count || arrayContainsUTIThatConformsTo(mediaTypes, kUTTypeMovie);
+ALLOW_DEPRECATED_DECLARATIONS_END
     BOOL shouldPresentDocumentMenuViewController = allowsImageMediaType || allowsVideoMediaType;
     if (shouldPresentDocumentMenuViewController) {
         [self ensureContextMenuInteraction];
@@ -806,6 +816,7 @@
 {
     NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType];
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     // For videos from the existing library or camera, the media URL will give us a file path.
     if (UTTypeConformsTo((CFStringRef)mediaType, kUTTypeMovie)) {
         NSURL *mediaURL = [info objectForKey:UIImagePickerControllerMediaURL];
@@ -826,6 +837,7 @@
         failureBlock();
         return;
     }
+ALLOW_DEPRECATED_DECLARATIONS_END
 
 #if PLATFORM(IOS_FAMILY)
     if (NSURL *imageURL = info[UIImagePickerControllerImageURL]) {

Modified: trunk/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm (269868 => 269869)


--- trunk/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -184,7 +184,9 @@
         auto cgImage = image->makeCGImage();
         auto nsImage = adoptNS([[NSImage alloc] initWithCGImage:cgImage.get() size:image->size()]);
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         auto itemProvider = adoptNS([[NSItemProvider alloc] initWithItem:[nsImage TIFFRepresentation] typeIdentifier:(__bridge NSString *)kUTTypeTIFF]);
+ALLOW_DEPRECATED_DECLARATIONS_END
         items = @[ itemProvider.get() ];
     } else if (!m_context.controlledSelectionData().isEmpty()) {
         auto selectionData = adoptNS([[NSData alloc] initWithBytes:static_cast<const void*>(m_context.controlledSelectionData().data()) length:m_context.controlledSelectionData().size()]);

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (269868 => 269869)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2020-11-16 20:14:05 UTC (rev 269869)
@@ -1,3 +1,18 @@
+2020-11-16  Devin Rousso  <[email protected]>
+
+        Ignore deprecation warnings for the uniform types C API
+        https://bugs.webkit.org/show_bug.cgi?id=218989
+
+        Reviewed by Tim Horton.
+
+        These should eventually be replaced with the ObjC API `UniformTypeIdentifiers.framework`.
+        See <https://developer.apple.com/documentation/uniformtypeidentifiers>.
+
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView _documentFragmentFromPasteboard:inContext:allowPlainText:]):
+        (+[WebHTMLView _insertablePasteboardTypes]):
+        (-[WebHTMLView _documentFragmentFromPasteboard:forType:inContext:subresources:]):
+
 2020-11-16  Megan Gardner  <[email protected]>
 
         Add menu support for app highlights for books

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm (269868 => 269869)


--- trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm	2020-11-16 20:05:00 UTC (rev 269868)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm	2020-11-16 20:14:05 UTC (rev 269869)
@@ -1190,8 +1190,10 @@
     if ([types containsObject:WebCore::legacyPDFPasteboardType()] && (fragment = [self _documentFragmentFromPasteboard:pasteboard forType:WebCore::legacyPDFPasteboardType() inContext:context subresources:0]))
         return fragment;
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if ([types containsObject:(NSString *)kUTTypePNG] && (fragment = [self _documentFragmentFromPasteboard:pasteboard forType:(NSString *)kUTTypePNG inContext:context subresources:0]))
         return fragment;
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     if ([types containsObject:WebCore::legacyURLPasteboardType()] && (fragment = [self _documentFragmentFromPasteboard:pasteboard forType:WebCore::legacyURLPasteboardType() inContext:context subresources:0]))
         return fragment;
@@ -1965,8 +1967,10 @@
 {
     static NSArray *types = nil;
     if (!types) {
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         types = [[NSArray alloc] initWithObjects:WebArchivePboardType, WebCore::legacyHTMLPasteboardType(), WebCore::legacyFilenamesPasteboardType(), WebCore::legacyTIFFPasteboardType(), WebCore::legacyPDFPasteboardType(),
             WebCore::legacyURLPasteboardType(), WebCore::legacyRTFDPasteboardType(), WebCore::legacyRTFPasteboardType(), WebCore::legacyStringPasteboardType(), WebCore::legacyColorPasteboardType(), kUTTypePNG, nil];
+ALLOW_DEPRECATED_DECLARATIONS_END
         CFRetain(types);
     }
     return types;
@@ -2356,8 +2360,10 @@
         return [self _web_documentFragmentFromPasteboard:pasteboard pasteboardType:WebCore::legacyTIFFPasteboardType() imageMIMEType:@"image/tiff"];
     if ([pboardType isEqualToString:WebCore::legacyPDFPasteboardType()])
         return [self _web_documentFragmentFromPasteboard:pasteboard pasteboardType:WebCore::legacyPDFPasteboardType() imageMIMEType:@"application/pdf"];
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     if ([pboardType isEqualToString:(NSString *)kUTTypePNG])
         return [self _web_documentFragmentFromPasteboard:pasteboard pasteboardType:(NSString *)kUTTypePNG imageMIMEType:@"image/png"];
+ALLOW_DEPRECATED_DECLARATIONS_END
 
     if ([pboardType isEqualToString:WebCore::legacyURLPasteboardType()]) {
         NSURL *URL = "" URLFromPasteboard:pasteboard];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to