Add iOS 11 SPI
authorjbedard@apple.com <jbedard@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Jul 2017 05:41:54 +0000 (05:41 +0000)
committerjbedard@apple.com <jbedard@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Jul 2017 05:41:54 +0000 (05:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=174430
<rdar://problem/33269288>

Reviewed by Tim Horton.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj: Add sqlite3SPI.h header.
* platform/ios/PlatformPasteboardIOS.mm: Move UIKit SPI to UIKitSPI.h.
* platform/ios/WebItemProviderPasteboard.mm: Ditto.
* platform/network/cf/FormDataStreamCFNet.cpp: Explicitly define fnfErr and remove
MacErrors.h header for iOS.
* platform/spi/cocoa/IOSurfaceSPI.h: IOSurface is no longer SPI in iOS 11.
* platform/spi/cocoa/PassKitSPI.h: Do not re-define setRequiredShippingContactFields
and setRequiredBillingContactFields in iOS 11.
* platform/spi/cocoa/QuartzCoreSPI.h: Added QuartzCoreSPI used in iOS 11.
* platform/spi/ios/UIKitSPI.h: Add drag-and-drop SPI.
* platform/spi/ios/sqlite3SPI.h: Define required sqlite3 macros.
* platform/sql/SQLiteFileSystem.cpp: Use sqlite3SPI.h.

Source/WebKit:

* Platform/spi/ios/UIKitSPI.h: Add drag-and-drop SPI for iOS 11.
* UIProcess/ios/WKContentViewInteraction.mm: Move UIKit SPI to UIKitSPI.h.

Source/WebKitLegacy:

* Storage/StorageTracker.cpp: sqlite3_private.h no longer exists in the iOS
Simulator SDK, explicitly define the required macro.

Source/WTF:

* Configurations/WTF.xcconfig: Exclude MachExceptions.def when building iOS 11 for
the iOS simulator.

Tools:

* TestWebKitAPI/Tests/ios/DataInteractionTests.mm: Define drag-and-drop API required for testing.
* TestWebKitAPI/ios/DataInteractionSimulator.h: Ditto.
* TestWebKitAPI/ios/DataInteractionSimulator.mm: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219537 268f45cc-cd09-0410-ab3c-d52691b4dbfc

23 files changed:
Source/WTF/ChangeLog
Source/WTF/Configurations/WTF.xcconfig
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/graphics/cocoa/IOSurface.mm
Source/WebCore/platform/ios/PlatformPasteboardIOS.mm
Source/WebCore/platform/ios/WebItemProviderPasteboard.mm
Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp
Source/WebCore/platform/spi/cocoa/IOSurfaceSPI.h
Source/WebCore/platform/spi/cocoa/PassKitSPI.h
Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h
Source/WebCore/platform/spi/ios/SQLite3SPI.h [new file with mode: 0644]
Source/WebCore/platform/spi/ios/UIKitSPI.h
Source/WebCore/platform/sql/SQLiteFileSystem.cpp
Source/WebKit/ChangeLog
Source/WebKit/Platform/spi/ios/UIKitSPI.h
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKitLegacy/ChangeLog
Source/WebKitLegacy/Storage/StorageTracker.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/ios/DataInteractionTests.mm
Tools/TestWebKitAPI/ios/DataInteractionSimulator.h
Tools/TestWebKitAPI/ios/DataInteractionSimulator.mm

index 105295af0776e17725515ab6998a80931bab3740..0180818c0fcbc8825168d2b97a9bd44dc1fa4efe 100644 (file)
@@ -1,3 +1,14 @@
+2017-07-14  Jonathan Bedard  <jbedard@apple.com>
+
+        Add iOS 11 SPI
+        https://bugs.webkit.org/show_bug.cgi?id=174430
+        <rdar://problem/33269288>
+
+        Reviewed by Tim Horton.
+
+        * Configurations/WTF.xcconfig: Exclude MachExceptions.def when building iOS 11 for
+        the iOS simulator.
+
 2017-07-14  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r219510.
index af199ceb9506f8950d33a9ce4807ba6dbb7b27e5..e396a61ca11be7fd80ea582aba67d532dff78fb6 100644 (file)
@@ -29,4 +29,5 @@ GCC_SYMBOLS_PRIVATE_EXTERN = YES;
 STRIP_INSTALLED_PRODUCT = NO;
 
 EXCLUDED_SOURCE_FILE_NAMES_ = MachExceptions.defs
-EXCLUDED_SOURCE_FILE_NAMES[sdk=iphoneos*] = $(EXCLUDED_SOURCE_FILE_NAMES_$(USE_INTERNAL_SDK))
+EXCLUDED_SOURCE_FILE_NAMES[sdk=iphone*] = $(EXCLUDED_SOURCE_FILE_NAMES_$(USE_INTERNAL_SDK))
+EXCLUDED_SOURCE_FILE_NAMES[sdk=iphonesimulator10*] =
index eab7df5dbd349328507d49a4970a262cc8c6043d..b4eab052cf5bbda9554e092583da99b56f0b478c 100644 (file)
@@ -1,3 +1,24 @@
+2017-07-14  Jonathan Bedard  <jbedard@apple.com>
+
+        Add iOS 11 SPI
+        https://bugs.webkit.org/show_bug.cgi?id=174430
+        <rdar://problem/33269288>
+
+        Reviewed by Tim Horton.
+
+        * WebCore.xcodeproj/project.pbxproj: Add sqlite3SPI.h header.
+        * platform/ios/PlatformPasteboardIOS.mm: Move UIKit SPI to UIKitSPI.h.
+        * platform/ios/WebItemProviderPasteboard.mm: Ditto.
+        * platform/network/cf/FormDataStreamCFNet.cpp: Explicitly define fnfErr and remove
+        MacErrors.h header for iOS.
+        * platform/spi/cocoa/IOSurfaceSPI.h: IOSurface is no longer SPI in iOS 11.
+        * platform/spi/cocoa/PassKitSPI.h: Do not re-define setRequiredShippingContactFields
+        and setRequiredBillingContactFields in iOS 11.
+        * platform/spi/cocoa/QuartzCoreSPI.h: Added QuartzCoreSPI used in iOS 11.
+        * platform/spi/ios/UIKitSPI.h: Add drag-and-drop SPI.
+        * platform/spi/ios/sqlite3SPI.h: Define required sqlite3 macros.
+        * platform/sql/SQLiteFileSystem.cpp: Use sqlite3SPI.h.
+
 2017-07-14  Zan Dobersek  <zdobersek@igalia.com>
 
         [GCrypt] Implement CryptoKeyRSA PKCS#8 exports
index 9fc218c1a759c02964cc42df9f4bd24ed99e29b0..af548f93c0a081ad8613b968ec6e2af74307df7f 100644 (file)
                31C0FF3E0E4CEFAC007D6FE5 /* JSWebKitAnimationEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 31C0FF3A0E4CEFAC007D6FE5 /* JSWebKitAnimationEvent.h */; };
                31C0FF3F0E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31C0FF3B0E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.cpp */; };
                31C0FF400E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 31C0FF3C0E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.h */; };
+               31CBAF6C1F19868500849F73 /* SQLite3SPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 31AA003F1EF44829009DFC06 /* SQLite3SPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
                31D591B316697A6C00E6BF02 /* PlugInClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 31D591B116697A6C00E6BF02 /* PlugInClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
                31DCD29D1AB4FBDE0072E817 /* AnimationTrigger.h in Headers */ = {isa = PBXBuildFile; fileRef = 31DCD29C1AB4FBDE0072E817 /* AnimationTrigger.h */; settings = {ATTRIBUTES = (Private, ); }; };
                31DCDF431DA1C45400EA5B93 /* ExtendedColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31DCDF411DA1C45400EA5B93 /* ExtendedColor.cpp */; };
                31A795C31888B72400382F90 /* ANGLEInstancedArrays.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ANGLEInstancedArrays.idl; sourceTree = "<group>"; };
                31A795C41888BAD100382F90 /* JSANGLEInstancedArrays.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSANGLEInstancedArrays.cpp; sourceTree = "<group>"; };
                31A795C51888BAD100382F90 /* JSANGLEInstancedArrays.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSANGLEInstancedArrays.h; sourceTree = "<group>"; };
+               31AA003F1EF44829009DFC06 /* SQLite3SPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SQLite3SPI.h; sourceTree = "<group>"; };
                31AB4FFF122878A2001A7DB0 /* GraphicsContext3DIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsContext3DIOS.h; sourceTree = "<group>"; };
                31B313DA1B69871600F2AABC /* NSURLConnectionSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSURLConnectionSPI.h; sourceTree = "<group>"; };
                31B313DE1B6988C500F2AABC /* NSButtonCellSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSButtonCellSPI.h; sourceTree = "<group>"; };
                A172182419DE182B00464D17 /* ios */ = {
                        isa = PBXGroup;
                        children = (
+                               31AA003F1EF44829009DFC06 /* SQLite3SPI.h */,
                                CE1252421A16C01A00864480 /* CoreUISPI.h */,
                                2DC4CF781D2DD98900ECCC94 /* DataDetectorsUISPI.h */,
                                CEC337AE1A46086D009B8523 /* GraphicsServicesSPI.h */,
                                37BAAE581980D1DD005DFE71 /* ProtectionSpace.h in Headers */,
                                514C76750CE923A1007EF3CD /* ProtectionSpaceBase.h in Headers */,
                                372ADA38197F47B900FC501E /* ProtectionSpaceCocoa.h in Headers */,
+                               31CBAF6C1F19868500849F73 /* SQLite3SPI.h in Headers */,
                                51A052561058874000CC9E95 /* ProtectionSpaceHash.h in Headers */,
                                1AF8E11A1256592600230FF7 /* ProxyServer.h in Headers */,
                                FF945ECC161F7F3600971BC8 /* PseudoElement.h in Headers */,
                1C09D0501E31C32900725F18 /* libPAL.a */ = {
                        isa = PBXReferenceProxy;
                        fileType = archive.ar;
-                       name = libPAL.a;
-                       path = lib.a;
+                       path = libPAL.a;
                        remoteRef = 1C09D04F1E31C32900725F18 /* PBXContainerItemProxy */;
                        sourceTree = BUILT_PRODUCTS_DIR;
                };
index 9f5c9d53b66dc00cfbf430a15b806cf8965072c9..acfa75205e220e4742b3ff5af3024e97df4f7e22 100644 (file)
@@ -365,7 +365,7 @@ IOSurface::Format IOSurface::format() const
 
 IOSurfaceID IOSurface::surfaceID() const
 {
-#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED < 110000
+#if PLATFORM(IOS) && (!USE(APPLE_INTERNAL_SDK) || __IPHONE_OS_VERSION_MIN_REQUIRED < 110000)
     return 0;
 #else
     return IOSurfaceGetID(m_surface.get());
index 34ea64c6a7d9dd882223d2abe6aa9f717ae58782..345659110f602a23d88b9f64f7803de681b53b83 100644 (file)
@@ -30,6 +30,7 @@
 #import "Image.h"
 #import "Pasteboard.h"
 #import "SharedBuffer.h"
+#import "UIKitSPI.h"
 #import "URL.h"
 #import "WebItemProviderPasteboard.h"
 #import <MobileCoreServices/MobileCoreServices.h>
 #import <UIKit/UIPasteboard.h>
 #import <wtf/SoftLinking.h>
 
-#if ENABLE(DATA_INTERACTION)
-#import <UIKit/NSAttributedString+UIItemProvider.h>
-#import <UIKit/NSString+UIItemProvider.h>
-#import <UIKit/NSURL+UIItemProvider.h>
-#import <UIKit/UIImage+UIItemProvider.h>
-#endif
-
 SOFT_LINK_FRAMEWORK(UIKit)
 SOFT_LINK_CLASS(UIKit, UIImage)
 SOFT_LINK_CLASS(UIKit, UIPasteboard)
index 857ac3064ffb67054f290def9efad2bf069f22ba..6c62b2dc6db285f4e1573b96f2432b13db1ffd93 100644 (file)
 #import "UIKitSPI.h"
 #import <Foundation/NSProgress.h>
 #import <MobileCoreServices/MobileCoreServices.h>
-#import <UIKit/NSString+UIItemProvider.h>
-#import <UIKit/NSURL+UIItemProvider.h>
 #import <UIKit/UIColor.h>
 #import <UIKit/UIImage.h>
-#import <UIKit/UIItemProviderReading.h>
-#import <UIKit/UIItemProviderWriting.h>
 #import <WebCore/FileSystemIOS.h>
 #import <WebCore/Pasteboard.h>
 #import <wtf/BlockPtr.h>
index 7dd9877c08a3eb0aeb78d8ad68a2656fc1e0e241..93838244a7cb16ade025d0d2b644e976667ad277 100644 (file)
@@ -43,7 +43,7 @@
 #include <wtf/Threading.h>
 
 #if PLATFORM(IOS)
-#include <MacErrors.h>
+static const int fnfErr = -43;
 #elif PLATFORM(MAC)
 #include <CoreServices/CoreServices.h>
 #endif
index 49cb6cb5935ea0c67d08887955a0c44fcf77c24f..c8a969bfd0fff1535e3ef3f03d6213cbd64a223a 100644 (file)
 
 typedef struct __IOSurface *IOSurfaceRef;
 
+#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED < 110000
 enum {
     kIOSurfaceLockReadOnly  = 0x00000001,
 };
+#endif
 
 #endif
 
@@ -88,8 +90,10 @@ WTF_EXTERN_C_END
 
 #else
 
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300
+#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300)
+
 #import <IOSurface/IOSurfaceTypes.h>
+
 #else
 enum {
     kIOSurfacePurgeableNonVolatile = 0,
index 75cb11218d8cf593c05fc4492f23abe62b690df4..b1330e9fec849ee5187f7e0cbf35cd0ea8cdcfe6 100644 (file)
@@ -299,7 +299,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, strong) NSString *sourceApplicationSecondaryIdentifier;
 @property (nonatomic, strong) NSString *CTDataConnectionServiceType;
 
-#if !USE(APPLE_INTERNAL_SDK)
+#if (PLATFORM(MAC) && !USE(APPLE_INTERNAL_SDK)) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED < 110000)
 - (void)setRequiredShippingContactFields:(nonnull NSSet *)contactInformation;
 - (void)setRequiredBillingContactFields:(nonnull NSSet *)contactInformation;
 #endif
index a434b4b5834cfd2007b10b23377a84f30ceeb7b3..f2329686f0eecb13d627eb1b8c55b2a6807b3589 100644 (file)
@@ -125,10 +125,16 @@ typedef enum {
     kCATransactionPhasePreLayout,
     kCATransactionPhasePreCommit,
     kCATransactionPhasePostCommit,
+    kCATransactionPhaseNull = ~0u
 } CATransactionPhase;
 
 @interface CATransaction ()
 + (void)addCommitHandler:(void(^)(void))block forPhase:(CATransactionPhase)phase;
+
+#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
++ (CATransactionPhase)currentPhase;
+#endif
+
 @end
 
 @interface CALayerHost : CALayer
diff --git a/Source/WebCore/platform/spi/ios/SQLite3SPI.h b/Source/WebCore/platform/spi/ios/SQLite3SPI.h
new file mode 100644 (file)
index 0000000..e7d2957
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#include <sqlite3_private.h>
+
+#else
+
+#define SQLITE_FCNTL_TRUNCATE_DATABASE 101
+#define SQLITE_TRUNCATE_DATABASE SQLITE_FCNTL_TRUNCATE_DATABASE
+
+#endif
index 5f65b540d5bff53c8a8ce2a3f61c5fbe888987cb..2e7c4fe40f43aae771411b30e7ee1eb2ccc2a6c2 100644 (file)
 #import <UIKit/UIViewController_Private.h>
 
 #if ENABLE(DATA_INTERACTION)
+#import <UIKit/NSAttributedString+UIItemProvider.h>
+#import <UIKit/NSString+UIItemProvider.h>
+#import <UIKit/NSURL+UIItemProvider.h>
+#import <UIKit/UIImage+UIItemProvider.h>
 #import <UIKit/UIItemProvider_Private.h>
 #endif
 
@@ -43,6 +47,8 @@
 
 #import <UIKit/UIKit.h>
 
+NS_ASSUME_NONNULL_BEGIN
+
 typedef NS_ENUM(NSInteger, UIApplicationSceneClassicMode) {
     UIApplicationSceneClassicModeOriginalPad = 4,
 };
@@ -76,4 +82,52 @@ typedef NS_ENUM(NSInteger, UIApplicationSceneClassicMode) {
 + (UIViewController *)viewControllerForView:(UIView *)view;
 @end
 
+NS_ASSUME_NONNULL_END
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
+@interface NSURL ()
+@property (nonatomic, copy, nullable, setter=_setTitle:) NSString *_title;
+@end
+#endif
+
+#if ENABLE(DATA_INTERACTION)
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface UIItemProvider : NSItemProvider
+@property (nonatomic) CGSize estimatedDisplayedSize;
+@end
+
+#define UIItemProviderRepresentationOptionsVisibilityAll NSItemProviderRepresentationVisibilityAll
+
+@protocol UIItemProviderReading <NSItemProviderReading>
+
+@required
+- (nullable instancetype)initWithItemProviderData:(NSData *)data typeIdentifier:(NSString *)typeIdentifier error:(NSError **)outError;
+
+@end
+
+@protocol UIItemProviderWriting <NSItemProviderWriting>
+
+@required
+- (NSProgress * _Nullable)loadDataWithTypeIdentifier:(NSString *)typeIdentifier forItemProviderCompletionHandler:(void (^)(NSData * _Nullable, NSError * _Nullable))completionHandler;
+
+@end
+
+@interface NSAttributedString () <UIItemProviderReading, UIItemProviderWriting>
+@end
+
+@interface NSString () <UIItemProviderReading, UIItemProviderWriting>
+@end
+
+@interface NSURL () <UIItemProviderReading, UIItemProviderWriting>
+@end
+
+@interface UIImage () <UIItemProviderReading, UIItemProviderWriting>
+@end
+
+NS_ASSUME_NONNULL_END
+
+#endif
+
 #endif
index d4c968cce964de979a39815a2af06930c0b781e0..ead5fec13d1c02f92218fb9f58267923377aabea 100644 (file)
@@ -37,7 +37,7 @@
 #include <sqlite3.h>
 
 #if PLATFORM(IOS)
-#include <sqlite3_private.h>
+#include "SQLite3SPI.h"
 #endif
 
 namespace WebCore {
index f8890f95ea1fb5502b150c76cea3fa0c57f87318..28215f2dce5dea34de8800933843485ba725f00d 100644 (file)
@@ -1,3 +1,14 @@
+2017-07-14  Jonathan Bedard  <jbedard@apple.com>
+
+        Add iOS 11 SPI
+        https://bugs.webkit.org/show_bug.cgi?id=174430
+        <rdar://problem/33269288>
+
+        Reviewed by Tim Horton.
+
+        * Platform/spi/ios/UIKitSPI.h: Add drag-and-drop SPI for iOS 11.
+        * UIProcess/ios/WKContentViewInteraction.mm: Move UIKit SPI to UIKitSPI.h.
+
 2017-07-14  Jeff Miller  <jeffm@apple.com>
 
         -[WKWebProcessBundleParameters setParametersForKeyWithDictionary:] passing wrong parameters to -setParameter:forKey
index 5731be34398454489c87caee2cf7251971cfc0ff..34e1e5eba249f9eee7cd8a7529a8a4d690ace2da 100644 (file)
 #import <UIKit/UIItemProvider_Private.h>
 #endif
 
+#if ENABLE(DRAG_SUPPORT)
+#import <UIKit/UIDragInteraction.h>
+#import <UIKit/UIDragInteraction_Private.h>
+#import <UIKit/UIDragPreviewParameters.h>
+#import <UIKit/UIDragPreview_Private.h>
+#import <UIKit/UIDragSession.h>
+#import <UIKit/UIDragging.h>
+#import <UIKit/UIDropInteraction.h>
+#import <UIKit/UIPreviewInteraction.h>
+#import <UIKit/UIURLDragPreviewView.h>
+#import <UIKit/_UITextDragCaretView.h>
+#endif
+
 #else
 
 #if HAVE(LINK_PREVIEW)
@@ -315,7 +328,7 @@ typedef enum {
 @end
 
 @interface UITapGestureRecognizer ()
-@property (nonatomic, getter=_allowableSeparation, setter=_setAllowableSeparation:) CGFloat allowableSeparation; 
+@property (nonatomic, getter=_allowableSeparation, setter=_setAllowableSeparation:) CGFloat allowableSeparation;
 @property (nonatomic, readonly) CGPoint location;
 @property (nonatomic) CGFloat allowableMovement;
 @property (nonatomic, readonly) CGPoint centroid;
@@ -848,6 +861,51 @@ typedef enum {
 + (instancetype)actionWithTitle:(NSString *)title handler:(void (^)(UIViewControllerPreviewAction *action, UIViewController *previewViewController))handler;
 @end
 
+#if ENABLE(DRAG_SUPPORT)
+
+@interface UIItemProvider : NSItemProvider
+@property (nonatomic) CGSize estimatedDisplayedSize;
+@end
+
+WTF_EXTERN_C_BEGIN
+
+NSTimeInterval _UIDragInteractionDefaultLiftDelay();
+
+WTF_EXTERN_C_END
+
+typedef NS_OPTIONS(NSUInteger, UIDragOperation)
+{
+    UIDragOperationNone = 0,
+    UIDragOperationEvery = NSUIntegerMax,
+};
+
+@interface UIDragInteraction ()
+@property (nonatomic, assign, getter=_liftDelay, setter=_setLiftDelay:) NSTimeInterval liftDelay;
+@end
+
+@protocol UITextInput;
+@interface _UITextDragCaretView : UIView
+- (instancetype)initWithTextInputView:(UIView<UITextInput> *)textInputView;
+-(void)insertAtPosition:(UITextPosition *)position;
+-(void)updateToPosition:(UITextPosition *)position;
+-(void)remove;
+@end
+
+@interface UICalloutBar : UIView
++ (void)fadeSharedCalloutBar;
+@end
+
+@interface UIApplicationRotationFollowingWindow : UIWindow
+@end
+@interface UIAutoRotatingWindow : UIApplicationRotationFollowingWindow
+@end
+
+@interface UITextEffectsWindow : UIAutoRotatingWindow
++ (UITextEffectsWindow *)sharedTextEffectsWindow;
+@end
+
+#endif
+
 #endif // USE(APPLE_INTERNAL_SDK)
 
 @interface UIColor (IPI)
index 65c5ef57507b28a32f1104c484b2941e3365093f..f6fa76c1d1bf7662c7927a3f71ef29465bd88dea 100644 (file)
 #import <wtf/SoftLinking.h>
 
 #if ENABLE(DRAG_SUPPORT)
-// FIXME: Move private headers to UIKitSPI.h and add declarations as needed for building on OpenSource against the iOS 11 SDK.
-#import <UIKit/UIDragInteraction.h>
-#import <UIKit/UIDragInteraction_Private.h>
-#import <UIKit/UIDragPreviewParameters.h>
-#import <UIKit/UIDragPreview_Private.h>
-#import <UIKit/UIDragSession.h>
-#import <UIKit/UIDragging.h>
-#import <UIKit/UIDropInteraction.h>
-#import <UIKit/UIPreviewInteraction.h>
-#import <UIKit/UIURLDragPreviewView.h>
-#import <UIKit/_UITextDragCaretView.h>
 #import <WebCore/DragData.h>
 #import <WebCore/DragItem.h>
 #import <WebCore/PlatformPasteboard.h>
 #import <WebCore/WebItemProviderPasteboard.h>
-#endif // ENABLE(DRAG_SUPPORT)
+#endif
 
 @interface UIEvent(UIEventInternal)
 @property (nonatomic, assign) UIKeyboardInputFlags _inputFlags;
index b9df7230cb1a45e2ec9f17a4860ae07fa4b7c405..3f4fffffb36a0a1519a6a067c8c23b861c037ba1 100644 (file)
@@ -1,3 +1,14 @@
+2017-07-14  Jonathan Bedard  <jbedard@apple.com>
+
+        Add iOS 11 SPI
+        https://bugs.webkit.org/show_bug.cgi?id=174430
+        <rdar://problem/33269288>
+
+        Reviewed by Tim Horton.
+
+        * Storage/StorageTracker.cpp: sqlite3_private.h no longer exists in the iOS
+        Simulator SDK, explicitly define the required macro.
+
 2017-07-13  Dan Bernstein  <mitz@apple.com>
 
         Removed empty project directories left behind after the rename
index 7c576ab68db2f4fc51941cef7597bda5412afd28..557806116843986345c8bfc94919da58ba71fe21 100644 (file)
@@ -41,7 +41,7 @@
 #include <wtf/text/CString.h>
 
 #if PLATFORM(IOS)
-#include <sqlite3_private.h>
+#include <WebCore/SQLite3SPI.h>
 #endif
 
 using namespace WebCore;
index 37c2fe7a46ac83de60ef03f77c7960bd63d50e88..3ed0f86b2789a497d8c39af20d39bea7b03094f2 100644 (file)
@@ -1,3 +1,15 @@
+2017-07-14  Jonathan Bedard  <jbedard@apple.com>
+
+        Add iOS 11 SPI
+        https://bugs.webkit.org/show_bug.cgi?id=174430
+        <rdar://problem/33269288>
+
+        Reviewed by Tim Horton.
+
+        * TestWebKitAPI/Tests/ios/DataInteractionTests.mm: Define drag-and-drop API required for testing.
+        * TestWebKitAPI/ios/DataInteractionSimulator.h: Ditto.
+        * TestWebKitAPI/ios/DataInteractionSimulator.mm: Ditto.
+
 2017-07-14  Jonathan Bedard  <jbedard@apple.com>
 
         Failing to install on iPad simulators
index aafa233c2a2d22b4795348f762b94bce92b55d63..e40d0c6b6d92aef50702ba9ff5e5143b1362b6c8 100644 (file)
 #import "TestWKWebView.h"
 #import "WKWebViewConfigurationExtras.h"
 #import <MobileCoreServices/MobileCoreServices.h>
-#import <UIKit/NSString+UIItemProvider.h>
-#import <UIKit/NSURL+UIItemProvider.h>
-#import <UIKit/UIImage+UIItemProvider.h>
-#import <UIKit/UIItemProvider_Private.h>
 #import <WebKit/WKPreferencesPrivate.h>
 #import <WebKit/WKProcessPoolPrivate.h>
 #import <WebKit/WKWebViewConfigurationPrivate.h>
 
 typedef void (^FileLoadCompletionBlock)(NSURL *, BOOL, NSError *);
 typedef void (^DataLoadCompletionBlock)(NSData *, NSError *);
+typedef void (^UIItemProviderDataLoadCompletionBlock)(NSData *, NSError *);
+
+@interface UIItemProviderRepresentationOptions : NSObject
+@end
+
+@interface UIItemProvider()
++ (UIItemProvider *)itemProviderWithURL:(NSURL *)url title:(NSString *)title;
+- (void) registerDataRepresentationForTypeIdentifier:(NSString *)typeIdentifier options:(UIItemProviderRepresentationOptions*)options loadHandler:(NSProgress * (^)(void (^UIItemProviderDataLoadCompletionBlock)(NSData *item, NSError *error))) loadHandler;
+@end
 
 static NSString *InjectedBundlePasteboardDataType = @"org.webkit.data";
 
index 17de7b917b4bf0856ba33c989f21e0ecda8f0666..3f7fa98c0b2b4dda572c80253f5e8e8ff1ef1172 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#pragma once
+
 #if ENABLE(DATA_INTERACTION)
 
 #import "TestWKWebView.h"
+
+#if USE(APPLE_INTERNAL_SDK)
+#import <UIKit/NSString+UIItemProvider.h>
+#import <UIKit/NSURL+UIItemProvider.h>
+#import <UIKit/UIImage+UIItemProvider.h>
 #import <UIKit/UIItemProvider.h>
+#import <UIKit/UIItemProvider_Private.h>
+#else
+
+@interface NSURL ()
+@property (nonatomic, copy, setter=_setTitle:) NSString *_title;
+@end
+
+@interface UIItemProvider : NSItemProvider
+@property (nonatomic) CGSize estimatedDisplayedSize;
+@end
+
+#define UIItemProviderRepresentationOptionsVisibilityAll NSItemProviderRepresentationVisibilityAll
+
+@protocol UIItemProviderReading <NSItemProviderReading>
+
+@required
+- (instancetype)initWithItemProviderData:(NSData *)data typeIdentifier:(NSString *)typeIdentifier error:(NSError **)outError;
+
+@end
+
+@protocol UIItemProviderWriting <NSItemProviderWriting>
+
+@required
+- (NSProgress *)loadDataWithTypeIdentifier:(NSString *)typeIdentifier forItemProviderCompletionHandler:(void (^)(NSData *, NSError *))completionHandler;
+
+@end
+
+@interface NSAttributedString () <UIItemProviderReading, UIItemProviderWriting>
+@end
+@interface NSString () <UIItemProviderReading, UIItemProviderWriting>
+@end
+@interface NSURL () <UIItemProviderReading, UIItemProviderWriting>
+@end
+@interface UIImage () <UIItemProviderReading, UIItemProviderWriting>
+@end
+
+#endif
+
 #import <UIKit/UIKit.h>
 #import <WebKit/WKUIDelegatePrivate.h>
 #import <WebKit/_WKInputDelegate.h>
index 48ab8e07a06f28ddff23ffbd511830bde1058083..cc4af793c5478501c725587abdb317b235a98bf4 100644 (file)
 
 #import "InstanceMethodSwizzler.h"
 #import "PlatformUtilities.h"
+
 #import <UIKit/UIDragInteraction.h>
 #import <UIKit/UIDragItem.h>
+
+#if USE(APPLE_INTERNAL_SDK)
 #import <UIKit/UIDragSession.h>
 #import <UIKit/UIDragging.h>
-#import <UIKit/UIItemProvider_Private.h>
+#else
+
+@protocol UIDraggingInfo <NSObject>
+@end
+
+@interface UIDraggingSession : NSObject <UIDraggingInfo>
+@end
+
+#endif
+
 #import <WebKit/WKWebViewPrivate.h>
 #import <WebKit/_WKFocusedElementInfo.h>
 #import <WebKit/_WKFormInputSession.h>