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