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