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