[iOS] REGRESSION (r238635): Text area fails to re-focus after dismissal of keyboard...
[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 #if !USE(UIKIT_KEYBOARD_ADDITIONS)
264     RetainPtr<UIEvent> _uiEventBeingResent;
265 #endif
266     BlockPtr<void(::WebEvent *, BOOL)> _keyWebEventHandler;
267
268     CGPoint _lastInteractionLocation;
269     uint64_t _layerTreeTransactionIdAtLastTouchStart;
270
271     WebKit::WKSelectionDrawingInfo _lastSelectionDrawingInfo;
272
273     Optional<WebKit::InteractionInformationRequest> _outstandingPositionInformationRequest;
274
275     uint64_t _positionInformationCallbackDepth;
276     Vector<Optional<InteractionInformationRequestAndCallback>> _pendingPositionInformationHandlers;
277     
278     std::unique_ptr<WebKit::InputViewUpdateDeferrer> _inputViewUpdateDeferrer;
279
280     RetainPtr<WKKeyboardScrollViewAnimator> _keyboardScrollingAnimator;
281
282 #if ENABLE(DATALIST_ELEMENT)
283     RetainPtr<UIView <WKFormControl>> _dataListTextSuggestionsInputView;
284     RetainPtr<NSArray<UITextSuggestion *>> _dataListTextSuggestions;
285 #endif
286
287 #if HAVE(PENCILKIT)
288     RetainPtr<WKDrawingCoordinator> _drawingCoordinator;
289 #endif
290
291     BOOL _isEditable;
292     BOOL _showingTextStyleOptions;
293     BOOL _hasValidPositionInformation;
294     BOOL _isTapHighlightIDValid;
295     BOOL _potentialTapInProgress;
296     BOOL _isDoubleTapPending;
297     BOOL _highlightLongPressCanClick;
298     BOOL _hasTapHighlightForPotentialTap;
299     BOOL _selectionNeedsUpdate;
300     BOOL _shouldRestoreSelection;
301     BOOL _usingGestureForSelection;
302     BOOL _inspectorNodeSearchEnabled;
303     BOOL _isChangingFocusUsingAccessoryTab;
304     BOOL _didAccessoryTabInitiateFocus;
305     BOOL _isExpectingFastSingleTapCommit;
306     BOOL _showDebugTapHighlightsForFastClicking;
307     BOOL _isZoomingToRevealFocusedElement;
308
309     BOOL _keyboardDidRequestDismissal;
310
311     BOOL _becomingFirstResponder;
312     BOOL _resigningFirstResponder;
313     BOOL _needsDeferredEndScrollingSelectionUpdate;
314     BOOL _isChangingFocus;
315     BOOL _isBlurringFocusedNode;
316
317     BOOL _focusRequiresStrongPasswordAssistance;
318
319     BOOL _hasSetUpInteractions;
320
321 #if ENABLE(DATA_INTERACTION)
322     WebKit::DragDropInteractionState _dragDropInteractionState;
323     RetainPtr<UIDragInteraction> _dragInteraction;
324     RetainPtr<UIDropInteraction> _dropInteraction;
325     BOOL _shouldRestoreCalloutBarAfterDrop;
326     BOOL _isAnimatingConcludeEditDrag;
327     RetainPtr<UIView> _visibleContentViewSnapshot;
328     RetainPtr<_UITextDragCaretView> _editDropCaretView;
329 #endif
330
331 #if PLATFORM(WATCHOS)
332     RetainPtr<WKFocusedFormControlView> _focusedFormControlView;
333     RetainPtr<UIViewController> _presentedFullScreenInputViewController;
334     RetainPtr<UINavigationController> _inputNavigationViewControllerForFullScreenInputs;
335
336     BOOL _shouldRestoreFirstResponderStatusAfterLosingFocus;
337     BlockPtr<void()> _activeFocusedStateRetainBlock;
338 #endif
339 }
340
341 @end
342
343 @interface WKContentView (WKInteraction) <UIGestureRecognizerDelegate, UITextAutoscrolling, UITextInputMultiDocument, UITextInputPrivate, UIWebFormAccessoryDelegate, UIWebTouchEventsGestureRecognizerDelegate, UIWKInteractionViewProtocol, WKActionSheetAssistantDelegate, WKFileUploadPanelDelegate, WKKeyboardScrollViewAnimatorDelegate
344 #if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
345     , WKShareSheetDelegate
346 #endif
347 #if ENABLE(DATA_INTERACTION)
348     , UIDragInteractionDelegate, UIDropInteractionDelegate
349 #endif
350 >
351
352 @property (nonatomic, readonly) CGPoint lastInteractionLocation;
353 @property (nonatomic, readonly) BOOL isEditable;
354 @property (nonatomic, readonly) BOOL shouldHideSelectionWhenScrolling;
355 @property (nonatomic, readonly) const WebKit::InteractionInformationAtPosition& positionInformation;
356 @property (nonatomic, readonly) const WebKit::WKAutoCorrectionData& autocorrectionData;
357 @property (nonatomic, readonly) const WebKit::FocusedElementInformation& focusedElementInformation;
358 @property (nonatomic, readonly) UIWebFormAccessory *formAccessoryView;
359 @property (nonatomic, readonly) UITextInputAssistantItem *inputAssistantItemForWebView;
360 #if ENABLE(POINTER_EVENTS)
361 @property (nonatomic, readonly) BOOL preventsPanningInXAxis;
362 @property (nonatomic, readonly) BOOL preventsPanningInYAxis;
363 #endif
364
365 #if ENABLE(DATALIST_ELEMENT)
366 @property (nonatomic, strong) UIView <WKFormControl> *dataListTextSuggestionsInputView;
367 @property (nonatomic, strong) NSArray<UITextSuggestion *> *dataListTextSuggestions;
368 #endif
369
370 - (void)setupInteraction;
371 - (void)cleanupInteraction;
372
373 - (void)scrollViewWillStartPanOrPinchGesture;
374
375 - (BOOL)canBecomeFirstResponderForWebView;
376 - (BOOL)becomeFirstResponderForWebView;
377 - (BOOL)resignFirstResponderForWebView;
378 - (BOOL)canPerformActionForWebView:(SEL)action withSender:(id)sender;
379 - (id)targetForActionForWebView:(SEL)action withSender:(id)sender;
380
381 #define DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW(_action) \
382     - (void)_action ## ForWebView:(id)sender;
383 FOR_EACH_WKCONTENTVIEW_ACTION(DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW)
384 FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION(DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW)
385 #undef DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW
386
387 - (void)_setFontForWebView:(UIFont *)fontFamily sender:(id)sender;
388 - (void)_setFontSizeForWebView:(CGFloat)fontSize sender:(id)sender;
389 - (void)_setTextColorForWebView:(UIColor *)color sender:(id)sender;
390
391 #if ENABLE(TOUCH_EVENTS)
392 - (void)_webTouchEvent:(const WebKit::NativeWebTouchEvent&)touchEvent preventsNativeGestures:(BOOL)preventsDefault;
393 #endif
394 - (void)_commitPotentialTapFailed;
395 - (void)_didNotHandleTapAsClick:(const WebCore::IntPoint&)point;
396 - (void)_didCompleteSyntheticClick;
397 - (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;
398
399 - (BOOL)_mayDisableDoubleTapGesturesDuringSingleTap;
400 - (void)_disableDoubleTapGesturesDuringTapIfNecessary:(uint64_t)requestID;
401 - (void)_elementDidFocus:(const WebKit::FocusedElementInformation&)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode changingActivityState:(BOOL)changingActivityState userObject:(NSObject <NSSecureCoding> *)userObject;
402 - (void)_elementDidBlur;
403 - (void)_didUpdateInputMode:(WebCore::InputMode)mode;
404 - (void)_didReceiveEditorStateUpdateAfterFocus;
405 - (void)_selectionChanged;
406 - (void)_updateChangedSelection;
407 - (BOOL)_interpretKeyEvent:(::WebEvent *)theEvent isCharEvent:(BOOL)isCharEvent;
408 - (void)_positionInformationDidChange:(const WebKit::InteractionInformationAtPosition&)info;
409 - (void)_attemptClickAtLocation:(CGPoint)location;
410 - (void)_willStartScrollingOrZooming;
411 - (void)_didScroll;
412 - (void)_didEndScrollingOrZooming;
413 - (void)_scrollingNodeScrollingWillBegin;
414 - (void)_scrollingNodeScrollingDidEnd;
415 - (void)_showPlaybackTargetPicker:(BOOL)hasVideo fromRect:(const WebCore::IntRect&)elementRect routeSharingPolicy:(WebCore::RouteSharingPolicy)policy routingContextUID:(NSString *)contextUID;
416 - (void)_showRunOpenPanel:(API::OpenPanelParameters*)parameters resultListener:(WebKit::WebOpenPanelResultListenerProxy*)listener;
417 - (void)_showShareSheet:(const WebCore::ShareDataWithParsedURL&)shareData completionHandler:(WTF::CompletionHandler<void(bool)>&&)completionHandler;
418 - (void)accessoryDone;
419 - (void)_didHandleKeyEvent:(::WebEvent *)event eventWasHandled:(BOOL)eventWasHandled;
420 - (Vector<WebKit::OptionItem>&) focusedSelectElementOptions;
421 - (void)_enableInspectorNodeSearch;
422 - (void)_disableInspectorNodeSearch;
423 - (void)_becomeFirstResponderWithSelectionMovingForward:(BOOL)selectingForward completionHandler:(void (^)(BOOL didBecomeFirstResponder))completionHandler;
424 - (void)_setDoubleTapGesturesEnabled:(BOOL)enabled;
425 #if ENABLE(DATA_DETECTION)
426 - (NSArray *)_dataDetectionResults;
427 #endif
428 - (NSArray<NSValue *> *)_uiTextSelectionRects;
429 - (void)accessibilityRetrieveSpeakSelectionContent;
430 - (void)_accessibilityRetrieveRectsEnclosingSelectionOffset:(NSInteger)offset withGranularity:(UITextGranularity)granularity;
431 - (void)_accessibilityRetrieveRectsAtSelectionOffset:(NSInteger)offset withText:(NSString *)text completionHandler:(void (^)(const Vector<WebCore::SelectionRect>& rects))completionHandler;
432 - (void)_accessibilityRetrieveRectsAtSelectionOffset:(NSInteger)offset withText:(NSString *)text;
433 - (void)_accessibilityStoreSelection;
434 - (void)_accessibilityClearSelection;
435 - (WKFormInputSession *)_formInputSession;
436
437 @property (nonatomic, readonly) WebKit::InteractionInformationAtPosition currentPositionInformation;
438 - (void)doAfterPositionInformationUpdate:(void (^)(WebKit::InteractionInformationAtPosition))action forRequest:(WebKit::InteractionInformationRequest)request;
439 - (BOOL)ensurePositionInformationIsUpToDate:(WebKit::InteractionInformationRequest)request;
440
441 #if ENABLE(DATA_INTERACTION)
442 - (void)_didChangeDragInteractionPolicy;
443 - (void)_didPerformDragOperation:(BOOL)handled;
444 - (void)_didHandleDragStartRequest:(BOOL)started;
445 - (void)_didHandleAdditionalDragItemsRequest:(BOOL)added;
446 - (void)_startDrag:(RetainPtr<CGImageRef>)image item:(const WebCore::DragItem&)item;
447 - (void)_didConcludeEditDrag:(Optional<WebCore::TextIndicatorData>)data;
448 - (void)_didChangeDragCaretRect:(CGRect)previousRect currentRect:(CGRect)rect;
449 #endif
450
451 - (void)reloadContextViewForPresentedListViewController;
452
453 #if ENABLE(DATALIST_ELEMENT)
454 - (void)updateTextSuggestionsForInputDelegate;
455 #endif
456
457 #if HAVE(PENCILKIT)
458 - (WKDrawingCoordinator *)_drawingCoordinator;
459 #endif
460
461 @end
462
463 @interface WKContentView (WKTesting)
464
465 - (void)_simulateLongPressActionAtLocation:(CGPoint)location;
466 - (void)_simulateTextEntered:(NSString *)text;
467 - (void)selectFormAccessoryPickerRow:(NSInteger)rowIndex;
468 - (void)setTimePickerValueToHour:(NSInteger)hour minute:(NSInteger)minute;
469 - (NSDictionary *)_contentsOfUserInterfaceItem:(NSString *)userInterfaceItem;
470
471 @property (nonatomic, readonly) NSString *textContentTypeForTesting;
472 @property (nonatomic, readonly) NSString *selectFormPopoverTitle;
473 @property (nonatomic, readonly) NSString *formInputLabel;
474 @property (nonatomic, readonly) WKFormInputControl *formInputControl;
475
476 @end
477
478 #if HAVE(LINK_PREVIEW)
479 @interface WKContentView (WKInteractionPreview) <UIPreviewItemDelegate>
480
481 - (void)_registerPreview;
482 - (void)_unregisterPreview;
483 @end
484 #endif
485
486 @interface WKContentView (WKFileUploadPanel)
487 + (Class)_fileUploadPanelClass;
488 @end
489
490 #endif // PLATFORM(IOS_FAMILY)