[iOS] Remove some unnecessary editing SPI after <rdar://problem/46047546>
[WebKit-https.git] / Source / WebKit / UIProcess / API / Cocoa / WKWebViewPrivate.h
1 /*
2  * Copyright (C) 2014 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 #import <WebKit/WKWebView.h>
27
28 #if WK_API_ENABLED
29
30 #import <WebKit/WKDataDetectorTypes.h>
31 #import <WebKit/_WKActivatedElementInfo.h>
32 #import <WebKit/_WKAttachment.h>
33 #import <WebKit/_WKFindOptions.h>
34 #import <WebKit/_WKLayoutMode.h>
35 #import <WebKit/_WKOverlayScrollbarStyle.h>
36 #import <WebKit/_WKRenderingProgressEvents.h>
37
38 typedef NS_ENUM(NSInteger, _WKPaginationMode) {
39     _WKPaginationModeUnpaginated,
40     _WKPaginationModeLeftToRight,
41     _WKPaginationModeRightToLeft,
42     _WKPaginationModeTopToBottom,
43     _WKPaginationModeBottomToTop,
44 } WK_API_AVAILABLE(macosx(10.10), ios(8.0));
45
46 typedef NS_OPTIONS(NSUInteger, _WKMediaCaptureState) {
47     _WKMediaCaptureStateNone = 0,
48     _WKMediaCaptureStateActiveMicrophone = 1 << 0,
49     _WKMediaCaptureStateActiveCamera = 1 << 1,
50     _WKMediaCaptureStateMutedMicrophone = 1 << 2,
51     _WKMediaCaptureStateMutedCamera = 1 << 3,
52 } WK_API_AVAILABLE(macosx(10.13), ios(11.0));
53
54 typedef NS_OPTIONS(NSUInteger, _WKMediaMutedState) {
55     _WKMediaNoneMuted = 0,
56     _WKMediaAudioMuted = 1 << 0,
57     _WKMediaCaptureDevicesMuted = 1 << 1,
58 } WK_API_AVAILABLE(macosx(10.13), ios(11.0));
59
60 typedef NS_OPTIONS(NSUInteger, _WKCaptureDevices) {
61     _WKCaptureDeviceMicrophone = 1 << 0,
62     _WKCaptureDeviceCamera = 1 << 1,
63     _WKCaptureDeviceDisplay = 1 << 2,
64 } WK_API_AVAILABLE(macosx(10.13), ios(11.0));
65
66 #if TARGET_OS_IPHONE
67
68 typedef NS_ENUM(NSUInteger, _WKDragInteractionPolicy) {
69     _WKDragInteractionPolicyDefault = 0,
70     _WKDragInteractionPolicyAlwaysEnable,
71     _WKDragInteractionPolicyAlwaysDisable
72 } WK_API_AVAILABLE(ios(11.0));
73
74 #else
75 #import <WebKit/WKBase.h>
76 #endif
77
78 #if !TARGET_OS_IPHONE
79
80 typedef NS_ENUM(NSInteger, _WKImmediateActionType) {
81     _WKImmediateActionNone,
82     _WKImmediateActionLinkPreview,
83     _WKImmediateActionDataDetectedItem,
84     _WKImmediateActionLookupText,
85     _WKImmediateActionMailtoLink,
86     _WKImmediateActionTelLink
87 } WK_API_AVAILABLE(macosx(10.12));
88
89 typedef NS_OPTIONS(NSUInteger, _WKRectEdge) {
90     _WKRectEdgeNone = 0,
91     _WKRectEdgeLeft = 1 << CGRectMinXEdge,
92     _WKRectEdgeTop = 1 << CGRectMinYEdge,
93     _WKRectEdgeRight = 1 << CGRectMaxXEdge,
94     _WKRectEdgeBottom = 1 << CGRectMaxYEdge,
95     _WKRectEdgeAll = _WKRectEdgeLeft | _WKRectEdgeTop | _WKRectEdgeRight | _WKRectEdgeBottom,
96 } WK_API_AVAILABLE(macosx(10.13.4));
97
98 #endif
99
100 @class WKBrowsingContextHandle;
101 @class _WKApplicationManifest;
102 @class _WKFrameHandle;
103 @class _WKHitTestResult;
104 @class _WKIconLoadingDelegate;
105 @class _WKInspector;
106 @class _WKRemoteObjectRegistry;
107 @class _WKSafeBrowsingWarning;
108 @class _WKSessionState;
109 @class _WKThumbnailView;
110 @class _WKWebsitePolicies;
111 @class _WKWebViewPrintFormatter;
112
113 @protocol WKHistoryDelegatePrivate;
114 @protocol _WKDiagnosticLoggingDelegate;
115 @protocol _WKFindDelegate;
116 @protocol _WKIconLoadingDelegate;
117 @protocol _WKInputDelegate;
118 @protocol _WKFullscreenDelegate;
119
120 @interface WKWebView (WKPrivate)
121
122 // FIXME: This should return a _WKRemoteObjectRegistry *.
123 @property (nonatomic, readonly) id _remoteObjectRegistry;
124 @property (nonatomic, readonly) WKBrowsingContextHandle *_handle;
125
126 @property (nonatomic, setter=_setObservedRenderingProgressEvents:) _WKRenderingProgressEvents _observedRenderingProgressEvents;
127
128 @property (nonatomic, weak, setter=_setHistoryDelegate:) id <WKHistoryDelegatePrivate> _historyDelegate;
129 @property (nonatomic, weak, setter=_setIconLoadingDelegate:) id <_WKIconLoadingDelegate> _iconLoadingDelegate;
130
131 @property (nonatomic, readonly) NSURL *_unreachableURL;
132
133 - (void)_loadAlternateHTMLString:(NSString *)string baseURL:(NSURL *)baseURL forUnreachableURL:(NSURL *)unreachableURL;
134 - (WKNavigation *)_loadData:(NSData *)data MIMEType:(NSString *)MIMEType characterEncodingName:(NSString *)characterEncodingName baseURL:(NSURL *)baseURL userData:(id)userData WK_API_AVAILABLE(macosx(10.12), ios(10.0));
135 - (WKNavigation *)_loadRequest:(NSURLRequest *)request shouldOpenExternalURLs:(BOOL)shouldOpenExternalURLs WK_API_AVAILABLE(macosx(10.13), ios(11.0));
136
137 @property (nonatomic, readonly) NSArray *_certificateChain WK_API_DEPRECATED_WITH_REPLACEMENT("certificateChain", macosx(10.10, 10.11), ios(8.0, 9.0));
138 @property (nonatomic, readonly) NSURL *_committedURL;
139 @property (nonatomic, readonly) NSString *_MIMEType;
140 @property (nonatomic, readonly) NSString *_userAgent WK_API_AVAILABLE(macosx(10.11), ios(9.0));
141
142 @property (nonatomic, readonly, getter=_isPlayingAudio) BOOL _playingAudio WK_API_AVAILABLE(macosx(10.13.4), ios(11.3));
143
144 @property (copy, setter=_setApplicationNameForUserAgent:) NSString *_applicationNameForUserAgent;
145 @property (copy, setter=_setCustomUserAgent:) NSString *_customUserAgent;
146
147 @property (nonatomic, setter=_setUserContentExtensionsEnabled:) BOOL _userContentExtensionsEnabled WK_API_AVAILABLE(macosx(10.11), ios(9.0));
148
149 @property (nonatomic, readonly) pid_t _webProcessIdentifier;
150
151 @property (nonatomic, getter=_isEditable, setter=_setEditable:) BOOL _editable WK_API_AVAILABLE(macosx(10.11), ios(9.0));
152
153 // FIXME: Remove these once nobody is using them.
154 @property (nonatomic, readonly) NSData *_sessionStateData;
155 - (void)_restoreFromSessionStateData:(NSData *)sessionStateData;
156
157 @property (nonatomic, readonly) _WKSessionState *_sessionState;
158 - (WKNavigation *)_restoreSessionState:(_WKSessionState *)sessionState andNavigate:(BOOL)navigate;
159 - (_WKSessionState *)_sessionStateWithFilter:(BOOL (^)(WKBackForwardListItem *item))filter;
160
161 @property (nonatomic, setter=_setAllowsRemoteInspection:) BOOL _allowsRemoteInspection;
162 @property (nonatomic, copy, setter=_setRemoteInspectionNameOverride:) NSString *_remoteInspectionNameOverride WK_API_AVAILABLE(macosx(10.12), ios(10.0));
163
164 @property (nonatomic, setter=_setAddsVisitedLinks:) BOOL _addsVisitedLinks;
165
166 @property (nonatomic, readonly) BOOL _networkRequestsInProgress;
167
168 @property (nonatomic, readonly, getter=_isShowingNavigationGestureSnapshot) BOOL _showingNavigationGestureSnapshot;
169
170 - (void)_close;
171
172 - (void)_updateWebsitePolicies:(_WKWebsitePolicies *)websitePolicies WK_API_AVAILABLE(macosx(10.13), ios(11.0));
173
174 - (void)_evaluateJavaScriptWithoutUserGesture:(NSString *)javaScriptString completionHandler:(void (^)(id, NSError *))completionHandler WK_API_AVAILABLE(macosx(10.13), ios(11.0));
175
176 @property (nonatomic, setter=_setLayoutMode:) _WKLayoutMode _layoutMode;
177 // For use with _layoutMode = _WKLayoutModeFixedSize:
178 @property (nonatomic, setter=_setFixedLayoutSize:) CGSize _fixedLayoutSize;
179
180 @property (nonatomic, setter=_setViewportSizeForCSSViewportUnits:) CGSize _viewportSizeForCSSViewportUnits WK_API_AVAILABLE(macosx(10.13), ios(11.0));
181
182 @property (nonatomic, setter=_setViewScale:) CGFloat _viewScale WK_API_AVAILABLE(macosx(10.11), ios(9.0));
183
184 @property (nonatomic, setter=_setMinimumEffectiveDeviceWidth:) CGFloat _minimumEffectiveDeviceWidth WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
185
186 @property (nonatomic, setter=_setBackgroundExtendsBeyondPage:) BOOL _backgroundExtendsBeyondPage WK_API_AVAILABLE(macosx(10.13.4), ios(8.0));
187
188 - (_WKAttachment *)_insertAttachmentWithFilename:(NSString *)filename contentType:(NSString *)contentType data:(NSData *)data options:(_WKAttachmentDisplayOptions *)options completion:(void(^)(BOOL success))completionHandler WK_API_DEPRECATED_WITH_REPLACEMENT("-_insertAttachmentWithFileWrapper:contentType:options:completion:", macosx(10.13.4, WK_MAC_TBA), ios(11.3, WK_IOS_TBA));
189 - (_WKAttachment *)_insertAttachmentWithFileWrapper:(NSFileWrapper *)fileWrapper contentType:(NSString *)contentType options:(_WKAttachmentDisplayOptions *)options completion:(void(^)(BOOL success))completionHandler WK_API_DEPRECATED_WITH_REPLACEMENT("-_insertAttachmentWithFileWrapper:contentType:completion:", macosx(WK_MAC_TBA, WK_MAC_TBA), ios(WK_IOS_TBA, WK_IOS_TBA));
190 - (_WKAttachment *)_insertAttachmentWithFileWrapper:(NSFileWrapper *)fileWrapper contentType:(NSString *)contentType completion:(void(^)(BOOL success))completionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
191 - (_WKAttachment *)_attachmentForIdentifier:(NSString *)identifier WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
192
193 + (BOOL)_handlesSafeBrowsing WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
194 + (NSURL *)_confirmMalwareSentinel WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
195 + (NSURL *)_visitUnsafeWebsiteSentinel WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
196 - (void)_showSafeBrowsingWarningWithTitle:(NSString *)title warning:(NSString *)warning details:(NSAttributedString *)details completionHandler:(void(^)(BOOL))completionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
197 - (void)_showSafeBrowsingWarningWithURL:(NSURL *)url title:(NSString *)title warning:(NSString *)warning details:(NSAttributedString *)details completionHandler:(void(^)(BOOL))completionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
198
199 - (void)_isJITEnabled:(void(^)(BOOL))completionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
200 - (void)_removeDataDetectedLinks:(dispatch_block_t)completion WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
201
202 - (IBAction)_alignCenter:(id)sender WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
203 - (IBAction)_alignJustified:(id)sender WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
204 - (IBAction)_alignLeft:(id)sender WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
205 - (IBAction)_alignRight:(id)sender WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
206 - (IBAction)_indent:(id)sender WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
207 - (IBAction)_outdent:(id)sender WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
208 - (IBAction)_toggleStrikeThrough:(id)sender WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
209 - (IBAction)_insertOrderedList:(id)sender WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
210 - (IBAction)_insertUnorderedList:(id)sender WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
211 - (IBAction)_insertNestedOrderedList:(id)sender WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
212 - (IBAction)_insertNestedUnorderedList:(id)sender WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
213 - (IBAction)_increaseListLevel:(id)sender WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
214 - (IBAction)_decreaseListLevel:(id)sender WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
215 - (IBAction)_changeListType:(id)sender WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
216 - (IBAction)_pasteAsQuotation:(id)sender WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
217 - (IBAction)_pasteAndMatchStyle:(id)sender WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
218
219 #if TARGET_OS_IPHONE
220
221 - (void)_setFont:(UIFont *)font sender:(id)sender WK_API_AVAILABLE(ios(WK_IOS_TBA));
222 - (void)_setFontSize:(CGFloat)fontSize sender:(id)sender WK_API_AVAILABLE(ios(WK_IOS_TBA));
223 - (void)_setTextColor:(UIColor *)color sender:(id)sender WK_API_AVAILABLE(ios(WK_IOS_TBA));
224
225 - (void)_detectDataWithTypes:(WKDataDetectorTypes)types completionHandler:(dispatch_block_t)completion WK_API_AVAILABLE(ios(WK_IOS_TBA));
226
227 // DERECATED: The setters of the three following function are deprecated, please use overrideLayoutParameters.
228 // Define the smallest size a page take with a regular viewport.
229 @property (nonatomic, readonly) CGSize _minimumLayoutSizeOverride;
230 // Define the largest size the unobscured area can get for the current view bounds. This value is used to define viewport units.
231 @property (nonatomic, readonly) CGSize _maximumUnobscuredSizeOverride;
232
233 // Define the inset of the scrollview unusable by the web page.
234 @property (nonatomic, setter=_setObscuredInsets:) UIEdgeInsets _obscuredInsets;
235
236 @property (nonatomic, setter=_setUnobscuredSafeAreaInsets:) UIEdgeInsets _unobscuredSafeAreaInsets WK_API_AVAILABLE(ios(11.0));
237 @property (nonatomic, readonly) BOOL _safeAreaShouldAffectObscuredInsets WK_API_AVAILABLE(ios(11.0));
238 @property (nonatomic, setter=_setObscuredInsetEdgesAffectedBySafeArea:) UIRectEdge _obscuredInsetEdgesAffectedBySafeArea WK_API_AVAILABLE(ios(11.0));
239
240 // An ancestor view whose bounds will be intersected with those of this WKWebView to determine the visible region of content to render.
241 @property (nonatomic, readonly) UIView *_enclosingViewForExposedRectComputation WK_API_AVAILABLE(ios(11.0));
242
243 // Override the interface orientation. Clients using _beginAnimatedResizeWithUpdates: must update the interface orientation
244 // in the update block.
245 @property (nonatomic, setter=_setInterfaceOrientationOverride:) UIInterfaceOrientation _interfaceOrientationOverride;
246
247 @property (nonatomic, setter=_setAllowsViewportShrinkToFit:) BOOL _allowsViewportShrinkToFit;
248
249 // FIXME: Remove these three properties once we expose WKWebViewContentProvider as API.
250 @property (nonatomic, readonly, getter=_isDisplayingPDF) BOOL _displayingPDF;
251 @property (nonatomic, readonly) NSData *_dataForDisplayedPDF;
252 // FIXME: This can be removed once WKNavigation's response property is implemented.
253 @property (nonatomic, readonly) NSString *_suggestedFilenameForDisplayedPDF;
254
255 @property (nonatomic, readonly) _WKWebViewPrintFormatter *_webViewPrintFormatter;
256
257 @property (nonatomic, setter=_setDragInteractionPolicy:) _WKDragInteractionPolicy _dragInteractionPolicy WK_API_AVAILABLE(ios(11.0));
258
259 - (void)_beginInteractiveObscuredInsetsChange;
260 - (void)_endInteractiveObscuredInsetsChange;
261 - (void)_hideContentUntilNextUpdate;
262
263 - (void)_beginAnimatedResizeWithUpdates:(void (^)(void))updateBlock;
264 - (void)_endAnimatedResize;
265 - (void)_resizeWhileHidingContentWithUpdates:(void (^)(void))updateBlock;
266
267 - (void)_snapshotRect:(CGRect)rectInViewCoordinates intoImageOfWidth:(CGFloat)imageWidth completionHandler:(void(^)(CGImageRef))completionHandler;
268
269 - (void)_overrideLayoutParametersWithMinimumLayoutSize:(CGSize)minimumLayoutSize maximumUnobscuredSizeOverride:(CGSize)maximumUnobscuredSizeOverride WK_API_AVAILABLE(ios(9_0));
270
271 - (void)_clearOverrideLayoutParameters WK_API_AVAILABLE(ios(11.0));
272 - (void)_clearInterfaceOrientationOverride WK_API_AVAILABLE(ios(11.0));
273
274 - (UIView *)_viewForFindUI;
275
276 - (void)_setOverlaidAccessoryViewsInset:(CGSize)inset;
277
278 // Puts the view into a state where being taken out of the view hierarchy and resigning first responder
279 // will not count as becoming inactive and unfocused. The returned block must be called to exit the state.
280 - (void (^)(void))_retainActiveFocusedState WK_API_AVAILABLE(ios(9_0));
281
282 - (void)_becomeFirstResponderWithSelectionMovingForward:(BOOL)selectingForward completionHandler:(void (^)(BOOL didBecomeFirstResponder))completionHandler WK_API_AVAILABLE(ios(9_0));
283
284 - (id)_snapshotLayerContentsForBackForwardListItem:(WKBackForwardListItem *)item WK_API_AVAILABLE(ios(9_0));
285 - (NSArray *)_dataDetectionResults;
286
287 - (void)_accessibilityRetrieveSpeakSelectionContent WK_API_AVAILABLE(ios(11.0));
288 - (void)_accessibilityDidGetSpeakSelectionContent:(NSString *)content WK_API_AVAILABLE(ios(11.0));
289
290 @property (nonatomic, readonly) UIView *_safeBrowsingWarning WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
291 #else
292 @property (nonatomic, readonly) NSView *_safeBrowsingWarning WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
293
294 @property (nonatomic, readonly) _WKRectEdge _pinnedState WK_API_AVAILABLE(macosx(10.13.4));
295 @property (nonatomic, setter=_setRubberBandingEnabled:) _WKRectEdge _rubberBandingEnabled WK_API_AVAILABLE(macosx(10.13.4));
296
297 @property (readonly) NSColor *_pageExtendedBackgroundColor;
298 @property (nonatomic, setter=_setBackgroundColor:) NSColor *_backgroundColor WK_API_AVAILABLE(macosx(10.14));
299 @property (nonatomic, setter=_setDrawsBackground:) BOOL _drawsBackground;
300 @property (nonatomic, setter=_setTopContentInset:) CGFloat _topContentInset;
301
302 @property (nonatomic, setter=_setAutomaticallyAdjustsContentInsets:) BOOL _automaticallyAdjustsContentInsets;
303
304 // Default value is 0. A value of 0 means the window's backing scale factor will be used and automatically update when the window moves screens.
305 @property (nonatomic, setter=_setOverrideDeviceScaleFactor:) CGFloat _overrideDeviceScaleFactor WK_API_AVAILABLE(macosx(10.11));
306
307 @property (nonatomic, setter=_setWindowOcclusionDetectionEnabled:) BOOL _windowOcclusionDetectionEnabled;
308
309 @property (nonatomic, readonly) NSInteger _spellCheckerDocumentTag WK_API_AVAILABLE(macosx(10.14));
310
311 - (void)_setShouldSuppressFirstResponderChanges:(BOOL)shouldSuppress;
312
313 // Clients that want to maintain default behavior can return nil. To disable the immediate action entirely, return NSNull. And to
314 // do something custom, return an object that conforms to the NSImmediateActionAnimationController protocol.
315 - (id)_immediateActionAnimationControllerForHitTestResult:(_WKHitTestResult *)hitTestResult withType:(_WKImmediateActionType)type userData:(id<NSSecureCoding>)userData;
316
317 @property (nonatomic, setter=_setMinimumLayoutWidth:) CGFloat _minimumLayoutWidth WK_API_AVAILABLE(macosx(10.12));
318
319 // When using _minimumLayoutWidth, the web content will lay out to the intrinsic height
320 // of the content; use this property to force it to lay out to the height of the view instead.
321 @property (nonatomic, setter=_setShouldExpandContentToViewHeightForAutoLayout:) BOOL _shouldExpandContentToViewHeightForAutoLayout WK_API_AVAILABLE(macosx(10.12));
322
323 @property (nonatomic, setter=_setAlwaysShowsHorizontalScroller:) BOOL _alwaysShowsHorizontalScroller WK_API_AVAILABLE(macosx(10.13.4));
324 @property (nonatomic, setter=_setAlwaysShowsVerticalScroller:) BOOL _alwaysShowsVerticalScroller WK_API_AVAILABLE(macosx(10.13.4));
325
326 - (NSPrintOperation *)_printOperationWithPrintInfo:(NSPrintInfo *)printInfo;
327 - (NSPrintOperation *)_printOperationWithPrintInfo:(NSPrintInfo *)printInfo forFrame:(_WKFrameHandle *)frameHandle WK_API_AVAILABLE(macosx(10.12), ios(10.0));
328
329 // FIXME: This SPI should become a part of the WKUIDelegate. rdar://problem/26561537
330 @property (nonatomic, readwrite, setter=_setWantsMediaPlaybackControlsView:) BOOL _wantsMediaPlaybackControlsView WK_API_AVAILABLE(macosx(10.12.3));
331 @property (nonatomic, readonly) id _mediaPlaybackControlsView WK_API_AVAILABLE(macosx(10.13));
332 - (void)_addMediaPlaybackControlsView:(id)mediaPlaybackControlsView WK_API_AVAILABLE(macosx(10.13));
333 - (void)_removeMediaPlaybackControlsView WK_API_AVAILABLE(macosx(10.12.3));
334
335 - (void)_prepareForMoveToWindow:(NSWindow *)targetWindow completionHandler:(void(^)(void))completionHandler WK_API_AVAILABLE(macosx(10.13));
336
337 @property (nonatomic, setter=_setOverlayScrollbarStyle:) _WKOverlayScrollbarStyle _overlayScrollbarStyle WK_API_AVAILABLE(macosx(10.13.4));
338 @property (strong, nonatomic, setter=_setInspectorAttachmentView:) NSView *_inspectorAttachmentView WK_API_AVAILABLE(macosx(10.13.4));
339
340 @property (nonatomic, setter=_setThumbnailView:) _WKThumbnailView *_thumbnailView WK_API_AVAILABLE(macosx(10.13.4));
341 @property (nonatomic, setter=_setIgnoresAllEvents:) BOOL _ignoresAllEvents WK_API_AVAILABLE(macosx(10.13.4));
342
343 #endif
344
345 - (WKNavigation *)_reloadWithoutContentBlockers WK_API_AVAILABLE(macosx(10.12), ios(10.0));
346 - (WKNavigation *)_reloadExpiredOnly WK_API_AVAILABLE(macosx(10.13), ios(11.0));
347
348 - (void)_killWebContentProcess;
349 - (void)_killWebContentProcessAndResetState;
350
351 - (void)_getMainResourceDataWithCompletionHandler:(void (^)(NSData *, NSError *))completionHandler;
352 - (void)_getWebArchiveDataWithCompletionHandler:(void (^)(NSData *, NSError *))completionHandler;
353 - (void)_getContentsAsStringWithCompletionHandler:(void (^)(NSString *, NSError *))completionHandler WK_API_AVAILABLE(macosx(10.13), ios(11.0));
354
355 - (void)_getApplicationManifestWithCompletionHandler:(void (^)(_WKApplicationManifest *))completionHandler WK_API_AVAILABLE(macosx(10.13.4), ios(11.3));
356
357 @property (nonatomic, setter=_setPaginationMode:) _WKPaginationMode _paginationMode;
358 // Whether the column-break-{before,after} properties are respected instead of the
359 // page-break-{before,after} properties.
360 @property (nonatomic, setter=_setPaginationBehavesLikeColumns:) BOOL _paginationBehavesLikeColumns;
361 // Set to 0 to have the page length equal the view length.
362 @property (nonatomic, setter=_setPageLength:) CGFloat _pageLength;
363 @property (nonatomic, setter=_setGapBetweenPages:) CGFloat _gapBetweenPages;
364 @property (nonatomic, setter=_setPaginationLineGridEnabled:) BOOL _paginationLineGridEnabled;
365 @property (readonly) NSUInteger _pageCount;
366
367 @property (nonatomic, readonly) BOOL _supportsTextZoom;
368 @property (nonatomic, setter=_setTextZoomFactor:) double _textZoomFactor;
369 @property (nonatomic, setter=_setPageZoomFactor:) double _pageZoomFactor;
370
371 @property (nonatomic, weak, setter=_setDiagnosticLoggingDelegate:) id <_WKDiagnosticLoggingDelegate> _diagnosticLoggingDelegate WK_API_AVAILABLE(macosx(10.11), ios(9.0));
372 @property (nonatomic, weak, setter=_setFindDelegate:) id <_WKFindDelegate> _findDelegate;
373 - (void)_findString:(NSString *)string options:(_WKFindOptions)options maxCount:(NSUInteger)maxCount;
374 - (void)_countStringMatches:(NSString *)string options:(_WKFindOptions)options maxCount:(NSUInteger)maxCount;
375 - (void)_hideFindUI;
376
377 @property (nonatomic, weak, setter=_setInputDelegate:) id <_WKInputDelegate> _inputDelegate WK_API_AVAILABLE(macosx(10.12), ios(10.0));
378
379 @property (nonatomic, readonly, getter=_isDisplayingStandaloneImageDocument) BOOL _displayingStandaloneImageDocument;
380 @property (nonatomic, readonly, getter=_isDisplayingStandaloneMediaDocument) BOOL _displayingStandaloneMediaDocument;
381
382 @property (nonatomic, setter=_setScrollPerformanceDataCollectionEnabled:) BOOL _scrollPerformanceDataCollectionEnabled WK_API_AVAILABLE(macosx(10.11), ios(9.0));
383 @property (nonatomic, readonly) NSArray *_scrollPerformanceData WK_API_AVAILABLE(macosx(10.11), ios(9.0));
384
385 - (void)_saveBackForwardSnapshotForItem:(WKBackForwardListItem *)item WK_API_AVAILABLE(macosx(10.11), ios(9.0));
386
387 @property (nonatomic, getter=_allowsMediaDocumentInlinePlayback, setter=_setAllowsMediaDocumentInlinePlayback:) BOOL _allowsMediaDocumentInlinePlayback;
388
389 @property (nonatomic, readonly) BOOL _webProcessIsResponsive WK_API_AVAILABLE(macosx(10.12), ios(10.0));
390
391 @property (nonatomic, setter=_setFullscreenDelegate:) id<_WKFullscreenDelegate> _fullscreenDelegate WK_API_AVAILABLE(macosx(10.13), ios(11.0));
392 @property (nonatomic, readonly) BOOL _isInFullscreen WK_API_AVAILABLE(macosx(10.12.3));
393
394 - (void)_muteMediaCapture WK_API_AVAILABLE(macosx(10.13), ios(11.0));
395 - (void)_setPageMuted:(_WKMediaMutedState)mutedState WK_API_AVAILABLE(macosx(10.13), ios(11.0));
396
397 @property (nonatomic, setter=_setMediaCaptureEnabled:) BOOL _mediaCaptureEnabled WK_API_AVAILABLE(macosx(10.13), ios(11.0));
398
399 @property (nonatomic, readonly) BOOL _canTogglePictureInPicture;
400 @property (nonatomic, readonly) BOOL _isPictureInPictureActive;
401 - (void)_updateMediaPlaybackControlsManager;
402 - (void)_togglePictureInPicture;
403
404 @end
405
406 #if TARGET_OS_IPHONE
407
408 @interface WKWebView () <UIResponderStandardEditActions>
409 @end
410
411 #else
412
413 @interface WKWebView (WKNSTextFinderClient) <NSTextFinderClient>
414 @end
415
416 #endif
417
418 @interface WKWebView (WKTesting)
419
420 - (NSDictionary *)_contentsOfUserInterfaceItem:(NSString *)userInterfaceItem WK_API_AVAILABLE(macosx(10.12.3), ios(10.3));
421
422 #if TARGET_OS_IPHONE
423
424 @property (nonatomic, readonly) CGRect _contentVisibleRect WK_API_AVAILABLE(ios(10.0));
425 - (CGPoint)_convertPointFromContentsToView:(CGPoint)point WK_API_AVAILABLE(ios(10.0));
426 - (CGPoint)_convertPointFromViewToContents:(CGPoint)point WK_API_AVAILABLE(ios(10.0));
427
428 - (void)keyboardAccessoryBarNext WK_API_AVAILABLE(ios(10.0));
429 - (void)keyboardAccessoryBarPrevious WK_API_AVAILABLE(ios(10.0));
430 - (void)dismissFormAccessoryView WK_API_AVAILABLE(ios(10.3));
431 - (void)selectFormAccessoryPickerRow:(int)rowIndex WK_API_AVAILABLE(ios(10.3));
432 @property (nonatomic, readonly) NSString *textContentTypeForTesting WK_API_AVAILABLE(ios(12.0));
433 @property (nonatomic, readonly) NSString *selectFormPopoverTitle WK_API_AVAILABLE(ios(12.0));
434 @property (nonatomic, readonly) NSString *formInputLabel WK_API_AVAILABLE(ios(12.0));
435 - (void)setTimePickerValueToHour:(NSInteger)hour minute:(NSInteger)minute WK_API_AVAILABLE(ios(12.0));
436
437 - (void)applyAutocorrection:(NSString *)newString toString:(NSString *)oldString withCompletionHandler:(void (^)(void))completionHandler WK_API_AVAILABLE(ios(11.0));
438
439 - (void)didStartFormControlInteraction WK_API_AVAILABLE(ios(10.3));
440 - (void)didEndFormControlInteraction WK_API_AVAILABLE(ios(10.3));
441
442 - (void)_didShowForcePressPreview WK_API_AVAILABLE(ios(10.3));
443 - (void)_didDismissForcePressPreview WK_API_AVAILABLE(ios(10.3));
444 - (void)_doAfterNextStablePresentationUpdate:(dispatch_block_t)updateBlock WK_API_AVAILABLE(ios(10.3));
445
446 @property (nonatomic, readonly) NSArray<NSValue *> *_uiTextSelectionRects WK_API_AVAILABLE(ios(10.3));
447 @property (nonatomic, readonly) CGRect _uiTextCaretRect WK_API_AVAILABLE(ios(10.3));
448 @property (nonatomic, readonly) CGRect _inputViewBounds WK_API_AVAILABLE(ios(10.3));
449
450 @property (nonatomic, readonly) NSString *_scrollingTreeAsText WK_API_AVAILABLE(ios(10.3));
451
452 @property (nonatomic, readonly) NSNumber *_stableStateOverride WK_API_AVAILABLE(ios(10.3));
453
454 - (NSDictionary *)_propertiesOfLayerWithID:(unsigned long long)layerID WK_API_AVAILABLE(ios(11.0));
455 - (void)_simulateLongPressActionAtLocation:(CGPoint)location WK_API_AVAILABLE(ios(11.0));
456 - (void)_simulateTextEntered:(NSString *)text WK_API_AVAILABLE(ios(12.0));
457
458 @property (nonatomic, readonly) CGRect _dragCaretRect WK_API_AVAILABLE(ios(11.0));
459
460 - (void)_requestActivatedElementAtPosition:(CGPoint)position completionBlock:(void (^)(_WKActivatedElementInfo *))block WK_API_AVAILABLE(ios(11.0));
461 - (void)_accessibilityRetrieveRectsAtSelectionOffset:(NSInteger)offset withText:(NSString *)text completionHandler:(void (^)(NSArray<NSValue *> *rects))completionHandler WK_API_AVAILABLE(ios(11.3));
462 - (void)_accessibilityStoreSelection WK_API_AVAILABLE(ios(11.3));
463 - (void)_accessibilityClearSelection WK_API_AVAILABLE(ios(11.3));
464 - (UIView *)_fullScreenPlaceholderView WK_API_AVAILABLE(ios(12.0));
465
466 @property (nonatomic, readonly) BOOL _contentViewIsFirstResponder WK_API_AVAILABLE(ios(WK_IOS_TBA));
467 #else
468 - (void)_dismissContentRelativeChildWindows WK_API_AVAILABLE(macosx(10.13.4));
469 - (void)_setFrame:(NSRect)rect andScrollBy:(NSSize)offset WK_API_AVAILABLE(macosx(10.13.4));
470 - (void)_beginDeferringViewInWindowChanges WK_API_AVAILABLE(macosx(10.13.4));
471 - (void)_endDeferringViewInWindowChanges WK_API_AVAILABLE(macosx(10.13.4));
472 - (void)_endDeferringViewInWindowChangesSync WK_API_AVAILABLE(macosx(10.13.4));
473 - (void)_gestureEventWasNotHandledByWebCore:(NSEvent *)event WK_API_AVAILABLE(macosx(10.13.4));
474 - (void)_setCustomSwipeViews:(NSArray *)customSwipeViews WK_API_AVAILABLE(macosx(10.13.4));
475 - (void)_setCustomSwipeViewsTopContentInset:(float)topContentInset WK_API_AVAILABLE(macosx(10.13.4));
476 - (NSView *)_fullScreenPlaceholderView WK_API_AVAILABLE(macosx(10.13.4));
477 - (NSWindow *)_fullScreenWindow WK_API_AVAILABLE(macosx(10.13.4));
478 - (void)_disableFrameSizeUpdates WK_API_AVAILABLE(macosx(10.13.4));
479 - (void)_enableFrameSizeUpdates WK_API_AVAILABLE(macosx(10.13.4));
480 - (void)_prepareForImmediateActionAnimation WK_API_AVAILABLE(macosx(10.13.4));
481 - (void)_cancelImmediateActionAnimation WK_API_AVAILABLE(macosx(10.13.4));
482 - (void)_completeImmediateActionAnimation WK_API_AVAILABLE(macosx(10.13.4));
483 - (BOOL)_canChangeFrameLayout:(_WKFrameHandle *)frameHandle WK_API_AVAILABLE(macosx(10.13.4));
484 - (BOOL)_tryToSwipeWithEvent:(NSEvent *)event ignoringPinnedState:(BOOL)ignoringPinnedState WK_API_AVAILABLE(macosx(10.13.4));
485 - (void)_setDidMoveSwipeSnapshotCallback:(void(^)(CGRect))callback WK_API_AVAILABLE(macosx(10.13.4));
486 @property (nonatomic, setter=_setTotalHeightOfBanners:) CGFloat _totalHeightOfBanners WK_API_AVAILABLE(macosx(10.13.4));
487 @property (nonatomic, copy, setter=_setUnderlayColor:) NSColor *_underlayColor WK_API_AVAILABLE(macosx(10.13.4));
488 @property (nonatomic, readwrite, setter=_setIgnoresNonWheelEvents:) BOOL _ignoresNonWheelEvents WK_API_AVAILABLE(macosx(10.13.4));
489 @property (nonatomic, readonly) WKPageRef _pageRefForTransitionToWKWebView  WK_API_AVAILABLE(macosx(10.13.4));
490 @property (nonatomic, readonly) BOOL _hasActiveVideoForControlsManager WK_API_AVAILABLE(macosx(10.12));
491 - (void)_requestControlledElementID WK_API_AVAILABLE(macosx(10.12.3));
492 - (void)_handleControlledElementIDResponse:(NSString *)identifier WK_API_AVAILABLE(macosx(10.12.3));
493 - (void)_handleAcceptedCandidate:(NSTextCheckingResult *)candidate WK_API_AVAILABLE(macosx(10.12.3));
494 - (void)_didHandleAcceptedCandidate WK_API_AVAILABLE(macosx(10.12.3));
495 - (void)_forceRequestCandidates WK_API_AVAILABLE(macosx(10.12.3));
496 - (void)_didUpdateCandidateListVisibility:(BOOL)visible WK_API_AVAILABLE(macosx(10.12.3));
497 @property (nonatomic, readonly) BOOL _shouldRequestCandidates WK_API_AVAILABLE(macosx(10.12.3));
498 - (void)_insertText:(id)string replacementRange:(NSRange)replacementRange WK_API_AVAILABLE(macosx(10.12.3));
499 - (NSRect)_candidateRect WK_API_AVAILABLE(macosx(10.13));
500 @property (nonatomic, readwrite, setter=_setUseSystemAppearance:) BOOL _useSystemAppearance WK_API_AVAILABLE(macosx(10.14));
501
502 - (void)_setHeaderBannerHeight:(int)height WK_API_AVAILABLE(macosx(10.12.3));
503 - (void)_setFooterBannerHeight:(int)height WK_API_AVAILABLE(macosx(10.12.3));
504 - (void)_doAfterProcessingAllPendingMouseEvents:(dispatch_block_t)action WK_API_AVAILABLE(macosx(WK_MAC_TBA));
505 #endif
506
507 - (void)_requestActiveNowPlayingSessionInfo:(void(^)(BOOL, BOOL, NSString*, double, double, NSInteger))callback WK_API_AVAILABLE(macosx(10.13.4), ios(11.3));
508
509 - (void)_setPageScale:(CGFloat)scale withOrigin:(CGPoint)origin WK_API_AVAILABLE(ios(10.3));
510 - (CGFloat)_pageScale WK_API_AVAILABLE(ios(10.3));
511
512 - (void)_doAfterNextPresentationUpdate:(void (^)(void))updateBlock WK_API_AVAILABLE(macosx(10.12), ios(10.0));
513 - (void)_doAfterNextPresentationUpdateWithoutWaitingForAnimatedResizeForTesting:(void (^)(void))updateBlock WK_API_AVAILABLE(macosx(10.14), ios(12.0));
514 - (void)_doAfterNextPresentationUpdateWithoutWaitingForPainting:(void (^)(void))updateBlock WK_API_AVAILABLE(macosx(10.12.3), ios(10.3));
515 - (void)_doAfterNextVisibleContentRectUpdate:(void (^)(void))updateBlock WK_API_AVAILABLE(macosx(10.13), ios(11.0));
516
517 - (void)_disableBackForwardSnapshotVolatilityForTesting WK_API_AVAILABLE(macosx(10.12.3), ios(10.3));
518 - (void)_executeEditCommand:(NSString *)command argument:(NSString *)argument completion:(void (^)(BOOL))completion WK_API_AVAILABLE(macosx(10.13.4), ios(11.3));
519
520 - (void)_denyNextUserMediaRequest WK_API_AVAILABLE(macosx(10.14), ios(12.0));
521
522 - (BOOL)_beginBackSwipeForTesting;
523 - (BOOL)_completeBackSwipeForTesting;
524 - (void)_setDefersLoadingForTesting:(BOOL)defersLoading;
525
526 - (void)_setShareSheetCompletesImmediatelyWithResolutionForTesting:(BOOL)resolved WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
527
528 @property (nonatomic, readonly) _WKInspector *_inspector WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
529 @property (nonatomic, readonly) _WKFrameHandle *_mainFrame WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
530
531 @end
532
533 #endif