8e775cdb17163b6d627c5b8a9a21ff5e0faf1723
[WebKit-https.git] / Source / WebKit / WebProcess / WebPage / WebPage.h
1 /*
2  * Copyright (C) 2010-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 #pragma once
27
28 #include "APIInjectedBundleEditorClient.h"
29 #include "APIInjectedBundleFormClient.h"
30 #include "APIInjectedBundlePageContextMenuClient.h"
31 #include "APIInjectedBundlePageLoaderClient.h"
32 #include "APIInjectedBundlePageResourceLoadClient.h"
33 #include "APIInjectedBundlePageUIClient.h"
34 #include "APIObject.h"
35 #include "CallbackID.h"
36 #include "EditingRange.h"
37 #include "InjectedBundlePageContextMenuClient.h"
38 #include "InjectedBundlePageFullScreenClient.h"
39 #include "InjectedBundlePagePolicyClient.h"
40 #include "LayerTreeContext.h"
41 #include "MessageReceiver.h"
42 #include "MessageSender.h"
43 #include "OptionalCallbackID.h"
44 #include "Plugin.h"
45 #include "SandboxExtension.h"
46 #include "SharedMemory.h"
47 #include "UserData.h"
48 #include "WebURLSchemeHandler.h"
49 #include "WebUserContentController.h"
50 #include <WebCore/ActivityState.h>
51 #include <WebCore/DictionaryPopupInfo.h>
52 #include <WebCore/FrameLoaderTypes.h>
53 #include <WebCore/HTMLMenuElement.h>
54 #include <WebCore/HTMLMenuItemElement.h>
55 #include <WebCore/IntRect.h>
56 #include <WebCore/IntSizeHash.h>
57 #include <WebCore/Page.h>
58 #include <WebCore/PageOverlay.h>
59 #include <WebCore/UserActivity.h>
60 #include <WebCore/UserContentTypes.h>
61 #include <WebCore/UserInterfaceLayoutDirection.h>
62 #include <WebCore/UserScriptTypes.h>
63 #include <WebCore/VisibilityState.h>
64 #include <WebCore/WebCoreKeyboardUIMode.h>
65 #include <memory>
66 #include <pal/HysteresisActivity.h>
67 #include <wtf/HashMap.h>
68 #include <wtf/MonotonicTime.h>
69 #include <wtf/RefPtr.h>
70 #include <wtf/RunLoop.h>
71 #include <wtf/Seconds.h>
72 #include <wtf/WallTime.h>
73 #include <wtf/text/WTFString.h>
74
75 #if HAVE(ACCESSIBILITY) && PLATFORM(GTK)
76 #include "WebPageAccessibilityObject.h"
77 #include <wtf/glib/GRefPtr.h>
78 #endif
79
80 #if PLATFORM(GTK)
81 #include "ArgumentCodersGtk.h"
82 #include "WebPrintOperationGtk.h"
83 #endif
84
85 #if PLATFORM(IOS)
86 #include "GestureTypes.h"
87 #include "WebPageMessages.h"
88 #include <WebCore/ViewportConfiguration.h>
89 #endif
90
91 #if ENABLE(APPLICATION_MANIFEST)
92 #include <WebCore/ApplicationManifest.h>
93 #endif
94
95 #if ENABLE(IOS_TOUCH_EVENTS)
96 #include <WebKitAdditions/PlatformTouchEventIOS.h>
97 #elif ENABLE(TOUCH_EVENTS)
98 #include <WebCore/PlatformTouchEvent.h>
99 #endif
100
101 #if ENABLE(MAC_GESTURE_EVENTS)
102 #include <WebKitAdditions/PlatformGestureEventMac.h>
103 #endif
104
105 #if PLATFORM(COCOA)
106 #include <WebCore/VisibleSelection.h>
107 #include <wtf/RetainPtr.h>
108 OBJC_CLASS CALayer;
109 OBJC_CLASS NSArray;
110 OBJC_CLASS NSDictionary;
111 OBJC_CLASS NSObject;
112 OBJC_CLASS WKAccessibilityWebPageObject;
113 #endif
114
115 namespace API {
116 class Array;
117 }
118
119 namespace IPC {
120 class Decoder;
121 class Connection;
122 }
123
124 namespace WebCore {
125
126 class CaptureDevice;
127 class DocumentLoader;
128 class DragData;
129 class Frame;
130 class FrameSelection;
131 class FrameView;
132 class GraphicsContext;
133 class HTMLMenuElement;
134 class HTMLMenuItemElement;
135 class HTMLPlugInElement;
136 class HTMLPlugInImageElement;
137 class IntPoint;
138 class KeyboardEvent;
139 class MediaPlaybackTargetContext;
140 class MediaPlayerRequestInstallMissingPluginsCallback;
141 class Page;
142 class PrintContext;
143 class Range;
144 class ResourceRequest;
145 class ResourceResponse;
146 class SelectionRect;
147 class SharedBuffer;
148 class SubstituteData;
149 class TextCheckingRequest;
150 class URL;
151 class VisiblePosition;
152
153 enum SyntheticClickType : int8_t;
154 enum class NavigationPolicyCheck;
155 enum class TextIndicatorPresentationTransition : uint8_t;
156
157 struct CompositionUnderline;
158 struct DictationAlternative;
159 struct GlobalFrameIdentifier;
160 struct GlobalWindowIdentifier;
161 struct Highlight;
162 struct KeypressCommand;
163 struct PromisedBlobInfo;
164 struct TextCheckingResult;
165 struct ViewportArguments;
166
167
168
169 #if ENABLE(ATTACHMENT_ELEMENT)
170 class HTMLAttachmentElement;
171 struct AttachmentDisplayOptions;
172 #endif
173 }
174
175 namespace WebKit {
176
177 class DataReference;
178 class DrawingArea;
179 class DownloadID;
180 class FindController;
181 class GamepadData;
182 class GeolocationPermissionRequestManager;
183 class InjectedBundleBackForwardList;
184 class MediaDeviceSandboxExtensions;
185 class NotificationPermissionRequestManager;
186 class PDFPlugin;
187 class PageBanner;
188 class PluginView;
189 class RemoteWebInspectorUI;
190 class UserMediaPermissionRequestManager;
191 class ViewGestureGeometryCollector;
192 class VisibleContentRectUpdateInfo;
193 class WebColorChooser;
194 class WebContextMenu;
195 class WebContextMenuItemData;
196 class WebDocumentLoader;
197 class WebEvent;
198 class WebFrame;
199 class WebFullScreenManager;
200 class WebImage;
201 class WebInspector;
202 class WebInspectorClient;
203 class WebInspectorUI;
204 class WebGestureEvent;
205 class WebKeyboardEvent;
206 class WebURLSchemeHandlerProxy;
207 class WebMouseEvent;
208 class WebNotificationClient;
209 class WebOpenPanelResultListener;
210 class WebPageGroupProxy;
211 class WebPageOverlay;
212 class PlaybackSessionManager;
213 class WebPopupMenu;
214 class WebUndoStep;
215 class WebUserContentController;
216 class VideoFullscreenManager;
217 class WebWheelEvent;
218 class WebTouchEvent;
219 class WebCredentialsMessenger;
220 class RemoteLayerTreeTransaction;
221
222 enum FindOptions : uint16_t;
223 enum class DragControllerAction;
224
225 struct AssistedNodeInformation;
226 struct AttributedString;
227 struct BackForwardListItemState;
228 struct EditorState;
229 struct InteractionInformationAtPosition;
230 struct InteractionInformationRequest;
231 struct LoadParameters;
232 struct PrintInfo;
233 struct WebPageCreationParameters;
234 struct WebPreferencesStore;
235 struct WebSelectionData;
236 struct WebsitePoliciesData;
237
238 using SnapshotOptions = uint32_t;
239 using WKEventModifiers = uint32_t;
240
241 class WebPage : public API::ObjectImpl<API::Object::Type::BundlePage>, public IPC::MessageReceiver, public IPC::MessageSender {
242 public:
243     static Ref<WebPage> create(uint64_t pageID, WebPageCreationParameters&&);
244     virtual ~WebPage();
245
246     void reinitializeWebPage(WebPageCreationParameters&&);
247
248     void close();
249
250     static WebPage* fromCorePage(WebCore::Page*);
251
252     WebCore::Page* corePage() const { return m_page.get(); }
253     uint64_t pageID() const { return m_pageID; }
254     PAL::SessionID sessionID() const { return m_page->sessionID(); }
255     bool usesEphemeralSession() const { return m_page->usesEphemeralSession(); }
256
257     void setSessionID(PAL::SessionID);
258
259     void setSize(const WebCore::IntSize&);
260     const WebCore::IntSize& size() const { return m_viewSize; }
261     WebCore::IntRect bounds() const { return WebCore::IntRect(WebCore::IntPoint(), size()); }
262     
263     InjectedBundleBackForwardList* backForwardList();
264     DrawingArea* drawingArea() const { return m_drawingArea.get(); }
265
266 #if ENABLE(ASYNC_SCROLLING)
267     WebCore::ScrollingCoordinator* scrollingCoordinator() const;
268 #endif
269
270     WebPageGroupProxy* pageGroup() const { return m_pageGroup.get(); }
271
272     void scrollMainFrameIfNotAtMaxScrollPosition(const WebCore::IntSize& scrollOffset);
273
274     bool scrollBy(uint32_t scrollDirection, uint32_t scrollGranularity);
275
276     void centerSelectionInVisibleArea();
277
278 #if PLATFORM(COCOA)
279     void willCommitLayerTree(RemoteLayerTreeTransaction&);
280     void didFlushLayerTreeAtTime(MonotonicTime);
281 #endif
282
283     enum class LazyCreationPolicy { UseExistingOnly, CreateIfNeeded };
284
285     WebInspector* inspector(LazyCreationPolicy = LazyCreationPolicy::CreateIfNeeded);
286     WebInspectorUI* inspectorUI();
287     RemoteWebInspectorUI* remoteInspectorUI();
288     bool isInspectorPage() { return !!m_inspectorUI || !!m_remoteInspectorUI; }
289
290 #if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
291     PlaybackSessionManager& playbackSessionManager();
292     VideoFullscreenManager& videoFullscreenManager();
293 #endif
294
295 #if PLATFORM(IOS)
296     void setAllowsMediaDocumentInlinePlayback(bool);
297     bool allowsMediaDocumentInlinePlayback() const { return m_allowsMediaDocumentInlinePlayback; }
298 #endif
299
300 #if ENABLE(FULLSCREEN_API)
301     WebFullScreenManager* fullScreenManager();
302 #endif
303
304     // -- Called by the DrawingArea.
305     // FIXME: We could genericize these into a DrawingArea client interface. Would that be beneficial?
306     void drawRect(WebCore::GraphicsContext&, const WebCore::IntRect&);
307     void layoutIfNeeded();
308
309     // -- Called from WebCore clients.
310     bool handleEditingKeyboardEvent(WebCore::KeyboardEvent*);
311
312     void didStartNavigationPolicyCheck();
313     void didCompleteNavigationPolicyCheck();
314     void didStartPageTransition();
315     void didCompletePageTransition();
316     void didCommitLoad(WebFrame*);
317     void willReplaceMultipartContent(const WebFrame&);
318     void didReplaceMultipartContent(const WebFrame&);
319     void didFinishLoad(WebFrame*);
320     void show();
321     String userAgent(const WebCore::URL&) const;
322     String userAgent(WebFrame*, const WebCore::URL&) const;
323     String platformUserAgent(const WebCore::URL&) const;
324     WebCore::KeyboardUIMode keyboardUIMode();
325
326     void didInsertMenuElement(WebCore::HTMLMenuElement&);
327     void didRemoveMenuElement(WebCore::HTMLMenuElement&);
328     void didInsertMenuItemElement(WebCore::HTMLMenuItemElement&);
329     void didRemoveMenuItemElement(WebCore::HTMLMenuItemElement&);
330
331     const String& overrideContentSecurityPolicy() const { return m_overrideContentSecurityPolicy; }
332
333     WebUndoStep* webUndoStep(uint64_t);
334     void addWebUndoStep(uint64_t, WebUndoStep*);
335     void removeWebEditCommand(uint64_t);
336     bool isInRedo() const { return m_isInRedo; }
337
338     bool isAlwaysOnLoggingAllowed() const;
339     void setActivePopupMenu(WebPopupMenu*);
340
341     void setHiddenPageDOMTimerThrottlingIncreaseLimit(Seconds limit)
342     {
343         m_page->setDOMTimerAlignmentIntervalIncreaseLimit(limit);
344     }
345
346 #if ENABLE(INPUT_TYPE_COLOR)
347     WebColorChooser* activeColorChooser() const { return m_activeColorChooser; }
348     void setActiveColorChooser(WebColorChooser*);
349     void didChooseColor(const WebCore::Color&);
350     void didEndColorPicker();
351 #endif
352
353     WebOpenPanelResultListener* activeOpenPanelResultListener() const { return m_activeOpenPanelResultListener.get(); }
354     void setActiveOpenPanelResultListener(Ref<WebOpenPanelResultListener>&&);
355
356     void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
357     void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override;
358
359     // -- InjectedBundle methods
360 #if ENABLE(CONTEXT_MENUS)
361     void setInjectedBundleContextMenuClient(std::unique_ptr<API::InjectedBundle::PageContextMenuClient>&&);
362 #endif
363     void setInjectedBundleEditorClient(std::unique_ptr<API::InjectedBundle::EditorClient>&&);
364     void setInjectedBundleFormClient(std::unique_ptr<API::InjectedBundle::FormClient>&&);
365     void setInjectedBundlePageLoaderClient(std::unique_ptr<API::InjectedBundle::PageLoaderClient>&&);
366     void initializeInjectedBundlePolicyClient(WKBundlePagePolicyClientBase*);
367     void setInjectedBundleResourceLoadClient(std::unique_ptr<API::InjectedBundle::ResourceLoadClient>&&);
368     void setInjectedBundleUIClient(std::unique_ptr<API::InjectedBundle::PageUIClient>&&);
369 #if ENABLE(FULLSCREEN_API)
370     void initializeInjectedBundleFullScreenClient(WKBundlePageFullScreenClientBase*);
371 #endif
372
373 #if ENABLE(CONTEXT_MENUS)
374     API::InjectedBundle::PageContextMenuClient& injectedBundleContextMenuClient() { return *m_contextMenuClient; }
375 #endif
376     API::InjectedBundle::EditorClient& injectedBundleEditorClient() { return *m_editorClient; }
377     API::InjectedBundle::FormClient& injectedBundleFormClient() { return *m_formClient; }
378     API::InjectedBundle::PageLoaderClient& injectedBundleLoaderClient() { return *m_loaderClient; }
379     InjectedBundlePagePolicyClient& injectedBundlePolicyClient() { return m_policyClient; }
380     API::InjectedBundle::ResourceLoadClient& injectedBundleResourceLoadClient() { return *m_resourceLoadClient; }
381     API::InjectedBundle::PageUIClient& injectedBundleUIClient() { return *m_uiClient; }
382 #if ENABLE(FULLSCREEN_API)
383     InjectedBundlePageFullScreenClient& injectedBundleFullScreenClient() { return m_fullScreenClient; }
384 #endif
385
386     bool findStringFromInjectedBundle(const String&, FindOptions);
387
388     WebFrame* mainWebFrame() const { return m_mainFrame.get(); }
389
390     WebCore::Frame* mainFrame() const; // May return nullptr.
391     WebCore::FrameView* mainFrameView() const; // May return nullptr.
392
393     RefPtr<WebCore::Range> currentSelectionAsRange();
394
395 #if ENABLE(NETSCAPE_PLUGIN_API)
396     RefPtr<Plugin> createPlugin(WebFrame*, WebCore::HTMLPlugInElement*, const Plugin::Parameters&, String& newMIMEType);
397 #endif
398
399 #if ENABLE(WEBGL)
400     WebCore::WebGLLoadPolicy webGLPolicyForURL(WebFrame*, const WebCore::URL&);
401     WebCore::WebGLLoadPolicy resolveWebGLPolicyForURL(WebFrame*, const WebCore::URL&);
402 #endif
403     
404     enum class IncludePostLayoutDataHint { No, Yes };
405     EditorState editorState(IncludePostLayoutDataHint = IncludePostLayoutDataHint::Yes) const;
406     void updateEditorStateAfterLayoutIfEditabilityChanged();
407
408     String renderTreeExternalRepresentation() const;
409     String renderTreeExternalRepresentationForPrinting() const;
410     uint64_t renderTreeSize() const;
411
412     void setTracksRepaints(bool);
413     bool isTrackingRepaints() const;
414     void resetTrackedRepaints();
415     Ref<API::Array> trackedRepaintRects();
416
417     void executeEditingCommand(const String& commandName, const String& argument);
418     bool isEditingCommandEnabled(const String& commandName);
419     void clearMainFrameName();
420     void sendClose();
421
422     void sendSetWindowFrame(const WebCore::FloatRect&);
423
424     double textZoomFactor() const;
425     void setTextZoomFactor(double);
426     double pageZoomFactor() const;
427     void setPageZoomFactor(double);
428     void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
429     void windowScreenDidChange(uint32_t);
430
431     void accessibilitySettingsDidChange();
432 #if ENABLE(ACCESSIBILITY_EVENTS)
433     void updateAccessibilityEventsEnabled(bool);
434 #endif
435
436     void scalePage(double scale, const WebCore::IntPoint& origin);
437     void scalePageInViewCoordinates(double scale, WebCore::IntPoint centerInViewCoordinates);
438     double pageScaleFactor() const;
439     double totalScaleFactor() const;
440     double viewScaleFactor() const;
441     void scaleView(double scale);
442
443     void setUseFixedLayout(bool);
444     bool useFixedLayout() const { return m_useFixedLayout; }
445     bool setFixedLayoutSize(const WebCore::IntSize&);
446     WebCore::IntSize fixedLayoutSize() const;
447
448     void listenForLayoutMilestones(uint32_t /* LayoutMilestones */);
449
450     void setSuppressScrollbarAnimations(bool);
451     
452     void setEnableVerticalRubberBanding(bool);
453     void setEnableHorizontalRubberBanding(bool);
454     
455     void setBackgroundExtendsBeyondPage(bool);
456
457     void setPaginationMode(uint32_t /* WebCore::Pagination::Mode */);
458     void setPaginationBehavesLikeColumns(bool);
459     void setPageLength(double);
460     void setGapBetweenPages(double);
461     void setPaginationLineGridEnabled(bool);
462     
463     void postInjectedBundleMessage(const String& messageName, const UserData&);
464
465     bool drawsBackground() const { return m_drawsBackground; }
466
467     void setUnderlayColor(const WebCore::Color& color) { m_underlayColor = color; }
468     WebCore::Color underlayColor() const { return m_underlayColor; }
469
470     void stopLoading();
471     void stopLoadingFrame(uint64_t frameID);
472     bool defersLoading() const;
473     void setDefersLoading(bool deferLoading);
474
475     void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*);
476     void exitAcceleratedCompositingMode();
477
478     void addPluginView(PluginView*);
479     void removePluginView(PluginView*);
480
481     bool isVisible() const { return m_activityState & WebCore::ActivityState::IsVisible; }
482     bool isVisibleOrOccluded() const { return m_activityState & WebCore::ActivityState::IsVisibleOrOccluded; }
483
484     LayerHostingMode layerHostingMode() const { return m_layerHostingMode; }
485     void setLayerHostingMode(LayerHostingMode);
486
487 #if PLATFORM(COCOA)
488     void updatePluginsActiveAndFocusedState();
489     const WebCore::FloatRect& windowFrameInScreenCoordinates() const { return m_windowFrameInScreenCoordinates; }
490     const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates() const { return m_windowFrameInUnflippedScreenCoordinates; }
491     const WebCore::FloatRect& viewFrameInWindowCoordinates() const { return m_viewFrameInWindowCoordinates; }
492
493     bool hasCachedWindowFrame() const { return m_hasCachedWindowFrame; }
494
495     void updateHeaderAndFooterLayersForDeviceScaleChange(float scaleFactor);
496 #endif
497
498 #if PLATFORM(MAC)
499     void setTopOverhangImage(WebImage*);
500     void setBottomOverhangImage(WebImage*);
501     
502     void setUseSystemAppearance(bool);
503     void setDefaultAppearance(bool);
504 #endif
505
506     bool windowIsFocused() const;
507     bool windowAndWebPageAreFocused() const;
508
509 #if !PLATFORM(IOS)
510     void setHeaderPageBanner(PageBanner*);
511     PageBanner* headerPageBanner();
512     void setFooterPageBanner(PageBanner*);
513     PageBanner* footerPageBanner();
514
515     void hidePageBanners();
516     void showPageBanners();
517     
518     void setHeaderBannerHeightForTesting(int);
519     void setFooterBannerHeightForTesting(int);
520 #endif
521
522     WebCore::IntPoint screenToRootView(const WebCore::IntPoint&);
523     WebCore::IntRect rootViewToScreen(const WebCore::IntRect&);
524     
525 #if PLATFORM(IOS)
526     WebCore::IntPoint accessibilityScreenToRootView(const WebCore::IntPoint&);
527     WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&);
528 #endif
529     
530     RefPtr<WebImage> scaledSnapshotWithOptions(const WebCore::IntRect&, double additionalScaleFactor, SnapshotOptions);
531
532     static const WebEvent* currentEvent();
533
534     FindController& findController() { return m_findController.get(); }
535
536 #if ENABLE(GEOLOCATION)
537     GeolocationPermissionRequestManager& geolocationPermissionRequestManager() { return m_geolocationPermissionRequestManager.get(); }
538 #endif
539
540 #if PLATFORM(IOS)
541     void savePageState(WebCore::HistoryItem&);
542     void restorePageState(const WebCore::HistoryItem&);
543 #endif
544
545 #if ENABLE(MEDIA_STREAM)
546     UserMediaPermissionRequestManager& userMediaPermissionRequestManager() { return *m_userMediaPermissionRequestManager; }
547     void prepareToSendUserMediaPermissionRequest();
548 #endif
549
550     void elementDidFocus(WebCore::Node*);
551     void elementDidBlur(WebCore::Node*);
552     void resetAssistedNodeForFrame(WebFrame*);
553
554     void viewportPropertiesDidChange(const WebCore::ViewportArguments&);
555     void executeEditCommandWithCallback(const String&, const String& argument, CallbackID);
556
557 #if PLATFORM(IOS)
558     WebCore::FloatSize screenSize() const;
559     WebCore::FloatSize availableScreenSize() const;
560     WebCore::FloatSize overrideScreenSize() const;
561     int32_t deviceOrientation() const { return m_deviceOrientation; }
562     void didReceiveMobileDocType(bool);
563
564     void setUseTestingViewportConfiguration(bool useTestingViewport) { m_useTestingViewportConfiguration = useTestingViewport; }
565     bool isUsingTestingViewportConfiguration() const { return m_useTestingViewportConfiguration; }
566
567     double minimumPageScaleFactor() const;
568     double maximumPageScaleFactor() const;
569     double maximumPageScaleFactorIgnoringAlwaysScalable() const;
570     bool allowsUserScaling() const;
571     bool hasStablePageScaleFactor() const { return m_hasStablePageScaleFactor; }
572
573     void handleTap(const WebCore::IntPoint&, uint64_t lastLayerTreeTransactionId);
574     void potentialTapAtPosition(uint64_t requestID, const WebCore::FloatPoint&);
575     void commitPotentialTap(uint64_t lastLayerTreeTransactionId);
576     void commitPotentialTapFailed();
577     void cancelPotentialTap();
578     void cancelPotentialTapInFrame(WebFrame&);
579     void tapHighlightAtPosition(uint64_t requestID, const WebCore::FloatPoint&);
580
581     void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&);
582     void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&);
583
584     void blurAssistedNode();
585     void requestAssistedNodeInformation(CallbackID);
586     void selectWithGesture(const WebCore::IntPoint&, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithAssistedNode, CallbackID);
587     void updateSelectionWithTouches(const WebCore::IntPoint&, uint32_t touches, bool baseIsStart, CallbackID);
588     void selectWithTwoTouches(const WebCore::IntPoint& from, const WebCore::IntPoint& to, uint32_t gestureType, uint32_t gestureState, CallbackID);
589     void extendSelection(uint32_t granularity);
590     void selectWordBackward();
591     void moveSelectionByOffset(int32_t offset, CallbackID);
592     void selectTextWithGranularityAtPoint(const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithAssistedNode, CallbackID);
593     void selectPositionAtBoundaryWithDirection(const WebCore::IntPoint&, uint32_t granularity, uint32_t direction, bool isInteractingWithAssistedNode, CallbackID);
594     void moveSelectionAtBoundaryWithDirection(uint32_t granularity, uint32_t direction, CallbackID);
595     void selectPositionAtPoint(const WebCore::IntPoint&, bool isInteractingWithAssistedNode, CallbackID);
596     void beginSelectionInDirection(uint32_t direction, CallbackID);
597     void updateSelectionWithExtentPoint(const WebCore::IntPoint&, bool isInteractingWithAssistedNode, CallbackID);
598     void updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithAssistedNode, CallbackID);
599
600     void requestDictationContext(CallbackID);
601     void replaceDictatedText(const String& oldText, const String& newText);
602     void replaceSelectedText(const String& oldText, const String& newText);
603     void requestAutocorrectionData(const String& textForAutocorrection, CallbackID);
604     void applyAutocorrection(const String& correction, const String& originalText, CallbackID);
605     void syncApplyAutocorrection(const String& correction, const String& originalText, bool& correctionApplied);
606     void requestAutocorrectionContext(CallbackID);
607     void getAutocorrectionContext(String& beforeText, String& markedText, String& selectedText, String& afterText, uint64_t& location, uint64_t& length);
608     void getPositionInformation(const InteractionInformationRequest&, InteractionInformationAtPosition&);
609     void requestPositionInformation(const InteractionInformationRequest&);
610     void startInteractionWithElementAtPosition(const WebCore::IntPoint&);
611     void stopInteraction();
612     void performActionOnElement(uint32_t action);
613     void focusNextAssistedNode(bool isForward, CallbackID);
614     void autofillLoginCredentials(const String&, const String&);
615     void setAssistedNodeValue(const String&);
616     void setAssistedNodeValueAsNumber(double);
617     void setAssistedNodeSelectedIndex(uint32_t index, bool allowMultipleSelection);
618     WebCore::IntRect rectForElementAtInteractionLocation();
619     void updateSelectionAppearance();
620     void getSelectionContext(CallbackID);
621     void handleTwoFingerTapAtPoint(const WebCore::IntPoint&, uint64_t requestID);
622     void getRectsForGranularityWithSelectionOffset(uint32_t, int32_t, CallbackID);
623     void getRectsAtSelectionOffsetWithText(int32_t, const String&, CallbackID);
624     void storeSelectionForAccessibility(bool);
625     void startAutoscrollAtPosition(const WebCore::FloatPoint&);
626     void cancelAutoscroll();
627
628     void contentSizeCategoryDidChange(const String&);
629
630     Seconds eventThrottlingDelay() const;
631
632     void showInspectorHighlight(const WebCore::Highlight&);
633     void hideInspectorHighlight();
634
635     void showInspectorIndication();
636     void hideInspectorIndication();
637
638     void enableInspectorNodeSearch();
639     void disableInspectorNodeSearch();
640     
641     void setForceAlwaysUserScalable(bool);
642 #endif
643
644 #if PLATFORM(IOS) && ENABLE(IOS_TOUCH_EVENTS)
645     void dispatchAsynchronousTouchEvents(const Vector<WebTouchEvent, 1>& queue);
646 #endif
647
648     bool hasRichlyEditableSelection() const;
649
650     void setLayerTreeStateIsFrozen(bool);
651     void markLayersVolatile(WTF::Function<void ()>&& completionHandler = { });
652     void cancelMarkLayersVolatile();
653
654     NotificationPermissionRequestManager* notificationPermissionRequestManager();
655
656     void pageDidScroll();
657
658 #if USE(COORDINATED_GRAPHICS)
659     void pageDidRequestScroll(const WebCore::IntPoint&);
660 #endif
661
662 #if ENABLE(CONTEXT_MENUS)
663     WebContextMenu* contextMenu();
664     WebContextMenu* contextMenuAtPointInWindow(const WebCore::IntPoint&);
665 #endif
666
667     bool hasLocalDataForURL(const WebCore::URL&);
668     String cachedResponseMIMETypeForURL(const WebCore::URL&);
669     String cachedSuggestedFilenameForURL(const WebCore::URL&);
670     RefPtr<WebCore::SharedBuffer> cachedResponseDataForURL(const WebCore::URL&);
671
672     static bool canHandleRequest(const WebCore::ResourceRequest&);
673
674     class SandboxExtensionTracker {
675     public:
676         ~SandboxExtensionTracker();
677
678         void invalidate();
679
680         void beginLoad(WebFrame*, SandboxExtension::Handle&&);
681         void willPerformLoadDragDestinationAction(RefPtr<SandboxExtension>&& pendingDropSandboxExtension);
682         void didStartProvisionalLoad(WebFrame*);
683         void didCommitProvisionalLoad(WebFrame*);
684         void didFailProvisionalLoad(WebFrame*);
685
686     private:
687         void setPendingProvisionalSandboxExtension(RefPtr<SandboxExtension>&&);
688
689         RefPtr<SandboxExtension> m_pendingProvisionalSandboxExtension;
690         RefPtr<SandboxExtension> m_provisionalSandboxExtension;
691         RefPtr<SandboxExtension> m_committedSandboxExtension;
692     };
693
694     SandboxExtensionTracker& sandboxExtensionTracker() { return m_sandboxExtensionTracker; }
695
696 #if PLATFORM(GTK)
697     void setComposition(const String& text, const Vector<WebCore::CompositionUnderline>& underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeLength);
698     void confirmComposition(const String& text, int64_t selectionStart, int64_t selectionLength);
699     void cancelComposition();
700
701     void collapseSelectionInFrame(uint64_t frameID);
702 #endif
703
704 #if PLATFORM (GTK) && HAVE(GTK_GESTURES)
705     void getCenterForZoomGesture(const WebCore::IntPoint& centerInViewCoordinates, WebCore::IntPoint& result);
706 #endif
707
708     void didApplyStyle();
709     void didChangeSelection();
710     void didChangeContents();
711     void discardedComposition();
712     void canceledComposition();
713     void didUpdateComposition();
714     void didEndUserTriggeredSelectionChanges();
715
716 #if PLATFORM(COCOA)
717     void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
718     WKAccessibilityWebPageObject* accessibilityRemoteObject();
719     NSObject *accessibilityObjectForMainFramePlugin();
720     const WebCore::FloatPoint& accessibilityPosition() const { return m_accessibilityPosition; }
721     
722     void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
723
724     void setTextAsync(const String&);
725     void insertTextAsync(const String& text, const EditingRange& replacementRange, bool registerUndoGroup = false, uint32_t editingRangeIsRelativeTo = (uint32_t)EditingRangeIsRelativeTo::EditableRoot, bool suppressSelectionUpdate = false);
726     void getMarkedRangeAsync(CallbackID);
727     void getSelectedRangeAsync(CallbackID);
728     void characterIndexForPointAsync(const WebCore::IntPoint&, CallbackID);
729     void firstRectForCharacterRangeAsync(const EditingRange&, CallbackID);
730     void setCompositionAsync(const String& text, const Vector<WebCore::CompositionUnderline>& underlines, const EditingRange& selectionRange, const EditingRange& replacementRange);
731     void confirmCompositionAsync();
732
733     void readSelectionFromPasteboard(const WTF::String& pasteboardName, bool& result);
734     void getStringSelectionForPasteboard(WTF::String& stringValue);
735     void getDataSelectionForPasteboard(const WTF::String pasteboardType, SharedMemory::Handle& handle, uint64_t& size);
736     void shouldDelayWindowOrderingEvent(const WebKit::WebMouseEvent&, bool& result);
737     void acceptsFirstMouse(int eventNumber, const WebKit::WebMouseEvent&, bool& result);
738     bool performNonEditingBehaviorForSelector(const String&, WebCore::KeyboardEvent*);
739 #endif
740
741 #if PLATFORM(MAC)
742     void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::DictationAlternative>& dictationAlternativeLocations, bool registerUndoGroup = false);
743     void attributedSubstringForCharacterRangeAsync(const EditingRange&, CallbackID);
744     void fontAtSelection(CallbackID);
745 #endif
746
747 #if PLATFORM(COCOA) && ENABLE(SERVICE_CONTROLS)
748     void replaceSelectionWithPasteboardData(const Vector<String>& types, const IPC::DataReference&);
749 #endif
750
751 #if HAVE(ACCESSIBILITY) && PLATFORM(GTK)
752     void updateAccessibilityTree();
753 #endif
754
755     void setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length, bool suppressUnderline);
756     bool hasCompositionForTesting();
757     void confirmCompositionForTesting(const String& compositionString);
758
759     // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require
760     // any synchronous messages, and should be removed when <rdar://problem/8775115> is fixed.
761     void dummy(bool&);
762
763 #if PLATFORM(COCOA)
764     bool isSpeaking();
765     void speak(const String&);
766     void stopSpeaking();
767
768     void performDictionaryLookupForSelection(WebCore::Frame&, const WebCore::VisibleSelection&, WebCore::TextIndicatorPresentationTransition);
769 #endif
770
771     bool isSmartInsertDeleteEnabled();
772     void setSmartInsertDeleteEnabled(bool);
773
774     bool isSelectTrailingWhitespaceEnabled() const;
775     void setSelectTrailingWhitespaceEnabled(bool);
776
777     void replaceSelectionWithText(WebCore::Frame*, const String&);
778     void clearSelection();
779     void restoreSelectionInFocusedEditableElement();
780
781 #if ENABLE(DRAG_SUPPORT) && PLATFORM(GTK)
782     void performDragControllerAction(DragControllerAction, const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t draggingSourceOperationMask, WebSelectionData&&, uint32_t flags);
783 #endif
784
785 #if ENABLE(DRAG_SUPPORT) && !PLATFORM(GTK)
786     void performDragControllerAction(DragControllerAction, const WebCore::DragData&, SandboxExtension::Handle&&, SandboxExtension::HandleArray&&);
787 #endif
788
789 #if ENABLE(DRAG_SUPPORT)
790     void dragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation);
791
792     void willPerformLoadDragDestinationAction();
793     void mayPerformUploadDragDestinationAction();
794
795     void willStartDrag() { ASSERT(!m_isStartingDrag); m_isStartingDrag = true; }
796     void didStartDrag();
797     void dragCancelled();
798 #endif
799
800     void beginPrinting(uint64_t frameID, const PrintInfo&);
801     void endPrinting();
802     void computePagesForPrinting(uint64_t frameID, const PrintInfo&, CallbackID);
803     void computePagesForPrintingImpl(uint64_t frameID, const PrintInfo&, Vector<WebCore::IntRect>& pageRects, double& totalScaleFactor);
804
805 #if PLATFORM(COCOA)
806     void drawRectToImage(uint64_t frameID, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, CallbackID);
807     void drawPagesToPDF(uint64_t frameID, const PrintInfo&, uint32_t first, uint32_t count, CallbackID);
808     void drawPagesToPDFImpl(uint64_t frameID, const PrintInfo&, uint32_t first, uint32_t count, RetainPtr<CFMutableDataRef>& pdfPageData);
809 #endif
810
811 #if PLATFORM(IOS)
812     void computePagesForPrintingAndDrawToPDF(uint64_t frameID, const PrintInfo&, CallbackID, Ref<Messages::WebPage::ComputePagesForPrintingAndDrawToPDF::DelayedReply>&&);
813 #endif
814
815 #if PLATFORM(GTK)
816     void drawPagesForPrinting(uint64_t frameID, const PrintInfo&, CallbackID);
817     void didFinishPrintOperation(const WebCore::ResourceError&, CallbackID);
818 #endif
819
820     void addResourceRequest(unsigned long, const WebCore::ResourceRequest&);
821     void removeResourceRequest(unsigned long);
822
823     void setMediaVolume(float);
824     void setMuted(WebCore::MediaProducer::MutedStateFlags);
825     void setMayStartMediaWhenInWindow(bool);
826     void stopMediaCapture();
827
828 #if ENABLE(MEDIA_SESSION)
829     void handleMediaEvent(uint32_t /* WebCore::MediaEventType */);
830     void setVolumeOfMediaElement(double, uint64_t);
831 #endif
832
833     void updateMainFrameScrollOffsetPinning();
834
835     bool mainFrameHasCustomContentProvider() const;
836     void addMIMETypeWithCustomContentProvider(const String&);
837
838     void mainFrameDidLayout();
839
840     bool canRunBeforeUnloadConfirmPanel() const { return m_canRunBeforeUnloadConfirmPanel; }
841     void setCanRunBeforeUnloadConfirmPanel(bool canRunBeforeUnloadConfirmPanel) { m_canRunBeforeUnloadConfirmPanel = canRunBeforeUnloadConfirmPanel; }
842
843     bool canRunModal() const { return m_canRunModal; }
844     void setCanRunModal(bool canRunModal) { m_canRunModal = canRunModal; }
845
846     void runModal();
847
848     void setDeviceScaleFactor(float);
849     float deviceScaleFactor() const;
850
851     void forceRepaintWithoutCallback();
852
853     void unmarkAllMisspellings();
854     void unmarkAllBadGrammar();
855
856 #if PLATFORM(COCOA)
857     void handleAlternativeTextUIResult(const String&);
858 #endif
859
860     // For testing purpose.
861     void simulateMouseDown(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, WallTime);
862     void simulateMouseUp(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, WallTime);
863     void simulateMouseMotion(WebCore::IntPoint, WallTime);
864
865 #if ENABLE(CONTEXT_MENUS)
866     void contextMenuShowing() { m_isShowingContextMenu = true; }
867 #endif
868
869     void wheelEvent(const WebWheelEvent&);
870
871     void wheelEventHandlersChanged(bool);
872     void recomputeShortCircuitHorizontalWheelEventsState();
873
874 #if ENABLE(MAC_GESTURE_EVENTS)
875     void gestureEvent(const WebGestureEvent&);
876 #endif
877
878     void updateVisibilityState(bool isInitialState = false);
879
880 #if PLATFORM(IOS)
881     void setViewportConfigurationMinimumLayoutSize(const WebCore::FloatSize&, const WebCore::FloatSize& viewSize);
882     void setMaximumUnobscuredSize(const WebCore::FloatSize&);
883     void setDeviceOrientation(int32_t);
884     void dynamicViewportSizeUpdate(const WebCore::FloatSize& minimumLayoutSize, const WebCore::FloatSize& viewSize, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& targetUnobscuredSafeAreaInsets, double scale, int32_t deviceOrientation, uint64_t dynamicViewportSizeUpdateID);
885     void synchronizeDynamicViewportUpdate(double& newTargetScale, WebCore::FloatPoint& newScrollPosition, uint64_t& nextValidLayerTreeTransactionID);
886     std::optional<float> scaleFromUIProcess(const VisibleContentRectUpdateInfo&) const;
887     void updateVisibleContentRects(const VisibleContentRectUpdateInfo&, MonotonicTime oldestTimestamp);
888     bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; }
889     void willStartUserTriggeredZooming();
890     void applicationWillResignActive();
891     void applicationDidEnterBackground(bool isSuspendedUnderLock);
892     void applicationDidFinishSnapshottingAfterEnteringBackground();
893     void applicationWillEnterForeground(bool isSuspendedUnderLock);
894     void applicationDidBecomeActive();
895     void completePendingSyntheticClickForContentChangeObserver();
896
897     bool platformPrefersTextLegibilityBasedZoomScaling() const;
898     const WebCore::ViewportConfiguration& viewportConfiguration() const { return m_viewportConfiguration; }
899 #endif
900
901 #if ENABLE(IOS_TOUCH_EVENTS)
902     void dispatchTouchEvent(const WebTouchEvent&, bool& handled);
903 #endif
904
905 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
906     uint64_t nativeWindowHandle() { return m_nativeWindowHandle; }
907 #endif
908
909     bool shouldUseCustomContentProviderForResponse(const WebCore::ResourceResponse&);
910
911     bool asynchronousPluginInitializationEnabled() const { return m_asynchronousPluginInitializationEnabled; }
912     void setAsynchronousPluginInitializationEnabled(bool enabled) { m_asynchronousPluginInitializationEnabled = enabled; }
913     bool asynchronousPluginInitializationEnabledForAllPlugins() const { return m_asynchronousPluginInitializationEnabledForAllPlugins; }
914     void setAsynchronousPluginInitializationEnabledForAllPlugins(bool enabled) { m_asynchronousPluginInitializationEnabledForAllPlugins = enabled; }
915     bool artificialPluginInitializationDelayEnabled() const { return m_artificialPluginInitializationDelayEnabled; }
916     void setArtificialPluginInitializationDelayEnabled(bool enabled) { m_artificialPluginInitializationDelayEnabled = enabled; }
917     void setTabToLinksEnabled(bool enabled) { m_tabToLinks = enabled; }
918     bool tabToLinksEnabled() const { return m_tabToLinks; }
919
920     bool scrollingPerformanceLoggingEnabled() const { return m_scrollingPerformanceLoggingEnabled; }
921     void setScrollingPerformanceLoggingEnabled(bool);
922
923 #if PLATFORM(COCOA)
924     bool shouldUsePDFPlugin() const;
925     bool pdfPluginEnabled() const { return m_pdfPluginEnabled; }
926     void setPDFPluginEnabled(bool enabled) { m_pdfPluginEnabled = enabled; }
927
928     NSDictionary *dataDetectionContext() const { return m_dataDetectionContext.get(); }
929 #endif
930
931     void savePDFToFileInDownloadsFolder(const String& suggestedFilename, const WebCore::URL& originatingURL, const uint8_t* data, unsigned long size);
932
933 #if PLATFORM(COCOA)
934     void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
935 #endif
936
937     bool mainFrameIsScrollable() const { return m_mainFrameIsScrollable; }
938
939     void setAlwaysShowsHorizontalScroller(bool);
940     void setAlwaysShowsVerticalScroller(bool);
941
942     bool alwaysShowsHorizontalScroller() const { return m_alwaysShowsHorizontalScroller; };
943     bool alwaysShowsVerticalScroller() const { return m_alwaysShowsVerticalScroller; };
944
945     void setMinimumLayoutSize(const WebCore::IntSize&);
946     WebCore::IntSize minimumLayoutSize() const { return m_minimumLayoutSize; }
947
948     void setAutoSizingShouldExpandToViewHeight(bool shouldExpand);
949     bool autoSizingShouldExpandToViewHeight() { return m_autoSizingShouldExpandToViewHeight; }
950
951     void setViewportSizeForCSSViewportUnits(std::optional<WebCore::IntSize>);
952     std::optional<WebCore::IntSize> viewportSizeForCSSViewportUnits() const { return m_viewportSizeForCSSViewportUnits; }
953
954     bool canShowMIMEType(const String& MIMEType) const;
955
956     void addTextCheckingRequest(uint64_t requestID, Ref<WebCore::TextCheckingRequest>&&);
957     void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
958     void didCancelCheckingText(uint64_t requestID);
959
960 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
961     void determinePrimarySnapshottedPlugIn();
962     void determinePrimarySnapshottedPlugInTimerFired();
963     void resetPrimarySnapshottedPlugIn();
964     bool matchesPrimaryPlugIn(const String& pageOrigin, const String& pluginOrigin, const String& mimeType) const;
965     bool plugInIntersectsSearchRect(WebCore::HTMLPlugInImageElement& pluginImageElement);
966     bool plugInIsPrimarySize(WebCore::HTMLPlugInImageElement& pluginImageElement, unsigned &pluginArea);
967 #endif
968
969 #if ENABLE(DATA_DETECTION)
970     void setDataDetectionResults(NSArray *);
971 #endif
972
973     unsigned extendIncrementalRenderingSuppression();
974     void stopExtendingIncrementalRenderingSuppression(unsigned token);
975     bool shouldExtendIncrementalRenderingSuppression() { return !m_activeRenderingSuppressionTokens.isEmpty(); }
976
977     WebCore::ScrollPinningBehavior scrollPinningBehavior() { return m_scrollPinningBehavior; }
978     void setScrollPinningBehavior(uint32_t /* WebCore::ScrollPinningBehavior */ pinning);
979
980     std::optional<WebCore::ScrollbarOverlayStyle> scrollbarOverlayStyle() { return m_scrollbarOverlayStyle; }
981     void setScrollbarOverlayStyle(std::optional<uint32_t /* WebCore::ScrollbarOverlayStyle */> scrollbarStyle);
982
983     Ref<WebCore::DocumentLoader> createDocumentLoader(WebCore::Frame&, const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
984     void updateCachedDocumentLoader(WebDocumentLoader&, WebCore::Frame&);
985
986     void getBytecodeProfile(CallbackID);
987     void getSamplingProfilerOutput(CallbackID);
988     
989 #if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION)
990     void handleTelephoneNumberClick(const String& number, const WebCore::IntPoint&);
991     void handleSelectionServiceClick(WebCore::FrameSelection&, const Vector<String>& telephoneNumbers, const WebCore::IntPoint&);
992 #endif
993
994     void didChangeScrollOffsetForFrame(WebCore::Frame*);
995
996     void setMainFrameProgressCompleted(bool completed) { m_mainFrameProgressCompleted = completed; }
997     bool shouldDispatchFakeMouseMoveEvents() const { return m_shouldDispatchFakeMouseMoveEvents; }
998
999     void postMessage(const String& messageName, API::Object* messageBody);
1000     void postSynchronousMessageForTesting(const String& messageName, API::Object* messageBody, RefPtr<API::Object>& returnData);
1001
1002 #if PLATFORM(GTK)
1003     void setInputMethodState(bool);
1004 #endif
1005
1006     void imageOrMediaDocumentSizeChanged(const WebCore::IntSize&);
1007
1008 #if ENABLE(VIDEO) && USE(GSTREAMER)
1009     void requestInstallMissingMediaPlugins(const String& details, const String& description, WebCore::MediaPlayerRequestInstallMissingPluginsCallback&);
1010 #endif
1011
1012     void addUserScript(String&& source, WebCore::UserContentInjectedFrames, WebCore::UserScriptInjectionTime);
1013     void addUserStyleSheet(const String& source, WebCore::UserContentInjectedFrames);
1014     void removeAllUserContent();
1015
1016     void dispatchDidReachLayoutMilestone(WebCore::LayoutMilestones);
1017
1018     void didRestoreScrollPosition();
1019
1020     bool isControlledByAutomation() const;
1021     void setControlledByAutomation(bool);
1022
1023     void insertNewlineInQuotedContent();
1024
1025 #if USE(OS_STATE)
1026     WallTime loadCommitTime() const { return m_loadCommitTime; }
1027 #endif
1028
1029 #if ENABLE(GAMEPAD)
1030     void gamepadActivity(const Vector<GamepadData>&, bool shouldMakeGamepadsVisible);
1031 #endif
1032     
1033 #if ENABLE(POINTER_LOCK)
1034     void didAcquirePointerLock();
1035     void didNotAcquirePointerLock();
1036     void didLosePointerLock();
1037 #endif
1038
1039     void didGetLoadDecisionForIcon(bool decision, CallbackID loadIdentifier, OptionalCallbackID);
1040     void setUseIconLoadingClient(bool);
1041
1042 #if ENABLE(DATA_INTERACTION)
1043     void didConcludeEditDataInteraction();
1044 #endif
1045
1046     WebURLSchemeHandlerProxy* urlSchemeHandlerForScheme(const String&);
1047     void stopAllURLSchemeTasks();
1048
1049     std::optional<double> cpuLimit() const { return m_cpuLimit; }
1050
1051     static PluginView* pluginViewForFrame(WebCore::Frame*);
1052
1053     void sendPartialEditorStateAndSchedulePostLayoutUpdate();
1054     void flushPendingEditorStateUpdate();
1055
1056 #if HAVE(CFNETWORK_STORAGE_PARTITIONING)
1057     void hasStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, uint64_t pageID, WTF::CompletionHandler<void (bool)>&& callback);
1058     void requestStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, uint64_t pageID, WTF::CompletionHandler<void (bool)>&& callback);
1059     void storageAccessResponse(bool wasGranted, uint64_t contextId);
1060 #endif
1061
1062 #if ENABLE(ATTACHMENT_ELEMENT)
1063     void insertAttachment(const String& identifier, const WebCore::AttachmentDisplayOptions&, const String& filename, std::optional<String> contentType, const IPC::DataReference&, CallbackID);
1064     void requestAttachmentInfo(const String& identifier, CallbackID);
1065     void setAttachmentDisplayOptions(const String& identifier, const WebCore::AttachmentDisplayOptions&, CallbackID);
1066     void setAttachmentDataAndContentType(const String& identifier, const IPC::DataReference&, std::optional<String> newContentType, std::optional<String> newFilename, CallbackID);
1067 #endif
1068
1069 #if ENABLE(APPLICATION_MANIFEST)
1070     void getApplicationManifest(CallbackID);
1071     void didFinishLoadingApplicationManifest(uint64_t, const std::optional<WebCore::ApplicationManifest>&);
1072 #endif
1073
1074 #if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
1075     void openGLDisplayMaskChanged(uint32_t displayMask);
1076 #endif
1077
1078     UserContentControllerIdentifier userContentControllerIdentifier() const { return m_userContentController->identifier(); }
1079
1080     bool isSuspended() const { return m_isSuspended; }
1081
1082 private:
1083     WebPage(uint64_t pageID, WebPageCreationParameters&&);
1084
1085     void updateThrottleState();
1086     void updateUserActivity();
1087
1088     // IPC::MessageSender
1089     IPC::Connection* messageSenderConnection() override;
1090     uint64_t messageSenderDestinationID() override;
1091
1092     void platformInitialize();
1093     void platformDetach();
1094     void platformEditorState(WebCore::Frame&, EditorState& result, IncludePostLayoutDataHint) const;
1095     void sendEditorStateUpdate();
1096
1097 #if PLATFORM(COCOA)
1098     void sendTouchBarMenuDataAddedUpdate(WebCore::HTMLMenuElement&);
1099     void sendTouchBarMenuDataRemovedUpdate(WebCore::HTMLMenuElement&);
1100     void sendTouchBarMenuItemDataAddedUpdate(WebCore::HTMLMenuItemElement&);
1101     void sendTouchBarMenuItemDataRemovedUpdate(WebCore::HTMLMenuItemElement&);
1102 #endif
1103
1104     void didReceiveWebPageMessage(IPC::Connection&, IPC::Decoder&);
1105     void didReceiveSyncWebPageMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&);
1106
1107 #if PLATFORM(IOS)
1108     void resetViewportDefaultConfiguration(WebFrame* mainFrame, bool hasMobileDocType = false);
1109     void viewportConfigurationChanged();
1110     void updateViewportSizeForCSSViewportUnits();
1111
1112     static void convertSelectionRectsToRootView(WebCore::FrameView*, Vector<WebCore::SelectionRect>&);
1113     RefPtr<WebCore::Range> rangeForWebSelectionAtPosition(const WebCore::IntPoint&, const WebCore::VisiblePosition&, SelectionFlags&);
1114     void getAssistedNodeInformation(AssistedNodeInformation&);
1115     void platformInitializeAccessibility();
1116     void handleSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location);
1117     void completeSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location, WebCore::SyntheticClickType);
1118     void sendTapHighlightForNodeIfNecessary(uint64_t requestID, WebCore::Node*);
1119     void resetTextAutosizing();
1120     WebCore::VisiblePosition visiblePositionInFocusedNodeForPoint(const WebCore::Frame&, const WebCore::IntPoint&, bool isInteractingWithAssistedNode);
1121     RefPtr<WebCore::Range> rangeForGranularityAtPoint(WebCore::Frame&, const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithAssistedNode);
1122 #endif
1123
1124 #if PLATFORM(IOS) && ENABLE(DATA_INTERACTION)
1125     void requestStartDataInteraction(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition);
1126     void requestAdditionalItemsForDragSession(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition);
1127 #endif
1128
1129 #if !PLATFORM(COCOA) && !PLATFORM(WPE)
1130     static const char* interpretKeyEvent(const WebCore::KeyboardEvent*);
1131 #endif
1132
1133     bool performDefaultBehaviorForKeyEvent(const WebKeyboardEvent&);
1134
1135 #if PLATFORM(MAC)
1136     bool executeKeypressCommandsInternal(const Vector<WebCore::KeypressCommand>&, WebCore::KeyboardEvent*);
1137 #endif
1138
1139     bool markLayersVolatileImmediatelyIfPossible();
1140     void layerVolatilityTimerFired();
1141     void callVolatilityCompletionHandlers();
1142
1143     String sourceForFrame(WebFrame*);
1144
1145     void loadDataImpl(uint64_t navigationID, Ref<WebCore::SharedBuffer>&&, const String& MIMEType, const String& encodingName, const WebCore::URL& baseURL, const WebCore::URL& failingURL, const UserData&);
1146     void loadStringImpl(uint64_t navigationID, const String&, const String& MIMEType, const WebCore::URL& baseURL, const WebCore::URL& failingURL, const UserData&);
1147
1148     bool platformHasLocalDataForURL(const WebCore::URL&);
1149
1150     // Actions
1151     void tryClose();
1152     void platformDidReceiveLoadParameters(const LoadParameters&);
1153     void loadRequest(LoadParameters&&);
1154     void loadData(const LoadParameters&);
1155     void loadString(const LoadParameters&);
1156     void loadAlternateHTMLString(const LoadParameters&);
1157     void navigateToPDFLinkWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint);
1158     void reload(uint64_t navigationID, uint32_t reloadOptions, SandboxExtension::Handle&&);
1159     void goToBackForwardItem(uint64_t navigationID, uint64_t, WebCore::FrameLoadType, WebCore::NavigationPolicyCheck);
1160     void tryRestoreScrollPosition();
1161     void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, CallbackID);
1162     void updateIsInWindow(bool isInitialState = false);
1163     void visibilityDidChange();
1164     void setActivityState(WebCore::ActivityState::Flags, bool wantsDidUpdateActivityState, const Vector<CallbackID>& callbackIDs);
1165     void validateCommand(const String&, CallbackID);
1166     void executeEditCommand(const String&, const String&);
1167     void setEditable(bool);
1168
1169     void mouseEvent(const WebMouseEvent&);
1170     void keyEvent(const WebKeyboardEvent&);
1171
1172 #if ENABLE(IOS_TOUCH_EVENTS)
1173     void touchEventSync(const WebTouchEvent&, bool& handled);
1174     void updatePotentialTapSecurityOrigin(const WebTouchEvent&, bool wasHandled);
1175 #elif ENABLE(TOUCH_EVENTS)
1176     void touchEvent(const WebTouchEvent&);
1177 #endif
1178
1179 #if ENABLE(CONTEXT_MENUS)
1180     void contextMenuHidden() { m_isShowingContextMenu = false; }
1181     void contextMenuForKeyEvent();
1182 #endif
1183
1184     static bool scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity);
1185     static bool logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity);
1186
1187     void loadURLInFrame(WebCore::URL&&, uint64_t frameID);
1188
1189     enum class WasRestoredByAPIRequest { No, Yes };
1190     void restoreSessionInternal(const Vector<BackForwardListItemState>&, WasRestoredByAPIRequest);
1191     void restoreSession(const Vector<BackForwardListItemState>&);
1192     void didRemoveBackForwardItem(uint64_t);
1193
1194 #if ENABLE(REMOTE_INSPECTOR)
1195     void setAllowsRemoteInspection(bool);
1196     void setRemoteInspectionNameOverride(const String&);
1197 #endif
1198
1199     void setDrawsBackground(bool);
1200
1201 #if PLATFORM(COCOA)
1202     void setTopContentInsetFenced(float, IPC::Attachment);
1203 #endif
1204     void setTopContentInset(float);
1205
1206     void viewWillStartLiveResize();
1207     void viewWillEndLiveResize();
1208
1209     void getContentsAsString(CallbackID);
1210 #if ENABLE(MHTML)
1211     void getContentsAsMHTMLData(CallbackID);
1212 #endif
1213     void getMainResourceDataOfFrame(uint64_t frameID, CallbackID);
1214     void getResourceDataFromFrame(uint64_t frameID, const String& resourceURL, CallbackID);
1215     void getRenderTreeExternalRepresentation(CallbackID);
1216     void getSelectionOrContentsAsString(CallbackID);
1217     void getSelectionAsWebArchiveData(CallbackID);
1218     void getSourceForFrame(uint64_t frameID, CallbackID);
1219     void getWebArchiveOfFrame(uint64_t frameID, CallbackID);
1220     void runJavaScriptInMainFrame(const String&, bool forceUserGesture, CallbackID);
1221     void forceRepaint(CallbackID);
1222     void takeSnapshot(WebCore::IntRect snapshotRect, WebCore::IntSize bitmapSize, uint32_t options, CallbackID);
1223
1224     void preferencesDidChange(const WebPreferencesStore&);
1225     void updatePreferences(const WebPreferencesStore&);
1226     void updatePreferencesGenerated(const WebPreferencesStore&);
1227
1228 #if PLATFORM(IOS)
1229     bool parentProcessHasServiceWorkerEntitlement() const;
1230 #else
1231     bool parentProcessHasServiceWorkerEntitlement() const { return true; }
1232 #endif
1233
1234     void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, WebCore::PolicyAction, uint64_t navigationID, const DownloadID&, std::optional<WebsitePoliciesData>&&);
1235     void continueWillSubmitForm(uint64_t frameID, uint64_t listenerID);
1236     void setUserAgent(const String&);
1237     void setCustomTextEncodingName(const String&);
1238     void suspendActiveDOMObjectsAndAnimations();
1239     void resumeActiveDOMObjectsAndAnimations();
1240
1241 #if PLATFORM(COCOA)
1242     void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
1243     void performDictionaryLookupOfCurrentSelection();
1244     void performDictionaryLookupForRange(WebCore::Frame&, WebCore::Range&, NSDictionary *options, WebCore::TextIndicatorPresentationTransition);
1245     WebCore::DictionaryPopupInfo dictionaryPopupInfoForRange(WebCore::Frame&, WebCore::Range&, NSDictionary *options, WebCore::TextIndicatorPresentationTransition);
1246 #if ENABLE(PDFKIT_PLUGIN)
1247     WebCore::DictionaryPopupInfo dictionaryPopupInfoForSelectionInPDFPlugin(PDFSelection *, PDFPlugin&, NSDictionary *options, WebCore::TextIndicatorPresentationTransition);
1248 #endif
1249
1250     void windowAndViewFramesChanged(const WebCore::FloatRect& windowFrameInScreenCoordinates, const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates, const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
1251
1252     RetainPtr<PDFDocument> pdfDocumentForPrintingFrame(WebCore::Frame*);
1253     void computePagesForPrintingPDFDocument(uint64_t frameID, const PrintInfo&, Vector<WebCore::IntRect>& resultPageRects);
1254     void drawPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, const WebCore::IntRect&);
1255     void drawPagesToPDFFromPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, uint32_t first, uint32_t count);
1256 #endif
1257
1258     void setMainFrameIsScrollable(bool);
1259
1260     void unapplyEditCommand(uint64_t commandID);
1261     void reapplyEditCommand(uint64_t commandID);
1262     void didRemoveEditCommand(uint64_t commandID);
1263
1264     void findString(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1265     void findStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1266     void getImageForFindMatch(uint32_t matchIndex);
1267     void selectFindMatch(uint32_t matchIndex);
1268     void hideFindUI();
1269     void countStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1270
1271 #if USE(COORDINATED_GRAPHICS)
1272     void sendViewportAttributesChanged(const WebCore::ViewportArguments&);
1273 #endif
1274
1275     void didChangeSelectedIndexForActivePopupMenu(int32_t newIndex);
1276     void setTextForActivePopupMenu(int32_t index);
1277
1278 #if PLATFORM(GTK)
1279     void failedToShowPopupMenu();
1280 #endif
1281
1282     void didChooseFilesForOpenPanel(const Vector<String>&);
1283     void didCancelForOpenPanel();
1284
1285 #if PLATFORM(IOS)
1286     void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const IPC::DataReference& iconData);
1287 #endif
1288
1289 #if ENABLE(SANDBOX_EXTENSIONS)
1290     void extendSandboxForFilesFromOpenPanel(SandboxExtension::HandleArray&&);
1291 #endif
1292
1293     void didReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed);
1294
1295     void didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed);
1296
1297 #if ENABLE(MEDIA_STREAM)
1298     void userMediaAccessWasGranted(uint64_t userMediaID, WebCore::CaptureDevice&& audioDeviceUID, WebCore::CaptureDevice&& videoDeviceUID, String&& mediaDeviceIdentifierHashSalt);
1299     void userMediaAccessWasDenied(uint64_t userMediaID, uint64_t reason, String&& invalidConstraint);
1300
1301     void didCompleteMediaDeviceEnumeration(uint64_t userMediaID, const Vector<WebCore::CaptureDevice>& devices, String&& deviceIdentifierHashSalt, bool originHasPersistentAccess);
1302 #endif
1303
1304 #if ENABLE(MEDIA_STREAM) && ENABLE(SANDBOX_EXTENSIONS)
1305     void grantUserMediaDeviceSandboxExtensions(MediaDeviceSandboxExtensions&&);
1306     void revokeUserMediaDeviceSandboxExtensions(const Vector<String>&);
1307 #endif
1308
1309 #if ENABLE(WEB_RTC)
1310     void disableICECandidateFiltering();
1311     void enableICECandidateFiltering();
1312 #endif
1313
1314 #if ENABLE(WEB_RTC) && USE(LIBWEBRTC)
1315     void disableEnumeratingAllNetworkInterfaces();
1316     void enableEnumeratingAllNetworkInterfaces();
1317 #endif
1318
1319     void advanceToNextMisspelling(bool startBeforeSelection);
1320     void changeSpellingToWord(const String& word);
1321
1322 #if USE(APPKIT)
1323     void uppercaseWord();
1324     void lowercaseWord();
1325     void capitalizeWord();
1326 #endif
1327
1328 #if ENABLE(CONTEXT_MENUS)
1329     void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&);
1330 #endif
1331
1332     void changeSelectedIndex(int32_t index);
1333     void setCanStartMediaTimerFired();
1334
1335     static bool platformCanHandleRequest(const WebCore::ResourceRequest&);
1336
1337     static PluginView* focusedPluginViewForFrame(WebCore::Frame&);
1338
1339     static RefPtr<WebCore::Range> rangeFromEditingRange(WebCore::Frame&, const EditingRange&, EditingRangeIsRelativeTo = EditingRangeIsRelativeTo::EditableRoot);
1340
1341     void reportUsedFeatures();
1342
1343     void updateWebsitePolicies(WebsitePoliciesData&&);
1344
1345 #if PLATFORM(MAC)
1346     void performImmediateActionHitTestAtLocation(WebCore::FloatPoint);
1347     std::tuple<RefPtr<WebCore::Range>, NSDictionary *> lookupTextAtLocation(WebCore::FloatPoint);
1348     void immediateActionDidUpdate();
1349     void immediateActionDidCancel();
1350     void immediateActionDidComplete();
1351     void setFont(const String& fontFamily, double fontSize, uint64_t fontTraits);
1352
1353     void dataDetectorsDidPresentUI(WebCore::PageOverlay::PageOverlayID);
1354     void dataDetectorsDidChangeUI(WebCore::PageOverlay::PageOverlayID);
1355     void dataDetectorsDidHideUI(WebCore::PageOverlay::PageOverlayID);
1356
1357     void handleAcceptedCandidate(WebCore::TextCheckingResult);
1358 #endif
1359
1360 #if PLATFORM(COCOA)
1361     void requestActiveNowPlayingSessionInfo(CallbackID);
1362 #endif
1363
1364     void setShouldDispatchFakeMouseMoveEvents(bool dispatch) { m_shouldDispatchFakeMouseMoveEvents = dispatch; }
1365
1366 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
1367     void playbackTargetSelected(uint64_t, const WebCore::MediaPlaybackTargetContext& outputDevice) const;
1368     void playbackTargetAvailabilityDidChange(uint64_t, bool);
1369     void setShouldPlayToPlaybackTarget(uint64_t, bool);
1370 #endif
1371
1372     void clearWheelEventTestTrigger();
1373
1374     void setShouldScaleViewToFitDocument(bool);
1375
1376     void pageStoppedScrolling();
1377
1378 #if ENABLE(VIDEO) && USE(GSTREAMER)
1379     void didEndRequestInstallMissingMediaPlugins(uint32_t result);
1380 #endif
1381
1382     void setResourceCachingDisabled(bool);
1383     void setUserInterfaceLayoutDirection(uint32_t);
1384
1385     bool canPluginHandleResponse(const WebCore::ResourceResponse&);
1386
1387 #if USE(QUICK_LOOK)
1388     void didReceivePasswordForQuickLookDocument(const String&);
1389 #endif
1390
1391     void frameBecameRemote(uint64_t frameID, WebCore::GlobalFrameIdentifier&& remoteFrameIdentifier, WebCore::GlobalWindowIdentifier&& remoteWindowIdentifier);
1392
1393     void registerURLSchemeHandler(uint64_t identifier, const String& scheme);
1394
1395     void urlSchemeTaskDidPerformRedirection(uint64_t handlerIdentifier, uint64_t taskIdentifier, WebCore::ResourceResponse&&, WebCore::ResourceRequest&&);
1396     void urlSchemeTaskDidReceiveResponse(uint64_t handlerIdentifier, uint64_t taskIdentifier, const WebCore::ResourceResponse&);
1397     void urlSchemeTaskDidReceiveData(uint64_t handlerIdentifier, uint64_t taskIdentifier, const IPC::DataReference&);
1398     void urlSchemeTaskDidComplete(uint64_t handlerIdentifier, uint64_t taskIdentifier, const WebCore::ResourceError&);
1399
1400     void setIsSuspended(bool);
1401
1402     RefPtr<WebImage> snapshotAtSize(const WebCore::IntRect&, const WebCore::IntSize& bitmapSize, SnapshotOptions);
1403     RefPtr<WebImage> snapshotNode(WebCore::Node&, SnapshotOptions, unsigned maximumPixelCount = std::numeric_limits<unsigned>::max());
1404 #if USE(CF)
1405     RetainPtr<CFDataRef> pdfSnapshotAtSize(const WebCore::IntRect&, const WebCore::IntSize& bitmapSize, SnapshotOptions);
1406 #endif
1407
1408 #if ENABLE(ATTACHMENT_ELEMENT)
1409     RefPtr<WebCore::HTMLAttachmentElement> attachmentElementWithIdentifier(const String& identifier) const;
1410 #endif
1411
1412     uint64_t m_pageID;
1413
1414     std::unique_ptr<WebCore::Page> m_page;
1415     RefPtr<WebFrame> m_mainFrame;
1416     RefPtr<InjectedBundleBackForwardList> m_backForwardList;
1417
1418     RefPtr<WebPageGroupProxy> m_pageGroup;
1419
1420     String m_userAgent;
1421
1422     WebCore::IntSize m_viewSize;
1423     std::unique_ptr<DrawingArea> m_drawingArea;
1424
1425     HashSet<PluginView*> m_pluginViews;
1426     bool m_hasSeenPlugin { false };
1427
1428     HashMap<uint64_t, RefPtr<WebCore::TextCheckingRequest>> m_pendingTextCheckingRequestMap;
1429
1430     bool m_useFixedLayout { false };
1431     bool m_drawsBackground { true };
1432
1433     WebCore::Color m_underlayColor;
1434
1435     bool m_isInRedo { false };
1436     bool m_isClosed { false };
1437     bool m_tabToLinks { false };
1438     
1439     bool m_asynchronousPluginInitializationEnabled { false };
1440     bool m_asynchronousPluginInitializationEnabledForAllPlugins { false };
1441     bool m_artificialPluginInitializationDelayEnabled { false };
1442     bool m_scrollingPerformanceLoggingEnabled { false };
1443     bool m_mainFrameIsScrollable { true };
1444
1445     bool m_alwaysShowsHorizontalScroller { false };
1446     bool m_alwaysShowsVerticalScroller { false };
1447
1448 #if PLATFORM(IOS)
1449     bool m_ignoreViewportScalingConstraints { false };
1450 #endif
1451
1452 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
1453     bool m_readyToFindPrimarySnapshottedPlugin { false };
1454     bool m_didFindPrimarySnapshottedPlugin { false };
1455     unsigned m_numberOfPrimarySnapshotDetectionAttempts { 0 };
1456     String m_primaryPlugInPageOrigin;
1457     String m_primaryPlugInOrigin;
1458     String m_primaryPlugInMimeType;
1459     RunLoop::Timer<WebPage> m_determinePrimarySnapshottedPlugInTimer;
1460 #endif
1461
1462     // The layer hosting mode.
1463     LayerHostingMode m_layerHostingMode;
1464
1465 #if PLATFORM(COCOA)
1466     bool m_pdfPluginEnabled { false };
1467     bool m_hasCachedWindowFrame { false };
1468
1469     // The frame of the containing window in screen coordinates.
1470     WebCore::FloatRect m_windowFrameInScreenCoordinates;
1471
1472     // The frame of the containing window in unflipped screen coordinates.
1473     WebCore::FloatRect m_windowFrameInUnflippedScreenCoordinates;
1474
1475     // The frame of the view in window coordinates.
1476     WebCore::FloatRect m_viewFrameInWindowCoordinates;
1477
1478     // The accessibility position of the view.
1479     WebCore::FloatPoint m_accessibilityPosition;
1480     
1481     RetainPtr<WKAccessibilityWebPageObject> m_mockAccessibilityElement;
1482
1483     UniqueRef<ViewGestureGeometryCollector> m_viewGestureGeometryCollector;
1484
1485     RetainPtr<NSDictionary> m_dataDetectionContext;
1486 #endif
1487
1488 #if HAVE(ACCESSIBILITY) && PLATFORM(GTK)
1489     GRefPtr<WebPageAccessibilityObject> m_accessibilityObject;
1490 #endif
1491
1492 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
1493     // Our view's window in the UI process.
1494     uint64_t m_nativeWindowHandle { 0 };
1495 #endif
1496
1497 #if !PLATFORM(IOS)
1498     RefPtr<PageBanner> m_headerBanner;
1499     RefPtr<PageBanner> m_footerBanner;
1500 #endif
1501
1502     RunLoop::Timer<WebPage> m_setCanStartMediaTimer;
1503     bool m_mayStartMediaWhenInWindow { false };
1504
1505     HashMap<uint64_t, RefPtr<WebUndoStep>> m_undoStepMap;
1506
1507 #if ENABLE(CONTEXT_MENUS)
1508     std::unique_ptr<API::InjectedBundle::PageContextMenuClient> m_contextMenuClient;
1509 #endif
1510     std::unique_ptr<API::InjectedBundle::EditorClient> m_editorClient;
1511     std::unique_ptr<API::InjectedBundle::FormClient> m_formClient;
1512     std::unique_ptr<API::InjectedBundle::PageLoaderClient> m_loaderClient;
1513     InjectedBundlePagePolicyClient m_policyClient;
1514     std::unique_ptr<API::InjectedBundle::ResourceLoadClient> m_resourceLoadClient;
1515     std::unique_ptr<API::InjectedBundle::PageUIClient> m_uiClient;
1516 #if ENABLE(FULLSCREEN_API)
1517     InjectedBundlePageFullScreenClient m_fullScreenClient;
1518 #endif
1519
1520     UniqueRef<FindController> m_findController;
1521
1522     RefPtr<WebInspector> m_inspector;
1523     RefPtr<WebInspectorUI> m_inspectorUI;
1524     RefPtr<RemoteWebInspectorUI> m_remoteInspectorUI;
1525
1526 #if (PLATFORM(IOS) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
1527     RefPtr<PlaybackSessionManager> m_playbackSessionManager;
1528     RefPtr<VideoFullscreenManager> m_videoFullscreenManager;
1529 #endif
1530
1531 #if PLATFORM(IOS)
1532     bool m_allowsMediaDocumentInlinePlayback { false };
1533 #endif
1534
1535 #if ENABLE(FULLSCREEN_API)
1536     RefPtr<WebFullScreenManager> m_fullScreenManager;
1537 #endif
1538
1539     RefPtr<WebPopupMenu> m_activePopupMenu;
1540
1541 #if ENABLE(CONTEXT_MENUS)
1542     RefPtr<WebContextMenu> m_contextMenu;
1543 #endif
1544
1545 #if ENABLE(INPUT_TYPE_COLOR)
1546     WebColorChooser* m_activeColorChooser { nullptr };
1547 #endif
1548
1549     RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener;
1550     RefPtr<NotificationPermissionRequestManager> m_notificationPermissionRequestManager;
1551
1552     Ref<WebUserContentController> m_userContentController;
1553
1554 #if ENABLE(GEOLOCATION)
1555     UniqueRef<GeolocationPermissionRequestManager> m_geolocationPermissionRequestManager;
1556 #endif
1557
1558 #if ENABLE(MEDIA_STREAM)
1559     std::unique_ptr<UserMediaPermissionRequestManager> m_userMediaPermissionRequestManager;
1560 #endif
1561
1562     std::unique_ptr<WebCore::PrintContext> m_printContext;
1563 #if PLATFORM(GTK)
1564     RefPtr<WebPrintOperationGtk> m_printOperation;
1565 #endif
1566
1567     SandboxExtensionTracker m_sandboxExtensionTracker;
1568
1569     RefPtr<SandboxExtension> m_pendingDropSandboxExtension;
1570     Vector<RefPtr<SandboxExtension>> m_pendingDropExtensionsForFileUpload;
1571
1572     PAL::HysteresisActivity m_pageScrolledHysteresis;
1573
1574     bool m_canRunBeforeUnloadConfirmPanel { false };
1575
1576     bool m_canRunModal { false };
1577     bool m_isRunningModal { false };
1578
1579 #if ENABLE(DRAG_SUPPORT)
1580     bool m_isStartingDrag { false };
1581 #endif
1582
1583     bool m_cachedMainFrameIsPinnedToLeftSide { true };
1584     bool m_cachedMainFrameIsPinnedToRightSide { true };
1585     bool m_cachedMainFrameIsPinnedToTopSide { true };
1586     bool m_cachedMainFrameIsPinnedToBottomSide { true };
1587     bool m_canShortCircuitHorizontalWheelEvents { false };
1588     bool m_hasWheelEventHandlers { false };
1589
1590     unsigned m_cachedPageCount { 0 };
1591
1592     HashSet<unsigned long> m_trackedNetworkResourceRequestIdentifiers;
1593
1594     WebCore::IntSize m_minimumLayoutSize;
1595     bool m_autoSizingShouldExpandToViewHeight { false };
1596     std::optional<WebCore::IntSize> m_viewportSizeForCSSViewportUnits;
1597
1598     bool m_userIsInteracting { false };
1599     bool m_isAssistingNodeDueToUserInteraction { false };
1600     bool m_hasEverFocusedElementDueToUserInteractionSincePageTransition { false };
1601     bool m_needsHiddenContentEditableQuirk { false };
1602     bool m_needsPlainTextQuirk { false };
1603     bool m_changingActivityState { false };
1604
1605 #if ENABLE(CONTEXT_MENUS)
1606     bool m_isShowingContextMenu { false };
1607 #endif
1608
1609     RefPtr<WebCore::Node> m_assistedNode;
1610     bool m_hasPendingBlurNotification { false };
1611     bool m_hasPendingEditorStateUpdate { false };
1612     
1613 #if PLATFORM(IOS)
1614     RefPtr<WebCore::Range> m_currentWordRange;
1615     RefPtr<WebCore::Node> m_interactionNode;
1616     WebCore::IntPoint m_lastInteractionLocation;
1617     
1618     enum SelectionAnchor { Start, End };
1619     SelectionAnchor m_selectionAnchor { Start };
1620
1621     RefPtr<WebCore::Node> m_potentialTapNode;
1622     WebCore::FloatPoint m_potentialTapLocation;
1623     RefPtr<WebCore::SecurityOrigin> m_potentialTapSecurityOrigin;
1624
1625     WebCore::ViewportConfiguration m_viewportConfiguration;
1626     bool m_hasReceivedVisibleContentRectsAfterDidCommitLoad { false };
1627     bool m_scaleWasSetByUIProcess { false };
1628     bool m_userHasChangedPageScaleFactor { false };
1629     bool m_hasStablePageScaleFactor { true };
1630     bool m_useTestingViewportConfiguration { false };
1631     bool m_isInStableState { true };
1632     bool m_forceAlwaysUserScalable { false };
1633     MonotonicTime m_oldestNonStableUpdateVisibleContentRectsTimestamp;
1634     Seconds m_estimatedLatency { 0 };
1635     WebCore::FloatSize m_screenSize;
1636     WebCore::FloatSize m_availableScreenSize;
1637     WebCore::FloatSize m_overrideScreenSize;
1638     RefPtr<WebCore::Range> m_currentBlockSelection;
1639     WebCore::IntRect m_blockRectForTextSelection;
1640
1641     RefPtr<WebCore::Range> m_initialSelection;
1642     WebCore::VisibleSelection m_storedSelectionForAccessibility { WebCore::VisibleSelection() };
1643     WebCore::IntSize m_blockSelectionDesiredSize;
1644     WebCore::FloatSize m_maximumUnobscuredSize;
1645     int32_t m_deviceOrientation { 0 };
1646     bool m_inDynamicSizeUpdate { false };
1647     HashMap<std::pair<WebCore::IntSize, double>, WebCore::IntPoint> m_dynamicSizeUpdateHistory;
1648     RefPtr<WebCore::Node> m_pendingSyntheticClickNode;
1649     WebCore::FloatPoint m_pendingSyntheticClickLocation;
1650     WebCore::FloatRect m_previousExposedContentRect;
1651     uint64_t m_currentAssistedNodeIdentifier { 0 };
1652 #endif
1653
1654     WebCore::Timer m_layerVolatilityTimer;
1655     Vector<WTF::Function<void ()>> m_markLayersAsVolatileCompletionHandlers;
1656     bool m_isSuspendedUnderLock { false };
1657
1658     HashSet<String, ASCIICaseInsensitiveHash> m_mimeTypesWithCustomContentProviders;
1659     WebCore::Color m_backgroundColor { WebCore::Color::white };
1660
1661     HashSet<unsigned> m_activeRenderingSuppressionTokens;
1662     unsigned m_maximumRenderingSuppressionToken { 0 };
1663     
1664     WebCore::ScrollPinningBehavior m_scrollPinningBehavior { WebCore::DoNotPin };
1665     std::optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle;
1666
1667     bool m_useAsyncScrolling { false };
1668
1669     WebCore::ActivityState::Flags m_activityState;
1670
1671     bool m_processSuppressionEnabled;
1672     UserActivity m_userActivity;
1673     PAL::HysteresisActivity m_userActivityHysteresis;
1674
1675     uint64_t m_pendingNavigationID { 0 };
1676
1677 #if ENABLE(WEBGL)
1678     WebCore::WebGLLoadPolicy m_systemWebGLPolicy { WebCore::WebGLAllowCreation };
1679 #endif
1680
1681     bool m_mainFrameProgressCompleted { false };
1682     bool m_shouldDispatchFakeMouseMoveEvents { true };
1683     bool m_isEditorStateMissingPostLayoutData { false };
1684     bool m_isSelectingTextWhileInsertingAsynchronously { false };
1685
1686     enum class EditorStateIsContentEditable { No, Yes, Unset };
1687     mutable EditorStateIsContentEditable m_lastEditorStateWasContentEditable { EditorStateIsContentEditable::Unset };
1688
1689 #if PLATFORM(GTK)
1690     bool m_inputMethodEnabled { false };
1691 #endif
1692
1693 #if ENABLE(VIDEO) && USE(GSTREAMER)
1694     RefPtr<WebCore::MediaPlayerRequestInstallMissingPluginsCallback> m_installMediaPluginsCallback;
1695 #endif
1696
1697 #if USE(OS_STATE)
1698     WallTime m_loadCommitTime;
1699 #endif
1700
1701     WebCore::UserInterfaceLayoutDirection m_userInterfaceLayoutDirection { WebCore::UserInterfaceLayoutDirection::LTR };
1702
1703     const String m_overrideContentSecurityPolicy;
1704     const std::optional<double> m_cpuLimit;
1705
1706     HashMap<String, RefPtr<WebURLSchemeHandlerProxy>> m_schemeToURLSchemeHandlerProxyMap;
1707     HashMap<uint64_t, WebURLSchemeHandlerProxy*> m_identifierToURLSchemeHandlerProxyMap;
1708
1709     HashMap<uint64_t, WTF::Function<void (bool granted)>> m_storageAccessResponseCallbackMap;
1710
1711 #if ENABLE(APPLICATION_MANIFEST)
1712     HashMap<uint64_t, uint64_t> m_applicationManifestFetchCallbackMap;
1713 #endif
1714
1715 #if ENABLE(WEB_AUTHN)
1716     std::unique_ptr<WebCredentialsMessenger> m_credentialsMessenger;
1717 #endif
1718
1719     bool m_isSuspended { false };
1720 };
1721
1722 } // namespace WebKit
1723