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