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