Limit user-agent interactions based on the touch-action property on iOS
[WebKit-https.git] / Source / WebKit / UIProcess / ios / WKContentViewInteraction.h
1 /*
2  * Copyright (C) 2012-2018 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #if PLATFORM(IOS_FAMILY)
27
28 #import "WKContentView.h"
29
30 #if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
31 #import "WKShareSheet.h"
32 #endif
33
34 #import "DragDropInteractionState.h"
35 #import "EditorState.h"
36 #import "FocusedElementInformation.h"
37 #import "GestureTypes.h"
38 #import "InteractionInformationAtPosition.h"
39 #import "UIKitSPI.h"
40 #import "WKActionSheetAssistant.h"
41 #import "WKAirPlayRoutePicker.h"
42 #import "WKFileUploadPanel.h"
43 #import "WKFormPeripheral.h"
44 #import "WKKeyboardScrollingAnimator.h"
45 #import "WKShareSheet.h"
46 #import "WKSyntheticClickTapGestureRecognizer.h"
47 #import "_WKFormInputSession.h"
48 #import <UIKit/UIView.h>
49 #import <WebCore/Color.h>
50 #import <WebCore/FloatQuad.h>
51 #import <wtf/BlockPtr.h>
52 #import <wtf/Forward.h>
53 #import <wtf/OptionSet.h>
54 #import <wtf/Vector.h>
55 #import <wtf/WeakObjCPtr.h>
56 #import <wtf/text/WTFString.h>
57
58 namespace API {
59 class OpenPanelParameters;
60 }
61
62 namespace WTF {
63 class TextStream;
64 }
65
66 namespace WebCore {
67 class Color;
68 class FloatQuad;
69 class IntSize;
70 class SelectionRect;
71 struct PromisedAttachmentInfo;
72 struct ShareDataWithParsedURL;
73 enum class RouteSharingPolicy : uint8_t;
74 }
75
76 #if ENABLE(DRAG_SUPPORT)
77 namespace WebCore {
78 struct DragItem;
79 }
80 #endif
81
82 namespace WebKit {
83 class InputViewUpdateDeferrer;
84 class NativeWebTouchEvent;
85 class SmartMagnificationController;
86 class WebOpenPanelResultListenerProxy;
87 class WebPageProxy;
88 }
89
90 @class _UILookupGestureRecognizer;
91 @class _UIHighlightView;
92 @class _UIWebHighlightLongPressGestureRecognizer;
93 @class UIHoverGestureRecognizer;
94 @class WebEvent;
95 @class WKActionSheetAssistant;
96 @class WKDrawingCoordinator;
97 @class WKFocusedFormControlView;
98 @class WKFormInputControl;
99 @class WKFormInputSession;
100 @class WKInspectorNodeSearchGestureRecognizer;
101
102 typedef void (^UIWKAutocorrectionCompletionHandler)(UIWKAutocorrectionRects *rectsForInput);
103 typedef void (^UIWKAutocorrectionContextHandler)(UIWKAutocorrectionContext *autocorrectionContext);
104 typedef void (^UIWKDictationContextHandler)(NSString *selectedText, NSString *beforeText, NSString *afterText);
105 typedef void (^UIWKSelectionCompletionHandler)(void);
106 typedef void (^UIWKSelectionWithDirectionCompletionHandler)(BOOL selectionEndIsMoving);
107
108 typedef BlockPtr<void(WebKit::InteractionInformationAtPosition)> InteractionInformationCallback;
109 typedef std::pair<WebKit::InteractionInformationRequest, InteractionInformationCallback> InteractionInformationRequestAndCallback;
110
111 #define FOR_EACH_WKCONTENTVIEW_ACTION(M) \
112     M(_addShortcut) \
113     M(_define) \
114     M(_lookup) \
115     M(_promptForReplace) \
116     M(_share) \
117     M(_showTextStyleOptions) \
118     M(_transliterateChinese) \
119     M(_nextAccessoryTab) \
120     M(_previousAccessoryTab) \
121     M(copy) \
122     M(cut) \
123     M(paste) \
124     M(replace) \
125     M(select) \
126     M(selectAll) \
127     M(toggleBoldface) \
128     M(toggleItalics) \
129     M(toggleUnderline) \
130     M(increaseSize) \
131     M(decreaseSize) \
132     M(pasteAndMatchStyle) \
133     M(makeTextWritingDirectionNatural)
134
135 #define FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION(M) \
136     M(_alignCenter) \
137     M(_alignJustified) \
138     M(_alignLeft) \
139     M(_alignRight) \
140     M(_indent) \
141     M(_outdent) \
142     M(_toggleStrikeThrough) \
143     M(_insertOrderedList) \
144     M(_insertUnorderedList) \
145     M(_insertNestedOrderedList) \
146     M(_insertNestedUnorderedList) \
147     M(_increaseListLevel) \
148     M(_decreaseListLevel) \
149     M(_changeListType) \
150     M(_pasteAsQuotation) \
151     M(_pasteAndMatchStyle)
152
153 namespace WebKit {
154
155 enum SuppressSelectionAssistantReason : uint8_t {
156     FocusedElementIsTransparentOrFullyClipped = 1 << 0,
157     FocusedElementIsTooSmall = 1 << 1,
158     DropAnimationIsRunning = 1 << 2
159 };
160
161 struct WKSelectionDrawingInfo {
162     enum class SelectionType { None, Plugin, Range };
163     WKSelectionDrawingInfo();
164     explicit WKSelectionDrawingInfo(const EditorState&);
165     SelectionType type;
166     WebCore::IntRect caretRect;
167     Vector<WebCore::SelectionRect> selectionRects;
168 };
169
170 WTF::TextStream& operator<<(WTF::TextStream&, const WKSelectionDrawingInfo&);
171
172 struct WKAutoCorrectionData {
173     String fontName;
174     CGFloat fontSize;
175     uint64_t fontTraits;
176     CGRect textFirstRect;
177     CGRect textLastRect;
178     UIWKAutocorrectionCompletionHandler autocorrectionHandler;
179     UIWKAutocorrectionContextHandler autocorrectionContextHandler;
180 };
181
182 }
183
184 @class WKFocusedElementInfo;
185 @protocol WKFormControl;
186
187 @interface WKFormInputSession : NSObject <_WKFormInputSession>
188
189 - (instancetype)initWithContentView:(WKContentView *)view focusedElementInfo:(WKFocusedElementInfo *)elementInfo requiresStrongPasswordAssistance:(BOOL)requiresStrongPasswordAssistance;
190 - (void)endEditing;
191 - (void)invalidate;
192
193 @end
194
195 @interface WKContentView () {
196     RetainPtr<UIWebTouchEventsGestureRecognizer> _touchEventGestureRecognizer;
197
198     BOOL _canSendTouchEventsAsynchronously;
199 #if ENABLE(POINTER_EVENTS)
200     BOOL _preventsPanningInXAxis;
201     BOOL _preventsPanningInYAxis;
202 #endif
203
204     RetainPtr<WKSyntheticClickTapGestureRecognizer> _singleTapGestureRecognizer;
205     RetainPtr<_UIWebHighlightLongPressGestureRecognizer> _highlightLongPressGestureRecognizer;
206     RetainPtr<UILongPressGestureRecognizer> _longPressGestureRecognizer;
207     RetainPtr<UITapGestureRecognizer> _doubleTapGestureRecognizer;
208     RetainPtr<UITapGestureRecognizer> _nonBlockingDoubleTapGestureRecognizer;
209     RetainPtr<UITapGestureRecognizer> _twoFingerDoubleTapGestureRecognizer;
210     RetainPtr<UITapGestureRecognizer> _twoFingerSingleTapGestureRecognizer;
211     RetainPtr<UITapGestureRecognizer> _stylusSingleTapGestureRecognizer;
212     RetainPtr<WKInspectorNodeSearchGestureRecognizer> _inspectorNodeSearchGestureRecognizer;
213
214 #if PLATFORM(IOSMAC)
215     RetainPtr<UIHoverGestureRecognizer> _hoverGestureRecognizer;
216     RetainPtr<_UILookupGestureRecognizer> _lookupGestureRecognizer;
217 #endif
218
219     RetainPtr<UIWKTextInteractionAssistant> _textSelectionAssistant;
220     OptionSet<WebKit::SuppressSelectionAssistantReason> _suppressSelectionAssistantReasons;
221
222     RetainPtr<UITextInputTraits> _traits;
223     RetainPtr<UIWebFormAccessory> _formAccessoryView;
224     RetainPtr<_UIHighlightView> _highlightView;
225     RetainPtr<UIView> _interactionViewsContainerView;
226     RetainPtr<NSString> _markedText;
227     RetainPtr<WKActionSheetAssistant> _actionSheetAssistant;
228 #if ENABLE(AIRPLAY_PICKER)
229     RetainPtr<WKAirPlayRoutePicker> _airPlayRoutePicker;
230 #endif
231     RetainPtr<WKFormInputSession> _formInputSession;
232     RetainPtr<WKFileUploadPanel> _fileUploadPanel;
233 #if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
234     RetainPtr<WKShareSheet> _shareSheet;
235 #endif
236     RetainPtr<UIGestureRecognizer> _previewGestureRecognizer;
237     RetainPtr<UIGestureRecognizer> _previewSecondaryGestureRecognizer;
238     Vector<bool> _focusStateStack;
239 #if HAVE(LINK_PREVIEW)
240     RetainPtr<UIPreviewItemController> _previewItemController;
241 #endif
242
243     std::unique_ptr<WebKit::SmartMagnificationController> _smartMagnificationController;
244
245     WeakObjCPtr<id <UITextInputDelegate>> _inputDelegate;
246
247     uint64_t _latestTapID;
248     struct TapHighlightInformation {
249         BOOL nodeHasBuiltInClickHandling { false };
250         WebCore::Color color;
251         Vector<WebCore::FloatQuad> quads;
252         WebCore::IntSize topLeftRadius;
253         WebCore::IntSize topRightRadius;
254         WebCore::IntSize bottomLeftRadius;
255         WebCore::IntSize bottomRightRadius;
256     };
257     TapHighlightInformation _tapHighlightInformation;
258
259     WebKit::WKAutoCorrectionData _autocorrectionData;
260     WebKit::InteractionInformationAtPosition _positionInformation;
261     WebKit::FocusedElementInformation _focusedElementInformation;
262     RetainPtr<NSObject<WKFormPeripheral>> _inputPeripheral;
263     RetainPtr<UIEvent> _uiEventBeingResent;
264     BlockPtr<void(::WebEvent *, BOOL)> _keyWebEventHandler;
265
266     CGPoint _lastInteractionLocation;
267     uint64_t _layerTreeTransactionIdAtLastTouchStart;
268
269     WebKit::WKSelectionDrawingInfo _lastSelectionDrawingInfo;
270
271     Optional<WebKit::InteractionInformationRequest> _outstandingPositionInformationRequest;
272
273     uint64_t _positionInformationCallbackDepth;
274     Vector<Optional<InteractionInformationRequestAndCallback>> _pendingPositionInformationHandlers;
275     
276     std::unique_ptr<WebKit::InputViewUpdateDeferrer> _inputViewUpdateDeferrer;
277
278     RetainPtr<WKKeyboardScrollViewAnimator> _keyboardScrollingAnimator;
279
280 #if ENABLE(DATALIST_ELEMENT)
281     RetainPtr<UIView <WKFormControl>> _dataListTextSuggestionsInputView;
282     RetainPtr<NSArray<UITextSuggestion *>> _dataListTextSuggestions;
283 #endif
284
285 #if HAVE(PENCILKIT)
286     RetainPtr<WKDrawingCoordinator> _drawingCoordinator;
287 #endif
288
289     BOOL _isEditable;
290     BOOL _showingTextStyleOptions;
291     BOOL _hasValidPositionInformation;
292     BOOL _isTapHighlightIDValid;
293     BOOL _potentialTapInProgress;
294     BOOL _isDoubleTapPending;
295     BOOL _highlightLongPressCanClick;
296     BOOL _hasTapHighlightForPotentialTap;
297     BOOL _selectionNeedsUpdate;
298     BOOL _shouldRestoreSelection;
299     BOOL _usingGestureForSelection;
300     BOOL _inspectorNodeSearchEnabled;
301     BOOL _isChangingFocusUsingAccessoryTab;
302     BOOL _didAccessoryTabInitiateFocus;
303     BOOL _isExpectingFastSingleTapCommit;
304     BOOL _showDebugTapHighlightsForFastClicking;
305     BOOL _isZoomingToRevealFocusedElement;
306
307     BOOL _becomingFirstResponder;
308     BOOL _resigningFirstResponder;
309     BOOL _needsDeferredEndScrollingSelectionUpdate;
310     BOOL _isChangingFocus;
311     BOOL _isBlurringFocusedNode;
312
313     BOOL _focusRequiresStrongPasswordAssistance;
314
315     BOOL _hasSetUpInteractions;
316
317 #if ENABLE(DATA_INTERACTION)
318     WebKit::DragDropInteractionState _dragDropInteractionState;
319     RetainPtr<UIDragInteraction> _dragInteraction;
320     RetainPtr<UIDropInteraction> _dropInteraction;
321     BOOL _shouldRestoreCalloutBarAfterDrop;
322     BOOL _isAnimatingConcludeEditDrag;
323     RetainPtr<UIView> _visibleContentViewSnapshot;
324     RetainPtr<_UITextDragCaretView> _editDropCaretView;
325 #endif
326
327 #if PLATFORM(WATCHOS)
328     RetainPtr<WKFocusedFormControlView> _focusedFormControlView;
329     RetainPtr<UIViewController> _presentedFullScreenInputViewController;
330     RetainPtr<UINavigationController> _inputNavigationViewControllerForFullScreenInputs;
331
332     BOOL _shouldRestoreFirstResponderStatusAfterLosingFocus;
333     BlockPtr<void()> _activeFocusedStateRetainBlock;
334 #endif
335 }
336
337 @end
338
339 @interface WKContentView (WKInteraction) <UIGestureRecognizerDelegate, UITextAutoscrolling, UITextInputMultiDocument, UITextInputPrivate, UIWebFormAccessoryDelegate, UIWebTouchEventsGestureRecognizerDelegate, UIWKInteractionViewProtocol, WKActionSheetAssistantDelegate, WKFileUploadPanelDelegate, WKKeyboardScrollViewAnimatorDelegate
340 #if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
341     , WKShareSheetDelegate
342 #endif
343 #if ENABLE(DATA_INTERACTION)
344     , UIDragInteractionDelegate, UIDropInteractionDelegate
345 #endif
346 >
347
348 @property (nonatomic, readonly) CGPoint lastInteractionLocation;
349 @property (nonatomic, readonly) BOOL isEditable;
350 @property (nonatomic, readonly) BOOL shouldHideSelectionWhenScrolling;
351 @property (nonatomic, readonly) const WebKit::InteractionInformationAtPosition& positionInformation;
352 @property (nonatomic, readonly) const WebKit::WKAutoCorrectionData& autocorrectionData;
353 @property (nonatomic, readonly) const WebKit::FocusedElementInformation& focusedElementInformation;
354 @property (nonatomic, readonly) UIWebFormAccessory *formAccessoryView;
355 @property (nonatomic, readonly) UITextInputAssistantItem *inputAssistantItemForWebView;
356 #if ENABLE(POINTER_EVENTS)
357 @property (nonatomic, readonly) BOOL preventsPanningInXAxis;
358 @property (nonatomic, readonly) BOOL preventsPanningInYAxis;
359 #endif
360
361 #if ENABLE(DATALIST_ELEMENT)
362 @property (nonatomic, strong) UIView <WKFormControl> *dataListTextSuggestionsInputView;
363 @property (nonatomic, strong) NSArray<UITextSuggestion *> *dataListTextSuggestions;
364 #endif
365
366 - (void)setupInteraction;
367 - (void)cleanupInteraction;
368
369 - (void)scrollViewWillStartPanOrPinchGesture;
370
371 - (BOOL)canBecomeFirstResponderForWebView;
372 - (BOOL)becomeFirstResponderForWebView;
373 - (BOOL)resignFirstResponderForWebView;
374 - (BOOL)canPerformActionForWebView:(SEL)action withSender:(id)sender;
375 - (id)targetForActionForWebView:(SEL)action withSender:(id)sender;
376
377 #define DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW(_action) \
378     - (void)_action ## ForWebView:(id)sender;
379 FOR_EACH_WKCONTENTVIEW_ACTION(DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW)
380 FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION(DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW)
381 #undef DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW
382
383 - (void)_setFontForWebView:(UIFont *)fontFamily sender:(id)sender;
384 - (void)_setFontSizeForWebView:(CGFloat)fontSize sender:(id)sender;
385 - (void)_setTextColorForWebView:(UIColor *)color sender:(id)sender;
386
387 #if ENABLE(TOUCH_EVENTS)
388 - (void)_webTouchEvent:(const WebKit::NativeWebTouchEvent&)touchEvent preventsNativeGestures:(BOOL)preventsDefault;
389 #endif
390 - (void)_commitPotentialTapFailed;
391 - (void)_didNotHandleTapAsClick:(const WebCore::IntPoint&)point;
392 - (void)_didCompleteSyntheticClick;
393 - (void)_didGetTapHighlightForRequest:(uint64_t)requestID color:(const WebCore::Color&)color quads:(const Vector<WebCore::FloatQuad>&)highlightedQuads topLeftRadius:(const WebCore::IntSize&)topLeftRadius topRightRadius:(const WebCore::IntSize&)topRightRadius bottomLeftRadius:(const WebCore::IntSize&)bottomLeftRadius bottomRightRadius:(const WebCore::IntSize&)bottomRightRadius nodeHasBuiltInClickHandling:(BOOL)nodeHasBuiltInClickHandling;
394
395 - (BOOL)_mayDisableDoubleTapGesturesDuringSingleTap;
396 - (void)_disableDoubleTapGesturesDuringTapIfNecessary:(uint64_t)requestID;
397 - (void)_elementDidFocus:(const WebKit::FocusedElementInformation&)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode changingActivityState:(BOOL)changingActivityState userObject:(NSObject <NSSecureCoding> *)userObject;
398 - (void)_elementDidBlur;
399 - (void)_didUpdateInputMode:(WebCore::InputMode)mode;
400 - (void)_didReceiveEditorStateUpdateAfterFocus;
401 - (void)_selectionChanged;
402 - (void)_updateChangedSelection;
403 - (BOOL)_interpretKeyEvent:(::WebEvent *)theEvent isCharEvent:(BOOL)isCharEvent;
404 - (void)_positionInformationDidChange:(const WebKit::InteractionInformationAtPosition&)info;
405 - (void)_attemptClickAtLocation:(CGPoint)location;
406 - (void)_willStartScrollingOrZooming;
407 - (void)_didScroll;
408 - (void)_didEndScrollingOrZooming;
409 - (void)_scrollingNodeScrollingWillBegin;
410 - (void)_scrollingNodeScrollingDidEnd;
411 - (void)_showPlaybackTargetPicker:(BOOL)hasVideo fromRect:(const WebCore::IntRect&)elementRect routeSharingPolicy:(WebCore::RouteSharingPolicy)policy routingContextUID:(NSString *)contextUID;
412 - (void)_showRunOpenPanel:(API::OpenPanelParameters*)parameters resultListener:(WebKit::WebOpenPanelResultListenerProxy*)listener;
413 - (void)_showShareSheet:(const WebCore::ShareDataWithParsedURL&)shareData completionHandler:(WTF::CompletionHandler<void(bool)>&&)completionHandler;
414 - (void)accessoryDone;
415 - (void)_didHandleKeyEvent:(::WebEvent *)event eventWasHandled:(BOOL)eventWasHandled;
416 - (Vector<WebKit::OptionItem>&) focusedSelectElementOptions;
417 - (void)_enableInspectorNodeSearch;
418 - (void)_disableInspectorNodeSearch;
419 - (void)_becomeFirstResponderWithSelectionMovingForward:(BOOL)selectingForward completionHandler:(void (^)(BOOL didBecomeFirstResponder))completionHandler;
420 - (void)_setDoubleTapGesturesEnabled:(BOOL)enabled;
421 #if ENABLE(DATA_DETECTION)
422 - (NSArray *)_dataDetectionResults;
423 #endif
424 - (NSArray<NSValue *> *)_uiTextSelectionRects;
425 - (void)accessibilityRetrieveSpeakSelectionContent;
426 - (void)_accessibilityRetrieveRectsEnclosingSelectionOffset:(NSInteger)offset withGranularity:(UITextGranularity)granularity;
427 - (void)_accessibilityRetrieveRectsAtSelectionOffset:(NSInteger)offset withText:(NSString *)text completionHandler:(void (^)(const Vector<WebCore::SelectionRect>& rects))completionHandler;
428 - (void)_accessibilityRetrieveRectsAtSelectionOffset:(NSInteger)offset withText:(NSString *)text;
429 - (void)_accessibilityStoreSelection;
430 - (void)_accessibilityClearSelection;
431 - (WKFormInputSession *)_formInputSession;
432
433 @property (nonatomic, readonly) WebKit::InteractionInformationAtPosition currentPositionInformation;
434 - (void)doAfterPositionInformationUpdate:(void (^)(WebKit::InteractionInformationAtPosition))action forRequest:(WebKit::InteractionInformationRequest)request;
435 - (BOOL)ensurePositionInformationIsUpToDate:(WebKit::InteractionInformationRequest)request;
436
437 #if ENABLE(DATA_INTERACTION)
438 - (void)_didChangeDragInteractionPolicy;
439 - (void)_didPerformDragOperation:(BOOL)handled;
440 - (void)_didHandleDragStartRequest:(BOOL)started;
441 - (void)_didHandleAdditionalDragItemsRequest:(BOOL)added;
442 - (void)_startDrag:(RetainPtr<CGImageRef>)image item:(const WebCore::DragItem&)item;
443 - (void)_didConcludeEditDrag:(Optional<WebCore::TextIndicatorData>)data;
444 - (void)_didChangeDragCaretRect:(CGRect)previousRect currentRect:(CGRect)rect;
445 #endif
446
447 - (void)reloadContextViewForPresentedListViewController;
448
449 #if ENABLE(DATALIST_ELEMENT)
450 - (void)updateTextSuggestionsForInputDelegate;
451 #endif
452
453 #if HAVE(PENCILKIT)
454 - (WKDrawingCoordinator *)_drawingCoordinator;
455 #endif
456
457 @end
458
459 @interface WKContentView (WKTesting)
460
461 - (void)_simulateLongPressActionAtLocation:(CGPoint)location;
462 - (void)_simulateTextEntered:(NSString *)text;
463 - (void)selectFormAccessoryPickerRow:(NSInteger)rowIndex;
464 - (void)setTimePickerValueToHour:(NSInteger)hour minute:(NSInteger)minute;
465 - (NSDictionary *)_contentsOfUserInterfaceItem:(NSString *)userInterfaceItem;
466
467 @property (nonatomic, readonly) NSString *textContentTypeForTesting;
468 @property (nonatomic, readonly) NSString *selectFormPopoverTitle;
469 @property (nonatomic, readonly) NSString *formInputLabel;
470 @property (nonatomic, readonly) WKFormInputControl *formInputControl;
471
472 @end
473
474 #if HAVE(LINK_PREVIEW)
475 @interface WKContentView (WKInteractionPreview) <UIPreviewItemDelegate>
476
477 - (void)_registerPreview;
478 - (void)_unregisterPreview;
479 @end
480 #endif
481
482 @interface WKContentView (WKFileUploadPanel)
483 + (Class)_fileUploadPanelClass;
484 @end
485
486 #endif // PLATFORM(IOS_FAMILY)