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