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