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