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