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