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