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