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