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