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