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