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