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