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