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