Modified: trunk/Source/WebCore/ChangeLog (220882 => 220883)
--- trunk/Source/WebCore/ChangeLog 2017-08-17 22:03:37 UTC (rev 220882)
+++ trunk/Source/WebCore/ChangeLog 2017-08-17 22:20:02 UTC (rev 220883)
@@ -1,3 +1,22 @@
+2017-08-17 Wenson Hsieh <[email protected]>
+
+ Fix the build on other platforms after r220865
+ https://bugs.webkit.org/show_bug.cgi?id=175683
+
+ Reviewed by Tim Horton.
+
+ Instead of special casing iOS 10 behavior with __IPHONE_OS_VERSION_MAX_ALLOWED < 110000, revert to special
+ casing iOS 11 behavior with __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000. This is because other targets that are
+ neither iOS 10 nor 11 will fail the "before iOS 11" compile-time check, and subsequently assume that item
+ providers exist. To fix this, flip the compiler-time checks and the order of codeblocks in the
+ PlatformPasteboard::write methods.
+
+ There is no change in behavior.
+
+ * platform/ios/PlatformPasteboardIOS.mm:
+ (WebCore::registerItemToPasteboard):
+ (WebCore::PlatformPasteboard::write):
+
2017-08-17 Michael Catanzaro <[email protected]>
-Wreturn-type warnings in CryptoKey.cpp and SubtleCrypto.cpp
Modified: trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm (220882 => 220883)
--- trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm 2017-08-17 22:03:37 UTC (rev 220882)
+++ trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm 2017-08-17 22:20:02 UTC (rev 220883)
@@ -175,8 +175,23 @@
static NSString *webIOSPastePboardType = @"iOS rich content paste pasteboard type";
-#if __IPHONE_OS_VERSION_MAX_ALLOWED < 110000
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
+static void registerItemToPasteboard(WebItemProviderRegistrationInfoList *representationsToRegister, id <AbstractPasteboard> pasteboard)
+{
+ UIItemProvider *itemProvider = [representationsToRegister itemProvider];
+ if (!itemProvider) {
+ [pasteboard setItemProviders:@[ ]];
+ return;
+ }
+
+ [pasteboard setItemProviders:@[ itemProvider ]];
+ if ([pasteboard respondsToSelector:@selector(setRegistrationInfoLists:)])
+ [pasteboard setRegistrationInfoLists:@[ representationsToRegister ]];
+}
+
+#else
+
static RetainPtr<NSDictionary> richTextRepresentationsForPasteboardWebContent(const PasteboardWebContent& content)
{
RetainPtr<NSMutableDictionary> representations = adoptNS([[NSMutableDictionary alloc] init]);
@@ -199,21 +214,6 @@
return representations;
}
-#else
-
-static void registerItemToPasteboard(WebItemProviderRegistrationInfoList *representationsToRegister, id <AbstractPasteboard> pasteboard)
-{
- UIItemProvider *itemProvider = [representationsToRegister itemProvider];
- if (!itemProvider) {
- [pasteboard setItemProviders:@[ ]];
- return;
- }
-
- [pasteboard setItemProviders:@[ itemProvider ]];
- if ([pasteboard respondsToSelector:@selector(setRegistrationInfoLists:)])
- [pasteboard setRegistrationInfoLists:@[ representationsToRegister ]];
-}
-
#endif
#if ENABLE(DATA_INTERACTION)
@@ -252,21 +252,7 @@
void PlatformPasteboard::write(const PasteboardWebContent& content)
{
-#if __IPHONE_OS_VERSION_MAX_ALLOWED < 110000
- RetainPtr<NSMutableDictionary> representations = adoptNS([[NSMutableDictionary alloc] init]);
- [representations addEntriesFromDictionary:richTextRepresentationsForPasteboardWebContent(content).autorelease()];
-
- NSString *textAsString = content.dataInStringFormat;
- [representations setValue:[textAsString dataUsingEncoding:NSUTF8StringEncoding] forKey:(NSString *)kUTTypeUTF8PlainText];
- [representations setValue:[textAsString dataUsingEncoding:NSUTF16StringEncoding] forKey:(NSString *)kUTTypeUTF16PlainText];
- // 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>.
- [representations setValue:textAsString forKey:(NSString *)kUTTypeText];
-
- // Explicitly cast m_pasteboard to UIPasteboard * to work around rdar://problem/33383354.
- ASSERT([m_pasteboard isKindOfClass:getUIPasteboardClass()]);
- [(UIPasteboard *)m_pasteboard setItems:@[representations.get()]];
-#else
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
auto representationsToRegister = adoptNS([[WebItemProviderRegistrationInfoList alloc] init]);
[representationsToRegister addData:[webIOSPastePboardType dataUsingEncoding:NSUTF8StringEncoding] forType:webIOSPastePboardType];
@@ -294,23 +280,26 @@
addRepresentationsForPlainText(representationsToRegister.get(), content.dataInStringFormat);
registerItemToPasteboard(representationsToRegister.get(), m_pasteboard.get());
+#else
+ RetainPtr<NSMutableDictionary> representations = adoptNS([[NSMutableDictionary alloc] init]);
+ [representations addEntriesFromDictionary:richTextRepresentationsForPasteboardWebContent(content).autorelease()];
+
+ NSString *textAsString = content.dataInStringFormat;
+ [representations setValue:[textAsString dataUsingEncoding:NSUTF8StringEncoding] forKey:(NSString *)kUTTypeUTF8PlainText];
+ [representations setValue:[textAsString dataUsingEncoding:NSUTF16StringEncoding] forKey:(NSString *)kUTTypeUTF16PlainText];
+ // 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>.
+ [representations setValue:textAsString forKey:(NSString *)kUTTypeText];
+
+ // Explicitly cast m_pasteboard to UIPasteboard * to work around rdar://problem/33383354.
+ ASSERT([m_pasteboard isKindOfClass:getUIPasteboardClass()]);
+ [(UIPasteboard *)m_pasteboard setItems:@[representations.get()]];
#endif
}
void PlatformPasteboard::write(const PasteboardImage& pasteboardImage)
{
-#if __IPHONE_OS_VERSION_MAX_ALLOWED < 110000
- RetainPtr<NSMutableDictionary> representations = adoptNS([[NSMutableDictionary alloc] init]);
- if (!pasteboardImage.resourceMIMEType.isNull()) {
- [representations setObject:pasteboardImage.resourceData->createNSData().get() forKey:pasteboardImage.resourceMIMEType];
- if (!pasteboardImage.url.url.isNull())
- [representations setObject:(NSURL *)pasteboardImage.url.url forKey:(NSString *)kUTTypeURL];
- }
-
- // Explicitly cast m_pasteboard to UIPasteboard * to work around rdar://problem/33383354.
- ASSERT([m_pasteboard isKindOfClass:getUIPasteboardClass()]);
- [(UIPasteboard *)m_pasteboard setItems:@[representations.get()]];
-#else
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
auto representationsToRegister = adoptNS([[WebItemProviderRegistrationInfoList alloc] init]);
auto& types = pasteboardImage.clientTypes;
@@ -339,12 +328,36 @@
}
registerItemToPasteboard(representationsToRegister.get(), m_pasteboard.get());
+#else
+ RetainPtr<NSMutableDictionary> representations = adoptNS([[NSMutableDictionary alloc] init]);
+ if (!pasteboardImage.resourceMIMEType.isNull()) {
+ [representations setObject:pasteboardImage.resourceData->createNSData().get() forKey:pasteboardImage.resourceMIMEType];
+ if (!pasteboardImage.url.url.isNull())
+ [representations setObject:(NSURL *)pasteboardImage.url.url forKey:(NSString *)kUTTypeURL];
+ }
+
+ // Explicitly cast m_pasteboard to UIPasteboard * to work around rdar://problem/33383354.
+ ASSERT([m_pasteboard isKindOfClass:getUIPasteboardClass()]);
+ [(UIPasteboard *)m_pasteboard setItems:@[representations.get()]];
#endif
}
void PlatformPasteboard::write(const String& pasteboardType, const String& text)
{
-#if __IPHONE_OS_VERSION_MAX_ALLOWED < 110000
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
+ auto representationsToRegister = adoptNS([[WebItemProviderRegistrationInfoList alloc] init]);
+
+ NSString *pasteboardTypeAsNSString = pasteboardType;
+ if (!text.isEmpty() && pasteboardTypeAsNSString.length) {
+ auto pasteboardTypeAsCFString = (CFStringRef)pasteboardTypeAsNSString;
+ if (UTTypeConformsTo(pasteboardTypeAsCFString, kUTTypeURL) || UTTypeConformsTo(pasteboardTypeAsCFString, kUTTypeText))
+ addRepresentationsForPlainText(representationsToRegister.get(), text);
+ else
+ [representationsToRegister addData:[pasteboardTypeAsNSString dataUsingEncoding:NSUTF8StringEncoding] forType:pasteboardType];
+ }
+
+ registerItemToPasteboard(representationsToRegister.get(), m_pasteboard.get());
+#else
RetainPtr<NSDictionary> representations = adoptNS([[NSMutableDictionary alloc] init]);
NSString *textAsString = text;
@@ -363,27 +376,12 @@
// Explicitly cast m_pasteboard to UIPasteboard * to work around rdar://problem/33383354.
ASSERT([m_pasteboard isKindOfClass:getUIPasteboardClass()]);
[(UIPasteboard *)m_pasteboard setItems:@[representations.get()]];
-#else
- auto representationsToRegister = adoptNS([[WebItemProviderRegistrationInfoList alloc] init]);
-
- NSString *pasteboardTypeAsNSString = pasteboardType;
- if (!text.isEmpty() && pasteboardTypeAsNSString.length) {
- auto pasteboardTypeAsCFString = (CFStringRef)pasteboardTypeAsNSString;
- if (UTTypeConformsTo(pasteboardTypeAsCFString, kUTTypeURL) || UTTypeConformsTo(pasteboardTypeAsCFString, kUTTypeText))
- addRepresentationsForPlainText(representationsToRegister.get(), text);
- else
- [representationsToRegister addData:[pasteboardTypeAsNSString dataUsingEncoding:NSUTF8StringEncoding] forType:pasteboardType];
- }
-
- registerItemToPasteboard(representationsToRegister.get(), m_pasteboard.get());
#endif
}
void PlatformPasteboard::write(const PasteboardURL& url)
{
-#if __IPHONE_OS_VERSION_MAX_ALLOWED < 110000
- write(kUTTypeURL, url.url.string());
-#else
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
auto representationsToRegister = adoptNS([[WebItemProviderRegistrationInfoList alloc] init]);
if (NSURL *nsURL = url.url) {
@@ -393,6 +391,8 @@
}
registerItemToPasteboard(representationsToRegister.get(), m_pasteboard.get());
+#else
+ write(kUTTypeURL, url.url.string());
#endif
}
Modified: trunk/Tools/ChangeLog (220882 => 220883)
--- trunk/Tools/ChangeLog 2017-08-17 22:03:37 UTC (rev 220882)
+++ trunk/Tools/ChangeLog 2017-08-17 22:20:02 UTC (rev 220883)
@@ -1,3 +1,15 @@
+2017-08-17 Wenson Hsieh <[email protected]>
+
+ Fix the build on other platforms after r220865
+ https://bugs.webkit.org/show_bug.cgi?id=175683
+
+ Reviewed by Tim Horton.
+
+ Check __IPHONE_OS_VERSION_MAX_ALLOWED instead of __IPHONE_OS_VERSION_MIN_REQUIRED in an SPI header. SPI
+ availability is determined by SDK version rather than deployment version.
+
+ * TestWebKitAPI/ios/UIKitSPI.h:
+
2017-08-17 Andreas Kling <[email protected]>
Disable CSS regions at compile time
Modified: trunk/Tools/TestWebKitAPI/ios/UIKitSPI.h (220882 => 220883)
--- trunk/Tools/TestWebKitAPI/ios/UIKitSPI.h 2017-08-17 22:03:37 UTC (rev 220882)
+++ trunk/Tools/TestWebKitAPI/ios/UIKitSPI.h 2017-08-17 22:20:02 UTC (rev 220883)
@@ -25,7 +25,7 @@
#if PLATFORM(IOS)
-#if USE(APPLE_INTERNAL_SDK) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
+#if USE(APPLE_INTERNAL_SDK) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
#import <UIKit/UIApplication_Private.h>