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