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