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