2 * Copyright (C) 2015 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
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.
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.
31 #include "PluginComplexTextInputState.h"
32 #include "WKLayoutMode.h"
33 #include "WebPageProxy.h"
34 #include "_WKOverlayScrollbarStyle.h"
35 #include <WebCore/TextIndicatorWindow.h>
37 #include <wtf/RetainPtr.h>
38 #include <wtf/WeakPtr.h>
39 #include <wtf/text/WTFString.h>
41 OBJC_CLASS NSImmediateActionGestureRecognizer;
42 OBJC_CLASS NSTextInputContext;
44 OBJC_CLASS WKBrowsingContextController;
45 OBJC_CLASS WKEditorUndoTargetObjC;
46 OBJC_CLASS WKFullScreenWindowController;
47 OBJC_CLASS WKImmediateActionController;
48 OBJC_CLASS WKViewLayoutStrategy;
50 OBJC_CLASS WKWindowVisibilityObserver;
51 OBJC_CLASS _WKThumbnailView;
53 @protocol WebViewImplDelegate
55 - (NSTextInputContext *)_web_superInputContext;
56 - (void)_web_superQuickLookWithEvent:(NSEvent *)event;
57 - (void)_web_superRemoveTrackingRect:(NSTrackingRectTag)tag;
58 - (void)_web_superSwipeWithEvent:(NSEvent *)event;
59 - (void)_web_superMagnifyWithEvent:(NSEvent *)event;
60 - (void)_web_superSmartMagnifyWithEvent:(NSEvent *)event;
61 - (id)_web_superAccessibilityAttributeValue:(NSString *)attribute;
62 - (void)_web_superDoCommandBySelector:(SEL)selector;
63 - (BOOL)_web_superPerformKeyEquivalent:(NSEvent *)event;
64 - (void)_web_superKeyDown:(NSEvent *)event;
65 - (NSView *)_web_superHitTest:(NSPoint)point;
67 - (id)_web_immediateActionAnimationControllerForHitTestResultInternal:(API::HitTestResult*)hitTestResult withType:(uint32_t)type userData:(API::Object*)userData;
68 - (void)_web_prepareForImmediateActionAnimation;
69 - (void)_web_cancelImmediateActionAnimation;
70 - (void)_web_completeImmediateActionAnimation;
72 - (void)_web_dismissContentRelativeChildWindows;
73 - (void)_web_dismissContentRelativeChildWindowsWithAnimation:(BOOL)animate;
75 - (void)_web_gestureEventWasNotHandledByWebCore:(NSEvent *)event;
77 - (void)_web_didChangeContentSize:(NSSize)newSize;
82 struct KeyPressCommand;
88 class DrawingAreaProxy;
89 class ViewGestureController;
90 class WebEditCommandProxy;
92 struct ColorSpaceData;
94 typedef id <NSValidatedUserInterfaceItem> ValidationItem;
95 typedef Vector<RetainPtr<ValidationItem>> ValidationVector;
96 typedef HashMap<String, ValidationVector> ValidationMap;
98 #if !USE(ASYNC_NSTEXTINPUTCLIENT)
99 struct WKViewInterpretKeyEventsParameters {
100 bool eventInterpretationHadSideEffects;
102 bool executingSavedKeypressCommands;
103 Vector<WebCore::KeypressCommand>* commands;
108 WTF_MAKE_FAST_ALLOCATED;
109 WTF_MAKE_NONCOPYABLE(WebViewImpl);
111 WebViewImpl(NSView <WebViewImplDelegate> *, WKWebView *outerWebView, WebProcessPool&, Ref<API::PageConfiguration>&&);
117 WebPageProxy& page() { return m_page.get(); }
119 void processDidExit();
121 void didRelaunchProcess();
123 void setDrawsBackground(bool);
124 bool drawsBackground() const;
125 bool isOpaque() const;
127 bool acceptsFirstMouse(NSEvent *);
128 bool acceptsFirstResponder();
129 bool becomeFirstResponder();
130 bool resignFirstResponder();
131 bool isFocused() const;
133 void viewWillStartLiveResize();
134 void viewDidEndLiveResize();
137 void setFrameSize(CGSize);
138 void disableFrameSizeUpdates();
139 void enableFrameSizeUpdates();
140 bool frameSizeUpdatesDisabled() const;
141 void setFrameAndScrollBy(CGRect, CGSize);
142 void updateWindowAndViewFrames();
144 void setFixedLayoutSize(CGSize);
145 CGSize fixedLayoutSize() const;
147 std::unique_ptr<DrawingAreaProxy> createDrawingAreaProxy();
148 bool isUsingUISideCompositing() const;
149 void setDrawingAreaSize(CGSize);
150 void forceAsyncDrawingAreaSizeUpdate(CGSize);
151 void waitForAsyncDrawingAreaSizeUpdate();
153 static bool wantsUpdateLayer() { return true; }
155 void drawRect(CGRect);
156 bool canChangeFrameLayout(WebFrameProxy&);
157 NSPrintOperation *printOperationWithPrintInfo(NSPrintInfo *, WebFrameProxy&);
159 void setAutomaticallyAdjustsContentInsets(bool);
160 bool automaticallyAdjustsContentInsets() const { return m_automaticallyAdjustsContentInsets; }
161 void updateContentInsetsIfAutomatic();
162 void setTopContentInset(CGFloat);
163 CGFloat topContentInset() const { return m_topContentInset; }
165 void prepareContentInRect(CGRect);
166 void updateViewExposedRect();
167 void setClipsToVisibleRect(bool);
168 bool clipsToVisibleRect() const { return m_clipsToVisibleRect; }
170 void setMinimumSizeForAutoLayout(CGSize);
171 CGSize minimumSizeForAutoLayout() const;
172 void setShouldExpandToViewHeightForAutoLayout(bool);
173 bool shouldExpandToViewHeightForAutoLayout() const;
174 void setIntrinsicContentSize(CGSize);
175 CGSize intrinsicContentSize() const;
177 void setViewScale(CGFloat);
178 CGFloat viewScale() const;
180 WKLayoutMode layoutMode() const;
181 void setLayoutMode(WKLayoutMode);
182 void updateSupportsArbitraryLayoutModes();
184 void setOverrideDeviceScaleFactor(CGFloat);
185 CGFloat overrideDeviceScaleFactor() const { return m_overrideDeviceScaleFactor; }
187 void windowDidOrderOffScreen();
188 void windowDidOrderOnScreen();
189 void windowDidBecomeKey(NSWindow *);
190 void windowDidResignKey(NSWindow *);
191 void windowDidMiniaturize();
192 void windowDidDeminiaturize();
193 void windowDidMove();
194 void windowDidResize();
195 void windowDidChangeBackingProperties(CGFloat oldBackingScaleFactor);
196 void windowDidChangeScreen();
197 void windowDidChangeLayerHosting();
198 void windowDidChangeOcclusionState();
199 bool shouldDelayWindowOrderingForEvent(NSEvent *);
200 bool windowResizeMouseLocationIsInVisibleScrollerThumb(CGPoint);
202 // -[NSView mouseDownCanMoveWindow] returns YES when the NSView is transparent,
203 // but we don't want a drag in the NSView to move the window, even if it's transparent.
204 static bool mouseDownCanMoveWindow() { return false; }
206 void viewWillMoveToWindow(NSWindow *);
207 void viewDidMoveToWindow();
208 void viewDidChangeBackingProperties();
210 void viewDidUnhide();
211 void activeSpaceDidChange();
213 NSView *hitTest(CGPoint);
215 ColorSpaceData colorSpace();
217 void setUnderlayColor(NSColor *);
218 NSColor *underlayColor() const;
219 NSColor *pageExtendedBackgroundColor() const;
221 void setOverlayScrollbarStyle(WTF::Optional<WebCore::ScrollbarOverlayStyle> scrollbarStyle);
222 WTF::Optional<WebCore::ScrollbarOverlayStyle> overlayScrollbarStyle() const;
224 void beginDeferringViewInWindowChanges();
225 // FIXME: Merge these two?
226 void endDeferringViewInWindowChanges();
227 void endDeferringViewInWindowChangesSync();
228 bool isDeferringViewInWindowChanges() const { return m_shouldDeferViewInWindowChanges; }
230 void setWindowOcclusionDetectionEnabled(bool enabled) { m_windowOcclusionDetectionEnabled = enabled; }
231 bool windowOcclusionDetectionEnabled() const { return m_windowOcclusionDetectionEnabled; }
233 void prepareForMoveToWindow(NSWindow *targetWindow, std::function<void()> completionHandler);
234 NSWindow *targetWindowForMovePreparation() const { return m_targetWindowForMovePreparation; }
236 void updateSecureInputState();
237 void resetSecureInputState();
238 bool inSecureInputState() const { return m_inSecureInputState; }
239 void notifyInputContextAboutDiscardedComposition();
240 void setPluginComplexTextInputStateAndIdentifier(PluginComplexTextInputState, uint64_t identifier);
241 void disableComplexTextInputIfNecessary();
242 bool handlePluginComplexTextInputKeyDown(NSEvent *);
243 bool tryHandlePluginComplexTextInputKeyDown(NSEvent *);
244 void pluginFocusOrWindowFocusChanged(bool pluginHasFocusAndWindowHasFocus, uint64_t pluginComplexTextInputIdentifier);
245 bool tryPostProcessPluginComplexTextInputKeyDown(NSEvent *);
246 PluginComplexTextInputState pluginComplexTextInputState() const { return m_pluginComplexTextInputState; }
247 uint64_t pluginComplexTextInputIdentifier() const { return m_pluginComplexTextInputIdentifier; }
249 void handleAcceptedAlternativeText(const String&);
250 NSInteger spellCheckerDocumentTag();
252 void pressureChangeWithEvent(NSEvent *);
253 NSEvent *lastPressureEvent() { return m_lastPressureEvent.get(); }
255 #if ENABLE(FULLSCREEN_API)
256 bool hasFullScreenWindowController() const;
257 WKFullScreenWindowController *fullScreenWindowController();
258 void closeFullScreenWindowController();
260 NSView *fullScreenPlaceholderView();
261 NSWindow *createFullScreenWindow();
263 bool isEditable() const;
264 bool executeSavedCommandBySelector(SEL);
265 void executeEditCommandForSelector(SEL, const String& argument = String());
266 void registerEditCommand(RefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo);
267 void clearAllEditCommands();
268 bool writeSelectionToPasteboard(NSPasteboard *, NSArray *types);
269 bool readSelectionFromPasteboard(NSPasteboard *);
270 id validRequestorForSendAndReturnTypes(NSString *sendType, NSString *returnType);
271 void centerSelectionInVisibleArea();
272 void selectionDidChange();
273 void startObservingFontPanel();
274 void updateFontPanelIfNeeded();
275 void changeFontFromFontPanel();
276 bool validateUserInterfaceItem(id <NSValidatedUserInterfaceItem>);
278 void startSpeaking();
279 void stopSpeaking(id);
281 void showGuessPanel(id);
282 void checkSpelling();
283 void changeSpelling(id);
284 void toggleContinuousSpellChecking();
286 bool isGrammarCheckingEnabled();
287 void setGrammarCheckingEnabled(bool);
288 void toggleGrammarChecking();
289 void toggleAutomaticSpellingCorrection();
290 void orderFrontSubstitutionsPanel(id);
291 void toggleSmartInsertDelete();
292 bool isAutomaticQuoteSubstitutionEnabled();
293 void setAutomaticQuoteSubstitutionEnabled(bool);
294 void toggleAutomaticQuoteSubstitution();
295 bool isAutomaticDashSubstitutionEnabled();
296 void setAutomaticDashSubstitutionEnabled(bool);
297 void toggleAutomaticDashSubstitution();
298 bool isAutomaticLinkDetectionEnabled();
299 void setAutomaticLinkDetectionEnabled(bool);
300 void toggleAutomaticLinkDetection();
301 bool isAutomaticTextReplacementEnabled();
302 void setAutomaticTextReplacementEnabled(bool);
303 void toggleAutomaticTextReplacement();
304 void uppercaseWord();
305 void lowercaseWord();
306 void capitalizeWord();
308 void preferencesDidChange();
310 void setTextIndicator(WebCore::TextIndicator&, WebCore::TextIndicatorWindowLifetime = WebCore::TextIndicatorWindowLifetime::Permanent);
311 void clearTextIndicatorWithAnimation(WebCore::TextIndicatorWindowDismissalAnimation);
312 void setTextIndicatorAnimationProgress(float);
313 void dismissContentRelativeChildWindows();
314 void dismissContentRelativeChildWindowsFromViewOnly();
315 void dismissContentRelativeChildWindowsWithAnimation(bool);
316 void dismissContentRelativeChildWindowsWithAnimationFromViewOnly(bool);
317 static void hideWordDefinitionWindow();
319 void quickLookWithEvent(NSEvent *);
320 void prepareForDictionaryLookup();
321 void setAllowsLinkPreview(bool);
322 bool allowsLinkPreview() const { return m_allowsLinkPreview; }
323 void* immediateActionAnimationControllerForHitTestResult(API::HitTestResult*, uint32_t type, API::Object* userData);
324 void didPerformImmediateActionHitTest(const WebHitTestResultData&, bool contentPreventsDefault, API::Object* userData);
325 void prepareForImmediateActionAnimation();
326 void cancelImmediateActionAnimation();
327 void completeImmediateActionAnimation();
328 void didChangeContentSize(CGSize);
330 void setIgnoresNonWheelEvents(bool);
331 bool ignoresNonWheelEvents() const { return m_ignoresNonWheelEvents; }
332 void setIgnoresAllEvents(bool);
333 bool ignoresAllEvents() const { return m_ignoresAllEvents; }
334 void setIgnoresMouseDraggedEvents(bool);
335 bool ignoresMouseDraggedEvents() const { return m_ignoresMouseDraggedEvents; }
337 void setAccessibilityWebProcessToken(NSData *);
338 void accessibilityRegisterUIProcessTokens();
339 void updateRemoteAccessibilityRegistration(bool registerProcess);
340 id accessibilityFocusedUIElement();
341 bool accessibilityIsIgnored() const { return false; }
342 id accessibilityHitTest(CGPoint);
343 void enableAccessibilityIfNecessary();
344 id accessibilityAttributeValue(NSString *);
346 NSTrackingArea *primaryTrackingArea() const { return m_primaryTrackingArea.get(); }
347 void setPrimaryTrackingArea(NSTrackingArea *);
349 NSTrackingRectTag addTrackingRect(CGRect, id owner, void* userData, bool assumeInside);
350 NSTrackingRectTag addTrackingRectWithTrackingNum(CGRect, id owner, void* userData, bool assumeInside, int tag);
351 void addTrackingRectsWithTrackingNums(CGRect*, id owner, void** userDataList, bool assumeInside, NSTrackingRectTag *trackingNums, int count);
352 void removeTrackingRect(NSTrackingRectTag);
353 void removeTrackingRects(NSTrackingRectTag *, int count);
354 NSString *stringForToolTip(NSToolTipTag tag);
355 void toolTipChanged(const String& oldToolTip, const String& newToolTip);
357 void setAcceleratedCompositingRootLayer(CALayer *);
358 CALayer *acceleratedCompositingRootLayer() const { return m_rootLayer.get(); }
361 void setThumbnailView(_WKThumbnailView *);
362 _WKThumbnailView *thumbnailView() const { return m_thumbnailView; }
364 void setInspectorAttachmentView(NSView *);
365 NSView *inspectorAttachmentView();
367 _WKRemoteObjectRegistry *remoteObjectRegistry();
369 WKBrowsingContextController *browsingContextController();
370 #endif // WK_API_ENABLED
372 #if ENABLE(DRAG_SUPPORT)
373 void draggedImage(NSImage *, CGPoint endPoint, NSDragOperation);
374 NSDragOperation draggingEntered(id <NSDraggingInfo>);
375 NSDragOperation draggingUpdated(id <NSDraggingInfo>);
376 void draggingExited(id <NSDraggingInfo>);
377 bool prepareForDragOperation(id <NSDraggingInfo>);
378 bool performDragOperation(id <NSDraggingInfo>);
379 NSView *hitTestForDragTypes(CGPoint, NSSet *types);
380 void registerDraggedTypes();
383 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
384 void startWindowDrag();
387 void dragImageForView(NSView *, NSImage *, CGPoint clientPoint, bool linkDrag);
388 void setFileAndURLTypes(NSString *filename, NSString *extension, NSString *title, NSString *url, NSString *visibleURL, NSPasteboard *);
389 void setPromisedDataForImage(WebCore::Image*, NSString *filename, NSString *extension, NSString *title, NSString *url, NSString *visibleURL, WebCore::SharedBuffer* archiveBuffer, NSString *pasteboardName);
390 #if ENABLE(ATTACHMENT_ELEMENT)
391 void setPromisedDataForAttachment(NSString *filename, NSString *extension, NSString *title, NSString *url, NSString *visibleURL, NSString *pasteboardName);
393 void pasteboardChangedOwner(NSPasteboard *);
394 void provideDataForPasteboard(NSPasteboard *, NSString *type);
395 NSArray *namesOfPromisedFilesDroppedAtDestination(NSURL *dropDestination);
397 RefPtr<ViewSnapshot> takeViewSnapshot();
398 void saveBackForwardSnapshotForCurrentItem();
399 void saveBackForwardSnapshotForItem(WebBackForwardListItem&);
401 ViewGestureController* gestureController() { return m_gestureController.get(); }
402 ViewGestureController& ensureGestureController();
403 void setAllowsBackForwardNavigationGestures(bool);
404 bool allowsBackForwardNavigationGestures() const { return m_allowsBackForwardNavigationGestures; }
405 void setAllowsMagnification(bool);
406 bool allowsMagnification() const { return m_allowsMagnification; }
408 void setMagnification(double, CGPoint centerPoint);
409 void setMagnification(double);
410 double magnification() const;
411 void setCustomSwipeViews(NSArray *);
412 void setCustomSwipeViewsTopContentInset(float);
413 bool tryToSwipeWithEvent(NSEvent *, bool ignoringPinnedState);
414 void setDidMoveSwipeSnapshotCallback(void(^)(CGRect));
416 void scrollWheel(NSEvent *);
417 void swipeWithEvent(NSEvent *);
418 void magnifyWithEvent(NSEvent *);
419 void rotateWithEvent(NSEvent *);
420 void smartMagnifyWithEvent(NSEvent *);
422 void setLastMouseDownEvent(NSEvent *);
424 void gestureEventWasNotHandledByWebCore(NSEvent *);
425 void gestureEventWasNotHandledByWebCoreFromViewOnly(NSEvent *);
427 void setTotalHeightOfBanners(CGFloat totalHeightOfBanners) { m_totalHeightOfBanners = totalHeightOfBanners; }
428 CGFloat totalHeightOfBanners() const { return m_totalHeightOfBanners; }
430 void doneWithKeyEvent(NSEvent *, bool eventWasHandled);
431 NSArray *validAttributesForMarkedText();
432 void doCommandBySelector(SEL);
433 void insertText(id string);
434 void insertText(id string, NSRange replacementRange);
435 NSTextInputContext *inputContext();
437 void setMarkedText(id string, NSRange selectedRange, NSRange replacementRange);
438 NSRange selectedRange();
439 bool hasMarkedText();
440 NSRange markedRange();
441 NSAttributedString *attributedSubstringForProposedRange(NSRange, NSRangePointer actualRange);
442 NSUInteger characterIndexForPoint(NSPoint);
443 NSRect firstRectForCharacterRange(NSRange, NSRangePointer actualRange);
444 bool performKeyEquivalent(NSEvent *);
445 void keyUp(NSEvent *);
446 void keyDown(NSEvent *);
447 void flagsChanged(NSEvent *);
449 // Override this so that AppKit will send us arrow keys as key down events so we can
450 // support them via the key bindings mechanism.
451 static bool wantsKeyDownForEvent(NSEvent *) { return true; }
453 #if USE(ASYNC_NSTEXTINPUTCLIENT)
454 void selectedRangeWithCompletionHandler(void(^)(NSRange));
455 void hasMarkedTextWithCompletionHandler(void(^)(BOOL hasMarkedText));
456 void markedRangeWithCompletionHandler(void(^)(NSRange));
457 void attributedSubstringForProposedRange(NSRange, void(^)(NSAttributedString *attrString, NSRange actualRange));
458 void firstRectForCharacterRange(NSRange, void(^)(NSRect firstRect, NSRange actualRange));
459 void characterIndexForPoint(NSPoint, void(^)(NSUInteger));
460 #endif // USE(ASYNC_NSTEXTINPUTCLIENT)
462 void mouseMoved(NSEvent *);
463 void mouseDown(NSEvent *);
464 void mouseUp(NSEvent *);
465 void mouseDragged(NSEvent *);
466 void mouseEntered(NSEvent *);
467 void mouseExited(NSEvent *);
468 void otherMouseDown(NSEvent *);
469 void otherMouseDragged(NSEvent *);
470 void otherMouseUp(NSEvent *);
471 void rightMouseDown(NSEvent *);
472 void rightMouseDragged(NSEvent *);
473 void rightMouseUp(NSEvent *);
476 WeakPtr<WebViewImpl> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
478 bool supportsArbitraryLayoutModes() const;
479 float intrinsicDeviceScaleFactor() const;
480 void dispatchSetTopContentInset();
482 void postFakeMouseMovedEventForFlagsChangedEvent(NSEvent *);
484 void setPluginComplexTextInputState(PluginComplexTextInputState);
486 void sendToolTipMouseExited();
487 void sendToolTipMouseEntered();
489 void reparentLayerTreeInThumbnailView();
490 void updateThumbnailViewLayer();
492 void setUserInterfaceItemState(NSString *commandName, bool enabled, int state);
494 #if USE(ASYNC_NSTEXTINPUTCLIENT)
495 Vector<WebCore::KeypressCommand> collectKeyboardLayoutCommandsForEvent(NSEvent *);
496 void interpretKeyEvent(NSEvent *, void(^completionHandler)(BOOL handled, const Vector<WebCore::KeypressCommand>&));
498 void executeSavedKeypressCommands();
499 bool interpretKeyEvent(NSEvent *, Vector<WebCore::KeypressCommand>&);
502 void mouseMovedInternal(NSEvent *);
503 void mouseDownInternal(NSEvent *);
504 void mouseUpInternal(NSEvent *);
505 void mouseDraggedInternal(NSEvent *);
507 bool mightBeginDragWhileInactive();
508 bool mightBeginScrollWhileInactive();
510 NSView <WebViewImplDelegate> *m_view;
511 std::unique_ptr<PageClient> m_pageClient;
512 Ref<WebPageProxy> m_page;
514 WeakPtrFactory<WebViewImpl> m_weakPtrFactory;
516 bool m_willBecomeFirstResponderAgain { false };
517 bool m_inBecomeFirstResponder { false };
518 bool m_inResignFirstResponder { false };
520 CGRect m_contentPreparationRect { { 0, 0 }, { 0, 0 } };
521 bool m_useContentPreparationRectForVisibleRect { false };
522 bool m_clipsToVisibleRect { false };
523 bool m_needsViewFrameInWindowCoordinates;
524 bool m_didScheduleWindowAndViewFrameUpdate { false };
525 bool m_isDeferringViewInWindowChanges { false };
526 bool m_windowOcclusionDetectionEnabled { true };
528 bool m_automaticallyAdjustsContentInsets { false };
529 CGFloat m_topContentInset { 0 };
530 bool m_didScheduleSetTopContentInset { false };
532 CGSize m_resizeScrollOffset { 0, 0 };
534 CGSize m_intrinsicContentSize { 0, 0 };
535 CGFloat m_overrideDeviceScaleFactor { 0 };
537 RetainPtr<WKViewLayoutStrategy> m_layoutStrategy;
538 WKLayoutMode m_lastRequestedLayoutMode { kWKLayoutModeViewSize };
539 CGFloat m_lastRequestedViewScale { 1 };
541 bool m_inSecureInputState { false };
542 RetainPtr<WKEditorUndoTargetObjC> m_undoTarget;
544 ValidationMap m_validationMap;
546 // The identifier of the plug-in we want to send complex text input to, or 0 if there is none.
547 uint64_t m_pluginComplexTextInputIdentifier { 0 };
549 // The state of complex text input for the plug-in.
550 PluginComplexTextInputState m_pluginComplexTextInputState { PluginComplexTextInputDisabled };
552 #if ENABLE(FULLSCREEN_API)
553 RetainPtr<WKFullScreenWindowController> m_fullScreenWindowController;
556 RetainPtr<WKWindowVisibilityObserver> m_windowVisibilityObserver;
558 bool m_shouldDeferViewInWindowChanges { false };
559 bool m_viewInWindowChangeWasDeferred { false };
560 NSWindow *m_targetWindowForMovePreparation { nullptr };
562 id m_flagsChangedEventMonitor { nullptr };
564 std::unique_ptr<WebCore::TextIndicatorWindow> m_textIndicatorWindow;
566 RetainPtr<NSColorSpace> m_colorSpace;
568 RetainPtr<NSEvent> m_lastMouseDownEvent;
569 RetainPtr<NSEvent> m_lastPressureEvent;
571 bool m_ignoresNonWheelEvents { false };
572 bool m_ignoresAllEvents { false };
573 bool m_ignoresMouseDraggedEvents { false };
575 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
576 RetainPtr<WKImmediateActionController> m_immediateActionController;
577 RetainPtr<NSImmediateActionGestureRecognizer> m_immediateActionGestureRecognizer;
580 bool m_allowsLinkPreview { true };
581 bool m_didRegisterForLookupPopoverCloseNotifications { false };
583 RetainPtr<NSTrackingArea> m_primaryTrackingArea;
585 NSToolTipTag m_lastToolTipTag { 0 };
586 id m_trackingRectOwner { nil };
587 void* m_trackingRectUserData { nullptr };
589 RetainPtr<CALayer> m_rootLayer;
590 RetainPtr<NSView> m_layerHostingView;
593 _WKThumbnailView *m_thumbnailView { nullptr };
595 RetainPtr<_WKRemoteObjectRegistry> m_remoteObjectRegistry;
597 RetainPtr<WKBrowsingContextController> m_browsingContextController;
600 std::unique_ptr<ViewGestureController> m_gestureController;
601 bool m_allowsBackForwardNavigationGestures { false };
602 bool m_allowsMagnification { false };
604 RetainPtr<id> m_remoteAccessibilityChild;
606 RefPtr<WebCore::Image> m_promisedImage;
607 String m_promisedFilename;
608 String m_promisedURL;
610 WTF::Optional<NSInteger> m_spellCheckerDocumentTag;
612 CGFloat m_totalHeightOfBanners { 0 };
614 RetainPtr<NSView> m_inspectorAttachmentView;
616 // We keep here the event when resending it to
617 // the application to distinguish the case of a new event from one
618 // that has been already sent to WebCore.
619 RetainPtr<NSEvent> m_keyDownEventBeingResent;
620 #if USE(ASYNC_NSTEXTINPUTCLIENT)
621 Vector<WebCore::KeypressCommand>* m_collectedKeypressCommands { nullptr };
623 WKViewInterpretKeyEventsParameters* m_interpretKeyEventsParameters { nullptr };
627 } // namespace WebKit
629 #endif // PLATFORM(MAC)
631 #endif // WebViewImpl_h