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