Skip to content

Commit ad20c79

Browse files
Add iOS 11 SPI
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: http://svn.webkit.org/repository/webkit/trunk@219537 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent c9d128a commit ad20c79

23 files changed

+306
-38
lines changed

Source/WTF/ChangeLog

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
2017-07-14 Jonathan Bedard <[email protected]>
2+
3+
Add iOS 11 SPI
4+
https://bugs.webkit.org/show_bug.cgi?id=174430
5+
<rdar://problem/33269288>
6+
7+
Reviewed by Tim Horton.
8+
9+
* Configurations/WTF.xcconfig: Exclude MachExceptions.def when building iOS 11 for
10+
the iOS simulator.
11+
112
2017-07-14 Commit Queue <[email protected]>
213

314
Unreviewed, rolling out r219510.

Source/WTF/Configurations/WTF.xcconfig

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ GCC_SYMBOLS_PRIVATE_EXTERN = YES;
2929
STRIP_INSTALLED_PRODUCT = NO;
3030

3131
EXCLUDED_SOURCE_FILE_NAMES_ = MachExceptions.defs
32-
EXCLUDED_SOURCE_FILE_NAMES[sdk=iphoneos*] = $(EXCLUDED_SOURCE_FILE_NAMES_$(USE_INTERNAL_SDK))
32+
EXCLUDED_SOURCE_FILE_NAMES[sdk=iphone*] = $(EXCLUDED_SOURCE_FILE_NAMES_$(USE_INTERNAL_SDK))
33+
EXCLUDED_SOURCE_FILE_NAMES[sdk=iphonesimulator10*] =

Source/WebCore/ChangeLog

+21
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
2017-07-14 Jonathan Bedard <[email protected]>
2+
3+
Add iOS 11 SPI
4+
https://bugs.webkit.org/show_bug.cgi?id=174430
5+
<rdar://problem/33269288>
6+
7+
Reviewed by Tim Horton.
8+
9+
* WebCore.xcodeproj/project.pbxproj: Add sqlite3SPI.h header.
10+
* platform/ios/PlatformPasteboardIOS.mm: Move UIKit SPI to UIKitSPI.h.
11+
* platform/ios/WebItemProviderPasteboard.mm: Ditto.
12+
* platform/network/cf/FormDataStreamCFNet.cpp: Explicitly define fnfErr and remove
13+
MacErrors.h header for iOS.
14+
* platform/spi/cocoa/IOSurfaceSPI.h: IOSurface is no longer SPI in iOS 11.
15+
* platform/spi/cocoa/PassKitSPI.h: Do not re-define setRequiredShippingContactFields
16+
and setRequiredBillingContactFields in iOS 11.
17+
* platform/spi/cocoa/QuartzCoreSPI.h: Added QuartzCoreSPI used in iOS 11.
18+
* platform/spi/ios/UIKitSPI.h: Add drag-and-drop SPI.
19+
* platform/spi/ios/sqlite3SPI.h: Define required sqlite3 macros.
20+
* platform/sql/SQLiteFileSystem.cpp: Use sqlite3SPI.h.
21+
122
2017-07-14 Zan Dobersek <[email protected]>
223

324
[GCrypt] Implement CryptoKeyRSA PKCS#8 exports

Source/WebCore/WebCore.xcodeproj/project.pbxproj

+5-2
Original file line numberDiff line numberDiff line change
@@ -1556,6 +1556,7 @@
15561556
31C0FF3E0E4CEFAC007D6FE5 /* JSWebKitAnimationEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 31C0FF3A0E4CEFAC007D6FE5 /* JSWebKitAnimationEvent.h */; };
15571557
31C0FF3F0E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31C0FF3B0E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.cpp */; };
15581558
31C0FF400E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 31C0FF3C0E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.h */; };
1559+
31CBAF6C1F19868500849F73 /* SQLite3SPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 31AA003F1EF44829009DFC06 /* SQLite3SPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
15591560
31D591B316697A6C00E6BF02 /* PlugInClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 31D591B116697A6C00E6BF02 /* PlugInClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
15601561
31DCD29D1AB4FBDE0072E817 /* AnimationTrigger.h in Headers */ = {isa = PBXBuildFile; fileRef = 31DCD29C1AB4FBDE0072E817 /* AnimationTrigger.h */; settings = {ATTRIBUTES = (Private, ); }; };
15611562
31DCDF431DA1C45400EA5B93 /* ExtendedColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31DCDF411DA1C45400EA5B93 /* ExtendedColor.cpp */; };
@@ -9185,6 +9186,7 @@
91859186
31A795C31888B72400382F90 /* ANGLEInstancedArrays.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ANGLEInstancedArrays.idl; sourceTree = "<group>"; };
91869187
31A795C41888BAD100382F90 /* JSANGLEInstancedArrays.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSANGLEInstancedArrays.cpp; sourceTree = "<group>"; };
91879188
31A795C51888BAD100382F90 /* JSANGLEInstancedArrays.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSANGLEInstancedArrays.h; sourceTree = "<group>"; };
9189+
31AA003F1EF44829009DFC06 /* SQLite3SPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SQLite3SPI.h; sourceTree = "<group>"; };
91889190
31AB4FFF122878A2001A7DB0 /* GraphicsContext3DIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsContext3DIOS.h; sourceTree = "<group>"; };
91899191
31B313DA1B69871600F2AABC /* NSURLConnectionSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSURLConnectionSPI.h; sourceTree = "<group>"; };
91909192
31B313DE1B6988C500F2AABC /* NSButtonCellSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSButtonCellSPI.h; sourceTree = "<group>"; };
@@ -21051,6 +21053,7 @@
2105121053
A172182419DE182B00464D17 /* ios */ = {
2105221054
isa = PBXGroup;
2105321055
children = (
21056+
31AA003F1EF44829009DFC06 /* SQLite3SPI.h */,
2105421057
CE1252421A16C01A00864480 /* CoreUISPI.h */,
2105521058
2DC4CF781D2DD98900ECCC94 /* DataDetectorsUISPI.h */,
2105621059
CEC337AE1A46086D009B8523 /* GraphicsServicesSPI.h */,
@@ -29007,6 +29010,7 @@
2900729010
37BAAE581980D1DD005DFE71 /* ProtectionSpace.h in Headers */,
2900829011
514C76750CE923A1007EF3CD /* ProtectionSpaceBase.h in Headers */,
2900929012
372ADA38197F47B900FC501E /* ProtectionSpaceCocoa.h in Headers */,
29013+
31CBAF6C1F19868500849F73 /* SQLite3SPI.h in Headers */,
2901029014
51A052561058874000CC9E95 /* ProtectionSpaceHash.h in Headers */,
2901129015
1AF8E11A1256592600230FF7 /* ProxyServer.h in Headers */,
2901229016
FF945ECC161F7F3600971BC8 /* PseudoElement.h in Headers */,
@@ -30370,8 +30374,7 @@
3037030374
1C09D0501E31C32900725F18 /* libPAL.a */ = {
3037130375
isa = PBXReferenceProxy;
3037230376
fileType = archive.ar;
30373-
name = libPAL.a;
30374-
path = lib.a;
30377+
path = libPAL.a;
3037530378
remoteRef = 1C09D04F1E31C32900725F18 /* PBXContainerItemProxy */;
3037630379
sourceTree = BUILT_PRODUCTS_DIR;
3037730380
};

Source/WebCore/platform/graphics/cocoa/IOSurface.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@
365365

366366
IOSurfaceID IOSurface::surfaceID() const
367367
{
368-
#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED < 110000
368+
#if PLATFORM(IOS) && (!USE(APPLE_INTERNAL_SDK) || __IPHONE_OS_VERSION_MIN_REQUIRED < 110000)
369369
return 0;
370370
#else
371371
return IOSurfaceGetID(m_surface.get());

Source/WebCore/platform/ios/PlatformPasteboardIOS.mm

+1-7
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,14 @@
3030
#import "Image.h"
3131
#import "Pasteboard.h"
3232
#import "SharedBuffer.h"
33+
#import "UIKitSPI.h"
3334
#import "URL.h"
3435
#import "WebItemProviderPasteboard.h"
3536
#import <MobileCoreServices/MobileCoreServices.h>
3637
#import <UIKit/UIImage.h>
3738
#import <UIKit/UIPasteboard.h>
3839
#import <wtf/SoftLinking.h>
3940

40-
#if ENABLE(DATA_INTERACTION)
41-
#import <UIKit/NSAttributedString+UIItemProvider.h>
42-
#import <UIKit/NSString+UIItemProvider.h>
43-
#import <UIKit/NSURL+UIItemProvider.h>
44-
#import <UIKit/UIImage+UIItemProvider.h>
45-
#endif
46-
4741
SOFT_LINK_FRAMEWORK(UIKit)
4842
SOFT_LINK_CLASS(UIKit, UIImage)
4943
SOFT_LINK_CLASS(UIKit, UIPasteboard)

Source/WebCore/platform/ios/WebItemProviderPasteboard.mm

-4
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,8 @@
3131
#import "UIKitSPI.h"
3232
#import <Foundation/NSProgress.h>
3333
#import <MobileCoreServices/MobileCoreServices.h>
34-
#import <UIKit/NSString+UIItemProvider.h>
35-
#import <UIKit/NSURL+UIItemProvider.h>
3634
#import <UIKit/UIColor.h>
3735
#import <UIKit/UIImage.h>
38-
#import <UIKit/UIItemProviderReading.h>
39-
#import <UIKit/UIItemProviderWriting.h>
4036
#import <WebCore/FileSystemIOS.h>
4137
#import <WebCore/Pasteboard.h>
4238
#import <wtf/BlockPtr.h>

Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#include <wtf/Threading.h>
4444

4545
#if PLATFORM(IOS)
46-
#include <MacErrors.h>
46+
static const int fnfErr = -43;
4747
#elif PLATFORM(MAC)
4848
#include <CoreServices/CoreServices.h>
4949
#endif

Source/WebCore/platform/spi/cocoa/IOSurfaceSPI.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@
4141

4242
typedef struct __IOSurface *IOSurfaceRef;
4343

44+
#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED < 110000
4445
enum {
4546
kIOSurfaceLockReadOnly = 0x00000001,
4647
};
48+
#endif
4749

4850
#endif
4951

@@ -88,8 +90,10 @@ WTF_EXTERN_C_END
8890

8991
#else
9092

91-
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300
93+
#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300)
94+
9295
#import <IOSurface/IOSurfaceTypes.h>
96+
9397
#else
9498
enum {
9599
kIOSurfacePurgeableNonVolatile = 0,

Source/WebCore/platform/spi/cocoa/PassKitSPI.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ NS_ASSUME_NONNULL_BEGIN
299299
@property (nonatomic, strong) NSString *sourceApplicationSecondaryIdentifier;
300300
@property (nonatomic, strong) NSString *CTDataConnectionServiceType;
301301

302-
#if !USE(APPLE_INTERNAL_SDK)
302+
#if (PLATFORM(MAC) && !USE(APPLE_INTERNAL_SDK)) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED < 110000)
303303
- (void)setRequiredShippingContactFields:(nonnull NSSet *)contactInformation;
304304
- (void)setRequiredBillingContactFields:(nonnull NSSet *)contactInformation;
305305
#endif

Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h

+6
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,16 @@ typedef enum {
125125
kCATransactionPhasePreLayout,
126126
kCATransactionPhasePreCommit,
127127
kCATransactionPhasePostCommit,
128+
kCATransactionPhaseNull = ~0u
128129
} CATransactionPhase;
129130

130131
@interface CATransaction ()
131132
+ (void)addCommitHandler:(void(^)(void))block forPhase:(CATransactionPhase)phase;
133+
134+
#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
135+
+ (CATransactionPhase)currentPhase;
136+
#endif
137+
132138
@end
133139

134140
@interface CALayerHost : CALayer
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (C) 2017 Apple Inc. All rights reserved.
3+
*
4+
* Redistribution and use in source and binary forms, with or without
5+
* modification, are permitted provided that the following conditions
6+
* are met:
7+
* 1. Redistributions of source code must retain the above copyright
8+
* notice, this list of conditions and the following disclaimer.
9+
* 2. Redistributions in binary form must reproduce the above copyright
10+
* notice, this list of conditions and the following disclaimer in the
11+
* documentation and/or other materials provided with the distribution.
12+
*
13+
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15+
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17+
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23+
* THE POSSIBILITY OF SUCH DAMAGE.
24+
*/
25+
26+
#if USE(APPLE_INTERNAL_SDK)
27+
28+
#include <sqlite3_private.h>
29+
30+
#else
31+
32+
#define SQLITE_FCNTL_TRUNCATE_DATABASE 101
33+
#define SQLITE_TRUNCATE_DATABASE SQLITE_FCNTL_TRUNCATE_DATABASE
34+
35+
#endif

Source/WebCore/platform/spi/ios/UIKitSPI.h

+54
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
#import <UIKit/UIViewController_Private.h>
3333

3434
#if ENABLE(DATA_INTERACTION)
35+
#import <UIKit/NSAttributedString+UIItemProvider.h>
36+
#import <UIKit/NSString+UIItemProvider.h>
37+
#import <UIKit/NSURL+UIItemProvider.h>
38+
#import <UIKit/UIImage+UIItemProvider.h>
3539
#import <UIKit/UIItemProvider_Private.h>
3640
#endif
3741

@@ -43,6 +47,8 @@
4347

4448
#import <UIKit/UIKit.h>
4549

50+
NS_ASSUME_NONNULL_BEGIN
51+
4652
typedef NS_ENUM(NSInteger, UIApplicationSceneClassicMode) {
4753
UIApplicationSceneClassicModeOriginalPad = 4,
4854
};
@@ -76,4 +82,52 @@ typedef NS_ENUM(NSInteger, UIApplicationSceneClassicMode) {
7682
+ (UIViewController *)viewControllerForView:(UIView *)view;
7783
@end
7884

85+
NS_ASSUME_NONNULL_END
86+
87+
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
88+
@interface NSURL ()
89+
@property (nonatomic, copy, nullable, setter=_setTitle:) NSString *_title;
90+
@end
91+
#endif
92+
93+
#if ENABLE(DATA_INTERACTION)
94+
95+
NS_ASSUME_NONNULL_BEGIN
96+
97+
@interface UIItemProvider : NSItemProvider
98+
@property (nonatomic) CGSize estimatedDisplayedSize;
99+
@end
100+
101+
#define UIItemProviderRepresentationOptionsVisibilityAll NSItemProviderRepresentationVisibilityAll
102+
103+
@protocol UIItemProviderReading <NSItemProviderReading>
104+
105+
@required
106+
- (nullable instancetype)initWithItemProviderData:(NSData *)data typeIdentifier:(NSString *)typeIdentifier error:(NSError **)outError;
107+
108+
@end
109+
110+
@protocol UIItemProviderWriting <NSItemProviderWriting>
111+
112+
@required
113+
- (NSProgress * _Nullable)loadDataWithTypeIdentifier:(NSString *)typeIdentifier forItemProviderCompletionHandler:(void (^)(NSData * _Nullable, NSError * _Nullable))completionHandler;
114+
115+
@end
116+
117+
@interface NSAttributedString () <UIItemProviderReading, UIItemProviderWriting>
118+
@end
119+
120+
@interface NSString () <UIItemProviderReading, UIItemProviderWriting>
121+
@end
122+
123+
@interface NSURL () <UIItemProviderReading, UIItemProviderWriting>
124+
@end
125+
126+
@interface UIImage () <UIItemProviderReading, UIItemProviderWriting>
127+
@end
128+
129+
NS_ASSUME_NONNULL_END
130+
131+
#endif
132+
79133
#endif

Source/WebCore/platform/sql/SQLiteFileSystem.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#include <sqlite3.h>
3838

3939
#if PLATFORM(IOS)
40-
#include <sqlite3_private.h>
40+
#include "SQLite3SPI.h"
4141
#endif
4242

4343
namespace WebCore {

Source/WebKit/ChangeLog

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
2017-07-14 Jonathan Bedard <[email protected]>
2+
3+
Add iOS 11 SPI
4+
https://bugs.webkit.org/show_bug.cgi?id=174430
5+
<rdar://problem/33269288>
6+
7+
Reviewed by Tim Horton.
8+
9+
* Platform/spi/ios/UIKitSPI.h: Add drag-and-drop SPI for iOS 11.
10+
* UIProcess/ios/WKContentViewInteraction.mm: Move UIKit SPI to UIKitSPI.h.
11+
112
2017-07-14 Jeff Miller <[email protected]>
213

314
-[WKWebProcessBundleParameters setParametersForKeyWithDictionary:] passing wrong parameters to -setParameter:forKey

0 commit comments

Comments
 (0)