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