4d8c1406a33507d85c08d1f67b64f84624ec0b0e
[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 "AssistedNodeInformation.h"
35 #import "DragDropInteractionState.h"
36 #import "EditorState.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 WKFocusedFormControlView;
97 @class WKFormInputControl;
98 @class WKFormInputSession;
99 @class WKInkPickerView;
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(toggleStrikeThrough) \
133     M(insertUnorderedList) \
134     M(insertOrderedList) \
135     M(indent) \
136     M(outdent) \
137     M(alignLeft) \
138     M(alignRight) \
139     M(alignCenter) \
140     M(alignJustified) \
141     M(pasteAndMatchStyle) \
142     M(makeTextWritingDirectionNatural)
143
144 #define FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION(M) \
145     M(_alignCenter) \
146     M(_alignJustified) \
147     M(_alignLeft) \
148     M(_alignRight) \
149     M(_indent) \
150     M(_outdent) \
151     M(_toggleStrikeThrough) \
152     M(_insertOrderedList) \
153     M(_insertUnorderedList) \
154     M(_insertNestedOrderedList) \
155     M(_insertNestedUnorderedList) \
156     M(_increaseListLevel) \
157     M(_decreaseListLevel) \
158     M(_changeListType) \
159     M(_pasteAsQuotation) \
160     M(_pasteAndMatchStyle)
161
162 namespace WebKit {
163
164 enum SuppressSelectionAssistantReason : uint8_t {
165     FocusedElementIsTransparent = 1 << 0,
166     DropAnimationIsRunning = 1 << 1
167 };
168
169 struct WKSelectionDrawingInfo {
170     enum class SelectionType { None, Plugin, Range };
171     WKSelectionDrawingInfo();
172     explicit WKSelectionDrawingInfo(const EditorState&);
173     SelectionType type;
174     WebCore::IntRect caretRect;
175     Vector<WebCore::SelectionRect> selectionRects;
176 };
177
178 WTF::TextStream& operator<<(WTF::TextStream&, const WKSelectionDrawingInfo&);
179
180 struct WKAutoCorrectionData {
181     String fontName;
182     CGFloat fontSize;
183     uint64_t fontTraits;
184     CGRect textFirstRect;
185     CGRect textLastRect;
186     UIWKAutocorrectionCompletionHandler autocorrectionHandler;
187     UIWKAutocorrectionContextHandler autocorrectionContextHandler;
188 };
189
190 }
191
192 @class WKFocusedElementInfo;
193 @protocol WKFormControl;
194
195 @interface WKFormInputSession : NSObject <_WKFormInputSession>
196
197 - (instancetype)initWithContentView:(WKContentView *)view focusedElementInfo:(WKFocusedElementInfo *)elementInfo requiresStrongPasswordAssistance:(BOOL)requiresStrongPasswordAssistance;
198 - (void)endEditing;
199 - (void)invalidate;
200
201 @end
202
203 @interface WKContentView () {
204     RetainPtr<UIWebTouchEventsGestureRecognizer> _touchEventGestureRecognizer;
205
206     BOOL _canSendTouchEventsAsynchronously;
207
208     RetainPtr<WKSyntheticClickTapGestureRecognizer> _singleTapGestureRecognizer;
209     RetainPtr<_UIWebHighlightLongPressGestureRecognizer> _highlightLongPressGestureRecognizer;
210     RetainPtr<UILongPressGestureRecognizer> _longPressGestureRecognizer;
211     RetainPtr<UITapGestureRecognizer> _doubleTapGestureRecognizer;
212     RetainPtr<UITapGestureRecognizer> _nonBlockingDoubleTapGestureRecognizer;
213     RetainPtr<UITapGestureRecognizer> _twoFingerDoubleTapGestureRecognizer;
214     RetainPtr<UITapGestureRecognizer> _twoFingerSingleTapGestureRecognizer;
215     RetainPtr<UITapGestureRecognizer> _stylusSingleTapGestureRecognizer;
216     RetainPtr<WKInspectorNodeSearchGestureRecognizer> _inspectorNodeSearchGestureRecognizer;
217
218 #if PLATFORM(IOSMAC)
219     RetainPtr<UIHoverGestureRecognizer> _hoverGestureRecognizer;
220     RetainPtr<_UILookupGestureRecognizer> _lookupGestureRecognizer;
221 #endif
222
223     RetainPtr<UIWKTextInteractionAssistant> _textSelectionAssistant;
224     OptionSet<WebKit::SuppressSelectionAssistantReason> _suppressSelectionAssistantReasons;
225
226     RetainPtr<UITextInputTraits> _traits;
227     RetainPtr<UIWebFormAccessory> _formAccessoryView;
228     RetainPtr<_UIHighlightView> _highlightView;
229     RetainPtr<UIView> _interactionViewsContainerView;
230     RetainPtr<NSString> _markedText;
231     RetainPtr<WKActionSheetAssistant> _actionSheetAssistant;
232 #if ENABLE(AIRPLAY_PICKER)
233     RetainPtr<WKAirPlayRoutePicker> _airPlayRoutePicker;
234 #endif
235     RetainPtr<WKFormInputSession> _formInputSession;
236     RetainPtr<WKFileUploadPanel> _fileUploadPanel;
237 #if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
238     RetainPtr<WKShareSheet> _shareSheet;
239 #endif
240     RetainPtr<UIGestureRecognizer> _previewGestureRecognizer;
241     RetainPtr<UIGestureRecognizer> _previewSecondaryGestureRecognizer;
242     Vector<bool> _focusStateStack;
243 #if HAVE(LINK_PREVIEW)
244     RetainPtr<UIPreviewItemController> _previewItemController;
245 #endif
246
247     std::unique_ptr<WebKit::SmartMagnificationController> _smartMagnificationController;
248
249     WeakObjCPtr<id <UITextInputDelegate>> _inputDelegate;
250
251     uint64_t _latestTapID;
252     struct TapHighlightInformation {
253         WebCore::Color color;
254         Vector<WebCore::FloatQuad> quads;
255         WebCore::IntSize topLeftRadius;
256         WebCore::IntSize topRightRadius;
257         WebCore::IntSize bottomLeftRadius;
258         WebCore::IntSize bottomRightRadius;
259     };
260     TapHighlightInformation _tapHighlightInformation;
261
262     WebKit::WKAutoCorrectionData _autocorrectionData;
263     WebKit::InteractionInformationAtPosition _positionInformation;
264     WebKit::AssistedNodeInformation _assistedNodeInformation;
265     RetainPtr<NSObject<WKFormPeripheral>> _inputPeripheral;
266     RetainPtr<UIEvent> _uiEventBeingResent;
267     BlockPtr<void(::WebEvent *, BOOL)> _keyWebEventHandler;
268
269     CGPoint _lastInteractionLocation;
270     uint64_t _layerTreeTransactionIdAtLastTouchStart;
271
272     WebKit::WKSelectionDrawingInfo _lastSelectionDrawingInfo;
273
274     Optional<WebKit::InteractionInformationRequest> _outstandingPositionInformationRequest;
275
276     uint64_t _positionInformationCallbackDepth;
277     Vector<Optional<InteractionInformationRequestAndCallback>> _pendingPositionInformationHandlers;
278     
279     std::unique_ptr<WebKit::InputViewUpdateDeferrer> _inputViewUpdateDeferrer;
280
281     RetainPtr<WKKeyboardScrollViewAnimator> _keyboardScrollingAnimator;
282
283 #if ENABLE(DATALIST_ELEMENT)
284     RetainPtr<UIView <WKFormControl>> _dataListTextSuggestionsInputView;
285     RetainPtr<NSArray<UITextSuggestion *>> _dataListTextSuggestions;
286 #endif
287
288 #if HAVE(PENCILKIT)
289     RetainPtr<WKInkPickerView> _inkPicker;
290 #endif
291
292     BOOL _isEditable;
293     BOOL _showingTextStyleOptions;
294     BOOL _hasValidPositionInformation;
295     BOOL _isTapHighlightIDValid;
296     BOOL _potentialTapInProgress;
297     BOOL _isDoubleTapPending;
298     BOOL _highlightLongPressCanClick;
299     BOOL _hasTapHighlightForPotentialTap;
300     BOOL _selectionNeedsUpdate;
301     BOOL _shouldRestoreSelection;
302     BOOL _usingGestureForSelection;
303     BOOL _inspectorNodeSearchEnabled;
304     BOOL _isChangingFocusUsingAccessoryTab;
305     BOOL _didAccessoryTabInitiateFocus;
306     BOOL _isExpectingFastSingleTapCommit;
307     BOOL _showDebugTapHighlightsForFastClicking;
308     BOOL _isZoomingToRevealFocusedElement;
309
310     BOOL _becomingFirstResponder;
311     BOOL _resigningFirstResponder;
312     BOOL _needsDeferredEndScrollingSelectionUpdate;
313     BOOL _isChangingFocus;
314     BOOL _isBlurringFocusedNode;
315
316     BOOL _focusRequiresStrongPasswordAssistance;
317
318     BOOL _hasSetUpInteractions;
319
320 #if ENABLE(DATA_INTERACTION)
321     WebKit::DragDropInteractionState _dragDropInteractionState;
322     RetainPtr<UIDragInteraction> _dragInteraction;
323     RetainPtr<UIDropInteraction> _dropInteraction;
324     BOOL _shouldRestoreCalloutBarAfterDrop;
325     BOOL _isAnimatingConcludeEditDrag;
326     RetainPtr<UIView> _visibleContentViewSnapshot;
327     RetainPtr<_UITextDragCaretView> _editDropCaretView;
328 #endif
329
330 #if PLATFORM(WATCHOS)
331     RetainPtr<WKFocusedFormControlView> _focusedFormControlView;
332     RetainPtr<UIViewController> _presentedFullScreenInputViewController;
333     RetainPtr<UINavigationController> _inputNavigationViewControllerForFullScreenInputs;
334
335     BOOL _shouldRestoreFirstResponderStatusAfterLosingFocus;
336     BlockPtr<void()> _activeFocusedStateRetainBlock;
337 #endif
338 }
339
340 @end
341
342 @interface WKContentView (WKInteraction) <UIGestureRecognizerDelegate, UITextAutoscrolling, UITextInputMultiDocument, UITextInputPrivate, UIWebFormAccessoryDelegate, UIWebTouchEventsGestureRecognizerDelegate, UIWKInteractionViewProtocol, WKActionSheetAssistantDelegate, WKFileUploadPanelDelegate, WKKeyboardScrollViewAnimatorDelegate
343 #if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
344     , WKShareSheetDelegate
345 #endif
346 #if ENABLE(DATA_INTERACTION)
347     , UIDragInteractionDelegate, UIDropInteractionDelegate
348 #endif
349 >
350
351 @property (nonatomic, readonly) CGPoint lastInteractionLocation;
352 @property (nonatomic, readonly) BOOL isEditable;
353 @property (nonatomic, readonly) BOOL shouldHideSelectionWhenScrolling;
354 @property (nonatomic, readonly) const WebKit::InteractionInformationAtPosition& positionInformation;
355 @property (nonatomic, readonly) const WebKit::WKAutoCorrectionData& autocorrectionData;
356 @property (nonatomic, readonly) const WebKit::AssistedNodeInformation& assistedNodeInformation;
357 @property (nonatomic, readonly) UIWebFormAccessory *formAccessoryView;
358 @property (nonatomic, readonly) UITextInputAssistantItem *inputAssistantItemForWebView;
359
360 #if ENABLE(DATALIST_ELEMENT)
361 @property (nonatomic, strong) UIView <WKFormControl> *dataListTextSuggestionsInputView;
362 @property (nonatomic, strong) NSArray<UITextSuggestion *> *dataListTextSuggestions;
363 #endif
364
365 - (void)setupInteraction;
366 - (void)cleanupInteraction;
367
368 - (void)scrollViewWillStartPanOrPinchGesture;
369
370 - (BOOL)canBecomeFirstResponderForWebView;
371 - (BOOL)becomeFirstResponderForWebView;
372 - (BOOL)resignFirstResponderForWebView;
373 - (BOOL)canPerformActionForWebView:(SEL)action withSender:(id)sender;
374 - (id)targetForActionForWebView:(SEL)action withSender:(id)sender;
375
376 #define DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW(_action) \
377     - (void)_action ## ForWebView:(id)sender;
378 FOR_EACH_WKCONTENTVIEW_ACTION(DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW)
379 FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION(DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW)
380 #undef DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW
381
382 - (void)setFontForWebView:(UIFont *)fontFamily sender:(id)sender;
383 - (void)setFontSizeForWebView:(CGFloat)fontSize sender:(id)sender;
384 - (void)setTextColorForWebView:(UIColor *)color sender:(id)sender;
385
386 #if ENABLE(TOUCH_EVENTS)
387 - (void)_webTouchEvent:(const WebKit::NativeWebTouchEvent&)touchEvent preventsNativeGestures:(BOOL)preventsDefault;
388 #endif
389 - (void)_commitPotentialTapFailed;
390 - (void)_didNotHandleTapAsClick:(const WebCore::IntPoint&)point;
391 - (void)_didCompleteSyntheticClick;
392 - (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;
393
394 - (BOOL)_mayDisableDoubleTapGesturesDuringSingleTap;
395 - (void)_disableDoubleTapGesturesDuringTapIfNecessary:(uint64_t)requestID;
396 - (void)_startAssistingNode:(const WebKit::AssistedNodeInformation&)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode changingActivityState:(BOOL)changingActivityState userObject:(NSObject <NSSecureCoding> *)userObject;
397 - (void)_stopAssistingNode;
398 - (void)_didReceiveEditorStateUpdateAfterFocus;
399 - (void)_selectionChanged;
400 - (void)_updateChangedSelection;
401 - (BOOL)_interpretKeyEvent:(::WebEvent *)theEvent isCharEvent:(BOOL)isCharEvent;
402 - (void)_positionInformationDidChange:(const WebKit::InteractionInformationAtPosition&)info;
403 - (void)_attemptClickAtLocation:(CGPoint)location;
404 - (void)_willStartScrollingOrZooming;
405 - (void)_didScroll;
406 - (void)_didEndScrollingOrZooming;
407 - (void)_scrollingNodeScrollingWillBegin;
408 - (void)_scrollingNodeScrollingDidEnd;
409 - (void)_showPlaybackTargetPicker:(BOOL)hasVideo fromRect:(const WebCore::IntRect&)elementRect routeSharingPolicy:(WebCore::RouteSharingPolicy)policy routingContextUID:(NSString *)contextUID;
410 - (void)_showRunOpenPanel:(API::OpenPanelParameters*)parameters resultListener:(WebKit::WebOpenPanelResultListenerProxy*)listener;
411 - (void)_showShareSheet:(const WebCore::ShareDataWithParsedURL&)shareData completionHandler:(WTF::CompletionHandler<void(bool)>&&)completionHandler;
412 - (void)accessoryDone;
413 - (void)_didHandleKeyEvent:(::WebEvent *)event eventWasHandled:(BOOL)eventWasHandled;
414 - (Vector<WebKit::OptionItem>&) assistedNodeSelectOptions;
415 - (void)_enableInspectorNodeSearch;
416 - (void)_disableInspectorNodeSearch;
417 - (void)_becomeFirstResponderWithSelectionMovingForward:(BOOL)selectingForward completionHandler:(void (^)(BOOL didBecomeFirstResponder))completionHandler;
418 - (void)_setDoubleTapGesturesEnabled:(BOOL)enabled;
419 #if ENABLE(DATA_DETECTION)
420 - (NSArray *)_dataDetectionResults;
421 #endif
422 - (NSArray<NSValue *> *)_uiTextSelectionRects;
423 - (void)accessibilityRetrieveSpeakSelectionContent;
424 - (void)_accessibilityRetrieveRectsEnclosingSelectionOffset:(NSInteger)offset withGranularity:(UITextGranularity)granularity;
425 - (void)_accessibilityRetrieveRectsAtSelectionOffset:(NSInteger)offset withText:(NSString *)text completionHandler:(void (^)(const Vector<WebCore::SelectionRect>& rects))completionHandler;
426 - (void)_accessibilityRetrieveRectsAtSelectionOffset:(NSInteger)offset withText:(NSString *)text;
427 - (void)_accessibilityStoreSelection;
428 - (void)_accessibilityClearSelection;
429 - (WKFormInputSession *)_formInputSession;
430
431 @property (nonatomic, readonly) WebKit::InteractionInformationAtPosition currentPositionInformation;
432 - (void)doAfterPositionInformationUpdate:(void (^)(WebKit::InteractionInformationAtPosition))action forRequest:(WebKit::InteractionInformationRequest)request;
433 - (BOOL)ensurePositionInformationIsUpToDate:(WebKit::InteractionInformationRequest)request;
434
435 #if ENABLE(DATA_INTERACTION)
436 - (void)_didChangeDragInteractionPolicy;
437 - (void)_didPerformDragOperation:(BOOL)handled;
438 - (void)_didHandleStartDataInteractionRequest:(BOOL)started;
439 - (void)_didHandleAdditionalDragItemsRequest:(BOOL)added;
440 - (void)_startDrag:(RetainPtr<CGImageRef>)image item:(const WebCore::DragItem&)item;
441 - (void)_didConcludeEditDataInteraction:(Optional<WebCore::TextIndicatorData>)data;
442 - (void)_didChangeDataInteractionCaretRect:(CGRect)previousRect currentRect:(CGRect)rect;
443 #endif
444
445 - (void)reloadContextViewForPresentedListViewController;
446
447 #if ENABLE(DATALIST_ELEMENT)
448 - (void)updateTextSuggestionsForInputDelegate;
449 #endif
450
451 @end
452
453 @interface WKContentView (WKTesting)
454
455 - (void)_simulateLongPressActionAtLocation:(CGPoint)location;
456 - (void)_simulateTextEntered:(NSString *)text;
457 - (void)selectFormAccessoryPickerRow:(NSInteger)rowIndex;
458 - (void)setTimePickerValueToHour:(NSInteger)hour minute:(NSInteger)minute;
459 - (NSDictionary *)_contentsOfUserInterfaceItem:(NSString *)userInterfaceItem;
460
461 @property (nonatomic, readonly) NSString *textContentTypeForTesting;
462 @property (nonatomic, readonly) NSString *selectFormPopoverTitle;
463 @property (nonatomic, readonly) NSString *formInputLabel;
464 @property (nonatomic, readonly) WKFormInputControl *formInputControl;
465
466 @end
467
468 #if HAVE(LINK_PREVIEW)
469 @interface WKContentView (WKInteractionPreview) <UIPreviewItemDelegate>
470
471 - (void)_registerPreview;
472 - (void)_unregisterPreview;
473 @end
474 #endif
475
476 @interface WKContentView (WKFileUploadPanel)
477 + (Class)_fileUploadPanelClass;
478 @end
479
480 #endif // PLATFORM(IOS_FAMILY)