Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Local...
[WebKit-https.git] / Source / WebKit / UIProcess / WebPageProxy.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 "APIObject.h"
29 #include "AssistedNodeInformation.h"
30 #include "AutoCorrectionCallback.h"
31 #include "Connection.h"
32 #include "ContextMenuContextData.h"
33 #include "DownloadID.h"
34 #include "DragControllerAction.h"
35 #include "EditingRange.h"
36 #include "EditorState.h"
37 #include "GeolocationPermissionRequestManagerProxy.h"
38 #include "HiddenPageThrottlingAutoIncreasesCounter.h"
39 #include "LayerTreeContext.h"
40 #include "MessageSender.h"
41 #include "NotificationPermissionRequestManagerProxy.h"
42 #include "PageLoadState.h"
43 #include "ProcessTerminationReason.h"
44 #include "ProcessThrottler.h"
45 #include "SandboxExtension.h"
46 #include "ShareSheetCallbackID.h"
47 #include "ShareableBitmap.h"
48 #include "SuspendedPageProxy.h"
49 #include "SystemPreviewController.h"
50 #include "UserMediaPermissionRequestManagerProxy.h"
51 #include "VisibleContentRectUpdateInfo.h"
52 #include "VisibleWebPageCounter.h"
53 #include "WKBase.h"
54 #include "WKPagePrivate.h"
55 #include "WebColorPicker.h"
56 #include "WebContextMenuItemData.h"
57 #include "WebCoreArgumentCoders.h"
58 #include "WebDataListSuggestionsDropdown.h"
59 #include "WebFrameProxy.h"
60 #include "WebPageCreationParameters.h"
61 #include "WebPageDiagnosticLoggingClient.h"
62 #include "WebPageInjectedBundleClient.h"
63 #include "WebPaymentCoordinatorProxy.h"
64 #include "WebPreferences.h"
65 #include "WebPageProxyMessages.h"
66 #include "WebPopupMenuProxy.h"
67 #include "WebProcessLifetimeTracker.h"
68 #include "WebsitePoliciesData.h"
69 #include <WebCore/ActivityState.h>
70 #include <WebCore/AutoplayEvent.h>
71 #include <WebCore/Color.h>
72 #include <WebCore/DragActions.h>
73 #include <WebCore/EventTrackingRegions.h>
74 #include <WebCore/FontAttributes.h>
75 #include <WebCore/FrameLoaderTypes.h>
76 #include <WebCore/FrameView.h> // FIXME: Move LayoutViewportConstraint to its own file and stop including this.
77 #include <WebCore/LayoutPoint.h>
78 #include <WebCore/LayoutSize.h>
79 #include <WebCore/MediaPlaybackTargetContext.h>
80 #include <WebCore/MediaProducer.h>
81 #include <WebCore/PlatformScreen.h>
82 #include <WebCore/ScrollTypes.h>
83 #include <WebCore/SearchPopupMenu.h>
84 #include <WebCore/TextChecking.h>
85 #include <WebCore/TextGranularity.h>
86 #include <WebCore/URL.h>
87 #include <WebCore/UserInterfaceLayoutDirection.h>
88 #include <memory>
89 #include <wtf/CompletionHandler.h>
90 #include <wtf/HashMap.h>
91 #include <wtf/HashSet.h>
92 #include <wtf/MonotonicTime.h>
93 #include <wtf/Optional.h>
94 #include <wtf/ProcessID.h>
95 #include <wtf/Ref.h>
96 #include <wtf/RefPtr.h>
97 #include <wtf/RunLoop.h>
98 #include <wtf/UniqueRef.h>
99 #include <wtf/Vector.h>
100 #include <wtf/text/WTFString.h>
101
102 OBJC_CLASS NSView;
103 OBJC_CLASS _WKRemoteObjectRegistry;
104
105 #if ENABLE(DRAG_SUPPORT)
106 #include <WebCore/DragActions.h>
107 #endif
108
109 #if ENABLE(TOUCH_EVENTS)
110 #include "NativeWebTouchEvent.h"
111 #endif
112
113 #if PLATFORM(COCOA)
114 #include "DynamicViewportSizeUpdate.h"
115 #include "LayerRepresentation.h"
116 #include "TouchBarMenuData.h"
117 #include "TouchBarMenuItemData.h"
118 #endif
119
120 #if PLATFORM(GTK)
121 #include "ArgumentCodersGtk.h"
122 #endif
123
124 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
125 #include <WebCore/MediaPlaybackTargetPicker.h>
126 #include <WebCore/WebMediaSessionManagerClient.h>
127 #endif
128
129 #if ENABLE(MEDIA_SESSION)
130 namespace WebCore {
131 class MediaSessionMetadata;
132 }
133 #endif
134
135 namespace API {
136 class Attachment;
137 class ContextMenuClient;
138 class FindClient;
139 class FindMatchesClient;
140 class FormClient;
141 class FullscreenClient;
142 class HistoryClient;
143 class IconLoadingClient;
144 class LoaderClient;
145 class Navigation;
146 class NavigationClient;
147 class PolicyClient;
148 class UIClient;
149 class URLRequest;
150 }
151
152 namespace IPC {
153 class Decoder;
154 class Connection;
155 }
156
157 namespace WebCore {
158 class AuthenticationChallenge;
159 class CertificateInfo;
160 class Cursor;
161 class DragData;
162 class FloatRect;
163 class FontAttributeChanges;
164 class FontChanges;
165 class GraphicsLayer;
166 class IntSize;
167 class ProtectionSpace;
168 class RunLoopObserver;
169 class SharedBuffer;
170 class TextIndicator;
171 class ValidationBubble;
172
173 enum SelectionDirection : uint8_t;
174
175 enum class AutoplayEvent : uint8_t;
176 enum class LockBackForwardList : bool;
177 enum class HasInsecureContent : bool;
178 enum class NotificationDirection : uint8_t;
179 enum class ShouldSample : bool;
180 enum class ShouldTreatAsContinuingLoad : bool;
181
182 struct ApplicationManifest;
183 struct BackForwardItemIdentifier;
184 struct DataListSuggestionInformation;
185 struct DictionaryPopupInfo;
186 struct ExceptionDetails;
187 struct FileChooserSettings;
188 struct GlobalWindowIdentifier;
189 struct MediaStreamRequest;
190 struct PrewarmInformation;
191 struct SecurityOriginData;
192 struct ShareData;
193 struct TextAlternativeWithRange;
194 struct TextCheckingResult;
195 struct ViewportAttributes;
196 struct WindowFeatures;
197
198 template <typename> class RectEdges;
199 using FloatBoxExtent = RectEdges<float>;
200 }
201
202 #if PLATFORM(GTK)
203 typedef GtkWidget* PlatformWidget;
204 #endif
205
206 #if PLATFORM(WPE)
207 struct wpe_view_backend;
208 #endif
209
210 #if PLATFORM(GTK) || PLATFORM(WPE)
211 typedef struct OpaqueJSContext* JSGlobalContextRef;
212 #endif
213
214 #if PLATFORM(WIN)
215 typedef HWND PlatformWidget;
216 #endif
217
218 namespace WebKit {
219 class DrawingAreaProxy;
220 class NativeWebGestureEvent;
221 class NativeWebKeyboardEvent;
222 class NativeWebMouseEvent;
223 class NativeWebWheelEvent;
224 class PageClient;
225 class RemoteLayerTreeHost;
226 class RemoteLayerTreeScrollingPerformanceData;
227 class RemoteLayerTreeTransaction;
228 class RemoteScrollingCoordinatorProxy;
229 class SecKeyProxyStore;
230 class SharedBufferDataReference;
231 class UserData;
232 class ViewSnapshot;
233 class VisitedLinkStore;
234 class WebBackForwardList;
235 class WebBackForwardListItem;
236 class WebContextMenuProxy;
237 class WebEditCommandProxy;
238 class WebFullScreenManagerProxy;
239 class PlaybackSessionManagerProxy;
240 class WebNavigationState;
241 class VideoFullscreenManagerProxy;
242 class WebAuthenticatorCoordinatorProxy;
243 class WebKeyboardEvent;
244 class WebURLSchemeHandler;
245 class WebMouseEvent;
246 class WebOpenPanelResultListenerProxy;
247 class WebPageDebuggable;
248 class WebPageGroup;
249 class WebPageInspectorController;
250 class WebProcessProxy;
251 class WebUserContentControllerProxy;
252 class WebWheelEvent;
253 class WebsiteDataStore;
254 class GamepadData;
255
256 struct AttributedString;
257 struct ColorSpaceData;
258 struct EditingRange;
259 struct EditorState;
260 struct FrameInfoData;
261 struct InteractionInformationRequest;
262 struct LoadParameters;
263 struct PlatformPopupMenuData;
264 struct PrintInfo;
265 struct WebPopupItem;
266 struct URLSchemeTaskParameters;
267
268 enum class ProcessSwapRequestedByClient;
269 enum class UndoOrRedo : bool;
270
271 #if USE(QUICK_LOOK)
272 class QuickLookDocumentData;
273 #endif
274
275 typedef GenericCallback<uint64_t> UnsignedCallback;
276 typedef GenericCallback<EditingRange> EditingRangeCallback;
277 typedef GenericCallback<const String&> StringCallback;
278 typedef GenericCallback<API::SerializedScriptValue*, bool, const WebCore::ExceptionDetails&> ScriptValueCallback;
279 typedef GenericCallback<const WebCore::FontAttributes&> FontAttributesCallback;
280
281 #if PLATFORM(GTK)
282 typedef GenericCallback<API::Error*> PrintFinishedCallback;
283 #endif
284
285 #if ENABLE(TOUCH_EVENTS)
286 struct QueuedTouchEvents {
287     QueuedTouchEvents(const NativeWebTouchEvent& event)
288         : forwardedEvent(event)
289     {
290     }
291     NativeWebTouchEvent forwardedEvent;
292     Vector<NativeWebTouchEvent> deferredTouchEvents;
293 };
294 #endif
295
296 typedef GenericCallback<const String&, bool, int32_t> ValidateCommandCallback;
297 typedef GenericCallback<const WebCore::IntRect&, const EditingRange&> RectForCharacterRangeCallback;
298
299 #if ENABLE(APPLICATION_MANIFEST)
300 typedef GenericCallback<const std::optional<WebCore::ApplicationManifest>&> ApplicationManifestCallback;
301 #endif
302
303 #if PLATFORM(MAC)
304 typedef GenericCallback<const AttributedString&, const EditingRange&> AttributedStringForCharacterRangeCallback;
305 typedef GenericCallback<const String&, double, bool> FontAtSelectionCallback;
306 #endif
307
308 #if PLATFORM(IOS_FAMILY)
309 typedef GenericCallback<const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t> GestureCallback;
310 typedef GenericCallback<const WebCore::IntPoint&, uint32_t, uint32_t> TouchesCallback;
311 typedef GenericCallback<const Vector<WebCore::SelectionRect>&> SelectionRectsCallback;
312 typedef GenericCallback<const AssistedNodeInformation&> AssistedNodeInformationCallback;
313 struct NodeAssistanceArguments {
314     AssistedNodeInformation m_nodeInformation;
315     bool m_userIsInteracting;
316     bool m_blurPreviousNode;
317     bool m_changingActivityState;
318     RefPtr<API::Object> m_userData;
319 };
320
321 using DrawToPDFCallback = GenericCallback<const IPC::DataReference&>;
322 #endif
323
324 #if PLATFORM(COCOA)
325 typedef GenericCallback<const WTF::MachSendRight&> MachSendRightCallback;
326 typedef GenericCallback<bool, bool, String, double, double, uint64_t> NowPlayingInfoCallback;
327 #endif
328
329 using SpellDocumentTag = int64_t;
330
331 class WebPageProxy : public API::ObjectImpl<API::Object::Type::Page>
332 #if ENABLE(INPUT_TYPE_COLOR)
333     , public WebColorPicker::Client
334 #endif
335 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
336     , public WebCore::WebMediaSessionManagerClient
337 #endif
338     , public WebPopupMenuProxy::Client
339     , public IPC::MessageReceiver
340     , public IPC::MessageSender
341     , public CanMakeWeakPtr<WebPageProxy> {
342 public:
343     static Ref<WebPageProxy> create(PageClient&, WebProcessProxy&, uint64_t pageID, Ref<API::PageConfiguration>&&);
344     virtual ~WebPageProxy();
345
346     const API::PageConfiguration& configuration() const;
347
348     uint64_t pageID() const { return m_pageID; }
349
350     PAL::SessionID sessionID() const;
351
352     WebFrameProxy* mainFrame() const { return m_mainFrame.get(); }
353     WebFrameProxy* focusedFrame() const { return m_focusedFrame.get(); }
354     WebFrameProxy* frameSetLargestFrame() const { return m_frameSetLargestFrame.get(); }
355
356     DrawingAreaProxy* drawingArea() const { return m_drawingArea.get(); }
357
358     WebNavigationState& navigationState() { return *m_navigationState.get(); }
359
360     WebsiteDataStore& websiteDataStore() { return m_websiteDataStore; }
361     void changeWebsiteDataStore(WebsiteDataStore&);
362
363 #if ENABLE(DATA_DETECTION)
364     NSArray *dataDetectionResults() { return m_dataDetectionResults.get(); }
365 #endif
366         
367 #if ENABLE(ASYNC_SCROLLING) && PLATFORM(COCOA)
368     RemoteScrollingCoordinatorProxy* scrollingCoordinatorProxy() const { return m_scrollingCoordinatorProxy.get(); }
369 #endif
370
371     WebBackForwardList& backForwardList() { return m_backForwardList; }
372
373     bool addsVisitedLinks() const { return m_addsVisitedLinks; }
374     void setAddsVisitedLinks(bool addsVisitedLinks) { m_addsVisitedLinks = addsVisitedLinks; }
375
376     void exitFullscreenImmediately();
377     void fullscreenMayReturnToInline();
378     void didEnterFullscreen();
379     void didExitFullscreen();
380
381     WebInspectorProxy* inspector() const;
382
383     void didChangeInspectorFrontendCount(unsigned count) { m_inspectorFrontendCount = count; }
384     unsigned inspectorFrontendCount() const { return m_inspectorFrontendCount; }
385
386     bool isControlledByAutomation() const { return m_controlledByAutomation; }
387     void setControlledByAutomation(bool);
388
389     WebPageInspectorController& inspectorController() { return *m_inspectorController; }
390
391 #if PLATFORM(IOS_FAMILY)
392     void showInspectorIndication();
393     void hideInspectorIndication();
394 #endif
395
396     void createInspectorTarget(const String& targetId, Inspector::InspectorTargetType);
397     void destroyInspectorTarget(const String& targetId);
398     void sendMessageToInspectorFrontend(const String& targetId, const String& message);
399
400 #if ENABLE(REMOTE_INSPECTOR)
401     void setIndicating(bool);
402     bool allowsRemoteInspection() const;
403     void setAllowsRemoteInspection(bool);
404     String remoteInspectionNameOverride() const;
405     void setRemoteInspectionNameOverride(const String&);
406     void remoteInspectorInformationDidChange();
407 #endif
408
409 #if ENABLE(FULLSCREEN_API)
410     WebFullScreenManagerProxy* fullScreenManager();
411
412     API::FullscreenClient& fullscreenClient() const { return *m_fullscreenClient; }
413     void setFullscreenClient(std::unique_ptr<API::FullscreenClient>&&);
414 #endif
415 #if (PLATFORM(IOS_FAMILY) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
416     PlaybackSessionManagerProxy* playbackSessionManager();
417     VideoFullscreenManagerProxy* videoFullscreenManager();
418 #endif
419
420 #if PLATFORM(IOS_FAMILY)
421     bool allowsMediaDocumentInlinePlayback() const;
422     void setAllowsMediaDocumentInlinePlayback(bool);
423 #endif
424
425 #if USE(SYSTEM_PREVIEW)
426     SystemPreviewController* systemPreviewController() { return m_systemPreviewController.get(); }
427 #endif
428
429 #if ENABLE(CONTEXT_MENUS)
430     API::ContextMenuClient& contextMenuClient() { return *m_contextMenuClient; }
431     void setContextMenuClient(std::unique_ptr<API::ContextMenuClient>&&);
432 #endif
433     API::FindClient& findClient() { return *m_findClient; }
434     void setFindClient(std::unique_ptr<API::FindClient>&&);
435     API::FindMatchesClient& findMatchesClient() { return *m_findMatchesClient; }
436     void setFindMatchesClient(std::unique_ptr<API::FindMatchesClient>&&);
437     API::DiagnosticLoggingClient* diagnosticLoggingClient() { return m_diagnosticLoggingClient.get(); }
438     void setDiagnosticLoggingClient(std::unique_ptr<API::DiagnosticLoggingClient>&&);
439     void setFormClient(std::unique_ptr<API::FormClient>&&);
440     void setNavigationClient(UniqueRef<API::NavigationClient>&&);
441     void setHistoryClient(UniqueRef<API::HistoryClient>&&);
442     void setLoaderClient(std::unique_ptr<API::LoaderClient>&&);
443     void setPolicyClient(std::unique_ptr<API::PolicyClient>&&);
444     void setInjectedBundleClient(const WKPageInjectedBundleClientBase*);
445     WebPageInjectedBundleClient* injectedBundleClient() { return m_injectedBundleClient.get(); }
446
447     API::UIClient& uiClient() { return *m_uiClient; }
448     void setUIClient(std::unique_ptr<API::UIClient>&&);
449
450     API::IconLoadingClient& iconLoadingClient() { return *m_iconLoadingClient; }
451     void setIconLoadingClient(std::unique_ptr<API::IconLoadingClient>&&);
452
453     enum class ShouldDelayAttachingDrawingArea { No, Yes };
454     void initializeWebPage(ShouldDelayAttachingDrawingArea = ShouldDelayAttachingDrawingArea::No);
455
456     WeakPtr<SecKeyProxyStore> secKeyProxyStore(const WebCore::AuthenticationChallenge&);
457         
458     void close();
459     bool tryClose();
460     bool isClosed() const { return m_isClosed; }
461
462     void setOpenedByDOM() { m_openedByDOM = true; }
463     bool openedByDOM() const { return m_openedByDOM; }
464
465     bool hasCommittedAnyProvisionalLoads() const { return m_hasCommittedAnyProvisionalLoads; }
466
467     void setIsUsingHighPerformanceWebGL(bool value) { m_isUsingHighPerformanceWebGL = value; }
468     bool isUsingHighPerformanceWebGL() const { return m_isUsingHighPerformanceWebGL; }
469
470     void didExceedInactiveMemoryLimitWhileActive();
471     void didExceedBackgroundCPULimitWhileInForeground();
472
473     void closePage(bool stopResponsivenessTimer);
474
475     void addPlatformLoadParameters(LoadParameters&);
476     RefPtr<API::Navigation> loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes, API::Object* userData = nullptr);
477     RefPtr<API::Navigation> loadFile(const String& fileURL, const String& resourceDirectoryURL, API::Object* userData = nullptr);
478     RefPtr<API::Navigation> loadData(const IPC::DataReference&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr);
479     void loadAlternateHTML(const IPC::DataReference&, const String& encoding, const WebCore::URL& baseURL, const WebCore::URL& unreachableURL, API::Object* userData = nullptr, bool forSafeBrowsing = false);
480     void loadWebArchiveData(API::Data*, API::Object* userData = nullptr);
481     void navigateToPDFLinkWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint);
482
483     void stopLoading();
484     RefPtr<API::Navigation> reload(OptionSet<WebCore::ReloadOption>);
485
486     RefPtr<API::Navigation> goForward();
487     RefPtr<API::Navigation> goBack();
488
489     RefPtr<API::Navigation> goToBackForwardItem(WebBackForwardListItem&);
490     void tryRestoreScrollPosition();
491     void didChangeBackForwardList(WebBackForwardListItem* addedItem, Vector<Ref<WebBackForwardListItem>>&& removed);
492     void willGoToBackForwardListItem(const WebCore::BackForwardItemIdentifier&, bool inPageCache);
493
494     bool shouldKeepCurrentBackForwardListItemInList(WebBackForwardListItem&);
495
496     bool willHandleHorizontalScrollEvents() const;
497
498     void updateWebsitePolicies(WebsitePoliciesData&&);
499
500     bool canShowMIMEType(const String& mimeType);
501
502     bool drawsBackground() const { return m_drawsBackground; }
503     void setDrawsBackground(bool);
504
505     String currentURL() const;
506
507     float topContentInset() const { return m_topContentInset; }
508     void setTopContentInset(float);
509
510     WebCore::Color underlayColor() const { return m_underlayColor; }
511     void setUnderlayColor(const WebCore::Color&);
512
513     // At this time, m_pageExtendedBackgroundColor can be set via pageExtendedBackgroundColorDidChange() which is a message
514     // from the UIProcess, or by didCommitLayerTree(). When PLATFORM(MAC) adopts UI side compositing, we should get rid of
515     // the message entirely.
516     WebCore::Color pageExtendedBackgroundColor() const { return m_pageExtendedBackgroundColor; }
517
518     void viewWillStartLiveResize();
519     void viewWillEndLiveResize();
520
521     void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, WTF::Function<void (CallbackBase::Error)>&&);
522     
523     void clearSelection();
524     void restoreSelectionInFocusedEditableElement();
525
526     PageClient& pageClient() const;
527
528     void setViewNeedsDisplay(const WebCore::Region&);
529     void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin, bool isProgrammaticScroll);
530     
531     WebCore::FloatPoint viewScrollPosition() const;
532
533     void setDelegatesScrolling(bool delegatesScrolling) { m_delegatesScrolling = delegatesScrolling; }
534     bool delegatesScrolling() const { return m_delegatesScrolling; }
535
536     enum class ActivityStateChangeDispatchMode { Deferrable, Immediate };
537     void activityStateDidChange(OptionSet<WebCore::ActivityState::Flag> mayHaveChanged, bool wantsSynchronousReply = false, ActivityStateChangeDispatchMode = ActivityStateChangeDispatchMode::Deferrable);
538     bool isInWindow() const { return m_activityState.contains(WebCore::ActivityState::IsInWindow); }
539     void waitForDidUpdateActivityState(ActivityStateChangeID);
540     void didUpdateActivityState() { m_waitingForDidUpdateActivityState = false; }
541
542     void layerHostingModeDidChange();
543
544     WebCore::IntSize viewSize() const;
545     bool isViewVisible() const { return m_activityState.contains(WebCore::ActivityState::IsVisible); }
546     bool isViewFocused() const { return m_activityState.contains(WebCore::ActivityState::IsFocused); }
547     bool isViewWindowActive() const { return m_activityState.contains(WebCore::ActivityState::WindowIsActive); }
548
549     void addMIMETypeWithCustomContentProvider(const String& mimeType);
550
551     void executeEditCommand(const String& commandName, const String& argument = String());
552     void validateCommand(const String& commandName, WTF::Function<void (const String&, bool, int32_t, CallbackBase::Error)>&&);
553
554     const EditorState& editorState() const { return m_editorState; }
555     bool canDelete() const { return hasSelectedRange() && isContentEditable(); }
556     bool hasSelectedRange() const { return m_editorState.selectionIsRange; }
557     bool isContentEditable() const { return m_editorState.isContentEditable; }
558
559     void increaseListLevel();
560     void decreaseListLevel();
561     void changeListType();
562
563     std::optional<WebCore::FontAttributes> cachedFontAttributesAtSelectionStart() const { return m_cachedFontAttributesAtSelectionStart; }
564
565 #if PLATFORM(COCOA)
566     const TouchBarMenuData& touchBarMenuData() const { return m_touchBarMenuData; }
567 #endif
568
569     bool maintainsInactiveSelection() const;
570     void setMaintainsInactiveSelection(bool);
571     void setEditable(bool);
572     bool isEditable() const { return m_isEditable; }
573
574     void activateMediaStreamCaptureInPage();
575     bool isMediaStreamCaptureMuted() const { return m_mutedState & WebCore::MediaProducer::CaptureDevicesAreMuted; }
576     void setMediaStreamCaptureMuted(bool);
577     void executeEditCommand(const String& commandName, const String& argument, WTF::Function<void(CallbackBase::Error)>&&);
578         
579     void requestFontAttributesAtSelectionStart(Function<void(const WebCore::FontAttributes&, CallbackBase::Error)>&&);
580     void fontAttributesCallback(const WebCore::FontAttributes&, CallbackID);
581
582 #if PLATFORM(IOS_FAMILY)
583     double displayedContentScale() const { return m_lastVisibleContentRectUpdate.scale(); }
584     const WebCore::FloatRect& exposedContentRect() const { return m_lastVisibleContentRectUpdate.exposedContentRect(); }
585     const WebCore::FloatRect& unobscuredContentRect() const { return m_lastVisibleContentRectUpdate.unobscuredContentRect(); }
586     bool inStableState() const { return m_lastVisibleContentRectUpdate.inStableState(); }
587     const WebCore::FloatRect& unobscuredContentRectRespectingInputViewBounds() const { return m_lastVisibleContentRectUpdate.unobscuredContentRectRespectingInputViewBounds(); }
588     // When visual viewports are enabled, this is the layout viewport rect.
589     const WebCore::FloatRect& customFixedPositionRect() const { return m_lastVisibleContentRectUpdate.customFixedPositionRect(); }
590
591     void updateVisibleContentRects(const VisibleContentRectUpdateInfo&);
592     void resendLastVisibleContentRects();
593
594     WebCore::FloatRect computeCustomFixedPositionRect(const WebCore::FloatRect& unobscuredContentRect, const WebCore::FloatRect& unobscuredContentRectRespectingInputViewBounds, const WebCore::FloatRect& currentCustomFixedPositionRect, double displayedContentScale, WebCore::FrameView::LayoutViewportConstraint = WebCore::FrameView::LayoutViewportConstraint::Unconstrained, bool visualViewportEnabled = false) const;
595
596     void scrollingNodeScrollViewWillStartPanGesture();
597     void scrollingNodeScrollViewDidScroll();
598     void scrollingNodeScrollWillStartScroll();
599     void scrollingNodeScrollDidEndScroll();
600
601     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& unobscuredSafeAreaInsets, double targetScale, int32_t deviceOrientation, DynamicViewportSizeUpdateID);
602
603     void setViewportConfigurationViewLayoutSize(const WebCore::FloatSize&, double scaleFactor);
604     void setMaximumUnobscuredSize(const WebCore::FloatSize&);
605     void setDeviceOrientation(int32_t);
606     int32_t deviceOrientation() const { return m_deviceOrientation; }
607     void setOverrideViewportArguments(const std::optional<WebCore::ViewportArguments>&);
608     void willCommitLayerTree(uint64_t transactionID);
609
610     void selectWithGesture(const WebCore::IntPoint, WebCore::TextGranularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithAssistedNode, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>&&);
611     void updateSelectionWithTouches(const WebCore::IntPoint, uint32_t touches, bool baseIsStart, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, CallbackBase::Error)>&&);
612     void selectWithTwoTouches(const WebCore::IntPoint from, const WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>&&);
613     void extendSelection(WebCore::TextGranularity);
614     void selectWordBackward();
615     void moveSelectionByOffset(int32_t offset, WTF::Function<void (CallbackBase::Error)>&&);
616     void selectTextWithGranularityAtPoint(const WebCore::IntPoint, WebCore::TextGranularity, bool isInteractingWithAssistedNode, WTF::Function<void (CallbackBase::Error)>&&);
617     void selectPositionAtPoint(const WebCore::IntPoint, bool isInteractingWithAssistedNode, WTF::Function<void (CallbackBase::Error)>&&);
618     void selectPositionAtBoundaryWithDirection(const WebCore::IntPoint, WebCore::TextGranularity, WebCore::SelectionDirection, bool isInteractingWithAssistedNode, WTF::Function<void (CallbackBase::Error)>&&);
619     void moveSelectionAtBoundaryWithDirection(WebCore::TextGranularity, WebCore::SelectionDirection, WTF::Function<void(CallbackBase::Error)>&&);
620     void beginSelectionInDirection(WebCore::SelectionDirection, WTF::Function<void (uint64_t, CallbackBase::Error)>&&);
621     void updateSelectionWithExtentPoint(const WebCore::IntPoint, bool isInteractingWithAssistedNode, WTF::Function<void (uint64_t, CallbackBase::Error)>&&);
622     void updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint, WebCore::TextGranularity, bool isInteractingWithAssistedNode, WTF::Function<void(uint64_t, CallbackBase::Error)>&&);
623     void requestAutocorrectionData(const String& textForAutocorrection, WTF::Function<void (const Vector<WebCore::FloatRect>&, const String&, double, uint64_t, CallbackBase::Error)>&&);
624     void applyAutocorrection(const String& correction, const String& originalText, WTF::Function<void (const String&, CallbackBase::Error)>&&);
625     bool applyAutocorrection(const String& correction, const String& originalText);
626     void requestAutocorrectionContext(WTF::Function<void (const String&, const String&, const String&, const String&, uint64_t, uint64_t, CallbackBase::Error)>&&);
627     void getAutocorrectionContext(String& contextBefore, String& markedText, String& selectedText, String& contextAfter, uint64_t& location, uint64_t& length);
628     void requestDictationContext(WTF::Function<void (const String&, const String&, const String&, CallbackBase::Error)>&&);
629     void replaceDictatedText(const String& oldText, const String& newText);
630     void replaceSelectedText(const String& oldText, const String& newText);
631     void didReceivePositionInformation(const InteractionInformationAtPosition&);
632     void requestPositionInformation(const InteractionInformationRequest&);
633     void startInteractionWithElementAtPosition(const WebCore::IntPoint&);
634     void stopInteraction();
635     void performActionOnElement(uint32_t action);
636     void saveImageToLibrary(const SharedMemory::Handle& imageHandle, uint64_t imageSize);
637     void focusNextAssistedNode(bool isForward, WTF::Function<void (CallbackBase::Error)>&& = [] (auto) { });
638     void setAssistedNodeValue(const String&);
639     void setAssistedNodeValueAsNumber(double);
640     void setAssistedNodeSelectedIndex(uint32_t index, bool allowMultipleSelection = false);
641     void applicationDidEnterBackground();
642     void applicationDidFinishSnapshottingAfterEnteringBackground();
643     void applicationWillEnterForeground();
644     void applicationWillResignActive();
645     void applicationDidBecomeActive();
646     void commitPotentialTapFailed();
647     void didNotHandleTapAsClick(const WebCore::IntPoint&);
648     void didCompleteSyntheticClick();
649     void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID);
650     void contentSizeCategoryDidChange(const String& contentSizeCategory);
651     void getSelectionContext(WTF::Function<void(const String&, const String&, const String&, CallbackBase::Error)>&&);
652     void handleTwoFingerTapAtPoint(const WebCore::IntPoint&, uint64_t requestID);
653     void setForceAlwaysUserScalable(bool);
654     bool forceAlwaysUserScalable() const { return m_forceAlwaysUserScalable; }
655     double layoutSizeScaleFactor() const { return m_viewportConfigurationLayoutSizeScaleFactor; }
656     void setIsScrollingOrZooming(bool);
657     void requestRectsForGranularityWithSelectionOffset(WebCore::TextGranularity, uint32_t offset, WTF::Function<void(const Vector<WebCore::SelectionRect>&, CallbackBase::Error)>&&);
658     void requestRectsAtSelectionOffsetWithText(int32_t offset, const String&, WTF::Function<void(const Vector<WebCore::SelectionRect>&, CallbackBase::Error)>&&);
659     void autofillLoginCredentials(const String& username, const String& password);
660     void storeSelectionForAccessibility(bool);
661     void startAutoscrollAtPosition(const WebCore::FloatPoint& positionInWindow);
662     void cancelAutoscroll();
663     void hardwareKeyboardAvailabilityChanged();
664 #if ENABLE(DATA_INTERACTION)
665     void didHandleStartDataInteractionRequest(bool started);
666     void didHandleAdditionalDragItemsRequest(bool added);
667     void requestStartDataInteraction(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition);
668     void requestAdditionalItemsForDragSession(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition);
669     void didConcludeEditDataInteraction(std::optional<WebCore::TextIndicatorData>);
670 #endif
671 #endif
672 #if ENABLE(DATA_DETECTION)
673     void setDataDetectionResult(const DataDetectionResult&);
674 #endif
675     void didCommitLayerTree(const WebKit::RemoteLayerTreeTransaction&);
676     void layerTreeCommitComplete();
677
678     bool updateLayoutViewportParameters(const WebKit::RemoteLayerTreeTransaction&);
679
680 #if PLATFORM(GTK)
681     void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd);
682     void confirmComposition(const String& compositionString, int64_t selectionStart, int64_t selectionLength);
683     void cancelComposition();
684 #endif
685
686 #if PLATFORM(GTK)
687     void setInputMethodState(bool enabled);
688 #endif
689
690 #if PLATFORM (GTK) && HAVE(GTK_GESTURES)
691     void getCenterForZoomGesture(const WebCore::IntPoint& centerInViewCoordinates, WebCore::IntPoint& center);
692 #endif
693
694 #if PLATFORM(COCOA)
695     void windowAndViewFramesChanged(const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
696     void setMainFrameIsScrollable(bool);
697
698     void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
699     bool shouldDelayWindowOrderingForEvent(const WebMouseEvent&);
700     bool acceptsFirstMouse(int eventNumber, const WebMouseEvent&);
701
702     void setAcceleratedCompositingRootLayer(LayerOrView*);
703     LayerOrView* acceleratedCompositingRootLayer() const;
704
705     void setTextAsync(const String&);
706     void insertTextAsync(const String& text, const EditingRange& replacementRange, bool registerUndoGroup = false, EditingRangeIsRelativeTo = EditingRangeIsRelativeTo::EditableRoot, bool suppressSelectionUpdate = false);
707     void getMarkedRangeAsync(WTF::Function<void (EditingRange, CallbackBase::Error)>&&);
708     void getSelectedRangeAsync(WTF::Function<void (EditingRange, CallbackBase::Error)>&&);
709     void characterIndexForPointAsync(const WebCore::IntPoint&, WTF::Function<void (uint64_t, CallbackBase::Error)>&&);
710     void firstRectForCharacterRangeAsync(const EditingRange&, WTF::Function<void (const WebCore::IntRect&, const EditingRange&, CallbackBase::Error)>&&);
711     void setCompositionAsync(const String& text, const Vector<WebCore::CompositionUnderline>& underlines, const EditingRange& selectionRange, const EditingRange& replacementRange);
712     void confirmCompositionAsync();
713
714     void setScrollPerformanceDataCollectionEnabled(bool);
715     bool scrollPerformanceDataCollectionEnabled() const { return m_scrollPerformanceDataCollectionEnabled; }
716     RemoteLayerTreeScrollingPerformanceData* scrollingPerformanceData() { return m_scrollingPerformanceData.get(); }
717 #endif // PLATFORM(COCOA)
718
719     void changeFontAttributes(WebCore::FontAttributeChanges&&);
720     void changeFont(WebCore::FontChanges&&);
721
722 #if PLATFORM(MAC)
723     void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::TextAlternativeWithRange>& dictationAlternatives, bool registerUndoGroup);
724     void attributedSubstringForCharacterRangeAsync(const EditingRange&, WTF::Function<void (const AttributedString&, const EditingRange&, CallbackBase::Error)>&&);
725     void fontAtSelection(WTF::Function<void (const String&, double, bool, CallbackBase::Error)>&&);
726
727     void startWindowDrag();
728     NSWindow *platformWindow();
729     void rootViewToWindow(const WebCore::IntRect& viewRect, WebCore::IntRect& windowRect);
730
731 #if WK_API_ENABLED
732     NSView *inspectorAttachmentView();
733     _WKRemoteObjectRegistry *remoteObjectRegistry();
734 #endif
735
736     void intrinsicContentSizeDidChange(const WebCore::IntSize& intrinsicContentSize);
737     CGRect boundsOfLayerInLayerBackedWindowCoordinates(CALayer *) const;
738 #endif // PLATFORM(MAC)
739
740 #if PLATFORM(GTK)
741     PlatformWidget viewWidget();
742     const WebCore::Color& backgroundColor() const { return m_backgroundColor; }
743     void setBackgroundColor(const WebCore::Color& color) { m_backgroundColor = color; }
744 #endif
745
746 #if PLATFORM(WIN)
747     PlatformWidget viewWidget();
748 #endif
749 #if PLATFORM(WPE)
750     struct wpe_view_backend* viewBackend();
751 #endif
752
753     bool isProcessingMouseEvents() const;
754     void processNextQueuedMouseEvent();
755     void handleMouseEvent(const NativeWebMouseEvent&);
756
757     void handleWheelEvent(const NativeWebWheelEvent&);
758
759     bool isProcessingKeyboardEvents() const;
760     void handleKeyboardEvent(const NativeWebKeyboardEvent&);
761
762 #if ENABLE(MAC_GESTURE_EVENTS)
763     void handleGestureEvent(const NativeWebGestureEvent&);
764 #endif
765
766 #if ENABLE(IOS_TOUCH_EVENTS)
767     void handleTouchEventSynchronously(NativeWebTouchEvent&);
768     void handleTouchEventAsynchronously(const NativeWebTouchEvent&);
769
770 #elif ENABLE(TOUCH_EVENTS)
771     void handleTouchEvent(const NativeWebTouchEvent&);
772 #endif
773
774     void scrollBy(WebCore::ScrollDirection, WebCore::ScrollGranularity);
775     void centerSelectionInVisibleArea();
776
777     const String& toolTip() const { return m_toolTip; }
778
779     const String& userAgent() const { return m_userAgent; }
780     void setApplicationNameForUserAgent(const String&);
781     const String& applicationNameForUserAgent() const { return m_applicationNameForUserAgent; }
782     void setCustomUserAgent(const String&);
783     const String& customUserAgent() const { return m_customUserAgent; }
784     static String standardUserAgent(const String& applicationName = String());
785
786     bool supportsTextEncoding() const;
787     void setCustomTextEncodingName(const String&);
788     String customTextEncodingName() const { return m_customTextEncodingName; }
789
790     bool areActiveDOMObjectsAndAnimationsSuspended() const { return m_isPageSuspended; }
791     void resumeActiveDOMObjectsAndAnimations();
792     void suspendActiveDOMObjectsAndAnimations();
793
794     double estimatedProgress() const;
795
796     SessionState sessionState(WTF::Function<bool (WebBackForwardListItem&)>&& = nullptr) const;
797     RefPtr<API::Navigation> restoreFromSessionState(SessionState, bool navigate);
798
799     bool supportsTextZoom() const;
800     double textZoomFactor() const { return m_textZoomFactor; }
801     void setTextZoomFactor(double);
802     double pageZoomFactor() const;
803     void setPageZoomFactor(double);
804     void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
805
806     void scalePage(double scale, const WebCore::IntPoint& origin);
807     void scalePageInViewCoordinates(double scale, const WebCore::IntPoint& centerInViewCoordinates);
808     double pageScaleFactor() const;
809     double viewScaleFactor() const { return m_viewScaleFactor; }
810     void scaleView(double scale);
811     void setShouldScaleViewToFitDocument(bool);
812     
813     float deviceScaleFactor() const;
814     void setIntrinsicDeviceScaleFactor(float);
815     void setCustomDeviceScaleFactor(float);
816     void windowScreenDidChange(WebCore::PlatformDisplayID);
817     void accessibilitySettingsDidChange();
818 #if ENABLE(ACCESSIBILITY_EVENTS)
819     void updateAccessibilityEventsEnabled(bool);
820 #endif
821
822     void setUseFixedLayout(bool);
823     void setFixedLayoutSize(const WebCore::IntSize&);
824     bool useFixedLayout() const { return m_useFixedLayout; };
825     const WebCore::IntSize& fixedLayoutSize() const { return m_fixedLayoutSize; };
826
827     void setAlwaysShowsHorizontalScroller(bool);
828     void setAlwaysShowsVerticalScroller(bool);
829     bool alwaysShowsHorizontalScroller() const { return m_alwaysShowsHorizontalScroller; }
830     bool alwaysShowsVerticalScroller() const { return m_alwaysShowsVerticalScroller; }
831
832     void listenForLayoutMilestones(OptionSet<WebCore::LayoutMilestone>);
833
834     bool hasHorizontalScrollbar() const { return m_mainFrameHasHorizontalScrollbar; }
835     bool hasVerticalScrollbar() const { return m_mainFrameHasVerticalScrollbar; }
836
837     void setSuppressScrollbarAnimations(bool);
838     bool areScrollbarAnimationsSuppressed() const { return m_suppressScrollbarAnimations; }
839
840     bool isPinnedToLeftSide() const { return m_mainFrameIsPinnedToLeftSide; }
841     bool isPinnedToRightSide() const { return m_mainFrameIsPinnedToRightSide; }
842     bool isPinnedToTopSide() const { return m_mainFrameIsPinnedToTopSide; }
843     bool isPinnedToBottomSide() const { return m_mainFrameIsPinnedToBottomSide; }
844
845     bool rubberBandsAtLeft() const;
846     void setRubberBandsAtLeft(bool);
847     bool rubberBandsAtRight() const;
848     void setRubberBandsAtRight(bool);
849     bool rubberBandsAtTop() const;
850     void setRubberBandsAtTop(bool);
851     bool rubberBandsAtBottom() const;
852     void setRubberBandsAtBottom(bool);
853
854     void setShouldUseImplicitRubberBandControl(bool shouldUseImplicitRubberBandControl) { m_shouldUseImplicitRubberBandControl = shouldUseImplicitRubberBandControl; }
855     bool shouldUseImplicitRubberBandControl() const { return m_shouldUseImplicitRubberBandControl; }
856         
857     void setEnableVerticalRubberBanding(bool);
858     bool verticalRubberBandingIsEnabled() const;
859     void setEnableHorizontalRubberBanding(bool);
860     bool horizontalRubberBandingIsEnabled() const;
861         
862     void setBackgroundExtendsBeyondPage(bool);
863     bool backgroundExtendsBeyondPage() const;
864
865     void setPaginationMode(WebCore::Pagination::Mode);
866     WebCore::Pagination::Mode paginationMode() const { return m_paginationMode; }
867     void setPaginationBehavesLikeColumns(bool);
868     bool paginationBehavesLikeColumns() const { return m_paginationBehavesLikeColumns; }
869     void setPageLength(double);
870     double pageLength() const { return m_pageLength; }
871     void setGapBetweenPages(double);
872     double gapBetweenPages() const { return m_gapBetweenPages; }
873     void setPaginationLineGridEnabled(bool);
874     bool paginationLineGridEnabled() const { return m_paginationLineGridEnabled; }
875     unsigned pageCount() const { return m_pageCount; }
876         
877 #if PLATFORM(MAC)
878     void setUseSystemAppearance(bool);
879     bool useSystemAppearance() const { return m_useSystemAppearance; }
880     void effectiveAppearanceDidChange();
881     bool useDarkAppearance() const;
882 #endif
883
884 #if PLATFORM(COCOA)
885     // Called by the web process through a message.
886     void registerWebProcessAccessibilityToken(const IPC::DataReference&);
887     // Called by the UI process when it is ready to send its tokens to the web process.
888     void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
889     bool readSelectionFromPasteboard(const String& pasteboardName);
890     String stringSelectionForPasteboard();
891     RefPtr<WebCore::SharedBuffer> dataSelectionForPasteboard(const String& pasteboardType);
892     void makeFirstResponder();
893     void assistiveTechnologyMakeFirstResponder();
894
895     ColorSpaceData colorSpace();
896 #endif
897
898 #if ENABLE(SERVICE_CONTROLS)
899     void replaceSelectionWithPasteboardData(const Vector<String>& types, const IPC::DataReference&);
900 #endif
901
902     void pageScaleFactorDidChange(double);
903     void pluginScaleFactorDidChange(double);
904     void pluginZoomFactorDidChange(double);
905
906     // Find.
907     void findString(const String&, FindOptions, unsigned maxMatchCount);
908     void findStringMatches(const String&, FindOptions, unsigned maxMatchCount);
909     void getImageForFindMatch(int32_t matchIndex);
910     void selectFindMatch(int32_t matchIndex);
911     void didGetImageForFindMatch(const ShareableBitmap::Handle& contentImageHandle, uint32_t matchIndex);
912     void hideFindUI();
913     void countStringMatches(const String&, FindOptions, unsigned maxMatchCount);
914     void didCountStringMatches(const String&, uint32_t matchCount);
915     void setTextIndicator(const WebCore::TextIndicatorData&, uint64_t /* WebCore::TextIndicatorWindowLifetime */ lifetime = 0 /* Permanent */);
916     void setTextIndicatorAnimationProgress(float);
917     void clearTextIndicator();
918     void didFindString(const String&, const Vector<WebCore::IntRect>&, uint32_t matchCount, int32_t matchIndex, bool didWrapAround);
919     void didFailToFindString(const String&);
920     void didFindStringMatches(const String&, const Vector<Vector<WebCore::IntRect>>& matchRects, int32_t firstIndexAfterSelection);
921
922     void getContentsAsString(WTF::Function<void (const String&, CallbackBase::Error)>&&);
923     void getBytecodeProfile(WTF::Function<void (const String&, CallbackBase::Error)>&&);
924     void getSamplingProfilerOutput(WTF::Function<void (const String&, CallbackBase::Error)>&&);
925     void isWebProcessResponsive(WTF::Function<void (bool isWebProcessResponsive)>&&);
926
927 #if ENABLE(MHTML)
928     void getContentsAsMHTMLData(Function<void (API::Data*, CallbackBase::Error)>&&);
929 #endif
930     void getMainResourceDataOfFrame(WebFrameProxy*, Function<void (API::Data*, CallbackBase::Error)>&&);
931     void getResourceDataFromFrame(WebFrameProxy*, API::URL*, Function<void (API::Data*, CallbackBase::Error)>&&);
932     void getRenderTreeExternalRepresentation(WTF::Function<void (const String&, CallbackBase::Error)>&&);
933     void getSelectionOrContentsAsString(WTF::Function<void (const String&, CallbackBase::Error)>&&);
934     void getSelectionAsWebArchiveData(Function<void (API::Data*, CallbackBase::Error)>&&);
935     void getSourceForFrame(WebFrameProxy*, WTF::Function<void (const String&, CallbackBase::Error)>&&);
936     void getWebArchiveOfFrame(WebFrameProxy*, Function<void (API::Data*, CallbackBase::Error)>&&);
937     void runJavaScriptInMainFrame(const String&, bool, WTF::Function<void (API::SerializedScriptValue*, bool hadException, const WebCore::ExceptionDetails&, CallbackBase::Error)>&& callbackFunction);
938     void runJavaScriptInMainFrameScriptWorld(const String&, bool, const String& worldName, WTF::Function<void(API::SerializedScriptValue*, bool hadException, const WebCore::ExceptionDetails&, CallbackBase::Error)>&& callbackFunction);
939     void forceRepaint(RefPtr<VoidCallback>&&);
940
941     float headerHeight(WebFrameProxy&);
942     float footerHeight(WebFrameProxy&);
943     void drawHeader(WebFrameProxy&, WebCore::FloatRect&&);
944     void drawFooter(WebFrameProxy&, WebCore::FloatRect&&);
945
946 #if PLATFORM(COCOA)
947     // Dictionary.
948     void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
949     void performDictionaryLookupOfCurrentSelection();
950 #endif
951
952     class PolicyDecisionSender;
953     void receivedPolicyDecision(WebCore::PolicyAction, API::Navigation*, std::optional<WebsitePoliciesData>&&, Ref<PolicyDecisionSender>&&);
954     void receivedNavigationPolicyDecision(WebCore::PolicyAction, API::Navigation*, ProcessSwapRequestedByClient, WebFrameProxy&, API::WebsitePolicies*, Ref<PolicyDecisionSender>&&);
955
956     void backForwardRemovedItem(const WebCore::BackForwardItemIdentifier&);
957
958 #if ENABLE(DRAG_SUPPORT)    
959     // Drag and drop support.
960     void dragEntered(WebCore::DragData&, const String& dragStorageName = String());
961     void dragUpdated(WebCore::DragData&, const String& dragStorageName = String());
962     void dragExited(WebCore::DragData&, const String& dragStorageName = String());
963     void performDragOperation(WebCore::DragData&, const String& dragStorageName, SandboxExtension::Handle&&, SandboxExtension::HandleArray&&);
964     void didPerformDragOperation(bool handled);
965
966     void didPerformDragControllerAction(uint64_t dragOperation, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, const WebCore::IntRect& insertionRect);
967     void dragEnded(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t operation);
968     void didStartDrag();
969     void dragCancelled();
970     void setDragCaretRect(const WebCore::IntRect&);
971 #if PLATFORM(COCOA)
972     void startDrag(const WebCore::DragItem&, const ShareableBitmap::Handle& dragImageHandle);
973     void setPromisedDataForImage(const String& pasteboardName, const SharedMemory::Handle& imageHandle, uint64_t imageSize, const String& filename, const String& extension,
974                          const String& title, const String& url, const String& visibleURL, const SharedMemory::Handle& archiveHandle, uint64_t archiveSize);
975 #endif
976 #if PLATFORM(GTK)
977     void startDrag(WebSelectionData&&, uint64_t dragOperation, const ShareableBitmap::Handle& dragImage);
978 #endif
979 #endif
980
981     void processDidBecomeUnresponsive();
982     void processDidBecomeResponsive();
983     void processDidTerminate(ProcessTerminationReason);
984     void dispatchProcessDidTerminate(ProcessTerminationReason);
985     void willChangeProcessIsResponsive();
986     void didChangeProcessIsResponsive();
987
988 #if PLATFORM(IOS_FAMILY)
989     void processWillBecomeSuspended();
990     void processWillBecomeForeground();
991 #endif
992
993     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
994     virtual void exitAcceleratedCompositingMode();
995     virtual void updateAcceleratedCompositingMode(const LayerTreeContext&);
996
997     void addEditCommand(WebEditCommandProxy*);
998     void removeEditCommand(WebEditCommandProxy*);
999     bool isValidEditCommand(WebEditCommandProxy*);
1000     void registerEditCommand(Ref<WebEditCommandProxy>&&, UndoOrRedo);
1001
1002     bool canUndo();
1003     bool canRedo();
1004
1005 #if PLATFORM(COCOA)
1006     void registerKeypressCommandName(const String& name) { m_knownKeypressCommandNames.add(name); }
1007     bool isValidKeypressCommandName(const String& name) const { return m_knownKeypressCommandNames.contains(name); }
1008 #endif
1009
1010     WebProcessProxy& process() { return m_process; }
1011     ProcessID processIdentifier() const;
1012
1013     WebPreferences& preferences() { return m_preferences; }
1014     void setPreferences(WebPreferences&);
1015
1016     WebPageGroup& pageGroup() { return m_pageGroup; }
1017
1018     bool isValid() const;
1019
1020 #if ENABLE(DRAG_SUPPORT)
1021     WebCore::DragOperation currentDragOperation() const { return m_currentDragOperation; }
1022     bool currentDragIsOverFileInput() const { return m_currentDragIsOverFileInput; }
1023     unsigned currentDragNumberOfFilesToBeAccepted() const { return m_currentDragNumberOfFilesToBeAccepted; }
1024     WebCore::IntRect currentDragCaretRect() const { return m_currentDragCaretRect; }
1025     void resetCurrentDragInformation();
1026     void didEndDragging();
1027 #endif
1028
1029     void preferencesDidChange();
1030
1031 #if ENABLE(CONTEXT_MENUS)
1032     // Called by the WebContextMenuProxy.
1033     void contextMenuItemSelected(const WebContextMenuItemData&);
1034     void handleContextMenuKeyEvent();
1035 #endif
1036
1037     // Called by the WebOpenPanelResultListenerProxy.
1038 #if PLATFORM(IOS_FAMILY)
1039     void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const API::Data* iconData);
1040 #endif
1041     void didChooseFilesForOpenPanel(const Vector<String>&);
1042     void didCancelForOpenPanel();
1043
1044     WebPageCreationParameters creationParameters();
1045
1046     void handleDownloadRequest(DownloadProxy*);
1047
1048     void advanceToNextMisspelling(bool startBeforeSelection);
1049     void changeSpellingToWord(const String& word);
1050 #if USE(APPKIT)
1051     void uppercaseWord();
1052     void lowercaseWord();
1053     void capitalizeWord();
1054 #endif
1055
1056 #if PLATFORM(COCOA)
1057     bool isSmartInsertDeleteEnabled() const { return m_isSmartInsertDeleteEnabled; }
1058     void setSmartInsertDeleteEnabled(bool);
1059 #endif
1060
1061 #if PLATFORM(GTK)
1062     String accessibilityPlugID() const { return m_accessibilityPlugID; }
1063 #endif
1064
1065     void setCanRunModal(bool);
1066     bool canRunModal();
1067
1068     void beginPrinting(WebFrameProxy*, const PrintInfo&);
1069     void endPrinting();
1070     void computePagesForPrinting(WebFrameProxy*, const PrintInfo&, Ref<ComputedPagesCallback>&&);
1071 #if PLATFORM(COCOA)
1072     void drawRectToImage(WebFrameProxy*, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, Ref<ImageCallback>&&);
1073     void drawPagesToPDF(WebFrameProxy*, const PrintInfo&, uint32_t first, uint32_t count, Ref<DataCallback>&&);
1074 #if PLATFORM(IOS_FAMILY)
1075     uint32_t computePagesForPrintingAndDrawToPDF(uint64_t frameID, const PrintInfo&, DrawToPDFCallback::CallbackFunction&&);
1076     void drawToPDFCallback(const IPC::DataReference& pdfData, WebKit::CallbackID);
1077 #endif
1078 #elif PLATFORM(GTK)
1079     void drawPagesForPrinting(WebFrameProxy*, const PrintInfo&, Ref<PrintFinishedCallback>&&);
1080 #endif
1081
1082     PageLoadState& pageLoadState() { return m_pageLoadState; }
1083
1084 #if PLATFORM(COCOA)
1085     void handleAlternativeTextUIResult(const String& result);
1086 #endif
1087
1088     void saveDataToFileInDownloadsFolder(String&& suggestedFilename, String&& mimeType, WebCore::URL&& originatingURL, API::Data&);
1089     void savePDFToFileInDownloadsFolder(String&& suggestedFilename, WebCore::URL&& originatingURL, const IPC::DataReference&);
1090 #if PLATFORM(COCOA)
1091     void savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
1092     void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const IPC::DataReference&, const String& pdfUUID);
1093     void openPDFFromTemporaryFolderWithNativeApplication(const String& pdfUUID);
1094 #endif
1095
1096 #if ENABLE(PDFKIT_PLUGIN)
1097     void showPDFContextMenu(const WebKit::PDFContextMenu&, std::optional<int32_t>& selectedIndex);
1098 #endif
1099     WebCore::IntRect visibleScrollerThumbRect() const { return m_visibleScrollerThumbRect; }
1100
1101     uint64_t renderTreeSize() const { return m_renderTreeSize; }
1102
1103     void printMainFrame();
1104     
1105     void setMediaVolume(float);
1106     void setMuted(WebCore::MediaProducer::MutedStateFlags);
1107     void setMayStartMediaWhenInWindow(bool);
1108     bool mayStartMediaWhenInWindow() const { return m_mayStartMediaWhenInWindow; }
1109     void setMediaCaptureEnabled(bool);
1110     bool mediaCaptureEnabled() const { return m_mediaCaptureEnabled; }
1111     void stopMediaCapture();
1112
1113 #if ENABLE(MEDIA_SESSION)
1114     bool hasMediaSessionWithActiveMediaElements() const { return m_hasMediaSessionWithActiveMediaElements; }
1115     void handleMediaEvent(WebCore::MediaEventType);
1116     void setVolumeOfMediaElement(double, uint64_t);
1117 #endif
1118         
1119 #if ENABLE(POINTER_LOCK)
1120     void didAllowPointerLock();
1121     void didDenyPointerLock();
1122 #endif
1123
1124     // WebPopupMenuProxy::Client
1125     NativeWebMouseEvent* currentlyProcessedMouseDownEvent() override;
1126
1127     void setSuppressVisibilityUpdates(bool flag);
1128     bool suppressVisibilityUpdates() { return m_suppressVisibilityUpdates; }
1129
1130 #if PLATFORM(IOS_FAMILY)
1131     void willStartUserTriggeredZooming();
1132
1133     void potentialTapAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
1134     void commitPotentialTap(uint64_t layerTreeTransactionIdAtLastTouchStart);
1135     void cancelPotentialTap();
1136     void tapHighlightAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
1137     void handleTap(const WebCore::FloatPoint&, uint64_t layerTreeTransactionIdAtLastTouchStart);
1138
1139     void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&);
1140     void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&);
1141
1142     void blurAssistedNode();
1143 #endif
1144
1145     void postMessageToInjectedBundle(const String& messageName, API::Object* messageBody);
1146
1147 #if ENABLE(INPUT_TYPE_COLOR)
1148     void setColorPickerColor(const WebCore::Color&);
1149     void endColorPicker();
1150 #endif
1151
1152     WebCore::IntSize viewLayoutSize() const { return m_viewLayoutSize; }
1153     void setViewLayoutSize(const WebCore::IntSize&);
1154
1155     bool autoSizingShouldExpandToViewHeight() const { return m_autoSizingShouldExpandToViewHeight; }
1156     void setAutoSizingShouldExpandToViewHeight(bool);
1157
1158     void setViewportSizeForCSSViewportUnits(const WebCore::IntSize&);
1159     WebCore::IntSize viewportSizeForCSSViewportUnits() const { return m_viewportSizeForCSSViewportUnits.value_or(WebCore::IntSize()); }
1160
1161     void didReceiveAuthenticationChallengeProxy(uint64_t frameID, Ref<AuthenticationChallengeProxy>&&);
1162
1163     SpellDocumentTag spellDocumentTag();
1164
1165     void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
1166     void didCancelCheckingText(uint64_t requestID);
1167
1168     void connectionWillOpen(IPC::Connection&);
1169     void webProcessWillShutDown();
1170
1171     void processDidFinishLaunching();
1172
1173     void didSaveToPageCache();
1174         
1175     void setScrollPinningBehavior(WebCore::ScrollPinningBehavior);
1176     WebCore::ScrollPinningBehavior scrollPinningBehavior() const { return m_scrollPinningBehavior; }
1177
1178     void setOverlayScrollbarStyle(std::optional<WebCore::ScrollbarOverlayStyle>);
1179     std::optional<WebCore::ScrollbarOverlayStyle> overlayScrollbarStyle() const { return m_scrollbarOverlayStyle; }
1180
1181     // When the state of the window changes such that the WebPage needs immediate update, the UIProcess sends a new
1182     // ActivityStateChangeID to the WebProcess through the SetActivityState message. The UIProcess will wait till it
1183     // receives a CommitLayerTree which has an ActivityStateChangeID equal to or greater than the one it sent.
1184     ActivityStateChangeID takeNextActivityStateChangeID() { return ++m_currentActivityStateChangeID; }
1185
1186     bool shouldRecordNavigationSnapshots() const { return m_shouldRecordNavigationSnapshots; }
1187     void setShouldRecordNavigationSnapshots(bool shouldRecordSnapshots) { m_shouldRecordNavigationSnapshots = shouldRecordSnapshots; }
1188     void recordAutomaticNavigationSnapshot();
1189     void suppressNextAutomaticNavigationSnapshot() { m_shouldSuppressNextAutomaticNavigationSnapshot = true; }
1190     void recordNavigationSnapshot(WebBackForwardListItem&);
1191     void requestAssistedNodeInformation(Function<void(const AssistedNodeInformation&, CallbackBase::Error)>&&);
1192
1193 #if PLATFORM(COCOA)
1194     RefPtr<ViewSnapshot> takeViewSnapshot();
1195 #endif
1196
1197 #if ENABLE(SUBTLE_CRYPTO)
1198     void wrapCryptoKey(const Vector<uint8_t>&, bool& succeeded, Vector<uint8_t>&);
1199     void unwrapCryptoKey(const Vector<uint8_t>&, bool& succeeded, Vector<uint8_t>&);
1200 #endif
1201
1202     void signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const WebCore::URL&, String& result);
1203
1204     void takeSnapshot(WebCore::IntRect, WebCore::IntSize bitmapSize, SnapshotOptions, WTF::Function<void (const ShareableBitmap::Handle&, CallbackBase::Error)>&&);
1205
1206     void navigationGestureDidBegin();
1207     void navigationGestureWillEnd(bool willNavigate, WebBackForwardListItem&);
1208     void navigationGestureDidEnd(bool willNavigate, WebBackForwardListItem&);
1209     void navigationGestureDidEnd();
1210     void navigationGestureSnapshotWasRemoved();
1211     void willRecordNavigationSnapshot(WebBackForwardListItem&);
1212
1213     bool isShowingNavigationGestureSnapshot() const { return m_isShowingNavigationGestureSnapshot; }
1214
1215     bool isPlayingAudio() const { return !!(m_mediaState & WebCore::MediaProducer::IsPlayingAudio); }
1216     void isPlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags, uint64_t);
1217     bool hasActiveAudioStream() const { return m_mediaState & WebCore::MediaProducer::HasActiveAudioCaptureDevice; }
1218     bool hasActiveVideoStream() const { return m_mediaState & WebCore::MediaProducer::HasActiveVideoCaptureDevice; }
1219     WebCore::MediaProducer::MediaStateFlags mediaStateFlags() const { return m_mediaState; }
1220     void handleAutoplayEvent(WebCore::AutoplayEvent, OptionSet<WebCore::AutoplayEventFlags>);
1221
1222     void videoControlsManagerDidChange();
1223     bool hasActiveVideoForControlsManager() const;
1224     void requestControlledElementID() const;
1225     void handleControlledElementIDResponse(const String&) const;
1226     bool isPlayingVideoInEnhancedFullscreen() const;
1227
1228 #if PLATFORM(COCOA)
1229     void requestActiveNowPlayingSessionInfo(Ref<NowPlayingInfoCallback>&&);
1230     void nowPlayingInfoCallback(bool, bool, const String&, double, double, uint64_t, CallbackID);
1231 #endif
1232
1233 #if ENABLE(MEDIA_SESSION)
1234     void hasMediaSessionWithActiveMediaElementsDidChange(bool);
1235     void mediaSessionMetadataDidChange(const WebCore::MediaSessionMetadata&);
1236     void focusedContentMediaElementDidChange(uint64_t);
1237 #endif
1238
1239 #if PLATFORM(MAC)
1240     API::HitTestResult* lastMouseMoveHitTestResult() const { return m_lastMouseMoveHitTestResult.get(); }
1241     void performImmediateActionHitTestAtLocation(WebCore::FloatPoint);
1242
1243     void immediateActionDidUpdate();
1244     void immediateActionDidCancel();
1245     void immediateActionDidComplete();
1246
1247     NSObject *immediateActionAnimationControllerForHitTestResult(RefPtr<API::HitTestResult>, uint64_t, RefPtr<API::Object>);
1248
1249     void installActivityStateChangeCompletionHandler(WTF::Function<void ()>&&);
1250
1251     void handleAcceptedCandidate(WebCore::TextCheckingResult);
1252     void didHandleAcceptedCandidate();
1253
1254     void setHeaderBannerHeightForTesting(int);
1255     void setFooterBannerHeightForTesting(int);
1256 #endif
1257
1258 #if USE(UNIFIED_TEXT_CHECKING)
1259     void checkTextOfParagraph(const String& text, OptionSet<WebCore::TextCheckingType> checkingTypes, int32_t insertionPoint, Vector<WebCore::TextCheckingResult>& results);
1260 #endif
1261     void getGuessesForWord(const String& word, const String& context, int32_t insertionPoint, Vector<String>& guesses);
1262
1263     void setShouldDispatchFakeMouseMoveEvents(bool);
1264
1265     // Diagnostic messages logging.
1266     void logDiagnosticMessage(const String& message, const String& description, WebCore::ShouldSample);
1267     void logDiagnosticMessageWithResult(const String& message, const String& description, uint32_t result, WebCore::ShouldSample);
1268     void logDiagnosticMessageWithValue(const String& message, const String& description, double value, unsigned significantFigures, WebCore::ShouldSample);
1269     void logDiagnosticMessageWithEnhancedPrivacy(const String& message, const String& description, WebCore::ShouldSample);
1270
1271     // Performance logging.
1272     void logScrollingEvent(uint32_t eventType, MonotonicTime, uint64_t);
1273
1274     // Form validation messages.
1275     void showValidationMessage(const WebCore::IntRect& anchorClientRect, const String& message);
1276     void hideValidationMessage();
1277 #if PLATFORM(COCOA)
1278     WebCore::ValidationBubble* validationBubble() const { return m_validationBubble.get(); } // For testing.
1279 #endif
1280
1281 #if PLATFORM(IOS_FAMILY)
1282     void setIsKeyboardAnimatingIn(bool isKeyboardAnimatingIn) { m_isKeyboardAnimatingIn = isKeyboardAnimatingIn; }
1283 #endif
1284
1285 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
1286     void addPlaybackTargetPickerClient(uint64_t);
1287     void removePlaybackTargetPickerClient(uint64_t);
1288     void showPlaybackTargetPicker(uint64_t, const WebCore::FloatRect&, bool hasVideo);
1289     void playbackTargetPickerClientStateDidChange(uint64_t, WebCore::MediaProducer::MediaStateFlags);
1290     void setMockMediaPlaybackTargetPickerEnabled(bool);
1291     void setMockMediaPlaybackTargetPickerState(const String&, WebCore::MediaPlaybackTargetContext::State);
1292
1293     // WebMediaSessionManagerClient
1294     void setPlaybackTarget(uint64_t, Ref<WebCore::MediaPlaybackTarget>&&) override;
1295     void externalOutputDeviceAvailableDidChange(uint64_t, bool) override;
1296     void setShouldPlayToPlaybackTarget(uint64_t, bool) override;
1297 #endif
1298
1299     void didChangeBackgroundColor();
1300     void didLayoutForCustomContentProvider();
1301
1302     // For testing
1303     void clearWheelEventTestTrigger();
1304     void callAfterNextPresentationUpdate(WTF::Function<void (CallbackBase::Error)>&&);
1305
1306     void didReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone>);
1307
1308     void didRestoreScrollPosition();
1309
1310     void getLoadDecisionForIcon(const WebCore::LinkIcon&, WebKit::CallbackID);
1311     void finishedLoadingIcon(WebKit::CallbackID, const IPC::DataReference&);
1312
1313     void setFocus(bool focused);
1314     void setWindowFrame(const WebCore::FloatRect&);
1315     void getWindowFrame(Messages::WebPageProxy::GetWindowFrame::DelayedReply&&);
1316     void getWindowFrameWithCallback(Function<void(WebCore::FloatRect)>&&);
1317
1318     bool isResourceCachingDisabled() const { return m_isResourceCachingDisabled; }
1319     void setResourceCachingDisabled(bool);
1320
1321     WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection();
1322     void setUserInterfaceLayoutDirection(WebCore::UserInterfaceLayoutDirection);
1323
1324     bool hasHadSelectionChangesFromUserInteraction() const { return m_hasHadSelectionChangesFromUserInteraction; }
1325     bool needsHiddenContentEditableQuirk() const { return m_needsHiddenContentEditableQuirk; }
1326     bool needsPlainTextQuirk() const { return m_needsPlainTextQuirk; }
1327
1328     bool isAlwaysOnLoggingAllowed() const;
1329
1330 #if ENABLE(GAMEPAD)
1331     void gamepadActivity(const Vector<GamepadData>&, bool shouldMakeGamepadsVisible);
1332 #endif
1333
1334     void isLoadingChanged() { activityStateDidChange(WebCore::ActivityState::IsLoading); }
1335
1336     void clearUserMediaState();
1337
1338     void setShouldSkipWaitingForPaintAfterNextViewDidMoveToWindow(bool shouldSkip) { m_shouldSkipWaitingForPaintAfterNextViewDidMoveToWindow = shouldSkip; }
1339
1340     void setURLSchemeHandlerForScheme(Ref<WebURLSchemeHandler>&&, const String& scheme);
1341     WebURLSchemeHandler* urlSchemeHandlerForScheme(const String& scheme);
1342
1343 #if PLATFORM(COCOA)
1344     void createSandboxExtensionsIfNeeded(const Vector<String>& files, SandboxExtension::Handle& fileReadHandle, SandboxExtension::HandleArray& fileUploadHandles);
1345 #endif
1346     void editorStateChanged(const EditorState&);
1347
1348 #if PLATFORM(COCOA)
1349     void touchBarMenuDataRemoved();
1350     void touchBarMenuDataChanged(const TouchBarMenuData&);
1351     void touchBarMenuItemDataAdded(const TouchBarMenuItemData&);
1352     void touchBarMenuItemDataRemoved(const TouchBarMenuItemData&);
1353 #endif
1354
1355 #if ENABLE(RESOURCE_LOAD_STATISTICS)
1356     void hasStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, uint64_t webProcessContextId);
1357     void requestStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, uint64_t webProcessContextId, bool prompt);
1358 #endif
1359
1360 #if ENABLE(ATTACHMENT_ELEMENT)
1361     RefPtr<API::Attachment> attachmentForIdentifier(const String& identifier) const;
1362     void insertAttachment(Ref<API::Attachment>&&, Function<void(CallbackBase::Error)>&&);
1363     void updateAttachmentAttributes(const API::Attachment&, Function<void(CallbackBase::Error)>&&);
1364     void serializedAttachmentDataForIdentifiers(const Vector<String>&, Vector<WebCore::SerializedAttachmentData>&);
1365 #endif
1366
1367 #if ENABLE(APPLICATION_MANIFEST)
1368     void getApplicationManifest(Function<void(const std::optional<WebCore::ApplicationManifest>&, CallbackBase::Error)>&&);
1369 #endif
1370
1371     void writeBlobToFilePath(const WebCore::URL& blobURL, const String& path, Function<void(bool success)>&&);
1372
1373     WebPreferencesStore preferencesStore() const;
1374
1375     void setDefersLoadingForTesting(bool);
1376
1377     WebCore::IntRect syncRootViewToScreen(const WebCore::IntRect& viewRect);
1378
1379 #if ENABLE(DATALIST_ELEMENT)
1380     void didSelectOption(const String&);
1381     void didCloseSuggestions();
1382 #endif
1383
1384     void updateCurrentModifierState();
1385
1386 private:
1387     WebPageProxy(PageClient&, WebProcessProxy&, uint64_t pageID, Ref<API::PageConfiguration>&&);
1388     void platformInitialize();
1389
1390     void notifyProcessPoolToPrewarm();
1391
1392     RefPtr<API::Navigation> goToBackForwardItem(WebBackForwardListItem&, WebCore::FrameLoadType);
1393
1394     void updateActivityState(OptionSet<WebCore::ActivityState::Flag> flagsToUpdate = WebCore::ActivityState::allFlags());
1395     void updateThrottleState();
1396     void updateHiddenPageThrottlingAutoIncreases();
1397
1398     bool suspendCurrentPageIfPossible(API::Navigation&, std::optional<uint64_t> mainFrameID);
1399
1400     enum class ResetStateReason {
1401         PageInvalidated,
1402         WebProcessExited,
1403         NavigationSwap,
1404     };
1405     void resetState(ResetStateReason);
1406     void resetStateAfterProcessExited(ProcessTerminationReason);
1407
1408     void setUserAgent(String&&);
1409
1410     // IPC::MessageReceiver
1411     // Implemented in generated WebPageProxyMessageReceiver.cpp
1412     void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
1413     void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override;
1414
1415
1416     // IPC::MessageSender
1417     bool sendMessage(std::unique_ptr<IPC::Encoder>, OptionSet<IPC::SendOption>) override;
1418     IPC::Connection* messageSenderConnection() override;
1419     uint64_t messageSenderDestinationID() override;
1420
1421     // WebPopupMenuProxy::Client
1422     void valueChangedForPopupMenu(WebPopupMenuProxy*, int32_t newSelectedIndex) override;
1423     void setTextFromItemForPopupMenu(WebPopupMenuProxy*, int32_t index) override;
1424 #if PLATFORM(GTK)
1425     void failedToShowPopupMenu() override;
1426 #endif
1427
1428 #if ENABLE(POINTER_LOCK)
1429     void requestPointerLock();
1430     void requestPointerUnlock();
1431 #endif
1432
1433     void didCreateMainFrame(uint64_t frameID);
1434     void didCreateSubframe(uint64_t frameID);
1435     void didCreateWindow(uint64_t frameID, WebCore::GlobalWindowIdentifier&&);
1436
1437     void didStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL&&, WebCore::URL&& unreachableURL, const UserData&);
1438     void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::ResourceRequest&&, const UserData&);
1439     void willPerformClientRedirectForFrame(uint64_t frameID, const String& url, double delay, WebCore::LockBackForwardList);
1440     void didCancelClientRedirectForFrame(uint64_t frameID);
1441     void didChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL&&);
1442     void didFailProvisionalLoadForFrame(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, const UserData&);
1443     void didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t frameLoadType, const WebCore::CertificateInfo&, bool containsPluginDocument, std::optional<WebCore::HasInsecureContent> forcedHasInsecureContent, const UserData&);
1444     void didFinishDocumentLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
1445     void didFinishLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
1446     void didFailLoadForFrame(uint64_t frameID, uint64_t navigationID, const WebCore::ResourceError&, const UserData&);
1447     void didSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t sameDocumentNavigationType, WebCore::URL&&, const UserData&);
1448     void didChangeMainDocument(uint64_t frameID);
1449
1450     void didReceiveTitleForFrame(uint64_t frameID, const String&, const UserData&);
1451     void didFirstLayoutForFrame(uint64_t frameID, const UserData&);
1452     void didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, const UserData&);
1453     void didDisplayInsecureContentForFrame(uint64_t frameID, const UserData&);
1454     void didRunInsecureContentForFrame(uint64_t frameID, const UserData&);
1455     void didDetectXSSForFrame(uint64_t frameID, const UserData&);
1456     void mainFramePluginHandlesPageScaleGestureDidChange(bool);
1457     void frameDidBecomeFrameSet(uint64_t frameID, bool);
1458     void didStartProgress();
1459     void didChangeProgress(double);
1460     void didFinishProgress();
1461     void setNetworkRequestsInProgress(bool);
1462
1463     void hasInsecureContent(WebCore::HasInsecureContent&);
1464
1465     void didDestroyNavigation(uint64_t navigationID);
1466
1467     void decidePolicyForNavigationAction(WebFrameProxy&, WebCore::SecurityOriginData&& frameSecurityOrigin, uint64_t navigationID, NavigationActionData&&, FrameInfoData&&, uint64_t originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody, WebCore::ResourceResponse&& redirectResponse, const UserData&, WebCore::ShouldSkipSafeBrowsingCheck, Ref<PolicyDecisionSender>&&);
1468     void decidePolicyForNavigationActionAsync(uint64_t frameID, WebCore::SecurityOriginData&& frameSecurityOrigin, uint64_t navigationID, NavigationActionData&&, FrameInfoData&&, uint64_t originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody, WebCore::ResourceResponse&& redirectResponse, const UserData&, WebCore::ShouldSkipSafeBrowsingCheck, uint64_t listenerID);
1469     void decidePolicyForNavigationActionSync(uint64_t frameID, bool isMainFrame, WebCore::SecurityOriginData&& frameSecurityOrigin, uint64_t navigationID, NavigationActionData&&, FrameInfoData&&, uint64_t originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody, WebCore::ResourceResponse&& redirectResponse, const UserData&, WebCore::ShouldSkipSafeBrowsingCheck, Messages::WebPageProxy::DecidePolicyForNavigationActionSync::DelayedReply&&);
1470     void decidePolicyForNewWindowAction(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, NavigationActionData&&, WebCore::ResourceRequest&&, const String& frameName, uint64_t listenerID, const UserData&);
1471     void decidePolicyForResponse(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, uint64_t listenerID, const UserData&);
1472     void unableToImplementPolicy(uint64_t frameID, const WebCore::ResourceError&, const UserData&);
1473     void beginSafeBrowsingCheck(const WebCore::URL&, WebFramePolicyListenerProxy&);
1474
1475     void willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const Vector<std::pair<String, String>>& textFieldValues, uint64_t listenerID, const UserData&);
1476         
1477     void contentRuleListNotification(WebCore::URL&&, Vector<String>&& identifiers, Vector<String>&& notifications);
1478
1479     // History client
1480     void didNavigateWithNavigationData(const WebNavigationDataStore&, uint64_t frameID);
1481     void didPerformClientRedirect(const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
1482     void didPerformServerRedirect(const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
1483     void didUpdateHistoryTitle(const String& title, const String& url, uint64_t frameID);
1484
1485     // UI client
1486     void createNewPage(const FrameInfoData&, uint64_t originatingPageID, WebCore::ResourceRequest&&, WebCore::WindowFeatures&&, NavigationActionData&&, Messages::WebPageProxy::CreateNewPage::DelayedReply&&);
1487     void showPage();
1488     void runJavaScriptAlert(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, Messages::WebPageProxy::RunJavaScriptAlert::DelayedReply&&);
1489     void runJavaScriptConfirm(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, Messages::WebPageProxy::RunJavaScriptConfirm::DelayedReply&&);
1490     void runJavaScriptPrompt(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, const String&, Messages::WebPageProxy::RunJavaScriptPrompt::DelayedReply&&);
1491     void setStatusText(const String&);
1492     void mouseDidMoveOverElement(WebHitTestResultData&&, uint32_t modifiers, UserData&&);
1493
1494 #if ENABLE(NETSCAPE_PLUGIN_API)
1495     void unavailablePluginButtonClicked(uint32_t opaquePluginUnavailabilityReason, const String& mimeType, const String& pluginURLString, const String& pluginsPageURLString, const String& frameURLString, const String& pageURLString);
1496 #endif // ENABLE(NETSCAPE_PLUGIN_API)
1497 #if ENABLE(WEBGL)
1498     void webGLPolicyForURL(WebCore::URL&&, Messages::WebPageProxy::WebGLPolicyForURL::DelayedReply&&);
1499     void resolveWebGLPolicyForURL(WebCore::URL&&, Messages::WebPageProxy::ResolveWebGLPolicyForURL::DelayedReply&&);
1500 #endif // ENABLE(WEBGL)
1501     void setToolbarsAreVisible(bool toolbarsAreVisible);
1502     void getToolbarsAreVisible(Messages::WebPageProxy::GetToolbarsAreVisible::DelayedReply&&);
1503     void setMenuBarIsVisible(bool menuBarIsVisible);
1504     void getMenuBarIsVisible(Messages::WebPageProxy::GetMenuBarIsVisible::DelayedReply&&);
1505     void setStatusBarIsVisible(bool statusBarIsVisible);
1506     void getStatusBarIsVisible(Messages::WebPageProxy::GetStatusBarIsVisible::DelayedReply&&);
1507     void getIsViewVisible(bool&);
1508     void setIsResizable(bool isResizable);
1509     void screenToRootView(const WebCore::IntPoint& screenPoint, Messages::WebPageProxy::ScreenToRootView::DelayedReply&&);
1510     void rootViewToScreen(const WebCore::IntRect& viewRect, Messages::WebPageProxy::RootViewToScreen::DelayedReply&&);
1511 #if PLATFORM(IOS_FAMILY)
1512     void accessibilityScreenToRootView(const WebCore::IntPoint& screenPoint, WebCore::IntPoint& windowPoint);
1513     void rootViewToAccessibilityScreen(const WebCore::IntRect& viewRect, WebCore::IntRect& result);
1514 #endif
1515     void runBeforeUnloadConfirmPanel(uint64_t frameID, const WebCore::SecurityOriginData&, const String& message, Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::DelayedReply&&);
1516     void didChangeViewportProperties(const WebCore::ViewportAttributes&);
1517     void pageDidScroll();
1518     void runOpenPanel(uint64_t frameID, const WebCore::SecurityOriginData&, const WebCore::FileChooserSettings&);
1519     void showShareSheet(const WebCore::ShareDataWithParsedURL&, ShareSheetCallbackID);
1520     void printFrame(uint64_t frameID);
1521     void exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply&&);
1522     void reachedApplicationCacheOriginQuota(const String& originIdentifier, uint64_t currentQuota, uint64_t totalBytesNeeded, Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::DelayedReply&&);
1523     void requestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, String originIdentifier);
1524
1525 #if ENABLE(MEDIA_STREAM)
1526     UserMediaPermissionRequestManagerProxy& userMediaPermissionRequestManager();
1527 #endif
1528     void requestUserMediaPermissionForFrame(uint64_t userMediaID, uint64_t frameID, const WebCore::SecurityOriginData& userMediaDocumentOriginIdentifier, const WebCore::SecurityOriginData& topLevelDocumentOriginIdentifier, const WebCore::MediaStreamRequest&);
1529     void enumerateMediaDevicesForFrame(uint64_t userMediaID, uint64_t frameID, const WebCore::SecurityOriginData& userMediaDocumentOriginData, const WebCore::SecurityOriginData& topLevelDocumentOriginData);
1530     void beginMonitoringCaptureDevices();
1531
1532     void runModal();
1533     void notifyScrollerThumbIsVisibleInRect(const WebCore::IntRect&);
1534     void recommendedScrollbarStyleDidChange(int32_t newStyle);
1535     void didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar);
1536     void didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide, bool pinnedToTopSide, bool pinnedToBottomSide);
1537     void didChangePageCount(unsigned);
1538     void pageExtendedBackgroundColorDidChange(const WebCore::Color&);
1539 #if ENABLE(NETSCAPE_PLUGIN_API)
1540     void didFailToInitializePlugin(const String& mimeType, const String& frameURLString, const String& pageURLString);
1541     void didBlockInsecurePluginVersion(const String& mimeType, const String& pluginURLString, const String& frameURLString, const String& pageURLString, bool replacementObscured);
1542 #endif // ENABLE(NETSCAPE_PLUGIN_API)
1543     void setCanShortCircuitHorizontalWheelEvents(bool canShortCircuitHorizontalWheelEvents) { m_canShortCircuitHorizontalWheelEvents = canShortCircuitHorizontalWheelEvents; }
1544
1545     void reattachToWebProcess();
1546     void swapToWebProcess(Ref<WebProcessProxy>&&, API::Navigation&, std::optional<uint64_t> mainFrameIDInPreviousProcess);
1547
1548     void finishAttachingToWebProcess(ShouldDelayAttachingDrawingArea = ShouldDelayAttachingDrawingArea::No);
1549
1550     RefPtr<API::Navigation> reattachToWebProcessForReload();
1551     RefPtr<API::Navigation> reattachToWebProcessWithItem(WebBackForwardListItem&);
1552
1553     void loadDataWithNavigation(API::Navigation&, const IPC::DataReference&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr);
1554     void loadRequestWithNavigation(API::Navigation&, WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, API::Object* userData, WebCore::ShouldTreatAsContinuingLoad);
1555
1556     void requestNotificationPermission(uint64_t notificationID, const String& originString);
1557     void showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, WebCore::NotificationDirection, const String& originString, uint64_t notificationID);
1558     void cancelNotification(uint64_t notificationID);
1559     void clearNotifications(const Vector<uint64_t>& notificationIDs);
1560     void didDestroyNotification(uint64_t notificationID);
1561
1562     void didChangeContentSize(const WebCore::IntSize&);
1563
1564 #if ENABLE(INPUT_TYPE_COLOR)
1565     void showColorPicker(const WebCore::Color& initialColor, const WebCore::IntRect&, Vector<WebCore::Color>&&);
1566     void didChooseColor(const WebCore::Color&) override;
1567     void didEndColorPicker() override;
1568 #endif
1569
1570 #if ENABLE(DATALIST_ELEMENT)
1571     void showDataListSuggestions(WebCore::DataListSuggestionInformation&&);
1572     void handleKeydownInDataList(const String&);
1573     void endDataListSuggestions();
1574 #endif
1575
1576     void closeOverlayedViews();
1577
1578     void compositionWasCanceled();
1579     void setHasHadSelectionChangesFromUserInteraction(bool);
1580     void setNeedsHiddenContentEditableQuirk(bool);
1581     void setNeedsPlainTextQuirk(bool);
1582
1583     // Back/Forward list management
1584     void backForwardAddItem(BackForwardListItemState&&);
1585     void backForwardGoToItem(const WebCore::BackForwardItemIdentifier&, SandboxExtension::Handle&);
1586     void backForwardItemAtIndex(int32_t index, std::optional<WebCore::BackForwardItemIdentifier>&);
1587     void backForwardBackListCount(uint32_t& count);
1588     void backForwardForwardListCount(uint32_t& count);
1589     void backForwardClear();
1590
1591     // Undo management
1592     void registerEditCommandForUndo(uint64_t commandID, uint32_t editAction);
1593     void registerInsertionUndoGrouping();
1594     void clearAllEditCommands();
1595     void canUndoRedo(UndoOrRedo, bool& result);
1596     void executeUndoRedo(UndoOrRedo);
1597
1598     // Keyboard handling
1599 #if PLATFORM(COCOA)
1600     void executeSavedCommandBySelector(const String& selector, bool& handled);
1601 #endif
1602
1603 #if PLATFORM(GTK)
1604     void getEditorCommandsForKeyEvent(const AtomicString&, Vector<String>&);
1605     void bindAccessibilityTree(const String&);
1606 #endif
1607
1608     // Popup Menu.
1609     void showPopupMenu(const WebCore::IntRect& rect, uint64_t textDirection, const Vector<WebPopupItem>& items, int32_t selectedIndex, const PlatformPopupMenuData&);
1610     void hidePopupMenu();
1611
1612 #if ENABLE(CONTEXT_MENUS)
1613     void showContextMenu(ContextMenuContextData&&, const UserData&);
1614 #endif
1615
1616 #if ENABLE(TELEPHONE_NUMBER_DETECTION)
1617 #if PLATFORM(MAC)
1618     void showTelephoneNumberMenu(const String& telephoneNumber, const WebCore::IntPoint&);
1619 #endif
1620 #endif
1621
1622     // Search popup results
1623     void saveRecentSearches(const String&, const Vector<WebCore::RecentSearch>&);
1624     void loadRecentSearches(const String&, Vector<WebCore::RecentSearch>&);
1625
1626 #if PLATFORM(COCOA)
1627     // Speech.
1628     void getIsSpeaking(bool&);
1629     void speak(const String&);
1630     void stopSpeaking();
1631
1632     // Spotlight.
1633     void searchWithSpotlight(const String&);
1634         
1635     void searchTheWeb(const String&);
1636
1637     // Dictionary.
1638     void didPerformDictionaryLookup(const WebCore::DictionaryPopupInfo&);
1639 #endif
1640
1641 #if PLATFORM(MAC)
1642     bool appleMailPaginationQuirkEnabled();
1643 #endif
1644
1645 #if PLATFORM(MAC)
1646     // FIXME: Need to support iOS too, but there is no isAppleMail for iOS.
1647     bool appleMailLinesClampEnabled();
1648 #endif
1649
1650     // Spelling and grammar.
1651     void checkSpellingOfString(const String& text, int32_t& misspellingLocation, int32_t& misspellingLength);
1652     void checkGrammarOfString(const String& text, Vector<WebCore::GrammarDetail>&, int32_t& badGrammarLocation, int32_t& badGrammarLength);
1653     void spellingUIIsShowing(bool&);
1654     void updateSpellingUIWithMisspelledWord(const String& misspelledWord);
1655     void updateSpellingUIWithGrammarString(const String& badGrammarPhrase, const WebCore::GrammarDetail&);
1656     void learnWord(const String& word);
1657     void ignoreWord(const String& word);
1658     void requestCheckingOfString(uint64_t requestID, const WebCore::TextCheckingRequestData&, int32_t insertionPoint);
1659
1660     void takeFocus(uint32_t direction);
1661     void setToolTip(const String&);
1662     void setCursor(const WebCore::Cursor&);
1663     void setCursorHiddenUntilMouseMoves(bool);
1664
1665     void didReceiveEvent(uint32_t opaqueType, bool handled);
1666
1667     void voidCallback(CallbackID);
1668     void dataCallback(const IPC::DataReference&, CallbackID);
1669     void imageCallback(const ShareableBitmap::Handle&, CallbackID);
1670     void stringCallback(const String&, CallbackID);
1671     void invalidateStringCallback(CallbackID);
1672     void scriptValueCallback(const IPC::DataReference&, bool hadException, const WebCore::ExceptionDetails&, CallbackID);
1673     void computedPagesCallback(const Vector<WebCore::IntRect>&, double totalScaleFactorForPrinting, CallbackID);
1674     void validateCommandCallback(const String&, bool, int, CallbackID);
1675     void unsignedCallback(uint64_t, CallbackID);
1676     void editingRangeCallback(const EditingRange&, CallbackID);
1677 #if ENABLE(APPLICATION_MANIFEST)
1678     void applicationManifestCallback(const std::optional<WebCore::ApplicationManifest>&, CallbackID);
1679 #endif
1680 #if PLATFORM(COCOA)
1681     void machSendRightCallback(const WTF::MachSendRight&, CallbackID);
1682 #endif
1683     void rectForCharacterRangeCallback(const WebCore::IntRect&, const EditingRange&, CallbackID);
1684 #if PLATFORM(MAC)
1685     void attributedStringForCharacterRangeCallback(const AttributedString&, const EditingRange&, CallbackID);
1686     void fontAtSelectionCallback(const String&, double, bool, CallbackID);
1687 #endif
1688 #if PLATFORM(IOS_FAMILY)
1689     void gestureCallback(const WebCore::IntPoint&, uint32_t gestureType, uint32_t gestureState, uint32_t flags, CallbackID);
1690     void touchesCallback(const WebCore::IntPoint&, uint32_t touches, uint32_t flags, CallbackID);
1691     void autocorrectionDataCallback(const Vector<WebCore::FloatRect>&, const String& fontName, float fontSize, uint64_t fontTraits, CallbackID);
1692     void autocorrectionContextCallback(const String& beforeText, const String& markedText, const String& selectedText, const String& afterText, uint64_t location, uint64_t length, CallbackID);
1693     void selectionContextCallback(const String& selectedText, const String& beforeText, const String& afterText, CallbackID);
1694     void interpretKeyEvent(const EditorState&, bool isCharEvent, bool& handled);
1695     void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect, WebCore::RouteSharingPolicy, const String&);
1696     void selectionRectsCallback(const Vector<WebCore::SelectionRect>&, CallbackID);
1697 #endif
1698 #if PLATFORM(GTK)
1699     void printFinishedCallback(const WebCore::ResourceError&, CallbackID);
1700 #endif
1701
1702     void focusedFrameChanged(uint64_t frameID);
1703     void frameSetLargestFrameChanged(uint64_t frameID);
1704
1705     void didFinishLoadingDataForCustomContentProvider(const String& suggestedFilename, const IPC::DataReference&);
1706
1707 #if PLATFORM(COCOA)
1708     void pluginFocusOrWindowFocusChanged(uint64_t pluginComplexTextInputIdentifier, bool pluginHasFocusAndWindowHasFocus);
1709     void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, uint64_t complexTextInputState);
1710 #endif
1711
1712     bool maybeInitializeSandboxExtensionHandle(const WebCore::URL&, SandboxExtension::Handle&);
1713
1714 #if USE(AUTOMATIC_TEXT_REPLACEMENT)
1715     void toggleSmartInsertDelete();
1716     void toggleAutomaticQuoteSubstitution();
1717     void toggleAutomaticLinkDetection();
1718     void toggleAutomaticDashSubstitution();
1719     void toggleAutomaticTextReplacement();
1720 #endif
1721
1722 #if PLATFORM(MAC)
1723     void substitutionsPanelIsShowing(bool&);
1724     void showCorrectionPanel(int32_t panelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings);
1725     void dismissCorrectionPanel(int32_t reason);
1726     void dismissCorrectionPanelSoon(int32_t reason, String& result);
1727     void recordAutocorrectionResponse(int32_t responseType, const String& replacedString, const String& replacementString);
1728
1729 #if USE(DICTATION_ALTERNATIVES)
1730     void showDictationAlternativeUI(const WebCore::FloatRect& boundingBoxOfDictatedText, uint64_t dictationContext);
1731     void removeDictationAlternatives(uint64_t dictationContext);
1732     void dictationAlternatives(uint64_t dictationContext, Vector<String>& result);
1733 #endif
1734
1735     void setEditableElementIsFocused(bool);
1736 #endif // PLATFORM(MAC)
1737
1738 #if PLATFORM(IOS_FAMILY)
1739     WebCore::FloatSize screenSize();
1740     WebCore::FloatSize availableScreenSize();
1741     WebCore::FloatSize overrideScreenSize();
1742     float textAutosizingWidth();
1743
1744     void couldNotRestorePageState();
1745     void restorePageState(std::optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatBoxExtent& obscuredInsetsOnSave, double scale);
1746     void restorePageCenterAndScale(std::optional<WebCore::FloatPoint>, double scale);
1747
1748     void didGetTapHighlightGeometries(uint64_t requestID, const WebCore::Color& color, const Vector<WebCore::FloatQuad>& geometries, const WebCore::IntSize& topLeftRadius, const WebCore::IntSize& topRightRadius, const WebCore::IntSize& bottomLeftRadius, const WebCore::IntSize& bottomRightRadius);
1749
1750     void startAssistingNode(const AssistedNodeInformation&, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, const UserData&);
1751     void stopAssistingNode();
1752
1753     void showInspectorHighlight(const WebCore::Highlight&);
1754     void hideInspectorHighlight();
1755
1756     void enableInspectorNodeSearch();
1757     void disableInspectorNodeSearch();
1758     void assistedNodeInformationCallback(const AssistedNodeInformation&, CallbackID);
1759 #endif // PLATFORM(IOS_FAMILY)
1760
1761 #if ENABLE(DATA_DETECTION)
1762     RetainPtr<NSArray> m_dataDetectionResults;
1763 #endif
1764
1765     void clearLoadDependentCallbacks();
1766
1767     void performDragControllerAction(DragControllerAction, WebCore::DragData&, const String& dragStorageName, SandboxExtension::Handle&&, SandboxExtension::HandleArray&&);
1768
1769     void updateBackingStoreDiscardableState();
1770
1771     void setRenderTreeSize(uint64_t treeSize) { m_renderTreeSize = treeSize; }
1772
1773 #if PLATFORM(X11)
1774     void createPluginContainer(uint64_t& windowID);
1775     void windowedPluginGeometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect, uint64_t windowID);
1776     void windowedPluginVisibilityDidChange(bool isVisible, uint64_t windowID);
1777 #endif
1778
1779     void processNextQueuedWheelEvent();
1780     void sendWheelEvent(const WebWheelEvent&);
1781     bool shouldProcessWheelEventNow(const WebWheelEvent&) const;
1782
1783 #if ENABLE(TOUCH_EVENTS)
1784     void updateTouchEventTracking(const WebTouchEvent&);
1785     WebCore::TrackingType touchEventTrackingType(const WebTouchEvent&) const;
1786 #endif
1787
1788 #if ENABLE(NETSCAPE_PLUGIN_API)
1789     void findPlugin(const String& mimeType, uint32_t processType, const String& urlString, const String& frameURLString, const String& pageURLString, bool allowOnlyApplicationPlugins, Messages::WebPageProxy::FindPlugin::DelayedReply&&);
1790 #endif
1791
1792 #if USE(QUICK_LOOK)
1793     void didStartLoadForQuickLookDocumentInMainFrame(const String& fileName, const String& uti);
1794     void didFinishLoadForQuickLookDocumentInMainFrame(const QuickLookDocumentData&);
1795     void didRequestPasswordForQuickLookDocumentInMainFrame(const String& fileName);
1796 #endif
1797
1798 #if ENABLE(CONTENT_FILTERING)
1799     void contentFilterDidBlockLoadForFrame(const WebCore::ContentFilterUnblockHandler&, uint64_t frameID);
1800 #endif
1801
1802     void tryReloadAfterProcessTermination();
1803     void resetRecentCrashCountSoon();
1804     void resetRecentCrashCount();
1805
1806     API::DiagnosticLoggingClient* effectiveDiagnosticLoggingClient(WebCore::ShouldSample);
1807
1808     void dispatchActivityStateChange();
1809     void viewDidLeaveWindow();
1810     void viewDidEnterWindow();
1811
1812 #if PLATFORM(MAC)
1813     void didPerformImmediateActionHitTest(const WebHitTestResultData&, bool contentPreventsDefault, const UserData&);
1814 #endif
1815
1816     void useFixedLayoutDidChange(bool useFixedLayout) { m_useFixedLayout = useFixedLayout; }
1817     void fixedLayoutSizeDidChange(WebCore::IntSize fixedLayoutSize) { m_fixedLayoutSize = fixedLayoutSize; }
1818
1819     void imageOrMediaDocumentSizeChanged(const WebCore::IntSize&);
1820 #if ENABLE(VIDEO)
1821 #if USE(GSTREAMER)
1822     void requestInstallMissingMediaPlugins(const String& details, const String& description);
1823 #endif
1824 #endif
1825
1826     void startURLSchemeTask(URLSchemeTaskParameters&&);
1827     void stopURLSchemeTask(uint64_t handlerIdentifier, uint64_t taskIdentifier);
1828     void loadSynchronousURLSchemeTask(URLSchemeTaskParameters&&, Messages::WebPageProxy::LoadSynchronousURLSchemeTask::DelayedReply&&);
1829
1830     void handleAutoFillButtonClick(const UserData&);
1831
1832     void didResignInputElementStrongPasswordAppearance(const UserData&);
1833
1834     void finishInitializingWebPageAfterProcessLaunch();
1835
1836     void handleMessage(IPC::Connection&, const String& messageName, const UserData& messageBody);
1837     void handleSynchronousMessage(IPC::Connection&, const String& messageName, const UserData& messageBody, UserData& returnUserData);
1838
1839     void viewIsBecomingVisible();
1840
1841     void stopAllURLSchemeTasks();
1842
1843     void clearInspectorTargets();
1844     void createInspectorTargets();
1845
1846 #if ENABLE(ATTACHMENT_ELEMENT)
1847     void registerAttachmentIdentifierFromData(const String&, const String& contentType, const String& preferredFileName, const IPC::DataReference&);
1848     void registerAttachmentIdentifierFromFilePath(const String&, const String& contentType, const String& filePath);
1849     void registerAttachmentsFromSerializedData(Vector<WebCore::SerializedAttachmentData>&&);
1850     void registerAttachmentIdentifier(const String&);
1851     void cloneAttachmentData(const String& fromIdentifier, const String& toIdentifier);
1852
1853     void platformRegisterAttachment(Ref<API::Attachment>&&, const String& preferredFileName, const IPC::DataReference&);
1854     void platformRegisterAttachment(Ref<API::Attachment>&&, const String& filePath);
1855     void platformCloneAttachment(Ref<API::Attachment>&& fromAttachment, Ref<API::Attachment>&& toAttachment);
1856
1857     void didInsertAttachmentWithIdentifier(const String& identifier, const String& source, bool hasEnclosingImage);
1858     void didRemoveAttachmentWithIdentifier(const String& identifier);
1859     void didRemoveAttachment(API::Attachment&);
1860     Ref<API::Attachment> ensureAttachment(const String& identifier);
1861     void invalidateAllAttachments();
1862 #endif
1863
1864     void reportPageLoadResult(const WebCore::ResourceError& = { });
1865
1866     void continueNavigationInNewProcess(API::Navigation&, Ref<WebProcessProxy>&&);
1867
1868     void setNeedsFontAttributes(bool);
1869     void updateFontAttributesAfterEditorStateChange();
1870
1871     WeakPtr<PageClient> m_pageClient;
1872     Ref<API::PageConfiguration> m_configuration;
1873
1874     std::unique_ptr<API::LoaderClient> m_loaderClient;
1875     std::unique_ptr<API::PolicyClient> m_policyClient;
1876     UniqueRef<API::NavigationClient> m_navigationClient;
1877     UniqueRef<API::HistoryClient> m_historyClient;
1878     std::unique_ptr<API::IconLoadingClient> m_iconLoadingClient;
1879     std::unique_ptr<API::FormClient> m_formClient;
1880     std::unique_ptr<API::UIClient> m_uiClient;
1881     std::unique_ptr<API::FindClient> m_findClient;
1882     std::unique_ptr<API::FindMatchesClient> m_findMatchesClient;
1883     std::unique_ptr<API::DiagnosticLoggingClient> m_diagnosticLoggingClient;
1884 #if ENABLE(CONTEXT_MENUS)
1885     std::unique_ptr<API::ContextMenuClient> m_contextMenuClient;
1886 #endif
1887     std::unique_ptr<WebPageInjectedBundleClient> m_injectedBundleClient;
1888
1889     std::unique_ptr<WebNavigationState> m_navigationState;
1890     String m_failingProvisionalLoadURL;
1891     bool m_isLoadingAlternateHTMLStringForFailingProvisionalLoad { false };
1892
1893     std::unique_ptr<DrawingAreaProxy> m_drawingArea;
1894 #if PLATFORM(COCOA)
1895     std::unique_ptr<RemoteLayerTreeHost> m_frozenRemoteLayerTreeHost;
1896 #if ENABLE(ASYNC_SCROLLING)
1897     std::unique_ptr<RemoteScrollingCoordinatorProxy> m_scrollingCoordinatorProxy;
1898 #endif
1899 #endif
1900     Ref<WebProcessProxy> m_process;
1901     Ref<WebPageGroup> m_pageGroup;
1902     Ref<WebPreferences> m_preferences;
1903
1904     WebProcessLifetimeTracker m_webProcessLifetimeTracker { *this };
1905
1906     Ref<WebUserContentControllerProxy> m_userContentController;
1907     Ref<VisitedLinkStore> m_visitedLinkStore;
1908     Ref<WebsiteDataStore> m_websiteDataStore;
1909
1910     RefPtr<WebFrameProxy> m_mainFrame;
1911     Function<void()> m_mainFrameCreationHandler;
1912     Function<void(const WebCore::GlobalWindowIdentifier&)> m_mainFrameWindowCreationHandler;
1913
1914     RefPtr<WebFrameProxy> m_focusedFrame;
1915     RefPtr<WebFrameProxy> m_frameSetLargestFrame;
1916
1917     String m_userAgent;
1918     String m_applicationNameForUserAgent;
1919     String m_customUserAgent;
1920     String m_customTextEncodingName;
1921     String m_overrideContentSecurityPolicy;
1922
1923     bool m_treatsSHA1CertificatesAsInsecure { true };
1924
1925     RefPtr<WebInspectorProxy> m_inspector;
1926
1927 #if ENABLE(FULLSCREEN_API)
1928     std::unique_ptr<WebFullScreenManagerProxy> m_fullScreenManager;
1929     std::unique_ptr<API::FullscreenClient> m_fullscreenClient;
1930 #endif
1931
1932 #if (PLATFORM(IOS_FAMILY) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
1933     RefPtr<PlaybackSessionManagerProxy> m_playbackSessionManager;
1934     RefPtr<VideoFullscreenManagerProxy> m_videoFullscreenManager;
1935 #endif
1936
1937 #if PLATFORM(IOS_FAMILY)
1938     VisibleContentRectUpdateInfo m_lastVisibleContentRectUpdate;
1939     uint64_t m_firstLayerTreeTransactionIdAfterDidCommitLoad { 0 };
1940     int32_t m_deviceOrientation { 0 };
1941     bool m_hasReceivedLayerTreeTransactionAfterDidCommitLoad { true };
1942     bool m_hasNetworkRequestsOnSuspended { false };
1943     bool m_isKeyboardAnimatingIn { false };
1944     bool m_isScrollingOrZooming { false };
1945 #endif
1946         
1947 #if PLATFORM(MAC)
1948     bool m_useSystemAppearance { false };
1949 #endif
1950
1951 #if ENABLE(APPLE_PAY)
1952     std::unique_ptr<WebPaymentCoordinatorProxy> m_paymentCoordinator;
1953 #endif
1954
1955 #if USE(SYSTEM_PREVIEW)
1956     std::unique_ptr<SystemPreviewController> m_systemPreviewController;
1957 #endif
1958
1959 #if ENABLE(WEB_AUTHN)
1960     std::unique_ptr<WebAuthenticatorCoordinatorProxy> m_credentialsMessenger;
1961 #endif
1962
1963     CallbackMap m_callbacks;
1964     HashSet<CallbackID> m_loadDependentStringCallbackIDs;
1965
1966     HashSet<WebEditCommandProxy*> m_editCommandSet;
1967
1968 #if PLATFORM(COCOA)
1969     HashSet<String> m_knownKeypressCommandNames;
1970 #endif
1971
1972     RefPtr<WebPopupMenuProxy> m_activePopupMenu;
1973 #if ENABLE(CONTEXT_MENUS)
1974     RefPtr<WebContextMenuProxy> m_activeContextMenu;
1975     ContextMenuContextData m_activeContextMenuContextData;
1976 #endif
1977     RefPtr<API::HitTestResult> m_lastMouseMoveHitTestResult;
1978
1979     RefPtr<WebOpenPanelResultListenerProxy> m_openPanelResultListener;
1980     GeolocationPermissionRequestManagerProxy m_geolocationPermissionRequestManager;
1981     NotificationPermissionRequestManagerProxy m_notificationPermissionRequestManager;
1982
1983 #if ENABLE(MEDIA_STREAM)
1984     std::unique_ptr<UserMediaPermissionRequestManagerProxy> m_userMediaPermissionRequestManager;
1985 #endif
1986
1987     OptionSet<WebCore::ActivityState::Flag> m_activityState;
1988     bool m_viewWasEverInWindow { false };
1989 #if PLATFORM(IOS_FAMILY)
1990     bool m_allowsMediaDocumentInlinePlayback { false };
1991     bool m_alwaysRunsAtForegroundPriority { false };
1992     ProcessThrottler::ForegroundActivityToken m_activityToken;
1993 #endif
1994     bool m_initialCapitalizationEnabled { false };
1995     std::optional<double> m_cpuLimit;
1996     Ref<WebBackForwardList> m_backForwardList;
1997         
1998     bool m_maintainsInactiveSelection { false };
1999
2000     bool m_waitsForPaintAfterViewDidMoveToWindow { false };
2001     bool m_shouldSkipWaitingForPaintAfterNextViewDidMoveToWindow { false };
2002
2003     String m_toolTip;
2004
2005     EditorState m_editorState;
2006     bool m_isEditable { false };
2007
2008 #if PLATFORM(COCOA)
2009     TouchBarMenuData m_touchBarMenuData;
2010 #endif
2011
2012     double m_textZoomFactor { 1 };
2013     double m_pageZoomFactor { 1 };
2014     double m_pageScaleFactor { 1 };
2015     double m_pluginZoomFactor { 1 };
2016     double m_pluginScaleFactor { 1 };
2017     double m_viewScaleFactor { 1 };
2018     float m_intrinsicDeviceScaleFactor { 1 };
2019     std::optional<float> m_customDeviceScaleFactor;
2020     float m_topContentInset { 0 };
2021
2022     LayerHostingMode m_layerHostingMode { LayerHostingMode::InProcess };
2023
2024     bool m_drawsBackground { true };
2025
2026     WebCore::Color m_underlayColor;
2027     WebCore::Color m_pageExtendedBackgroundColor;
2028
2029     bool m_useFixedLayout { false };
2030     WebCore::IntSize m_fixedLayoutSize;
2031
2032     bool m_alwaysShowsHorizontalScroller { false };
2033     bool m_alwaysShowsVerticalScroller { false };
2034
2035     OptionSet<WebCore::LayoutMilestone> m_observedLayoutMilestones;
2036
2037     bool m_suppressScrollbarAnimations { false };
2038
2039     WebCore::Pagination::Mode m_paginationMode { WebCore::Pagination::Unpaginated };
2040     bool m_paginationBehavesLikeColumns { false };
2041     double m_pageLength { 0 };
2042     double m_gapBetweenPages { 0 };
2043     bool m_paginationLineGridEnabled { false };
2044         
2045     // If the process backing the web page is alive and kicking.
2046     bool m_isValid { true };
2047
2048     // Whether WebPageProxy::close() has been called on this page.
2049     bool m_isClosed { false };
2050
2051     // Whether it can run modal child web pages.
2052     bool m_canRunModal { false };
2053
2054     bool m_needsToFinishInitializingWebPageAfterProcessLaunch { false };
2055
2056     bool m_isInPrintingMode { false };
2057     bool m_isPerformingDOMPrintOperation { false };
2058
2059     WebCore::ResourceRequest m_decidePolicyForResponseRequest;
2060     bool m_shouldSuppressAppLinksInNextNavigationPolicyDecision { false };
2061
2062     Deque<NativeWebMouseEvent> m_mouseEventQueue;
2063     Deque<NativeWebKeyboardEvent> m_keyEventQueue;
2064     Deque<NativeWebWheelEvent> m_wheelEventQueue;
2065     Deque<std::unique_ptr<Vector<NativeWebWheelEvent>>> m_currentlyProcessedWheelEvents;
2066 #if ENABLE(MAC_GESTURE_EVENTS)
2067     Deque<NativeWebGestureEvent> m_gestureEventQueue;
2068 #endif
2069
2070 #if ENABLE(TOUCH_EVENTS)
2071     struct TouchEventTracking {
2072         WebCore::TrackingType touchForceChangedTracking { WebCore::TrackingType::NotTracking };
2073         WebCore::TrackingType touchStartTracking { WebCore::TrackingType::NotTracking };
2074         WebCore::TrackingType touchMoveTracking { WebCore::TrackingType::NotTracking };
2075         WebCore::TrackingType touchEndTracking { WebCore::TrackingType::NotTracking };
2076
2077         bool isTrackingAnything() const
2078         {
2079             return touchForceChangedTracking != WebCore::TrackingType::NotTracking
2080                 || touchStartTracking != WebCore::TrackingType::NotTracking
2081                 || touchMoveTracking != WebCore::TrackingType::NotTracking
2082                 || touchEndTracking != WebCore::TrackingType::NotTracking;
2083         }
2084
2085         void reset()
2086         {
2087             touchForceChangedTracking = WebCore::TrackingType::NotTracking;
2088             touchStartTracking = WebCore::TrackingType::NotTracking;
2089             touchMoveTracking = WebCore::TrackingType::NotTracking;
2090             touchEndTracking = WebCore::TrackingType::NotTracking;
2091         }
2092     };
2093     TouchEventTracking m_touchAndPointerEventTracking;
2094 #endif
2095 #if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS)
2096     Deque<QueuedTouchEvents> m_touchEventQueue;
2097 #endif
2098
2099 #if ENABLE(INPUT_TYPE_COLOR)
2100     RefPtr<WebColorPicker> m_colorPicker;
2101 #endif
2102 #if ENABLE(DATALIST_ELEMENT)
2103     RefPtr<WebDataListSuggestionsDropdown> m_dataListSuggestionsDropdown;
2104 #endif
2105 #if PLATFORM(COCOA)
2106     RefPtr<WebCore::ValidationBubble> m_validationBubble;
2107 #endif
2108
2109     const uint64_t m_pageID;
2110
2111     bool m_isPageSuspended { false };
2112     bool m_addsVisitedLinks { true };
2113
2114     bool m_controlledByAutomation { false };
2115
2116     unsigned m_inspectorFrontendCount { 0 };
2117
2118 #if PLATFORM(COCOA)
2119     bool m_isSmartInsertDeleteEnabled { false };
2120 #endif
2121
2122 #if PLATFORM(GTK)
2123     String m_accessibilityPlugID;
2124     WebCore::Color m_backgroundColor { WebCore::Color::white };
2125 #endif
2126
2127     unsigned m_pendingLearnOrIgnoreWordMessageCount { 0 };
2128
2129     bool m_mainFrameHasCustomContentProvider { false };
2130
2131 #if ENABLE(DRAG_SUPPORT)
2132     // Current drag destination details are delivered as an asynchronous response,
2133     // so we preserve them to be used when the next dragging delegate call is made.
2134     WebCore::DragOperation m_currentDragOperation { WebCore::DragOperationNone };
2135     bool m_currentDragIsOverFileInput { false };
2136     unsigned m_currentDragNumberOfFilesToBeAccepted { 0 };
2137     WebCore::IntRect m_currentDragCaretRect;
2138 #endif
2139
2140     PageLoadState m_pageLoadState;
2141     
2142     bool m_delegatesScrolling { false };
2143
2144     bool m_mainFrameHasHorizontalScrollbar { false };
2145     bool m_mainFrameHasVerticalScrollbar { false };
2146
2147     // Whether horizontal wheel events can be handled directly for swiping purposes.
2148     bool m_canShortCircuitHorizontalWheelEvents { true };
2149
2150     bool m_mainFrameIsPinnedToLeftSide { true };
2151     bool m_mainFrameIsPinnedToRightSide { true };
2152     bool m_mainFrameIsPinnedToTopSide { true };
2153     bool m_mainFrameIsPinnedToBottomSide { true };
2154
2155     bool m_shouldUseImplicitRubberBandControl { false };
2156     bool m_rubberBandsAtLeft { true };
2157     bool m_rubberBandsAtRight { true };
2158     bool m_rubberBandsAtTop { true };
2159     bool m_rubberBandsAtBottom { true };
2160         
2161     bool m_enableVerticalRubberBanding { true };
2162     bool m_enableHorizontalRubberBanding { true };
2163
2164     bool m_backgroundExtendsBeyondPage { true };
2165
2166     bool m_shouldRecordNavigationSnapshots { false };
2167     bool m_isShowingNavigationGestureSnapshot { false };
2168
2169     bool m_mainFramePluginHandlesPageScaleGesture { false };
2170
2171     unsigned m_pageCount { 0 };
2172
2173     WebCore::IntRect m_visibleScrollerThumbRect;
2174
2175     uint64_t m_renderTreeSize { 0 };
2176     uint64_t m_sessionRestorationRenderTreeSize { 0 };
2177     bool m_hitRenderTreeSizeThreshold { false };
2178
2179     bool m_suppressVisibilityUpdates { false };
2180     bool m_autoSizingShouldExpandToViewHeight { false };
2181     WebCore::IntSize m_viewLayoutSize;
2182     std::optional<WebCore::IntSize> m_viewportSizeForCSSViewportUnits;
2183
2184     // Visual viewports
2185     WebCore::LayoutSize m_baseLayoutViewportSize;
2186     WebCore::LayoutPoint m_minStableLayoutViewportOrigin;
2187     WebCore::LayoutPoint m_maxStableLayoutViewportOrigin;
2188
2189     float m_mediaVolume { 1 };
2190     WebCore::MediaProducer::MutedStateFlags m_mutedState { WebCore::MediaProducer::NoneMuted };
2191     bool m_mayStartMediaWhenInWindow { true };
2192     bool m_mediaCaptureEnabled { true };
2193
2194     bool m_waitingForDidUpdateActivityState { false };
2195
2196     bool m_shouldScaleViewToFitDocument { false };
2197     bool m_shouldSuppressNextAutomaticNavigationSnapshot { false };
2198
2199 #if PLATFORM(COCOA)
2200     HashMap<String, String> m_temporaryPDFFiles;
2201     std::unique_ptr<WebCore::RunLoopObserver> m_activityStateChangeDispatcher;
2202
2203     std::unique_ptr<RemoteLayerTreeScrollingPerformanceData> m_scrollingPerformanceData;
2204     bool m_scrollPerformanceDataCollectionEnabled { false };
2205 #endif
2206     UserObservablePageCounter::Token m_pageIsUserObservableCount;
2207     ProcessSuppressionDisabledToken m_preventProcessSuppressionCount;
2208     HiddenPageThrottlingAutoIncreasesCounter::Token m_hiddenPageDOMTimerThrottlingAutoIncreasesCount;
2209     VisibleWebPageToken m_visiblePageToken;
2210         
2211     WebCore::ScrollPinningBehavior m_scrollPinningBehavior { WebCore::DoNotPin };
2212     std::optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle;
2213
2214     uint64_t m_navigationID { 0 };
2215     ActivityStateChangeID m_currentActivityStateChangeID { ActivityStateChangeAsynchronous };
2216
2217     WebPreferencesStore::ValueMap m_configurationPreferenceValues;
2218     OptionSet<WebCore::ActivityState::Flag> m_potentiallyChangedActivityStateFlags;
2219     bool m_activityStateChangeWantsSynchronousReply { false };
2220     Vector<CallbackID> m_nextActivityStateChangeCallbacks;
2221
2222     WebCore::MediaProducer::MediaStateFlags m_mediaState { WebCore::MediaProducer::IsNotPlaying };
2223
2224     bool m_isResourceCachingDisabled { false };
2225
2226     bool m_hasHadSelectionChangesFromUserInteraction { false };
2227     bool m_needsHiddenContentEditableQuirk { false };
2228     bool m_needsPlainTextQuirk { false };
2229
2230 #if ENABLE(MEDIA_SESSION)
2231     bool m_hasMediaSessionWithActiveMediaElements { false };
2232 #endif
2233
2234 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
2235     bool m_requiresTargetMonitoring { false };
2236 #endif
2237
2238 #if PLATFORM(IOS_FAMILY)
2239     std::unique_ptr<NodeAssistanceArguments> m_deferredNodeAssistanceArguments;
2240     bool m_forceAlwaysUserScalable { false };
2241     WebCore::FloatSize m_viewportConfigurationViewLayoutSize;
2242     double m_viewportConfigurationLayoutSizeScaleFactor { 1 };
2243     WebCore::FloatSize m_maximumUnobscuredSize;
2244 #endif
2245
2246     std::optional<WebCore::FontAttributes> m_cachedFontAttributesAtSelectionStart;
2247
2248 #if ENABLE(POINTER_LOCK)
2249     bool m_isPointerLockPending { false };
2250     bool m_isPointerLocked { false };
2251 #endif
2252
2253     bool m_isUsingHighPerformanceWebGL { false };
2254     bool m_openedByDOM { false };
2255     bool m_hasCommittedAnyProvisionalLoads { false };
2256
2257     HashMap<String, Ref<WebURLSchemeHandler>> m_urlSchemeHandlersByScheme;
2258     HashMap<uint64_t, Ref<WebURLSchemeHandler>> m_urlSchemeHandlersByIdentifier;
2259
2260 #if ENABLE(ATTACHMENT_ELEMENT)
2261     HashMap<String, Ref<API::Attachment>> m_attachmentIdentifierToAttachmentMap;
2262 #endif
2263
2264     const std::unique_ptr<WebPageInspectorController> m_inspectorController;
2265 #if ENABLE(REMOTE_INSPECTOR)
2266     const std::unique_ptr<WebPageDebuggable> m_inspectorDebuggable;
2267 #endif
2268
2269     std::optional<SpellDocumentTag> m_spellDocumentTag;
2270
2271     std::optional<MonotonicTime> m_pageLoadStart;
2272
2273     RunLoop::Timer<WebPageProxy> m_resetRecentCrashCountTimer;
2274     unsigned m_recentCrashCount { 0 };
2275
2276     bool m_needsFontAttributes { false };
2277 };
2278
2279 } // namespace WebKit