b84fb9e0ef395e6f6d92cb7040b5f05d8adbbd45
[WebKit-https.git] / Source / WebKit / UIProcess / WebPageProxy.h
1 /*
2  * Copyright (C) 2010-2019 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 "Connection.h"
30 #include "ContextMenuContextData.h"
31 #include "DownloadID.h"
32 #include "DragControllerAction.h"
33 #include "EditingRange.h"
34 #include "EditorState.h"
35 #include "FocusedElementInformation.h"
36 #include "GeolocationPermissionRequestManagerProxy.h"
37 #include "HiddenPageThrottlingAutoIncreasesCounter.h"
38 #include "LayerTreeContext.h"
39 #include "MessageSender.h"
40 #include "NotificationPermissionRequestManagerProxy.h"
41 #include "PageLoadState.h"
42 #include "ProcessTerminationReason.h"
43 #include "ProcessThrottler.h"
44 #include "SandboxExtension.h"
45 #include "ShareSheetCallbackID.h"
46 #include "ShareableBitmap.h"
47 #include "ShareableResource.h"
48 #include "SuspendedPageProxy.h"
49 #include "SyntheticEditingCommandType.h"
50 #include "SystemPreviewController.h"
51 #include "TransactionID.h"
52 #include "UserMediaPermissionRequestManagerProxy.h"
53 #include "VisibleContentRectUpdateInfo.h"
54 #include "VisibleWebPageCounter.h"
55 #include "WKBase.h"
56 #include "WKPagePrivate.h"
57 #include "WebColorPicker.h"
58 #include "WebContextMenuItemData.h"
59 #include "WebCoreArgumentCoders.h"
60 #include "WebDataListSuggestionsDropdown.h"
61 #include "WebFrameProxy.h"
62 #include "WebPageCreationParameters.h"
63 #include "WebPageDiagnosticLoggingClient.h"
64 #include "WebPageInjectedBundleClient.h"
65 #include "WebPageProxyIdentifier.h"
66 #include "WebPageProxyMessagesReplies.h"
67 #include "WebPaymentCoordinatorProxy.h"
68 #include "WebPreferences.h"
69 #include "WebPopupMenuProxy.h"
70 #include "WebUndoStepID.h"
71 #include "WebsitePoliciesData.h"
72 #include <WebCore/ActivityState.h>
73 #include <WebCore/AutoplayEvent.h>
74 #include <WebCore/Color.h>
75 #include <WebCore/DiagnosticLoggingClient.h>
76 #include <WebCore/DragActions.h>
77 #include <WebCore/EventTrackingRegions.h>
78 #include <WebCore/FontAttributes.h>
79 #include <WebCore/FrameLoaderTypes.h>
80 #include <WebCore/FrameView.h> // FIXME: Move LayoutViewportConstraint to its own file and stop including this.
81 #include <WebCore/GlobalFrameIdentifier.h>
82 #include <WebCore/InputMode.h>
83 #include <WebCore/LayoutPoint.h>
84 #include <WebCore/LayoutSize.h>
85 #include <WebCore/MediaPlaybackTargetContext.h>
86 #include <WebCore/MediaProducer.h>
87 #include <WebCore/PageIdentifier.h>
88 #include <WebCore/PlatformEvent.h>
89 #include <WebCore/PlatformScreen.h>
90 #include <WebCore/PlatformSpeechSynthesisUtterance.h>
91 #include <WebCore/PlatformSpeechSynthesizer.h>
92 #include <WebCore/PointerID.h>
93 #include <WebCore/RegistrableDomain.h>
94 #include <WebCore/ScrollTypes.h>
95 #include <WebCore/SearchPopupMenu.h>
96 #include <WebCore/TextChecking.h>
97 #include <WebCore/TextGranularity.h>
98 #include <WebCore/TextManipulationController.h>
99 #include <WebCore/UserInterfaceLayoutDirection.h>
100 #include <WebCore/ViewportArguments.h>
101 #include <memory>
102 #include <wtf/CompletionHandler.h>
103 #include <wtf/HashMap.h>
104 #include <wtf/HashSet.h>
105 #include <wtf/Logger.h>
106 #include <wtf/MonotonicTime.h>
107 #include <wtf/Optional.h>
108 #include <wtf/ProcessID.h>
109 #include <wtf/Ref.h>
110 #include <wtf/RefPtr.h>
111 #include <wtf/RunLoop.h>
112 #include <wtf/URL.h>
113 #include <wtf/UniqueRef.h>
114 #include <wtf/Vector.h>
115 #include <wtf/text/WTFString.h>
116
117 #if PLATFORM(IOS_FAMILY)
118 #include "WebAutocorrectionContext.h"
119 #endif
120
121 OBJC_CLASS NSView;
122 OBJC_CLASS _WKRemoteObjectRegistry;
123
124 #if ENABLE(DRAG_SUPPORT)
125 #include <WebCore/DragActions.h>
126 #endif
127
128 #if ENABLE(TOUCH_EVENTS)
129 #include "NativeWebTouchEvent.h"
130 #endif
131
132 #if PLATFORM(COCOA)
133 #include "DynamicViewportSizeUpdate.h"
134 #include "RemoteLayerTreeNode.h"
135 #include "TouchBarMenuData.h"
136 #include "TouchBarMenuItemData.h"
137 #endif
138
139 #if PLATFORM(GTK)
140 #include "ArgumentCodersGtk.h"
141 #endif
142
143 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
144 #include <WebCore/MediaPlaybackTargetPicker.h>
145 #include <WebCore/WebMediaSessionManagerClient.h>
146 #endif
147
148 #if HAVE(APP_SSO)
149 #include "SOAuthorizationLoadPolicy.h"
150 #endif
151
152 #if ENABLE(MEDIA_SESSION)
153 namespace WebCore {
154 class MediaSessionMetadata;
155 }
156 #endif
157
158 #if USE(DIRECT2D)
159 interface ID3D11Device1;
160 #endif
161
162 namespace API {
163 class Attachment;
164 class ContextMenuClient;
165 class FindClient;
166 class FindMatchesClient;
167 class FormClient;
168 class FullscreenClient;
169 class HistoryClient;
170 class IconLoadingClient;
171 class LoaderClient;
172 class Navigation;
173 class NavigationClient;
174 class PolicyClient;
175 class UIClient;
176 class URLRequest;
177 }
178
179 namespace Inspector {
180 enum class InspectorTargetType : uint8_t;
181 }
182
183 namespace IPC {
184 class Decoder;
185 class FormDataReference;
186 }
187
188 namespace WebCore {
189 class AuthenticationChallenge;
190 class CertificateInfo;
191 class Cursor;
192 class DragData;
193 class FloatRect;
194 class FontAttributeChanges;
195 class FontChanges;
196 class GraphicsLayer;
197 class IntSize;
198 class ProtectionSpace;
199 class RunLoopObserver;
200 class SharedBuffer;
201 class TextIndicator;
202 class ValidationBubble;
203
204 enum SelectionDirection : uint8_t;
205
206 enum class AutoplayEvent : uint8_t;
207 enum class DOMPasteAccessResponse : uint8_t;
208 enum class LockBackForwardList : bool;
209 enum class HasInsecureContent : bool;
210 enum class NotificationDirection : uint8_t;
211 enum class RouteSharingPolicy : uint8_t;
212 enum class ShouldSample : bool;
213 enum class ShouldTreatAsContinuingLoad : bool;
214 enum class WritingDirection : uint8_t;
215
216 struct ApplicationManifest;
217 struct BackForwardItemIdentifier;
218 struct ContentRuleListResults;
219 struct DataListSuggestionInformation;
220 struct DictionaryPopupInfo;
221 struct DragItem;
222 struct ExceptionDetails;
223 struct FileChooserSettings;
224 struct GlobalWindowIdentifier;
225 struct LinkIcon;
226 struct MediaStreamRequest;
227 struct MockWebAuthenticationConfiguration;
228 struct PrewarmInformation;
229 struct SecurityOriginData;
230 struct ShareData;
231 struct TextAlternativeWithRange;
232 struct TextCheckingResult;
233 struct ViewportAttributes;
234 struct WindowFeatures;
235
236 template <typename> class RectEdges;
237 using FloatBoxExtent = RectEdges<float>;
238 }
239
240 #if PLATFORM(GTK)
241 typedef GtkWidget* PlatformViewWidget;
242 #endif
243
244 #if PLATFORM(WPE)
245 struct wpe_view_backend;
246 #endif
247
248 #if PLATFORM(GTK) || PLATFORM(WPE)
249 typedef struct OpaqueJSContext* JSGlobalContextRef;
250 #endif
251
252 #if PLATFORM(WIN)
253 typedef HWND PlatformViewWidget;
254 #endif
255
256 namespace WebCore {
257 struct ElementContext;
258 }
259
260 namespace WebKit {
261 class DrawingAreaProxy;
262 class EditableImageController;
263 class GamepadData;
264 class NativeWebGestureEvent;
265 class NativeWebKeyboardEvent;
266 class NativeWebMouseEvent;
267 class NativeWebWheelEvent;
268 class PageClient;
269 class ProvisionalPageProxy;
270 class RemoteLayerTreeHost;
271 class RemoteLayerTreeScrollingPerformanceData;
272 class RemoteLayerTreeTransaction;
273 class RemoteScrollingCoordinatorProxy;
274 class SecKeyProxyStore;
275 class SharedBufferDataReference;
276 class UserData;
277 class ViewSnapshot;
278 class VisitedLinkStore;
279 class WebBackForwardList;
280 class WebBackForwardListItem;
281 class WebContextMenuProxy;
282 class WebEditCommandProxy;
283 class WebFullScreenManagerProxy;
284 class PlaybackSessionManagerProxy;
285 class WebNavigationState;
286 class VideoFullscreenManagerProxy;
287 class WebAuthenticatorCoordinatorProxy;
288 class WebBackForwardCache;
289 class WebKeyboardEvent;
290 class WebURLSchemeHandler;
291 class WebMouseEvent;
292 class WebOpenPanelResultListenerProxy;
293 class WebPageDebuggable;
294 class WebPageGroup;
295 class WebPageInspectorController;
296 class WebProcessProxy;
297 class WebUserContentControllerProxy;
298 class WebWheelEvent;
299 class WebsiteDataStore;
300 class WebViewDidMoveToWindowObserver;
301
302 struct AttributedString;
303 struct ColorSpaceData;
304 struct DataDetectionResult;
305 struct DocumentEditingContext;
306 struct DocumentEditingContextRequest;
307 struct EditingRange;
308 struct EditorState;
309 struct FocusedElementInformation;
310 struct FontInfo;
311 struct FrameInfoData;
312 struct InsertTextOptions;
313 struct InteractionInformationAtPosition;
314 struct InteractionInformationRequest;
315 struct LoadParameters;
316 struct NavigationActionData;
317 struct PlatformPopupMenuData;
318 struct PrintInfo;
319 struct PDFContextMenu;
320 struct WebAutocorrectionData;
321 struct WebHitTestResultData;
322 struct WebNavigationDataStore;
323 struct WebPopupItem;
324 struct WebSelectionData;
325 struct WebSpeechSynthesisVoice;
326 struct URLSchemeTaskParameters;
327 struct UserMessage;
328
329 enum class ProcessSwapRequestedByClient;
330 enum class UndoOrRedo : bool;
331 enum class WebContentMode : uint8_t;
332
333 typedef GenericCallback<API::Data*> DataCallback;
334 typedef GenericCallback<uint64_t> UnsignedCallback;
335 typedef GenericCallback<EditingRange> EditingRangeCallback;
336 typedef GenericCallback<const String&> StringCallback;
337 typedef GenericCallback<API::SerializedScriptValue*, bool, const WebCore::ExceptionDetails&> ScriptValueCallback;
338 typedef GenericCallback<const WebCore::FontAttributes&> FontAttributesCallback;
339 typedef GenericCallback<const String&, const String&, const String&> SelectionContextCallback;
340
341 #if HAVE(VISIBILITY_PROPAGATION_VIEW)
342 using LayerHostingContextID = uint32_t;
343 #endif
344
345 #if PLATFORM(GTK)
346 typedef GenericCallback<API::Error*> PrintFinishedCallback;
347 #endif
348
349 #if ENABLE(TOUCH_EVENTS)
350 struct QueuedTouchEvents {
351     QueuedTouchEvents(const NativeWebTouchEvent& event)
352         : forwardedEvent(event)
353     {
354     }
355     NativeWebTouchEvent forwardedEvent;
356     Vector<NativeWebTouchEvent> deferredTouchEvents;
357 };
358 #endif
359
360 typedef GenericCallback<const String&, bool, int32_t> ValidateCommandCallback;
361 typedef GenericCallback<const WebCore::IntRect&, const EditingRange&> RectForCharacterRangeCallback;
362
363 #if ENABLE(APPLICATION_MANIFEST)
364 typedef GenericCallback<const Optional<WebCore::ApplicationManifest>&> ApplicationManifestCallback;
365 #endif
366
367 #if PLATFORM(MAC)
368 typedef GenericCallback<const AttributedString&, const EditingRange&> AttributedStringForCharacterRangeCallback;
369 typedef GenericCallback<const FontInfo&, double, bool> FontAtSelectionCallback;
370 #endif
371
372 #if PLATFORM(IOS_FAMILY)
373 typedef GenericCallback<const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t> GestureCallback;
374 typedef GenericCallback<const WebCore::IntPoint&, uint32_t, uint32_t> TouchesCallback;
375 typedef GenericCallback<const Vector<WebCore::SelectionRect>&> SelectionRectsCallback;
376 typedef GenericCallback<const FocusedElementInformation&> FocusedElementInformationCallback;
377 struct ElementDidFocusArguments {
378     WTF_MAKE_STRUCT_FAST_ALLOCATED;
379     FocusedElementInformation information;
380     bool userIsInteracting;
381     bool blurPreviousNode;
382     OptionSet<WebCore::ActivityState::Flag> activityStateChanges;
383     RefPtr<API::Object> userData;
384 };
385 #endif
386
387 #if PLATFORM(COCOA)
388 using DrawToPDFCallback = GenericCallback<const IPC::DataReference&>;
389 typedef GenericCallback<const WTF::MachSendRight&> MachSendRightCallback;
390 typedef GenericCallback<bool, bool, String, double, double, uint64_t> NowPlayingInfoCallback;
391 #endif
392
393 using SpellDocumentTag = int64_t;
394
395 class WebPageProxy : public API::ObjectImpl<API::Object::Type::Page>
396 #if ENABLE(INPUT_TYPE_COLOR)
397     , public WebColorPicker::Client
398 #endif
399 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
400     , public WebCore::WebMediaSessionManagerClient
401 #endif
402 #if ENABLE(APPLE_PAY)
403     , public WebPaymentCoordinatorProxy::Client
404 #endif
405     , public WebPopupMenuProxy::Client
406     , public IPC::MessageReceiver
407     , public IPC::MessageSender
408 #if ENABLE(SPEECH_SYNTHESIS)
409     , public WebCore::PlatformSpeechSynthesisUtteranceClient
410     , public WebCore::PlatformSpeechSynthesizerClient
411 #endif
412     , public CanMakeWeakPtr<WebPageProxy> {
413 public:
414     static Ref<WebPageProxy> create(PageClient&, WebProcessProxy&, Ref<API::PageConfiguration>&&);
415     virtual ~WebPageProxy();
416
417     static void forMostVisibleWebPageIfAny(PAL::SessionID, const WebCore::SecurityOriginData&, CompletionHandler<void(WebPageProxy*)>&&);
418
419     const API::PageConfiguration& configuration() const;
420
421     using Identifier = WebPageProxyIdentifier;
422
423     Identifier identifier() const { return m_identifier; }
424     WebCore::PageIdentifier webPageID() const { return m_webPageID; }
425
426     PAL::SessionID sessionID() const;
427
428     WebFrameProxy* mainFrame() const { return m_mainFrame.get(); }
429     WebFrameProxy* focusedFrame() const { return m_focusedFrame.get(); }
430     WebFrameProxy* frameSetLargestFrame() const { return m_frameSetLargestFrame.get(); }
431
432     DrawingAreaProxy* drawingArea() const { return m_drawingArea.get(); }
433     DrawingAreaProxy* provisionalDrawingArea() const;
434
435     WebNavigationState& navigationState() { return *m_navigationState.get(); }
436
437     WebsiteDataStore& websiteDataStore() { return m_websiteDataStore; }
438
439     void addPreviouslyVisitedPath(const String&);
440
441 #if ENABLE(DATA_DETECTION)
442     NSArray *dataDetectionResults() { return m_dataDetectionResults.get(); }
443     void detectDataInAllFrames(WebCore::DataDetectorTypes, CompletionHandler<void(const DataDetectionResult&)>&&);
444     void removeDataDetectedLinks(CompletionHandler<void(const DataDetectionResult&)>&&);
445 #endif
446         
447 #if ENABLE(ASYNC_SCROLLING) && PLATFORM(COCOA)
448     RemoteScrollingCoordinatorProxy* scrollingCoordinatorProxy() const { return m_scrollingCoordinatorProxy.get(); }
449 #endif
450
451     WebBackForwardList& backForwardList() { return m_backForwardList; }
452
453     bool addsVisitedLinks() const { return m_addsVisitedLinks; }
454     void setAddsVisitedLinks(bool addsVisitedLinks) { m_addsVisitedLinks = addsVisitedLinks; }
455     VisitedLinkStore& visitedLinkStore() { return m_visitedLinkStore; }
456
457     void exitFullscreenImmediately();
458     void fullscreenMayReturnToInline();
459     void didEnterFullscreen();
460     void didExitFullscreen();
461
462     WebInspectorProxy* inspector() const;
463
464     void didChangeInspectorFrontendCount(unsigned count) { m_inspectorFrontendCount = count; }
465     unsigned inspectorFrontendCount() const { return m_inspectorFrontendCount; }
466     bool hasInspectorFrontend() const { return m_inspectorFrontendCount > 0; }
467
468     bool isControlledByAutomation() const { return m_controlledByAutomation; }
469     void setControlledByAutomation(bool);
470
471     WebPageInspectorController& inspectorController() { return *m_inspectorController; }
472
473 #if PLATFORM(IOS_FAMILY)
474     void showInspectorIndication();
475     void hideInspectorIndication();
476 #endif
477
478     void createInspectorTarget(const String& targetId, Inspector::InspectorTargetType);
479     void destroyInspectorTarget(const String& targetId);
480     void sendMessageToInspectorFrontend(const String& targetId, const String& message);
481
482 #if ENABLE(REMOTE_INSPECTOR)
483     void setIndicating(bool);
484     bool allowsRemoteInspection() const;
485     void setAllowsRemoteInspection(bool);
486     String remoteInspectionNameOverride() const;
487     void setRemoteInspectionNameOverride(const String&);
488     void remoteInspectorInformationDidChange();
489 #endif
490
491 #if ENABLE(FULLSCREEN_API)
492     WebFullScreenManagerProxy* fullScreenManager();
493
494     API::FullscreenClient& fullscreenClient() const { return *m_fullscreenClient; }
495     void setFullscreenClient(std::unique_ptr<API::FullscreenClient>&&);
496 #endif
497 #if (PLATFORM(IOS_FAMILY) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
498     PlaybackSessionManagerProxy* playbackSessionManager();
499     VideoFullscreenManagerProxy* videoFullscreenManager();
500 #endif
501
502 #if PLATFORM(IOS_FAMILY)
503     bool allowsMediaDocumentInlinePlayback() const;
504     void setAllowsMediaDocumentInlinePlayback(bool);
505 #endif
506
507 #if USE(SYSTEM_PREVIEW)
508     SystemPreviewController* systemPreviewController() { return m_systemPreviewController.get(); }
509     void systemPreviewActionTriggered(const WebCore::SystemPreviewInfo&, const String&) const;
510 #endif
511
512 #if ENABLE(CONTEXT_MENUS)
513     API::ContextMenuClient& contextMenuClient() { return *m_contextMenuClient; }
514     void setContextMenuClient(std::unique_ptr<API::ContextMenuClient>&&);
515 #endif
516     API::FindClient& findClient() { return *m_findClient; }
517     void setFindClient(std::unique_ptr<API::FindClient>&&);
518     API::FindMatchesClient& findMatchesClient() { return *m_findMatchesClient; }
519     void setFindMatchesClient(std::unique_ptr<API::FindMatchesClient>&&);
520     API::DiagnosticLoggingClient* diagnosticLoggingClient() { return m_diagnosticLoggingClient.get(); }
521     void setDiagnosticLoggingClient(std::unique_ptr<API::DiagnosticLoggingClient>&&);
522     void setFormClient(std::unique_ptr<API::FormClient>&&);
523     void setNavigationClient(UniqueRef<API::NavigationClient>&&);
524     void setHistoryClient(UniqueRef<API::HistoryClient>&&);
525     void setLoaderClient(std::unique_ptr<API::LoaderClient>&&);
526     void setPolicyClient(std::unique_ptr<API::PolicyClient>&&);
527     void setInjectedBundleClient(const WKPageInjectedBundleClientBase*);
528
529     API::UIClient& uiClient() { return *m_uiClient; }
530     void setUIClient(std::unique_ptr<API::UIClient>&&);
531
532     API::IconLoadingClient& iconLoadingClient() { return *m_iconLoadingClient; }
533     void setIconLoadingClient(std::unique_ptr<API::IconLoadingClient>&&);
534
535     void setPageLoadStateObserver(std::unique_ptr<PageLoadState::Observer>&&);
536
537     void initializeWebPage();
538     void setDrawingArea(std::unique_ptr<DrawingAreaProxy>&&);
539
540     WeakPtr<SecKeyProxyStore> secKeyProxyStore(const WebCore::AuthenticationChallenge&);
541         
542     void close();
543     bool tryClose();
544     bool isClosed() const { return m_isClosed; }
545
546     void setOpenedByDOM() { m_openedByDOM = true; }
547     bool openedByDOM() const { return m_openedByDOM; }
548
549     bool hasCommittedAnyProvisionalLoads() const { return m_hasCommittedAnyProvisionalLoads; }
550
551     bool preferFasterClickOverDoubleTap() const { return m_preferFasterClickOverDoubleTap; }
552
553     void setIsUsingHighPerformanceWebGL(bool value) { m_isUsingHighPerformanceWebGL = value; }
554     bool isUsingHighPerformanceWebGL() const { return m_isUsingHighPerformanceWebGL; }
555
556     void didExceedInactiveMemoryLimitWhileActive();
557     void didExceedBackgroundCPULimitWhileInForeground();
558
559     void closePage(bool stopResponsivenessTimer);
560
561     void addPlatformLoadParameters(LoadParameters&);
562     RefPtr<API::Navigation> loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes, API::Object* userData = nullptr);
563     RefPtr<API::Navigation> loadFile(const String& fileURL, const String& resourceDirectoryURL, API::Object* userData = nullptr);
564     RefPtr<API::Navigation> loadData(const IPC::DataReference&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow);
565     void loadAlternateHTML(const IPC::DataReference&, const String& encoding, const URL& baseURL, const URL& unreachableURL, API::Object* userData = nullptr);
566     void loadWebArchiveData(API::Data*, API::Object* userData = nullptr);
567     void navigateToPDFLinkWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint);
568
569     void simulateDeviceOrientationChange(double alpha, double beta, double gamma);
570
571     void stopLoading();
572     RefPtr<API::Navigation> reload(OptionSet<WebCore::ReloadOption>);
573
574     RefPtr<API::Navigation> goForward();
575     RefPtr<API::Navigation> goBack();
576
577     RefPtr<API::Navigation> goToBackForwardItem(WebBackForwardListItem&);
578     void tryRestoreScrollPosition();
579     void didChangeBackForwardList(WebBackForwardListItem* addedItem, Vector<Ref<WebBackForwardListItem>>&& removed);
580     void willGoToBackForwardListItem(const WebCore::BackForwardItemIdentifier&, bool inBackForwardCache);
581
582     bool shouldKeepCurrentBackForwardListItemInList(WebBackForwardListItem&);
583
584     bool willHandleHorizontalScrollEvents() const;
585
586     void updateWebsitePolicies(WebsitePoliciesData&&);
587
588     bool canShowMIMEType(const String& mimeType);
589
590     String currentURL() const;
591
592     float topContentInset() const { return m_topContentInset; }
593     void setTopContentInset(float);
594
595     WebCore::Color underlayColor() const { return m_underlayColor; }
596     void setUnderlayColor(const WebCore::Color&);
597
598     // At this time, m_pageExtendedBackgroundColor can be set via pageExtendedBackgroundColorDidChange() which is a message
599     // from the UIProcess, or by didCommitLayerTree(). When PLATFORM(MAC) adopts UI side compositing, we should get rid of
600     // the message entirely.
601     WebCore::Color pageExtendedBackgroundColor() const { return m_pageExtendedBackgroundColor; }
602
603     void viewWillStartLiveResize();
604     void viewWillEndLiveResize();
605
606     void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, WTF::Function<void (CallbackBase::Error)>&&);
607     
608     void clearSelection();
609     void restoreSelectionInFocusedEditableElement();
610
611     PageClient& pageClient() const;
612
613     void setViewNeedsDisplay(const WebCore::Region&);
614     void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin);
615     
616     WebCore::FloatPoint viewScrollPosition() const;
617
618     void setDelegatesScrolling(bool delegatesScrolling) { m_delegatesScrolling = delegatesScrolling; }
619     bool delegatesScrolling() const { return m_delegatesScrolling; }
620
621     enum class ActivityStateChangeDispatchMode { Deferrable, Immediate };
622     void activityStateDidChange(OptionSet<WebCore::ActivityState::Flag> mayHaveChanged, bool wantsSynchronousReply = false, ActivityStateChangeDispatchMode = ActivityStateChangeDispatchMode::Deferrable);
623     bool isInWindow() const { return m_activityState.contains(WebCore::ActivityState::IsInWindow); }
624     void waitForDidUpdateActivityState(ActivityStateChangeID);
625     void didUpdateActivityState() { m_waitingForDidUpdateActivityState = false; }
626
627     void layerHostingModeDidChange();
628
629     WebCore::IntSize viewSize() const;
630     bool isViewVisible() const { return m_activityState.contains(WebCore::ActivityState::IsVisible); }
631     bool isViewFocused() const { return m_activityState.contains(WebCore::ActivityState::IsFocused); }
632     bool isViewWindowActive() const { return m_activityState.contains(WebCore::ActivityState::WindowIsActive); }
633
634     void addMIMETypeWithCustomContentProvider(const String& mimeType);
635
636     void selectAll();
637     void executeEditCommand(const String& commandName, const String& argument = String());
638     void validateCommand(const String& commandName, WTF::Function<void (const String&, bool, int32_t, CallbackBase::Error)>&&);
639
640     const EditorState& editorState() const { return m_editorState; }
641     bool canDelete() const { return hasSelectedRange() && isContentEditable(); }
642     bool hasSelectedRange() const { return m_editorState.selectionIsRange; }
643     bool isContentEditable() const { return m_editorState.isContentEditable; }
644
645     void increaseListLevel();
646     void decreaseListLevel();
647     void changeListType();
648
649     void setBaseWritingDirection(WebCore::WritingDirection);
650
651     Optional<WebCore::FontAttributes> cachedFontAttributesAtSelectionStart() const { return m_cachedFontAttributesAtSelectionStart; }
652
653 #if PLATFORM(COCOA)
654     const TouchBarMenuData& touchBarMenuData() const { return m_touchBarMenuData; }
655 #endif
656
657     bool maintainsInactiveSelection() const;
658     void setMaintainsInactiveSelection(bool);
659     void setEditable(bool);
660     bool isEditable() const { return m_isEditable; }
661
662     void activateMediaStreamCaptureInPage();
663     bool isMediaStreamCaptureMuted() const { return m_mutedState & WebCore::MediaProducer::MediaStreamCaptureIsMuted; }
664     void setMediaStreamCaptureMuted(bool);
665     void executeEditCommand(const String& commandName, const String& argument, WTF::Function<void(CallbackBase::Error)>&&);
666         
667     void requestFontAttributesAtSelectionStart(Function<void(const WebCore::FontAttributes&, CallbackBase::Error)>&&);
668     void fontAttributesCallback(const WebCore::FontAttributes&, CallbackID);
669
670     void textInputContextsInRect(WebCore::FloatRect, CompletionHandler<void(const Vector<WebCore::ElementContext>&)>&&);
671     void focusTextInputContext(const WebCore::ElementContext&, CompletionHandler<void(bool)>&&);
672
673 #if PLATFORM(IOS_FAMILY)
674     double displayedContentScale() const { return m_lastVisibleContentRectUpdate.scale(); }
675     const WebCore::FloatRect& exposedContentRect() const { return m_lastVisibleContentRectUpdate.exposedContentRect(); }
676     const WebCore::FloatRect& unobscuredContentRect() const { return m_lastVisibleContentRectUpdate.unobscuredContentRect(); }
677     bool inStableState() const { return m_lastVisibleContentRectUpdate.inStableState(); }
678     const WebCore::FloatRect& unobscuredContentRectRespectingInputViewBounds() const { return m_lastVisibleContentRectUpdate.unobscuredContentRectRespectingInputViewBounds(); }
679     // When visual viewports are enabled, this is the layout viewport rect.
680     const WebCore::FloatRect& customFixedPositionRect() const { return m_lastVisibleContentRectUpdate.customFixedPositionRect(); }
681
682     void updateVisibleContentRects(const VisibleContentRectUpdateInfo&);
683     void resendLastVisibleContentRects();
684
685     WebCore::FloatRect computeCustomFixedPositionRect(const WebCore::FloatRect& unobscuredContentRect, const WebCore::FloatRect& unobscuredContentRectRespectingInputViewBounds, const WebCore::FloatRect& currentCustomFixedPositionRect, double displayedContentScale, WebCore::FrameView::LayoutViewportConstraint = WebCore::FrameView::LayoutViewportConstraint::Unconstrained) const;
686
687     WebCore::FloatRect unconstrainedLayoutViewportRect() const;
688     void adjustLayersForLayoutViewport(const WebCore::FloatRect& layoutViewport);
689
690     void scrollingNodeScrollViewWillStartPanGesture();
691     void scrollingNodeScrollViewDidScroll();
692     void scrollingNodeScrollWillStartScroll();
693     void scrollingNodeScrollDidEndScroll();
694
695     void dynamicViewportSizeUpdate(const WebCore::FloatSize& viewLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& unobscuredSafeAreaInsets, double targetScale, int32_t deviceOrientation, DynamicViewportSizeUpdateID);
696
697     void setViewportConfigurationViewLayoutSize(const WebCore::FloatSize&, double scaleFactor, double minimumEffectiveDeviceWidth);
698     void setMaximumUnobscuredSize(const WebCore::FloatSize&);
699     WebCore::FloatSize maximumUnobscuredSize() const { return m_maximumUnobscuredSize; }
700     void setDeviceOrientation(int32_t);
701     int32_t deviceOrientation() const { return m_deviceOrientation; }
702     void setOverrideViewportArguments(const Optional<WebCore::ViewportArguments>&);
703     void willCommitLayerTree(TransactionID);
704
705     void selectWithGesture(const WebCore::IntPoint, WebCore::TextGranularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithFocusedElement, WTF::Function<void(const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>&&);
706     void updateSelectionWithTouches(const WebCore::IntPoint, uint32_t touches, bool baseIsStart, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, CallbackBase::Error)>&&);
707     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)>&&);
708     void extendSelection(WebCore::TextGranularity);
709     void selectWordBackward();
710     void moveSelectionByOffset(int32_t offset, WTF::Function<void (CallbackBase::Error)>&&);
711     void selectTextWithGranularityAtPoint(const WebCore::IntPoint, WebCore::TextGranularity, bool isInteractingWithFocusedElement, WTF::Function<void(CallbackBase::Error)>&&);
712     void selectPositionAtPoint(const WebCore::IntPoint, bool isInteractingWithFocusedElement, WTF::Function<void(CallbackBase::Error)>&&);
713     void selectPositionAtBoundaryWithDirection(const WebCore::IntPoint, WebCore::TextGranularity, WebCore::SelectionDirection, bool isInteractingWithFocusedElement, WTF::Function<void(CallbackBase::Error)>&&);
714     void moveSelectionAtBoundaryWithDirection(WebCore::TextGranularity, WebCore::SelectionDirection, WTF::Function<void(CallbackBase::Error)>&&);
715     void beginSelectionInDirection(WebCore::SelectionDirection, WTF::Function<void (uint64_t, CallbackBase::Error)>&&);
716     void updateSelectionWithExtentPoint(const WebCore::IntPoint, bool isInteractingWithFocusedElement, WTF::Function<void(uint64_t, CallbackBase::Error)>&&);
717     void updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint, WebCore::TextGranularity, bool isInteractingWithFocusedElement, WTF::Function<void(uint64_t, CallbackBase::Error)>&&);
718     void requestAutocorrectionData(const String& textForAutocorrection, CompletionHandler<void(WebAutocorrectionData)>&&);
719     void applyAutocorrection(const String& correction, const String& originalText, WTF::Function<void (const String&, CallbackBase::Error)>&&);
720     bool applyAutocorrection(const String& correction, const String& originalText);
721     void requestAutocorrectionContext();
722     void handleAutocorrectionContext(const WebAutocorrectionContext&);
723     void requestDictationContext(WTF::Function<void (const String&, const String&, const String&, CallbackBase::Error)>&&);
724     void replaceDictatedText(const String& oldText, const String& newText);
725     void replaceSelectedText(const String& oldText, const String& newText);
726     void didReceivePositionInformation(const InteractionInformationAtPosition&);
727     void requestPositionInformation(const InteractionInformationRequest&);
728     void startInteractionWithPositionInformation(const InteractionInformationAtPosition&);
729     void stopInteraction();
730     void performActionOnElement(uint32_t action);
731     void saveImageToLibrary(const SharedMemory::Handle& imageHandle, uint64_t imageSize);
732     void focusNextFocusedElement(bool isForward, WTF::Function<void (CallbackBase::Error)>&& = [] (auto) { });
733     void setFocusedElementValue(const String&);
734     void setFocusedElementValueAsNumber(double);
735     void setFocusedElementSelectedIndex(uint32_t index, bool allowMultipleSelection = false);
736     void applicationDidEnterBackground();
737     void applicationDidFinishSnapshottingAfterEnteringBackground();
738     void applicationWillEnterForeground();
739     bool lastObservedStateWasBackground() const { return m_lastObservedStateWasBackground; }
740     void applicationWillResignActive();
741     void applicationDidBecomeActive();
742     void commitPotentialTapFailed();
743     void didNotHandleTapAsClick(const WebCore::IntPoint&);
744     void didCompleteSyntheticClick();
745     void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID);
746     void handleSmartMagnificationInformationForPotentialTap(uint64_t requestID, const WebCore::FloatRect& renderRect, bool fitEntireRect, double viewportMinimumScale, double viewportMaximumScale, bool nodeIsRootLevel);
747     void contentSizeCategoryDidChange(const String& contentSizeCategory);
748     void getSelectionContext(WTF::Function<void(const String&, const String&, const String&, CallbackBase::Error)>&&);
749     void handleTwoFingerTapAtPoint(const WebCore::IntPoint&, OptionSet<WebKit::WebEvent::Modifier>, uint64_t requestID);
750     void handleStylusSingleTapAtPoint(const WebCore::IntPoint&, uint64_t requestID);
751     void setForceAlwaysUserScalable(bool);
752     bool forceAlwaysUserScalable() const { return m_forceAlwaysUserScalable; }
753     double layoutSizeScaleFactor() const { return m_viewportConfigurationLayoutSizeScaleFactor; }
754     double minimumEffectiveDeviceWidth() const { return m_viewportConfigurationMinimumEffectiveDeviceWidth; }
755     void setIsScrollingOrZooming(bool);
756     void requestRectsForGranularityWithSelectionOffset(WebCore::TextGranularity, uint32_t offset, WTF::Function<void(const Vector<WebCore::SelectionRect>&, CallbackBase::Error)>&&);
757     void requestRectsAtSelectionOffsetWithText(int32_t offset, const String&, WTF::Function<void(const Vector<WebCore::SelectionRect>&, CallbackBase::Error)>&&);
758     void autofillLoginCredentials(const String& username, const String& password);
759     void storeSelectionForAccessibility(bool);
760     void startAutoscrollAtPosition(const WebCore::FloatPoint& positionInWindow);
761     void cancelAutoscroll();
762     void hardwareKeyboardAvailabilityChanged(bool keyboardIsAttached);
763     bool isScrollingOrZooming() const { return m_isScrollingOrZooming; }
764     void requestEvasionRectsAboveSelection(CompletionHandler<void(const Vector<WebCore::FloatRect>&)>&&);
765     void updateSelectionWithDelta(int64_t locationDelta, int64_t lengthDelta, CompletionHandler<void()>&&);
766     void requestDocumentEditingContext(WebKit::DocumentEditingContextRequest, CompletionHandler<void(WebKit::DocumentEditingContext)>&&);
767     void generateSyntheticEditingCommand(SyntheticEditingCommandType);
768 #if ENABLE(DRAG_SUPPORT)
769     void didHandleDragStartRequest(bool started);
770     void didHandleAdditionalDragItemsRequest(bool added);
771     void requestDragStart(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, WebCore::DragSourceAction allowedActions);
772     void requestAdditionalItemsForDragSession(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, WebCore::DragSourceAction allowedActions);
773     void insertDroppedImagePlaceholders(const Vector<WebCore::IntSize>&, CompletionHandler<void(const Vector<WebCore::IntRect>&, Optional<WebCore::TextIndicatorData>)>&& reply);
774     void willReceiveEditDragSnapshot();
775     void didReceiveEditDragSnapshot(Optional<WebCore::TextIndicatorData>);
776     void didConcludeDrop();
777 #endif
778 #endif // PLATFORM(IOS_FAMILY)
779 #if ENABLE(DATA_DETECTION)
780     void setDataDetectionResult(const DataDetectionResult&);
781 #endif
782     void didCommitLayerTree(const WebKit::RemoteLayerTreeTransaction&);
783     void layerTreeCommitComplete();
784
785     bool updateLayoutViewportParameters(const WebKit::RemoteLayerTreeTransaction&);
786
787 #if PLATFORM(GTK)
788     void setComposition(const String&, const Vector<WebCore::CompositionUnderline>&, const EditingRange& selectionRange);
789     void confirmComposition(const String& compositionString);
790
791     void setInputMethodState(bool enabled);
792
793     void getCenterForZoomGesture(const WebCore::IntPoint& centerInViewCoordinates, WebCore::IntPoint& center);
794 #endif
795
796 #if PLATFORM(COCOA)
797     void windowAndViewFramesChanged(const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
798     void setMainFrameIsScrollable(bool);
799
800     void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
801     bool shouldDelayWindowOrderingForEvent(const WebMouseEvent&);
802     bool acceptsFirstMouse(int eventNumber, const WebMouseEvent&);
803
804     void setRemoteLayerTreeRootNode(RemoteLayerTreeNode*);
805     CALayer *acceleratedCompositingRootLayer() const;
806
807     void setTextAsync(const String&);
808     void insertTextAsync(const String& text, const EditingRange& replacementRange, InsertTextOptions&&);
809     void hasMarkedText(CompletionHandler<void(bool)>&&);
810     void getMarkedRangeAsync(WTF::Function<void (EditingRange, CallbackBase::Error)>&&);
811     void getSelectedRangeAsync(WTF::Function<void (EditingRange, CallbackBase::Error)>&&);
812     void characterIndexForPointAsync(const WebCore::IntPoint&, WTF::Function<void (uint64_t, CallbackBase::Error)>&&);
813     void firstRectForCharacterRangeAsync(const EditingRange&, WTF::Function<void (const WebCore::IntRect&, const EditingRange&, CallbackBase::Error)>&&);
814     void setCompositionAsync(const String& text, const Vector<WebCore::CompositionUnderline>& underlines, const EditingRange& selectionRange, const EditingRange& replacementRange);
815     void confirmCompositionAsync();
816
817     void setScrollPerformanceDataCollectionEnabled(bool);
818     bool scrollPerformanceDataCollectionEnabled() const { return m_scrollPerformanceDataCollectionEnabled; }
819     RemoteLayerTreeScrollingPerformanceData* scrollingPerformanceData() { return m_scrollingPerformanceData.get(); }
820 #endif // PLATFORM(COCOA)
821
822     void changeFontAttributes(WebCore::FontAttributeChanges&&);
823     void changeFont(WebCore::FontChanges&&);
824
825 #if PLATFORM(MAC)
826     void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::TextAlternativeWithRange>& dictationAlternatives, bool registerUndoGroup);
827     void attributedSubstringForCharacterRangeAsync(const EditingRange&, WTF::Function<void (const AttributedString&, const EditingRange&, CallbackBase::Error)>&&);
828     void fontAtSelection(Function<void(const FontInfo&, double, bool, CallbackBase::Error)>&&);
829
830     void startWindowDrag();
831     NSWindow *platformWindow();
832     void rootViewToWindow(const WebCore::IntRect& viewRect, WebCore::IntRect& windowRect);
833
834     NSView *inspectorAttachmentView();
835     _WKRemoteObjectRegistry *remoteObjectRegistry();
836
837     CGRect boundsOfLayerInLayerBackedWindowCoordinates(CALayer *) const;
838 #endif // PLATFORM(MAC)
839
840 #if PLATFORM(GTK)
841     PlatformViewWidget viewWidget();
842     bool makeGLContextCurrent();
843 #endif
844
845     const Optional<WebCore::Color>& backgroundColor() const { return m_backgroundColor; }
846     void setBackgroundColor(const Optional<WebCore::Color>&);
847
848 #if PLATFORM(WIN)
849     PlatformViewWidget viewWidget();
850 #if USE(DIRECT2D)
851     ID3D11Device1* device() const;
852     void setDevice(ID3D11Device1*);
853 #endif
854 #endif
855 #if PLATFORM(WPE)
856     struct wpe_view_backend* viewBackend();
857 #endif
858
859     bool isProcessingMouseEvents() const;
860     void processNextQueuedMouseEvent();
861     void handleMouseEvent(const NativeWebMouseEvent&);
862
863     void handleWheelEvent(const NativeWebWheelEvent&);
864
865     bool isProcessingKeyboardEvents() const;
866     void handleKeyboardEvent(const NativeWebKeyboardEvent&);
867
868 #if ENABLE(MAC_GESTURE_EVENTS)
869     void handleGestureEvent(const NativeWebGestureEvent&);
870 #endif
871
872 #if ENABLE(IOS_TOUCH_EVENTS)
873     void resetPotentialTapSecurityOrigin();
874     void handleTouchEventSynchronously(NativeWebTouchEvent&);
875     void handleTouchEventAsynchronously(const NativeWebTouchEvent&);
876
877 #elif ENABLE(TOUCH_EVENTS)
878     void handleTouchEvent(const NativeWebTouchEvent&);
879 #endif
880
881 #if ENABLE(POINTER_EVENTS)
882     void cancelPointer(WebCore::PointerID, const WebCore::IntPoint&);
883     void touchWithIdentifierWasRemoved(WebCore::PointerID);
884 #endif
885
886     void scrollBy(WebCore::ScrollDirection, WebCore::ScrollGranularity);
887     void centerSelectionInVisibleArea();
888
889     const String& toolTip() const { return m_toolTip; }
890
891     const String& userAgent() const { return m_userAgent; }
892     void setApplicationNameForUserAgent(const String&);
893     const String& applicationNameForUserAgent() const { return m_applicationNameForUserAgent; }
894     void setApplicationNameForDesktopUserAgent(const String& applicationName) { m_applicationNameForDesktopUserAgent = applicationName; }
895     const String& applicationNameForDesktopUserAgent() const { return m_applicationNameForDesktopUserAgent; }
896     void setCustomUserAgent(const String&);
897     const String& customUserAgent() const { return m_customUserAgent; }
898     static String standardUserAgent(const String& applicationName = String());
899
900     bool supportsTextEncoding() const;
901     void setCustomTextEncodingName(const String&);
902     String customTextEncodingName() const { return m_customTextEncodingName; }
903
904     bool areActiveDOMObjectsAndAnimationsSuspended() const { return m_isPageSuspended; }
905     void resumeActiveDOMObjectsAndAnimations();
906     void suspendActiveDOMObjectsAndAnimations();
907
908     double estimatedProgress() const;
909
910     SessionState sessionState(WTF::Function<bool (WebBackForwardListItem&)>&& = nullptr) const;
911     RefPtr<API::Navigation> restoreFromSessionState(SessionState, bool navigate);
912
913     bool supportsTextZoom() const;
914     double textZoomFactor() const { return m_textZoomFactor; }
915     void setTextZoomFactor(double);
916     double pageZoomFactor() const;
917     void setPageZoomFactor(double);
918     void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
919
920     void scalePage(double scale, const WebCore::IntPoint& origin);
921     void scalePageInViewCoordinates(double scale, const WebCore::IntPoint& centerInViewCoordinates);
922     double pageScaleFactor() const;
923     double viewScaleFactor() const { return m_viewScaleFactor; }
924     void scaleView(double scale);
925     void setShouldScaleViewToFitDocument(bool);
926     
927     float deviceScaleFactor() const;
928     void setIntrinsicDeviceScaleFactor(float);
929     void setCustomDeviceScaleFactor(float);
930     void windowScreenDidChange(WebCore::PlatformDisplayID);
931     void accessibilitySettingsDidChange();
932
933     void setUseFixedLayout(bool);
934     void setFixedLayoutSize(const WebCore::IntSize&);
935     bool useFixedLayout() const { return m_useFixedLayout; };
936     const WebCore::IntSize& fixedLayoutSize() const { return m_fixedLayoutSize; };
937
938     void setAlwaysShowsHorizontalScroller(bool);
939     void setAlwaysShowsVerticalScroller(bool);
940     bool alwaysShowsHorizontalScroller() const { return m_alwaysShowsHorizontalScroller; }
941     bool alwaysShowsVerticalScroller() const { return m_alwaysShowsVerticalScroller; }
942
943     void listenForLayoutMilestones(OptionSet<WebCore::LayoutMilestone>);
944
945     bool hasHorizontalScrollbar() const { return m_mainFrameHasHorizontalScrollbar; }
946     bool hasVerticalScrollbar() const { return m_mainFrameHasVerticalScrollbar; }
947
948     void setSuppressScrollbarAnimations(bool);
949     bool areScrollbarAnimationsSuppressed() const { return m_suppressScrollbarAnimations; }
950
951     bool isPinnedToLeftSide() const { return m_mainFrameIsPinnedToLeftSide; }
952     bool isPinnedToRightSide() const { return m_mainFrameIsPinnedToRightSide; }
953     bool isPinnedToTopSide() const { return m_mainFrameIsPinnedToTopSide; }
954     bool isPinnedToBottomSide() const { return m_mainFrameIsPinnedToBottomSide; }
955
956     bool rubberBandsAtLeft() const;
957     void setRubberBandsAtLeft(bool);
958     bool rubberBandsAtRight() const;
959     void setRubberBandsAtRight(bool);
960     bool rubberBandsAtTop() const;
961     void setRubberBandsAtTop(bool);
962     bool rubberBandsAtBottom() const;
963     void setRubberBandsAtBottom(bool);
964
965     void setShouldUseImplicitRubberBandControl(bool shouldUseImplicitRubberBandControl) { m_shouldUseImplicitRubberBandControl = shouldUseImplicitRubberBandControl; }
966     bool shouldUseImplicitRubberBandControl() const { return m_shouldUseImplicitRubberBandControl; }
967         
968     void setEnableVerticalRubberBanding(bool);
969     bool verticalRubberBandingIsEnabled() const;
970     void setEnableHorizontalRubberBanding(bool);
971     bool horizontalRubberBandingIsEnabled() const;
972         
973     void setBackgroundExtendsBeyondPage(bool);
974     bool backgroundExtendsBeyondPage() const;
975
976     void setPaginationMode(WebCore::Pagination::Mode);
977     WebCore::Pagination::Mode paginationMode() const { return m_paginationMode; }
978     void setPaginationBehavesLikeColumns(bool);
979     bool paginationBehavesLikeColumns() const { return m_paginationBehavesLikeColumns; }
980     void setPageLength(double);
981     double pageLength() const { return m_pageLength; }
982     void setGapBetweenPages(double);
983     double gapBetweenPages() const { return m_gapBetweenPages; }
984     void setPaginationLineGridEnabled(bool);
985     bool paginationLineGridEnabled() const { return m_paginationLineGridEnabled; }
986     unsigned pageCount() const { return m_pageCount; }
987
988     void isJITEnabled(CompletionHandler<void(bool)>&&);
989
990 #if PLATFORM(MAC)
991     void setUseSystemAppearance(bool);
992     bool useSystemAppearance() const { return m_useSystemAppearance; }
993 #endif
994
995     void effectiveAppearanceDidChange();
996     bool useDarkAppearance() const;
997     bool useElevatedUserInterfaceLevel() const;
998
999 #if PLATFORM(COCOA)
1000     // Called by the web process through a message.
1001     void registerWebProcessAccessibilityToken(const IPC::DataReference&);
1002     // Called by the UI process when it is ready to send its tokens to the web process.
1003     void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
1004     bool readSelectionFromPasteboard(const String& pasteboardName);
1005     String stringSelectionForPasteboard();
1006     RefPtr<WebCore::SharedBuffer> dataSelectionForPasteboard(const String& pasteboardType);
1007     void makeFirstResponder();
1008     void assistiveTechnologyMakeFirstResponder();
1009
1010     ColorSpaceData colorSpace();
1011 #endif
1012
1013 #if ENABLE(SERVICE_CONTROLS)
1014     void replaceSelectionWithPasteboardData(const Vector<String>& types, const IPC::DataReference&);
1015 #endif
1016
1017     void pageScaleFactorDidChange(double);
1018     void pluginScaleFactorDidChange(double);
1019     void pluginZoomFactorDidChange(double);
1020
1021     // Find.
1022     void findString(const String&, FindOptions, unsigned maxMatchCount);
1023     void findStringMatches(const String&, FindOptions, unsigned maxMatchCount);
1024     void getImageForFindMatch(int32_t matchIndex);
1025     void selectFindMatch(int32_t matchIndex);
1026     void indicateFindMatch(int32_t matchIndex);
1027     void didGetImageForFindMatch(const ShareableBitmap::Handle& contentImageHandle, uint32_t matchIndex);
1028     void hideFindUI();
1029     void countStringMatches(const String&, FindOptions, unsigned maxMatchCount);
1030     void replaceMatches(Vector<uint32_t>&& matchIndices, const String& replacementText, bool selectionOnly, Function<void(uint64_t, CallbackBase::Error)>&&);
1031     void didCountStringMatches(const String&, uint32_t matchCount);
1032     void setTextIndicator(const WebCore::TextIndicatorData&, uint64_t /* WebCore::TextIndicatorWindowLifetime */ lifetime = 0 /* Permanent */);
1033     void setTextIndicatorAnimationProgress(float);
1034     void clearTextIndicator();
1035     void didFindString(const String&, const Vector<WebCore::IntRect>&, uint32_t matchCount, int32_t matchIndex, bool didWrapAround);
1036     void didFailToFindString(const String&);
1037     void didFindStringMatches(const String&, const Vector<Vector<WebCore::IntRect>>& matchRects, int32_t firstIndexAfterSelection);
1038
1039     void getContentsAsString(WTF::Function<void (const String&, CallbackBase::Error)>&&);
1040 #if PLATFORM(COCOA)
1041     void getContentsAsAttributedString(CompletionHandler<void(const AttributedString&)>&&);
1042 #endif
1043     void getBytecodeProfile(WTF::Function<void (const String&, CallbackBase::Error)>&&);
1044     void getSamplingProfilerOutput(WTF::Function<void (const String&, CallbackBase::Error)>&&);
1045
1046 #if ENABLE(MHTML)
1047     void getContentsAsMHTMLData(Function<void (API::Data*, CallbackBase::Error)>&&);
1048 #endif
1049     void getMainResourceDataOfFrame(WebFrameProxy*, Function<void (API::Data*, CallbackBase::Error)>&&);
1050     void getResourceDataFromFrame(WebFrameProxy*, API::URL*, Function<void (API::Data*, CallbackBase::Error)>&&);
1051     void getRenderTreeExternalRepresentation(WTF::Function<void (const String&, CallbackBase::Error)>&&);
1052     void getSelectionOrContentsAsString(WTF::Function<void (const String&, CallbackBase::Error)>&&);
1053     void getSelectionAsWebArchiveData(Function<void (API::Data*, CallbackBase::Error)>&&);
1054     void getSourceForFrame(WebFrameProxy*, WTF::Function<void (const String&, CallbackBase::Error)>&&);
1055     void getWebArchiveOfFrame(WebFrameProxy*, Function<void (API::Data*, CallbackBase::Error)>&&);
1056     void runJavaScriptInMainFrame(const String&, bool, WTF::Function<void (API::SerializedScriptValue*, bool hadException, const WebCore::ExceptionDetails&, CallbackBase::Error)>&& callbackFunction);
1057     void runJavaScriptInMainFrameScriptWorld(const String&, bool, const Optional<String>& worldName, WTF::Function<void(API::SerializedScriptValue*, bool hadException, const WebCore::ExceptionDetails&, CallbackBase::Error)>&& callbackFunction);
1058     // For sub frames.
1059     void runJavaScriptInFrame(WebCore::FrameIdentifier, const String& script, bool forceUserGesture, WTF::Function<void(API::SerializedScriptValue*, bool hadException, const WebCore::ExceptionDetails&, CallbackBase::Error)>&& callbackFunction);
1060     void forceRepaint(RefPtr<VoidCallback>&&);
1061
1062     float headerHeight(WebFrameProxy&);
1063     float footerHeight(WebFrameProxy&);
1064     void drawHeader(WebFrameProxy&, WebCore::FloatRect&&);
1065     void drawFooter(WebFrameProxy&, WebCore::FloatRect&&);
1066
1067 #if PLATFORM(COCOA)
1068     // Dictionary.
1069     void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
1070     void performDictionaryLookupOfCurrentSelection();
1071 #endif
1072
1073     class PolicyDecisionSender;
1074     enum class WillContinueLoadInNewProcess : bool { No, Yes };
1075     void receivedPolicyDecision(WebCore::PolicyAction, API::Navigation*, Optional<WebsitePoliciesData>&&, Ref<PolicyDecisionSender>&&, WillContinueLoadInNewProcess = WillContinueLoadInNewProcess::No);
1076     void receivedNavigationPolicyDecision(WebCore::PolicyAction, API::Navigation*, ProcessSwapRequestedByClient, WebFrameProxy&, API::WebsitePolicies*, Ref<PolicyDecisionSender>&&);
1077
1078     void backForwardRemovedItem(const WebCore::BackForwardItemIdentifier&);
1079
1080 #if ENABLE(DRAG_SUPPORT)    
1081     // Drag and drop support.
1082     void dragEntered(WebCore::DragData&, const String& dragStorageName = String());
1083     void dragUpdated(WebCore::DragData&, const String& dragStorageName = String());
1084     void dragExited(WebCore::DragData&, const String& dragStorageName = String());
1085     void performDragOperation(WebCore::DragData&, const String& dragStorageName, SandboxExtension::Handle&&, SandboxExtension::HandleArray&&);
1086     void didPerformDragOperation(bool handled);
1087
1088     void didPerformDragControllerAction(uint64_t dragOperation, WebCore::DragHandlingMethod, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, const WebCore::IntRect& insertionRect, const WebCore::IntRect& editableElementRect);
1089     void dragEnded(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t operation);
1090     void didStartDrag();
1091     void dragCancelled();
1092     void setDragCaretRect(const WebCore::IntRect&);
1093 #if PLATFORM(COCOA)
1094     void startDrag(const WebCore::DragItem&, const ShareableBitmap::Handle& dragImageHandle);
1095     void setPromisedDataForImage(const String& pasteboardName, const SharedMemory::Handle& imageHandle, uint64_t imageSize, const String& filename, const String& extension,
1096                          const String& title, const String& url, const String& visibleURL, const SharedMemory::Handle& archiveHandle, uint64_t archiveSize);
1097 #endif
1098 #if PLATFORM(GTK)
1099     void startDrag(WebSelectionData&&, uint64_t dragOperation, const ShareableBitmap::Handle& dragImage);
1100 #endif
1101 #endif
1102
1103     void processDidBecomeUnresponsive();
1104     void processDidBecomeResponsive();
1105     void processDidTerminate(ProcessTerminationReason);
1106     void provisionalProcessDidTerminate();
1107     void dispatchProcessDidTerminate(ProcessTerminationReason);
1108     void willChangeProcessIsResponsive();
1109     void didChangeProcessIsResponsive();
1110
1111 #if PLATFORM(IOS_FAMILY)
1112     void processWillBecomeSuspended();
1113     void processWillBecomeForeground();
1114 #endif
1115
1116 #if HAVE(VISIBILITY_PROPAGATION_VIEW)
1117     void didCreateContextForVisibilityPropagation(LayerHostingContextID);
1118     LayerHostingContextID contextIDForVisibilityPropagation() const { return m_contextIDForVisibilityPropagation; }
1119 #endif
1120
1121     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
1122     virtual void exitAcceleratedCompositingMode();
1123     virtual void updateAcceleratedCompositingMode(const LayerTreeContext&);
1124
1125     void addEditCommand(WebEditCommandProxy&);
1126     void removeEditCommand(WebEditCommandProxy&);
1127     void registerEditCommand(Ref<WebEditCommandProxy>&&, UndoOrRedo);
1128
1129     bool canUndo();
1130     bool canRedo();
1131
1132 #if PLATFORM(COCOA)
1133     void registerKeypressCommandName(const String& name) { m_knownKeypressCommandNames.add(name); }
1134     bool isValidKeypressCommandName(const String& name) const { return m_knownKeypressCommandNames.contains(name); }
1135 #endif
1136
1137     WebProcessProxy& ensureRunningProcess();
1138     WebProcessProxy& process() const { return m_process; }
1139     ProcessID processIdentifier() const;
1140
1141     WebBackForwardCache& backForwardCache() const;
1142
1143     WebPreferences& preferences() { return m_preferences; }
1144     void setPreferences(WebPreferences&);
1145
1146     WebPageGroup& pageGroup() { return m_pageGroup; }
1147
1148     bool hasRunningProcess() const;
1149     void launchInitialProcessIfNecessary();
1150
1151 #if ENABLE(DRAG_SUPPORT)
1152     WebCore::DragOperation currentDragOperation() const { return m_currentDragOperation; }
1153     WebCore::DragHandlingMethod currentDragHandlingMethod() const { return m_currentDragHandlingMethod; }
1154     bool currentDragIsOverFileInput() const { return m_currentDragIsOverFileInput; }
1155     unsigned currentDragNumberOfFilesToBeAccepted() const { return m_currentDragNumberOfFilesToBeAccepted; }
1156     WebCore::IntRect currentDragCaretRect() const { return m_currentDragCaretRect; }
1157     WebCore::IntRect currentDragCaretEditableElementRect() const { return m_currentDragCaretEditableElementRect; }
1158     void resetCurrentDragInformation();
1159     void didEndDragging();
1160 #endif
1161
1162     void preferencesDidChange();
1163
1164 #if ENABLE(CONTEXT_MENUS)
1165     // Called by the WebContextMenuProxy.
1166     void contextMenuItemSelected(const WebContextMenuItemData&);
1167     void handleContextMenuKeyEvent();
1168 #endif
1169
1170     // Called by the WebOpenPanelResultListenerProxy.
1171 #if PLATFORM(IOS_FAMILY)
1172     void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const API::Data* iconData);
1173 #endif
1174     void didChooseFilesForOpenPanel(const Vector<String>&);
1175     void didCancelForOpenPanel();
1176
1177     WebPageCreationParameters creationParameters(WebProcessProxy&, DrawingAreaProxy&);
1178
1179     void handleDownloadRequest(DownloadProxy&);
1180
1181     void advanceToNextMisspelling(bool startBeforeSelection);
1182     void changeSpellingToWord(const String& word);
1183 #if USE(APPKIT)
1184     void uppercaseWord();
1185     void lowercaseWord();
1186     void capitalizeWord();
1187 #endif
1188
1189 #if PLATFORM(COCOA)
1190     bool isSmartInsertDeleteEnabled() const { return m_isSmartInsertDeleteEnabled; }
1191     void setSmartInsertDeleteEnabled(bool);
1192 #endif
1193
1194     void setCanRunModal(bool);
1195     bool canRunModal();
1196
1197     void beginPrinting(WebFrameProxy*, const PrintInfo&);
1198     void endPrinting();
1199     void computePagesForPrinting(WebFrameProxy*, const PrintInfo&, Ref<ComputedPagesCallback>&&);
1200 #if PLATFORM(COCOA)
1201     void drawRectToImage(WebFrameProxy*, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, Ref<ImageCallback>&&);
1202     void drawPagesToPDF(WebFrameProxy*, const PrintInfo&, uint32_t first, uint32_t count, Ref<DataCallback>&&);
1203     void drawToPDF(WebCore::FrameIdentifier, const Optional<WebCore::FloatRect>&, DrawToPDFCallback::CallbackFunction&&);
1204     void drawToPDFCallback(const IPC::DataReference& pdfData, WebKit::CallbackID);
1205 #if PLATFORM(IOS_FAMILY)
1206     uint32_t computePagesForPrintingAndDrawToPDF(WebCore::FrameIdentifier, const PrintInfo&, DrawToPDFCallback::CallbackFunction&&);
1207 #endif
1208 #elif PLATFORM(GTK)
1209     void drawPagesForPrinting(WebFrameProxy*, const PrintInfo&, Ref<PrintFinishedCallback>&&);
1210 #endif
1211
1212     PageLoadState& pageLoadState() { return m_pageLoadState; }
1213
1214 #if PLATFORM(COCOA)
1215     void handleAlternativeTextUIResult(const String& result);
1216 #endif
1217
1218     void saveDataToFileInDownloadsFolder(String&& suggestedFilename, String&& mimeType, URL&& originatingURL, API::Data&);
1219     void savePDFToFileInDownloadsFolder(String&& suggestedFilename, URL&& originatingURL, const IPC::DataReference&);
1220 #if PLATFORM(COCOA)
1221     void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const IPC::DataReference&, const String& pdfUUID);
1222     void openPDFFromTemporaryFolderWithNativeApplication(const String& pdfUUID);
1223 #endif
1224
1225 #if ENABLE(PDFKIT_PLUGIN)
1226     void showPDFContextMenu(const WebKit::PDFContextMenu&, CompletionHandler<void(Optional<int32_t>&&)>&&);
1227 #endif
1228     WebCore::IntRect visibleScrollerThumbRect() const { return m_visibleScrollerThumbRect; }
1229
1230     uint64_t renderTreeSize() const { return m_renderTreeSize; }
1231
1232     void setMediaVolume(float);
1233     void setMuted(WebCore::MediaProducer::MutedStateFlags);
1234     void setMayStartMediaWhenInWindow(bool);
1235     bool mayStartMediaWhenInWindow() const { return m_mayStartMediaWhenInWindow; }
1236     void setMediaCaptureEnabled(bool);
1237     bool mediaCaptureEnabled() const { return m_mediaCaptureEnabled; }
1238     void stopMediaCapture();
1239
1240     void stopAllMediaPlayback();
1241     void suspendAllMediaPlayback();
1242     void resumeAllMediaPlayback();
1243
1244 #if ENABLE(MEDIA_SESSION)
1245     bool hasMediaSessionWithActiveMediaElements() const { return m_hasMediaSessionWithActiveMediaElements; }
1246     void handleMediaEvent(WebCore::MediaEventType);
1247     void setVolumeOfMediaElement(double, uint64_t);
1248 #endif
1249         
1250 #if ENABLE(POINTER_LOCK)
1251     void didAllowPointerLock();
1252     void didDenyPointerLock();
1253 #endif
1254
1255     // WebPopupMenuProxy::Client
1256     NativeWebMouseEvent* currentlyProcessedMouseDownEvent() override;
1257
1258     void setSuppressVisibilityUpdates(bool flag);
1259     bool suppressVisibilityUpdates() { return m_suppressVisibilityUpdates; }
1260
1261 #if PLATFORM(IOS_FAMILY)
1262     void willStartUserTriggeredZooming();
1263
1264     void potentialTapAtPosition(const WebCore::FloatPoint&, bool shouldRequestMagnificationInformation, uint64_t& requestID);
1265     void commitPotentialTap(OptionSet<WebKit::WebEvent::Modifier>, TransactionID layerTreeTransactionIdAtLastTouchStart, WebCore::PointerID);
1266     void cancelPotentialTap();
1267     void tapHighlightAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
1268     void handleTap(const WebCore::FloatPoint&, OptionSet<WebKit::WebEvent::Modifier>, TransactionID layerTreeTransactionIdAtLastTouchStart);
1269     void didRecognizeLongPress();
1270     void handleDoubleTapForDoubleClickAtPoint(const WebCore::IntPoint&, OptionSet<WebEvent::Modifier>, TransactionID layerTreeTransactionIdAtLastTouchStart);
1271
1272     void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&);
1273     void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&);
1274
1275     void blurFocusedElement();
1276     void setIsShowingInputViewForFocusedElement(bool);
1277 #endif
1278
1279     void postMessageToInjectedBundle(const String& messageName, API::Object* messageBody);
1280
1281 #if ENABLE(INPUT_TYPE_COLOR)
1282     void setColorPickerColor(const WebCore::Color&);
1283     void endColorPicker();
1284 #endif
1285
1286     WebCore::IntSize minimumSizeForAutoLayout() const { return m_minimumSizeForAutoLayout; }
1287     void setMinimumSizeForAutoLayout(const WebCore::IntSize&);
1288
1289     bool autoSizingShouldExpandToViewHeight() const { return m_autoSizingShouldExpandToViewHeight; }
1290     void setAutoSizingShouldExpandToViewHeight(bool);
1291
1292     void setViewportSizeForCSSViewportUnits(const WebCore::IntSize&);
1293     WebCore::IntSize viewportSizeForCSSViewportUnits() const { return m_viewportSizeForCSSViewportUnits.valueOr(WebCore::IntSize()); }
1294
1295     void didReceiveAuthenticationChallengeProxy(Ref<AuthenticationChallengeProxy>&&);
1296
1297     SpellDocumentTag spellDocumentTag();
1298
1299     void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
1300     void didCancelCheckingText(uint64_t requestID);
1301         
1302     void setScrollPinningBehavior(WebCore::ScrollPinningBehavior);
1303     WebCore::ScrollPinningBehavior scrollPinningBehavior() const { return m_scrollPinningBehavior; }
1304
1305     void setOverlayScrollbarStyle(Optional<WebCore::ScrollbarOverlayStyle>);
1306     Optional<WebCore::ScrollbarOverlayStyle> overlayScrollbarStyle() const { return m_scrollbarOverlayStyle; }
1307
1308     // When the state of the window changes such that the WebPage needs immediate update, the UIProcess sends a new
1309     // ActivityStateChangeID to the WebProcess through the SetActivityState message. The UIProcess will wait till it
1310     // receives a CommitLayerTree which has an ActivityStateChangeID equal to or greater than the one it sent.
1311     ActivityStateChangeID takeNextActivityStateChangeID() { return ++m_currentActivityStateChangeID; }
1312
1313     bool shouldRecordNavigationSnapshots() const { return m_shouldRecordNavigationSnapshots; }
1314     void setShouldRecordNavigationSnapshots(bool shouldRecordSnapshots) { m_shouldRecordNavigationSnapshots = shouldRecordSnapshots; }
1315     void recordAutomaticNavigationSnapshot();
1316     void suppressNextAutomaticNavigationSnapshot() { m_shouldSuppressNextAutomaticNavigationSnapshot = true; }
1317     void recordNavigationSnapshot(WebBackForwardListItem&);
1318     void requestFocusedElementInformation(Function<void(const FocusedElementInformation&, CallbackBase::Error)>&&);
1319
1320 #if PLATFORM(COCOA) || PLATFORM(GTK)
1321     RefPtr<ViewSnapshot> takeViewSnapshot();
1322 #endif
1323
1324 #if ENABLE(WEB_CRYPTO)
1325     void wrapCryptoKey(const Vector<uint8_t>&, CompletionHandler<void(bool, Vector<uint8_t>&&)>&&);
1326     void unwrapCryptoKey(const Vector<uint8_t>&, CompletionHandler<void(bool, Vector<uint8_t>&&)>&&);
1327 #endif
1328
1329     void signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const URL&, CompletionHandler<void(String)>&&);
1330
1331     void takeSnapshot(WebCore::IntRect, WebCore::IntSize bitmapSize, SnapshotOptions, WTF::Function<void (const ShareableBitmap::Handle&, CallbackBase::Error)>&&);
1332
1333     void navigationGestureDidBegin();
1334     void navigationGestureWillEnd(bool willNavigate, WebBackForwardListItem&);
1335     void navigationGestureDidEnd(bool willNavigate, WebBackForwardListItem&);
1336     void navigationGestureDidEnd();
1337     void navigationGestureSnapshotWasRemoved();
1338     void willRecordNavigationSnapshot(WebBackForwardListItem&);
1339
1340     bool isShowingNavigationGestureSnapshot() const { return m_isShowingNavigationGestureSnapshot; }
1341
1342     bool isPlayingAudio() const { return !!(m_mediaState & WebCore::MediaProducer::IsPlayingAudio); }
1343     void isPlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags, uint64_t);
1344     void updatePlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags);
1345     bool isCapturingAudio() const { return m_mediaState & WebCore::MediaProducer::AudioCaptureMask; }
1346     bool isCapturingVideo() const { return m_mediaState & WebCore::MediaProducer::VideoCaptureMask; }
1347     bool hasActiveAudioStream() const { return m_mediaState & WebCore::MediaProducer::HasActiveAudioCaptureDevice; }
1348     bool hasActiveVideoStream() const { return m_mediaState & WebCore::MediaProducer::HasActiveVideoCaptureDevice; }
1349     WebCore::MediaProducer::MediaStateFlags mediaStateFlags() const { return m_mediaState; }
1350     void handleAutoplayEvent(WebCore::AutoplayEvent, OptionSet<WebCore::AutoplayEventFlags>);
1351
1352     void videoControlsManagerDidChange();
1353     bool hasActiveVideoForControlsManager() const;
1354     void requestControlledElementID() const;
1355     void handleControlledElementIDResponse(const String&) const;
1356     bool isPlayingVideoInEnhancedFullscreen() const;
1357
1358 #if PLATFORM(COCOA)
1359     void requestActiveNowPlayingSessionInfo(Ref<NowPlayingInfoCallback>&&);
1360     void nowPlayingInfoCallback(bool, bool, const String&, double, double, uint64_t, CallbackID);
1361 #endif
1362
1363 #if ENABLE(MEDIA_SESSION)
1364     void hasMediaSessionWithActiveMediaElementsDidChange(bool);
1365     void mediaSessionMetadataDidChange(const WebCore::MediaSessionMetadata&);
1366     void focusedContentMediaElementDidChange(uint64_t);
1367 #endif
1368
1369 #if PLATFORM(MAC)
1370     API::HitTestResult* lastMouseMoveHitTestResult() const { return m_lastMouseMoveHitTestResult.get(); }
1371     void performImmediateActionHitTestAtLocation(WebCore::FloatPoint);
1372
1373     void immediateActionDidUpdate();
1374     void immediateActionDidCancel();
1375     void immediateActionDidComplete();
1376
1377     NSObject *immediateActionAnimationControllerForHitTestResult(RefPtr<API::HitTestResult>, uint64_t, RefPtr<API::Object>);
1378
1379     void handleAcceptedCandidate(WebCore::TextCheckingResult);
1380     void didHandleAcceptedCandidate();
1381
1382     void setHeaderBannerHeightForTesting(int);
1383     void setFooterBannerHeightForTesting(int);
1384 #endif
1385
1386     bool scrollingUpdatesDisabledForTesting();
1387
1388     void installActivityStateChangeCompletionHandler(Function<void()>&&);
1389
1390 #if USE(UNIFIED_TEXT_CHECKING)
1391     void checkTextOfParagraph(const String& text, OptionSet<WebCore::TextCheckingType> checkingTypes, int32_t insertionPoint, CompletionHandler<void(Vector<WebCore::TextCheckingResult>&&)>&&);
1392 #endif
1393     void getGuessesForWord(const String& word, const String& context, int32_t insertionPoint, CompletionHandler<void(Vector<String>&&)>&&);
1394
1395     void setShouldDispatchFakeMouseMoveEvents(bool);
1396
1397     // Diagnostic messages logging.
1398     void logDiagnosticMessage(const String& message, const String& description, WebCore::ShouldSample);
1399     void logDiagnosticMessageWithResult(const String& message, const String& description, uint32_t result, WebCore::ShouldSample);
1400     void logDiagnosticMessageWithValue(const String& message, const String& description, double value, unsigned significantFigures, WebCore::ShouldSample);
1401     void logDiagnosticMessageWithEnhancedPrivacy(const String& message, const String& description, WebCore::ShouldSample);
1402     void logDiagnosticMessageWithValueDictionary(const String& message, const String& description, const WebCore::DiagnosticLoggingClient::ValueDictionary&, WebCore::ShouldSample);
1403
1404     // Performance logging.
1405     void logScrollingEvent(uint32_t eventType, MonotonicTime, uint64_t);
1406
1407     // Form validation messages.
1408     void showValidationMessage(const WebCore::IntRect& anchorClientRect, const String& message);
1409     void hideValidationMessage();
1410 #if PLATFORM(COCOA)
1411     WebCore::ValidationBubble* validationBubble() const { return m_validationBubble.get(); } // For testing.
1412 #endif
1413
1414 #if PLATFORM(IOS_FAMILY)
1415     void setIsKeyboardAnimatingIn(bool isKeyboardAnimatingIn) { m_isKeyboardAnimatingIn = isKeyboardAnimatingIn; }
1416     bool waitingForPostLayoutEditorStateUpdateAfterFocusingElement() const { return m_waitingForPostLayoutEditorStateUpdateAfterFocusingElement; }
1417 #endif
1418
1419 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
1420     void addPlaybackTargetPickerClient(uint64_t);
1421     void removePlaybackTargetPickerClient(uint64_t);
1422     void showPlaybackTargetPicker(uint64_t, const WebCore::FloatRect&, bool hasVideo);
1423     void playbackTargetPickerClientStateDidChange(uint64_t, WebCore::MediaProducer::MediaStateFlags);
1424     void setMockMediaPlaybackTargetPickerEnabled(bool);
1425     void setMockMediaPlaybackTargetPickerState(const String&, WebCore::MediaPlaybackTargetContext::State);
1426     void mockMediaPlaybackTargetPickerDismissPopup();
1427
1428     // WebMediaSessionManagerClient
1429     void setPlaybackTarget(uint64_t, Ref<WebCore::MediaPlaybackTarget>&&) override;
1430     void externalOutputDeviceAvailableDidChange(uint64_t, bool) override;
1431     void setShouldPlayToPlaybackTarget(uint64_t, bool) override;
1432     void playbackTargetPickerWasDismissed(uint64_t) override;
1433 #endif
1434
1435     void didChangeBackgroundColor();
1436     void didLayoutForCustomContentProvider();
1437
1438     // For testing
1439     void clearWheelEventTestMonitor();
1440     void callAfterNextPresentationUpdate(WTF::Function<void (CallbackBase::Error)>&&);
1441
1442     void didReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone>);
1443
1444     void didRestoreScrollPosition();
1445
1446     void getLoadDecisionForIcon(const WebCore::LinkIcon&, WebKit::CallbackID);
1447     void finishedLoadingIcon(WebKit::CallbackID, const IPC::DataReference&);
1448
1449     void setFocus(bool focused);
1450     void setWindowFrame(const WebCore::FloatRect&);
1451     void getWindowFrame(Messages::WebPageProxy::GetWindowFrameDelayedReply&&);
1452     void getWindowFrameWithCallback(Function<void(WebCore::FloatRect)>&&);
1453
1454     WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection();
1455     void setUserInterfaceLayoutDirection(WebCore::UserInterfaceLayoutDirection);
1456
1457     bool hasHadSelectionChangesFromUserInteraction() const { return m_hasHadSelectionChangesFromUserInteraction; }
1458     bool isTouchBarUpdateSupressedForHiddenContentEditable() const { return m_isTouchBarUpdateSupressedForHiddenContentEditable; }
1459     bool isNeverRichlyEditableForTouchBar() const { return m_isNeverRichlyEditableForTouchBar; }
1460
1461     bool isAlwaysOnLoggingAllowed() const;
1462
1463 #if ENABLE(GAMEPAD)
1464     void gamepadActivity(const Vector<GamepadData>&, bool shouldMakeGamepadsVisible);
1465 #endif
1466
1467     void isLoadingChanged() { activityStateDidChange(WebCore::ActivityState::IsLoading); }
1468
1469     void clearUserMediaState();
1470
1471     void setShouldSkipWaitingForPaintAfterNextViewDidMoveToWindow(bool shouldSkip) { m_shouldSkipWaitingForPaintAfterNextViewDidMoveToWindow = shouldSkip; }
1472
1473     void setURLSchemeHandlerForScheme(Ref<WebURLSchemeHandler>&&, const String& scheme);
1474     WebURLSchemeHandler* urlSchemeHandlerForScheme(const String& scheme);
1475
1476 #if PLATFORM(COCOA)
1477     void createSandboxExtensionsIfNeeded(const Vector<String>& files, SandboxExtension::Handle& fileReadHandle, SandboxExtension::HandleArray& fileUploadHandles);
1478 #endif
1479     void editorStateChanged(const EditorState&);
1480     void updateEditorState(const EditorState&);
1481     void scheduleFullEditorStateUpdate();
1482     void dispatchDidReceiveEditorStateAfterFocus();
1483
1484 #if PLATFORM(COCOA)
1485     void touchBarMenuDataRemoved();
1486     void touchBarMenuDataChanged(const TouchBarMenuData&);
1487     void touchBarMenuItemDataAdded(const TouchBarMenuItemData&);
1488     void touchBarMenuItemDataRemoved(const TouchBarMenuItemData&);
1489 #endif
1490
1491 #if ENABLE(RESOURCE_LOAD_STATISTICS)
1492     void requestStorageAccessConfirm(const WebCore::RegistrableDomain& subFrameDomain, const WebCore::RegistrableDomain& topFrameDomain, WebCore::FrameIdentifier, CompletionHandler<void(bool)>&&);
1493     void didCommitCrossSiteLoadWithDataTransferFromPrevalentResource();
1494 #endif
1495
1496 #if ENABLE(DEVICE_ORIENTATION)
1497     void shouldAllowDeviceOrientationAndMotionAccess(WebCore::FrameIdentifier, WebCore::SecurityOriginData&&, bool mayPrompt, CompletionHandler<void(WebCore::DeviceOrientationOrMotionPermissionState)>&&);
1498 #endif
1499
1500     static WebPageProxy* nonEphemeralWebPageProxy();
1501
1502 #if ENABLE(ATTACHMENT_ELEMENT)
1503     RefPtr<API::Attachment> attachmentForIdentifier(const String& identifier) const;
1504     void insertAttachment(Ref<API::Attachment>&&, Function<void(CallbackBase::Error)>&&);
1505     void updateAttachmentAttributes(const API::Attachment&, Function<void(CallbackBase::Error)>&&);
1506     void serializedAttachmentDataForIdentifiers(const Vector<String>&, CompletionHandler<void(Vector<WebCore::SerializedAttachmentData>&&)>&&);
1507     void registerAttachmentIdentifier(const String&);
1508     void didInvalidateDataForAttachment(API::Attachment&);
1509
1510     enum class ShouldUpdateAttachmentAttributes : bool { No, Yes };
1511     ShouldUpdateAttachmentAttributes willUpdateAttachmentAttributes(const API::Attachment&);
1512 #endif
1513
1514 #if ENABLE(APPLICATION_MANIFEST)
1515     void getApplicationManifest(Function<void(const Optional<WebCore::ApplicationManifest>&, CallbackBase::Error)>&&);
1516 #endif
1517
1518     WebPreferencesStore preferencesStore() const;
1519
1520     void setDefersLoadingForTesting(bool);
1521
1522     bool isPageOpenedByDOMShowingInitialEmptyDocument() const;
1523
1524     WebCore::IntRect syncRootViewToScreen(const WebCore::IntRect& viewRect);
1525
1526 #if ENABLE(DATALIST_ELEMENT)
1527     void didSelectOption(const String&);
1528     void didCloseSuggestions();
1529 #endif
1530
1531     void updateCurrentModifierState();
1532
1533 #if HAVE(PENCILKIT)
1534     EditableImageController& editableImageController() { return *m_editableImageController; }
1535 #endif
1536
1537     ProvisionalPageProxy* provisionalPageProxy() const { return m_provisionalPage.get(); }
1538     void commitProvisionalPage(WebCore::FrameIdentifier, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t frameLoadType, const WebCore::CertificateInfo&, bool containsPluginDocument, Optional<WebCore::HasInsecureContent> forcedHasInsecureContent, const UserData&);
1539
1540     // Logic shared between the WebPageProxy and the ProvisionalPageProxy.
1541     void didStartProvisionalLoadForFrameShared(Ref<WebProcessProxy>&&, WebCore::FrameIdentifier, uint64_t navigationID, URL&&, URL&& unreachableURL, const UserData&);
1542     void didFailProvisionalLoadForFrameShared(Ref<WebProcessProxy>&&, WebCore::FrameIdentifier, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, WebCore::WillContinueLoading, const UserData&);
1543     void didReceiveServerRedirectForProvisionalLoadForFrameShared(Ref<WebProcessProxy>&&, WebCore::FrameIdentifier, uint64_t navigationID, WebCore::ResourceRequest&&, const UserData&);
1544     void didPerformServerRedirectShared(Ref<WebProcessProxy>&&, const String& sourceURLString, const String& destinationURLString, WebCore::FrameIdentifier);
1545     void didPerformClientRedirectShared(Ref<WebProcessProxy>&&, const String& sourceURLString, const String& destinationURLString, WebCore::FrameIdentifier);
1546     void didNavigateWithNavigationDataShared(Ref<WebProcessProxy>&&, const WebNavigationDataStore&, WebCore::FrameIdentifier);
1547     void didChangeProvisionalURLForFrameShared(Ref<WebProcessProxy>&&, WebCore::FrameIdentifier, uint64_t navigationID, URL&&);
1548     void decidePolicyForNavigationActionAsyncShared(Ref<WebProcessProxy>&&, WebCore::PageIdentifier, WebCore::FrameIdentifier, WebCore::SecurityOriginData&& frameSecurityOrigin, WebCore::PolicyCheckIdentifier,
1549         uint64_t navigationID, NavigationActionData&&, FrameInfoData&&, Optional<WebPageProxyIdentifier> originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&,
1550         IPC::FormDataReference&& requestBody, WebCore::ResourceResponse&& redirectResponse, const UserData&, uint64_t listenerID);
1551     void decidePolicyForResponseShared(Ref<WebProcessProxy>&&, WebCore::PageIdentifier, WebCore::FrameIdentifier, const WebCore::SecurityOriginData& frameSecurityOrigin, WebCore::PolicyCheckIdentifier,
1552         uint64_t navigationID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, const String& downloadAttribute, uint64_t listenerID, const UserData&);
1553     void startURLSchemeTaskShared(Ref<WebProcessProxy>&&, WebCore::PageIdentifier, URLSchemeTaskParameters&&);
1554     void loadDataWithNavigationShared(Ref<WebProcessProxy>&&, WebCore::PageIdentifier, API::Navigation&, const IPC::DataReference&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData, WebCore::ShouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&& = WTF::nullopt, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow);
1555     void loadRequestWithNavigationShared(Ref<WebProcessProxy>&&, WebCore::PageIdentifier, API::Navigation&, WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, API::Object* userData, WebCore::ShouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&& = WTF::nullopt);
1556     void backForwardGoToItemShared(Ref<WebProcessProxy>&&, const WebCore::BackForwardItemIdentifier&, CompletionHandler<void(SandboxExtension::Handle&&)>&&);
1557     void decidePolicyForNavigationActionSyncShared(Ref<WebProcessProxy>&&, WebCore::FrameIdentifier, bool isMainFrame, WebCore::SecurityOriginData&&, WebCore::PolicyCheckIdentifier, uint64_t navigationID, NavigationActionData&&,
1558         FrameInfoData&&, Optional<WebPageProxyIdentifier> originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody,
1559         WebCore::ResourceResponse&& redirectResponse, const UserData&, Messages::WebPageProxy::DecidePolicyForNavigationActionSyncDelayedReply&&);
1560 #if USE(QUICK_LOOK)
1561     void requestPasswordForQuickLookDocumentInMainFrameShared(const String& fileName, CompletionHandler<void(const String&)>&&);
1562 #endif
1563 #if ENABLE(CONTENT_FILTERING)
1564     void contentFilterDidBlockLoadForFrameShared(Ref<WebProcessProxy>&&, const WebCore::ContentFilterUnblockHandler&, WebCore::FrameIdentifier);
1565 #endif
1566
1567     void dumpAdClickAttribution(CompletionHandler<void(const String&)>&&);
1568     void clearAdClickAttribution(CompletionHandler<void()>&&);
1569     void setAdClickAttributionOverrideTimerForTesting(bool value, CompletionHandler<void()>&&);
1570     void setAdClickAttributionConversionURLForTesting(const URL&, CompletionHandler<void()>&&);
1571     void markAdClickAttributionsAsExpiredForTesting(CompletionHandler<void()>&&);
1572
1573 #if ENABLE(SPEECH_SYNTHESIS)
1574     void speechSynthesisVoiceList(CompletionHandler<void(Vector<WebSpeechSynthesisVoice>&&)>&&);
1575     void speechSynthesisSpeak(const String&, const String&, float volume, float rate, float pitch, MonotonicTime startTime, const String& voiceURI, const String& voiceName, const String& voiceLang, bool localService, bool defaultVoice, CompletionHandler<void()>&&);
1576     void speechSynthesisSetFinishedCallback(CompletionHandler<void()>&&);
1577     void speechSynthesisCancel();
1578     void speechSynthesisPause(CompletionHandler<void()>&&);
1579     void speechSynthesisResume(CompletionHandler<void()>&&);
1580 #endif
1581
1582     void configureLoggingChannel(const String&, WTFLogChannelState, WTFLogLevel);
1583
1584     void addObserver(WebViewDidMoveToWindowObserver&);
1585     void removeObserver(WebViewDidMoveToWindowObserver&);
1586     void webViewDidMoveToWindow();
1587
1588 #if HAVE(APP_SSO)
1589     void setShouldSuppressSOAuthorizationInAllNavigationPolicyDecision() { m_shouldSuppressSOAuthorizationInAllNavigationPolicyDecision = true; }
1590     void setShouldSuppressSOAuthorizationInNextNavigationPolicyDecision() { m_shouldSuppressSOAuthorizationInNextNavigationPolicyDecision = true; }
1591     void decidePolicyForSOAuthorizationLoad(const String&, CompletionHandler<void(SOAuthorizationLoadPolicy)>&&);
1592 #endif
1593
1594     Logger& logger();
1595
1596     // IPC::MessageReceiver
1597     // Implemented in generated WebPageProxyMessageReceiver.cpp
1598     void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
1599     void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override;
1600
1601     void requestStorageSpace(WebCore::FrameIdentifier, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, WTF::CompletionHandler<void(uint64_t)>&&);
1602
1603     URL currentResourceDirectoryURL() const;
1604
1605 #if ENABLE(MEDIA_STREAM)
1606     void setMockCaptureDevicesEnabledOverride(Optional<bool>);
1607 #endif
1608
1609     void maybeInitializeSandboxExtensionHandle(WebProcessProxy&, const URL&, const URL& resourceDirectoryURL, SandboxExtension::Handle&);
1610
1611 #if ENABLE(WEB_AUTHN)
1612     void setMockWebAuthenticationConfiguration(WebCore::MockWebAuthenticationConfiguration&&);
1613 #endif
1614
1615     using TextManipulationItemCallback = WTF::Function<void (WebCore::TextManipulationController::ItemIdentifier, const Vector<WebCore::TextManipulationController::ManipulationToken>&)>;
1616     void startTextManipulations(const Vector<WebCore::TextManipulationController::ExclusionRule>&, TextManipulationItemCallback&&, WTF::CompletionHandler<void()>&&);
1617     void didFindTextManipulationItem(WebCore::TextManipulationController::ItemIdentifier, const Vector<WebCore::TextManipulationController::ManipulationToken>&);
1618     void completeTextManipulation(WebCore::TextManipulationController::ItemIdentifier, const Vector<WebCore::TextManipulationController::ManipulationToken>&,
1619         WTF::Function<void (WebCore::TextManipulationController::ManipulationResult)>&&);
1620
1621 private:
1622     WebPageProxy(PageClient&, WebProcessProxy&, Ref<API::PageConfiguration>&&);
1623     void platformInitialize();
1624
1625     void notifyProcessPoolToPrewarm();
1626     bool shouldUseBackForwardCache() const;
1627
1628     RefPtr<API::Navigation> goToBackForwardItem(WebBackForwardListItem&, WebCore::FrameLoadType);
1629
1630     void updateActivityState(OptionSet<WebCore::ActivityState::Flag> flagsToUpdate = WebCore::ActivityState::allFlags());
1631     void updateThrottleState();
1632     void updateHiddenPageThrottlingAutoIncreases();
1633
1634     bool suspendCurrentPageIfPossible(API::Navigation&, Optional<WebCore::FrameIdentifier> mainFrameID, ProcessSwapRequestedByClient, ShouldDelayClosingUntilEnteringAcceleratedCompositingMode);
1635
1636     enum class ResetStateReason {
1637         PageInvalidated,
1638         WebProcessExited,
1639         NavigationSwap,
1640     };
1641     void resetState(ResetStateReason);
1642     void resetStateAfterProcessExited(ProcessTerminationReason);
1643
1644     void setUserAgent(String&&);
1645
1646     // IPC::MessageSender
1647     bool sendMessage(std::unique_ptr<IPC::Encoder>, OptionSet<IPC::SendOption>) override;
1648     IPC::Connection* messageSenderConnection() const override;
1649     uint64_t messageSenderDestinationID() const override;
1650
1651     // WebPopupMenuProxy::Client
1652     void valueChangedForPopupMenu(WebPopupMenuProxy*, int32_t newSelectedIndex) override;
1653     void setTextFromItemForPopupMenu(WebPopupMenuProxy*, int32_t index) override;
1654 #if PLATFORM(GTK)
1655     void failedToShowPopupMenu() override;
1656 #endif
1657
1658 #if ENABLE(POINTER_LOCK)
1659     void requestPointerLock();
1660     void requestPointerUnlock();
1661 #endif
1662
1663     void didCreateMainFrame(WebCore::FrameIdentifier);
1664     void didCreateSubframe(WebCore::FrameIdentifier);
1665     void didCreateWindow(WebCore::FrameIdentifier, WebCore::GlobalWindowIdentifier&&);
1666
1667     void didStartProvisionalLoadForFrame(WebCore::FrameIdentifier, uint64_t navigationID, URL&&, URL&& unreachableURL, const UserData&);
1668     void didReceiveServerRedirectForProvisionalLoadForFrame(WebCore::FrameIdentifier, uint64_t navigationID, WebCore::ResourceRequest&&, const UserData&);
1669     void willPerformClientRedirectForFrame(WebCore::FrameIdentifier, const String& url, double delay, WebCore::LockBackForwardList);
1670     void didCancelClientRedirectForFrame(WebCore::FrameIdentifier);
1671     void didChangeProvisionalURLForFrame(WebCore::FrameIdentifier, uint64_t navigationID, URL&&);
1672     void didFailProvisionalLoadForFrame(WebCore::FrameIdentifier, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, WebCore::WillContinueLoading, const UserData&);
1673     void didCommitLoadForFrame(WebCore::FrameIdentifier, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t frameLoadType, const WebCore::CertificateInfo&, bool containsPluginDocument, Optional<WebCore::HasInsecureContent> forcedHasInsecureContent, const UserData&);
1674     void didFinishDocumentLoadForFrame(WebCore::FrameIdentifier, uint64_t navigationID, const UserData&);
1675     void didFinishLoadForFrame(WebCore::FrameIdentifier, uint64_t navigationID, const UserData&);
1676     void didFailLoadForFrame(WebCore::FrameIdentifier, uint64_t navigationID, const WebCore::ResourceError&, const UserData&);
1677     void didSameDocumentNavigationForFrame(WebCore::FrameIdentifier, uint64_t navigationID, uint32_t sameDocumentNavigationType, URL&&, const UserData&);
1678     void didChangeMainDocument(WebCore::FrameIdentifier);
1679     void didExplicitOpenForFrame(WebCore::FrameIdentifier, URL&&, String&& mimeType);
1680
1681     void didReceiveTitleForFrame(WebCore::FrameIdentifier, const String&, const UserData&);
1682     void didFirstLayoutForFrame(WebCore::FrameIdentifier, const UserData&);
1683     void didFirstVisuallyNonEmptyLayoutForFrame(WebCore::FrameIdentifier, const UserData&);
1684     void didDisplayInsecureContentForFrame(WebCore::FrameIdentifier, const UserData&);
1685     void didRunInsecureContentForFrame(WebCore::FrameIdentifier, const UserData&);
1686     void didDetectXSSForFrame(WebCore::FrameIdentifier, const UserData&);
1687     void mainFramePluginHandlesPageScaleGestureDidChange(bool);
1688     void frameDidBecomeFrameSet(WebCore::FrameIdentifier, bool);
1689     void didStartProgress();
1690     void didChangeProgress(double);
1691     void didFinishProgress();
1692     void setNetworkRequestsInProgress(bool);
1693
1694     void hasInsecureContent(CompletionHandler<void(WebCore::HasInsecureContent)>&&);
1695
1696     void didDestroyNavigation(uint64_t navigationID);
1697
1698     void decidePolicyForNavigationAction(Ref<WebProcessProxy>&&, WebFrameProxy&, WebCore::SecurityOriginData&&, uint64_t navigationID, NavigationActionData&&,
1699         FrameInfoData&&, Optional<WebPageProxyIdentifier> originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody,
1700         WebCore::ResourceResponse&& redirectResponse, const UserData&, Ref<PolicyDecisionSender>&&);
1701     void decidePolicyForNavigationActionAsync(WebCore::FrameIdentifier, WebCore::SecurityOriginData&&, WebCore::PolicyCheckIdentifier, uint64_t navigationID, NavigationActionData&&,
1702         FrameInfoData&&, Optional<WebPageProxyIdentifier> originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody,
1703         WebCore::ResourceResponse&& redirectResponse, const UserData&, uint64_t listenerID);
1704     void decidePolicyForNavigationActionSync(WebCore::FrameIdentifier, bool isMainFrame, WebCore::SecurityOriginData&&, WebCore::PolicyCheckIdentifier, uint64_t navigationID, NavigationActionData&&,
1705         FrameInfoData&&, Optional<WebPageProxyIdentifier> originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody,
1706         WebCore::ResourceResponse&& redirectResponse, const UserData&, Messages::WebPageProxy::DecidePolicyForNavigationActionSyncDelayedReply&&);
1707     void decidePolicyForNewWindowAction(WebCore::FrameIdentifier, const WebCore::SecurityOriginData&, WebCore::PolicyCheckIdentifier, NavigationActionData&&,
1708         WebCore::ResourceRequest&&, const String& frameName, uint64_t listenerID, const UserData&);
1709     void decidePolicyForResponse(WebCore::FrameIdentifier, const WebCore::SecurityOriginData&, WebCore::PolicyCheckIdentifier, uint64_t navigationID,
1710         const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, const String& downloadAttribute, uint64_t listenerID, const UserData&);
1711     void unableToImplementPolicy(WebCore::FrameIdentifier, const WebCore::ResourceError&, const UserData&);
1712     void beginSafeBrowsingCheck(const URL&, bool, WebFramePolicyListenerProxy&);
1713
1714     WebContentMode effectiveContentModeAfterAdjustingPolicies(API::WebsitePolicies&, const WebCore::ResourceRequest&);
1715
1716     void willSubmitForm(WebCore::FrameIdentifier, WebCore::FrameIdentifier sourceFrameID, const Vector<std::pair<String, String>>& textFieldValues, uint64_t listenerID, const UserData&);
1717
1718     void contentRuleListNotification(URL&&, WebCore::ContentRuleListResults&&);
1719
1720     // History client
1721     void didNavigateWithNavigationData(const WebNavigationDataStore&, WebCore::FrameIdentifier);
1722     void didPerformClientRedirect(const String& sourceURLString, const String& destinationURLString, WebCore::FrameIdentifier);
1723     void didPerformServerRedirect(const String& sourceURLString, const String& destinationURLString, WebCore::FrameIdentifier);
1724     void didUpdateHistoryTitle(const String& title, const String& url, WebCore::FrameIdentifier);
1725
1726     // UI client
1727     void createNewPage(const FrameInfoData&, Optional<WebPageProxyIdentifier> originatingPageID, WebCore::ResourceRequest&&, WebCore::WindowFeatures&&, NavigationActionData&&, Messages::WebPageProxy::CreateNewPageDelayedReply&&);
1728     void showPage();
1729     void runJavaScriptAlert(WebCore::FrameIdentifier, const WebCore::SecurityOriginData&, const String&, Messages::WebPageProxy::RunJavaScriptAlertDelayedReply&&);
1730     void runJavaScriptConfirm(WebCore::FrameIdentifier, const WebCore::SecurityOriginData&, const String&, Messages::WebPageProxy::RunJavaScriptConfirmDelayedReply&&);
1731     void runJavaScriptPrompt(WebCore::FrameIdentifier, const WebCore::SecurityOriginData&, const String&, const String&, Messages::WebPageProxy::RunJavaScriptPromptDelayedReply&&);
1732     void setStatusText(const String&);
1733     void mouseDidMoveOverElement(WebHitTestResultData&&, uint32_t modifiers, UserData&&);
1734
1735 #if ENABLE(NETSCAPE_PLUGIN_API)
1736     void unavailablePluginButtonClicked(uint32_t opaquePluginUnavailabilityReason, const String& mimeType, const String& pluginURLString, const String& pluginsPageURLString, const String& frameURLString, const String& pageURLString);
1737 #endif // ENABLE(NETSCAPE_PLUGIN_API)
1738 #if ENABLE(WEBGL)
1739     void webGLPolicyForURL(URL&&, Messages::WebPageProxy::WebGLPolicyForURLDelayedReply&&);
1740     void resolveWebGLPolicyForURL(URL&&, Messages::WebPageProxy::ResolveWebGLPolicyForURLDelayedReply&&);
1741 #endif // ENABLE(WEBGL)
1742     void setToolbarsAreVisible(bool toolbarsAreVisible);
1743     void getToolbarsAreVisible(Messages::WebPageProxy::GetToolbarsAreVisibleDelayedReply&&);
1744     void setMenuBarIsVisible(bool menuBarIsVisible);
1745     void getMenuBarIsVisible(Messages::WebPageProxy::GetMenuBarIsVisibleDelayedReply&&);
1746     void setStatusBarIsVisible(bool statusBarIsVisible);
1747     void getStatusBarIsVisible(Messages::WebPageProxy::GetStatusBarIsVisibleDelayedReply&&);
1748     void getIsViewVisible(bool&);
1749     void setIsResizable(bool isResizable);
1750     void screenToRootView(const WebCore::IntPoint& screenPoint, Messages::WebPageProxy::ScreenToRootViewDelayedReply&&);
1751     void rootViewToScreen(const WebCore::IntRect& viewRect, Messages::WebPageProxy::RootViewToScreenDelayedReply&&);
1752     void accessibilityScreenToRootView(const WebCore::IntPoint& screenPoint, CompletionHandler<void(WebCore::IntPoint)>&&);
1753     void rootViewToAccessibilityScreen(const WebCore::IntRect& viewRect, CompletionHandler<void(WebCore::IntRect)>&&);
1754     void runBeforeUnloadConfirmPanel(WebCore::FrameIdentifier, const WebCore::SecurityOriginData&, const String& message, Messages::WebPageProxy::RunBeforeUnloadConfirmPanelDelayedReply&&);
1755     void didChangeViewportProperties(const WebCore::ViewportAttributes&);
1756     void pageDidScroll();
1757     void runOpenPanel(WebCore::FrameIdentifier, const WebCore::SecurityOriginData&, const WebCore::FileChooserSettings&);
1758     void showShareSheet(const WebCore::ShareDataWithParsedURL&, ShareSheetCallbackID);
1759     void printFrame(WebCore::FrameIdentifier, CompletionHandler<void()>&&);
1760     void exceededDatabaseQuota(WebCore::FrameIdentifier, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, Messages::WebPageProxy::ExceededDatabaseQuotaDelayedReply&&);
1761     void reachedApplicationCacheOriginQuota(const String& originIdentifier, uint64_t currentQuota, uint64_t totalBytesNeeded, Messages::WebPageProxy::ReachedApplicationCacheOriginQuotaDelayedReply&&);
1762     void requestGeolocationPermissionForFrame(uint64_t geolocationID, WebCore::FrameIdentifier, String originIdentifier);
1763
1764 #if PLATFORM(GTK) || PLATFORM(WPE)
1765     void sendMessageToWebView(UserMessage&&);
1766     void sendMessageToWebViewWithReply(UserMessage&&, CompletionHandler<void(UserMessage&&)>&&);
1767 #endif
1768
1769 #if ENABLE(MEDIA_STREAM)
1770     UserMediaPermissionRequestManagerProxy& userMediaPermissionRequestManager();
1771 #endif
1772     void requestUserMediaPermissionForFrame(uint64_t userMediaID, WebCore::FrameIdentifier, const WebCore::SecurityOriginData& userMediaDocumentOriginIdentifier, const WebCore::SecurityOriginData& topLevelDocumentOriginIdentifier, WebCore::MediaStreamRequest&&);
1773     void enumerateMediaDevicesForFrame(WebCore::FrameIdentifier, const WebCore::SecurityOriginData& userMediaDocumentOriginData, const WebCore::SecurityOriginData& topLevelDocumentOriginData, CompletionHandler<void(const Vector<WebCore::CaptureDevice>&, const String&)>&&);
1774     void beginMonitoringCaptureDevices();
1775
1776     void runModal();
1777     void notifyScrollerThumbIsVisibleInRect(const WebCore::IntRect&);
1778     void recommendedScrollbarStyleDidChange(int32_t newStyle);
1779     void didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar);
1780     void didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide, bool pinnedToTopSide, bool pinnedToBottomSide);
1781     void didChangePageCount(unsigned);
1782     void pageExtendedBackgroundColorDidChange(const WebCore::Color&);
1783 #if ENABLE(NETSCAPE_PLUGIN_API)
1784     void didFailToInitializePlugin(const String& mimeType, const String& frameURLString, const String& pageURLString);
1785     void didBlockInsecurePluginVersion(const String& mimeType, const String& pluginURLString, const String& frameURLString, const String& pageURLString, bool replacementObscured);
1786 #endif // ENABLE(NETSCAPE_PLUGIN_API)
1787     void setCanShortCircuitHorizontalWheelEvents(bool canShortCircuitHorizontalWheelEvents) { m_canShortCircuitHorizontalWheelEvents = canShortCircuitHorizontalWheelEvents; }
1788
1789     enum class ProcessLaunchReason {
1790         InitialProcess,
1791         ProcessSwap,
1792         Crash
1793     };
1794
1795     void launchProcess(const WebCore::RegistrableDomain&, ProcessLaunchReason);
1796     void swapToWebProcess(Ref<WebProcessProxy>&&, WebCore::PageIdentifier, std::unique_ptr<DrawingAreaProxy>&&, RefPtr<WebFrameProxy>&& mainFrame);
1797     void didFailToSuspendAfterProcessSwap();
1798     void didSuspendAfterProcessSwap();
1799     void finishAttachingToWebProcess(ProcessLaunchReason);
1800
1801     RefPtr<API::Navigation> launchProcessForReload();
1802     RefPtr<API::Navigation> launchProcessWithItem(WebBackForwardListItem&);
1803
1804     void requestNotificationPermission(uint64_t notificationID, const String& originString);
1805     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);
1806     void cancelNotification(uint64_t notificationID);
1807     void clearNotifications(const Vector<uint64_t>& notificationIDs);
1808     void didDestroyNotification(uint64_t notificationID);
1809
1810     void didChangeContentSize(const WebCore::IntSize&);
1811     void didChangeIntrinsicContentSize(const WebCore::IntSize&);
1812
1813 #if ENABLE(INPUT_TYPE_COLOR)
1814     void showColorPicker(const WebCore::Color& initialColor, const WebCore::IntRect&, Vector<WebCore::Color>&&);
1815     void didChooseColor(const WebCore::Color&) override;
1816     void didEndColorPicker() override;
1817 #endif
1818
1819 #if ENABLE(DATALIST_ELEMENT)
1820     void showDataListSuggestions(WebCore::DataListSuggestionInformation&&);
1821     void handleKeydownInDataList(const String&);
1822     void endDataListSuggestions();
1823 #endif
1824
1825     void closeOverlayedViews();
1826
1827     void compositionWasCanceled();
1828     void setHasHadSelectionChangesFromUserInteraction(bool);
1829     void setIsTouchBarUpdateSupressedForHiddenContentEditable(bool);
1830     void setIsNeverRichlyEditableForTouchBar(bool);
1831
1832     void requestDOMPasteAccess(const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&);
1833
1834     // Back/Forward list management
1835     void backForwardAddItem(BackForwardListItemState&&);
1836     void backForwardGoToItem(const WebCore::BackForwardItemIdentifier&, CompletionHandler<void(SandboxExtension::Handle&&)>&&);
1837     void backForwardItemAtIndex(int32_t index, CompletionHandler<void(Optional<WebCore::BackForwardItemIdentifier>&&)>&&);
1838     void backForwardBackListCount(CompletionHandler<void(uint32_t)>&&);
1839     void backForwardForwardListCount(CompletionHandler<void(uint32_t)>&&);
1840     void backForwardClear();
1841
1842     // Undo management
1843     void registerEditCommandForUndo(WebUndoStepID commandID, const String& label);
1844     void registerInsertionUndoGrouping();
1845     void clearAllEditCommands();
1846     void canUndoRedo(UndoOrRedo, CompletionHandler<void(bool)>&&);
1847     void executeUndoRedo(UndoOrRedo, CompletionHandler<void()>&&);
1848
1849     // Keyboard handling
1850 #if PLATFORM(COCOA)
1851     void executeSavedCommandBySelector(const String& selector, CompletionHandler<void(bool)>&&);
1852 #endif
1853
1854 #if PLATFORM(GTK)
1855     void getEditorCommandsForKeyEvent(const AtomString&, Vector<String>&);
1856 #endif
1857
1858 #if USE(ATK)
1859     void bindAccessibilityTree(const String&);
1860     void showEmojiPicker(const WebCore::IntRect&, CompletionHandler<void(String)>&&);
1861 #endif
1862
1863     // Popup Menu.
1864     void showPopupMenu(const WebCore::IntRect& rect, uint64_t textDirection, const Vector<WebPopupItem>& items, int32_t selectedIndex, const PlatformPopupMenuData&);
1865     void hidePopupMenu();
1866
1867 #if ENABLE(CONTEXT_MENUS)
1868     void showContextMenu(ContextMenuContextData&&, const UserData&);
1869 #endif
1870
1871 #if ENABLE(TELEPHONE_NUMBER_DETECTION)
1872 #if PLATFORM(MAC)
1873     void showTelephoneNumberMenu(const String& telephoneNumber, const WebCore::IntPoint&);
1874 #endif
1875 #endif
1876
1877     // Search popup results
1878     void saveRecentSearches(const String&, const Vector<WebCore::RecentSearch>&);
1879     void loadRecentSearches(const String&, CompletionHandler<void(Vector<WebCore::RecentSearch>&&)>&&);
1880
1881 #if PLATFORM(COCOA)
1882     // Speech.
1883     void getIsSpeaking(CompletionHandler<void(bool)>&&);
1884     void speak(const String&);
1885     void stopSpeaking();
1886
1887     // Spotlight.
1888     void searchWithSpotlight(const String&);
1889         
1890     void searchTheWeb(const String&);
1891
1892     // Dictionary.
1893     void didPerformDictionaryLookup(const WebCore::DictionaryPopupInfo&);
1894 #endif
1895
1896 #if PLATFORM(MAC)
1897     bool appleMailPaginationQuirkEnabled();
1898 #endif
1899
1900 #if PLATFORM(MAC)
1901     // FIXME: Need to support iOS too, but there is no isAppleMail for iOS.
1902     bool appleMailLinesClampEnabled();
1903 #endif
1904
1905     // Spelling and grammar.
1906     void checkSpellingOfString(const String& text, CompletionHandler<void(int32_t misspellingLocation, int32_t misspellingLength)>&&);
1907     void checkGrammarOfString(const String& text, CompletionHandler<void(Vector<WebCore::GrammarDetail>&&, int32_t badGrammarLocation, int32_t badGrammarLength)>&&);
1908     void spellingUIIsShowing(CompletionHandler<void(bool)>&&);
1909     void updateSpellingUIWithMisspelledWord(const String& misspelledWord);
1910     void updateSpellingUIWithGrammarString(const String& badGrammarPhrase, const WebCore::GrammarDetail&);
1911     void learnWord(const String& word);
1912     void ignoreWord(const String& word);
1913     void requestCheckingOfString(uint64_t requestID, const WebCore::TextCheckingRequestData&, int32_t insertionPoint);
1914
1915     void takeFocus(uint32_t direction);
1916     void setToolTip(const String&);
1917     void setCursor(const WebCore::Cursor&);
1918     void setCursorHiddenUntilMouseMoves(bool);
1919
1920     void didReceiveEvent(uint32_t opaqueType, bool handled);
1921
1922     void voidCallback(CallbackID);
1923     void dataCallback(const IPC::DataReference&, CallbackID);
1924     void imageCallback(const ShareableBitmap::Handle&, CallbackID);
1925     void stringCallback(const String&, CallbackID);
1926     void invalidateStringCallback(CallbackID);
1927     void scriptValueCallback(const IPC::DataReference&, bool hadException, const WebCore::ExceptionDetails&, CallbackID);
1928     void computedPagesCallback(const Vector<WebCore::IntRect>&, double totalScaleFactorForPrinting, const WebCore::FloatBoxExtent& computedPageMargin, CallbackID);
1929     void validateCommandCallback(const String&, bool, int, CallbackID);
1930     void unsignedCallback(uint64_t, CallbackID);
1931     void editingRangeCallback(const EditingRange&, CallbackID);
1932 #if ENABLE(APPLICATION_MANIFEST)
1933     void applicationManifestCallback(const Optional<WebCore::ApplicationManifest>&, CallbackID);
1934 #endif
1935 #if PLATFORM(COCOA)
1936     void machSendRightCallback(const WTF::MachSendRight&, CallbackID);
1937 #endif
1938     void rectForCharacterRangeCallback(const WebCore::IntRect&, const EditingRange&, CallbackID);
1939 #if PLATFORM(MAC)
1940     void attributedStringForCharacterRangeCallback(const AttributedString&, const EditingRange&, CallbackID);
1941     void fontAtSelectionCallback(const FontInfo&, double, bool, CallbackID);
1942 #endif
1943 #if PLATFORM(IOS_FAMILY)
1944     void gestureCallback(const WebCore::IntPoint&, uint32_t gestureType, uint32_t gestureState, uint32_t flags, CallbackID);
1945     void touchesCallback(const WebCore::IntPoint&, uint32_t touches, uint32_t flags, CallbackID);
1946     void selectionContextCallback(const String& selectedText, const String& beforeText, const String& afterText, CallbackID);
1947     void interpretKeyEvent(const EditorState&, bool isCharEvent, CompletionHandler<void(bool)>&&);
1948     void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect, WebCore::RouteSharingPolicy, const String&);
1949     void selectionRectsCallback(const Vector<WebCore::SelectionRect>&, CallbackID);
1950
1951     void updateStringForFind(const String&);
1952 #endif
1953 #if PLATFORM(GTK)
1954     void printFinishedCallback(const WebCore::ResourceError&, CallbackID);
1955 #endif
1956
1957     void focusedFrameChanged(const Optional<WebCore::FrameIdentifier>&);
1958     void frameSetLargestFrameChanged(const Optional<WebCore::FrameIdentifier>&);
1959
1960     void didFinishLoadingDataForCustomContentProvider(const String& suggestedFilename, const IPC::DataReference&);
1961
1962 #if PLATFORM(COCOA)
1963     void pluginFocusOrWindowFocusChanged(uint64_t pluginComplexTextInputIdentifier, bool pluginHasFocusAndWindowHasFocus);
1964     void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, uint64_t complexTextInputState);
1965 #endif
1966
1967 #if USE(AUTOMATIC_TEXT_REPLACEMENT)
1968     void toggleSmartInsertDelete();
1969     void toggleAutomaticQuoteSubstitution();
1970     void toggleAutomaticLinkDetection();
1971     void toggleAutomaticDashSubstitution();
1972     void toggleAutomaticTextReplacement();
1973 #endif
1974
1975 #if PLATFORM(MAC)
1976     void substitutionsPanelIsShowing(CompletionHandler<void(bool)>&&);
1977     void showCorrectionPanel(int32_t panelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings);
1978     void dismissCorrectionPanel(int32_t reason);
1979     void dismissCorrectionPanelSoon(int32_t reason, CompletionHandler<void(String)>&&);
1980     void recordAutocorrectionResponse(int32_t responseType, const String& replacedString, const String& replacementString);
1981
1982 #if USE(DICTATION_ALTERNATIVES)
1983     void showDictationAlternativeUI(const WebCore::FloatRect& boundingBoxOfDictatedText, uint64_t dictationContext);
1984     void removeDictationAlternatives(uint64_t dictationContext);
1985     void dictationAlternatives(uint64_t dictationContext, CompletionHandler<void(Vector<String>&&)>&&);
1986 #endif
1987
1988     void setEditableElementIsFocused(bool);
1989 #endif // PLATFORM(MAC)
1990
1991 #if PLATFORM(IOS_FAMILY)
1992     WebCore::FloatSize screenSize();
1993     WebCore::FloatSize availableScreenSize();
1994     WebCore::FloatSize overrideScreenSize();
1995     float textAutosizingWidth();
1996
1997     void couldNotRestorePageState();
1998     void restorePageState(Optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatBoxExtent& obscuredInsetsOnSave, double scale);
1999     void restorePageCenterAndScale(Optional<WebCore::FloatPoint>, double scale);
2000
2001     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, bool nodeHasBuiltInClickHandling);
2002
2003     void elementDidFocus(const FocusedElementInformation&, bool userIsInteracting, bool blurPreviousNode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges, const UserData&);
2004     void elementDidBlur();
2005     void updateInputContextAfterBlurringAndRefocusingElement();
2006     void focusedElementDidChangeInputMode(WebCore::InputMode);
2007     void didReleaseAllTouchPoints();
2008     void didReceiveEditorStateUpdateAfterFocus();
2009
2010     void showInspectorHighlight(const WebCore::Highlight&);
2011     void hideInspectorHighlight();
2012
2013     void enableInspectorNodeSearch();
2014     void disableInspectorNodeSearch();
2015     void focusedElementInformationCallback(const FocusedElementInformation&, CallbackID);
2016 #else
2017     void didReleaseAllTouchPoints() { }
2018 #endif // PLATFORM(IOS_FAMILY)
2019
2020 #if ENABLE(DATA_DETECTION)
2021     RetainPtr<NSArray> m_dataDetectionResults;
2022 #endif
2023
2024     void clearLoadDependentCallbacks();
2025
2026     void performDragControllerAction(DragControllerAction, WebCore::DragData&, const String& dragStorageName, SandboxExtension::Handle&&, SandboxExtension::HandleArray&&);
2027
2028     void updateBackingStoreDiscardableState();
2029
2030     void setRenderTreeSize(uint64_t treeSize) { m_renderTreeSize = treeSize; }
2031
2032 #if PLATFORM(X11)
2033     void createPluginContainer(CompletionHandler<void(uint64_t)>&&);
2034     void windowedPluginGeometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect, uint64_t windowID);
2035     void windowedPluginVisibilityDidChange(bool isVisible, uint64_t windowID);
2036 #endif
2037
2038     void processNextQueuedWheelEvent();
2039     void sendWheelEvent(const WebWheelEvent&);
2040     bool shouldProcessWheelEventNow(const WebWheelEvent&) const;
2041
2042 #if ENABLE(TOUCH_EVENTS)
2043     void updateTouchEventTracking(const WebTouchEvent&);
2044     WebCore::TrackingType touchEventTrackingType(const WebTouchEvent&) const;
2045 #endif
2046
2047 #if ENABLE(NETSCAPE_PLUGIN_API)
2048     void findPlugin(const String& mimeType, uint32_t processType, const String& urlString, const String& frameURLString, const String& pageURLString, bool allowOnlyApplicationPlugins, Messages::WebPageProxy::FindPluginDelayedReply&&);
2049 #endif
2050
2051 #if USE(QUICK_LOOK)
2052     void didStartLoadForQuickLookDocumentInMainFrame(const String& fileName, const String& uti);
2053     void didFinishLoadForQuickLookDocumentInMainFrame(const ShareableResource::Handle&);
2054     void requestPasswordForQuickLookDocumentInMainFrame(const String& fileName, CompletionHandler<void(const String&)>&&);
2055 #endif
2056
2057 #if ENABLE(CONTENT_FILTERING)
2058     void contentFilterDidBlockLoadForFrame(const WebCore::ContentFilterUnblockHandler&, WebCore::FrameIdentifier);
2059 #endif
2060
2061     void tryReloadAfterProcessTermination();
2062     void resetRecentCrashCountSoon();
2063     void resetRecentCrashCount();
2064
2065     API::DiagnosticLoggingClient* effectiveDiagnosticLoggingClient(WebCore::ShouldSample);
2066
2067     void dispatchActivityStateChange();
2068     void viewDidLeaveWindow();
2069     void viewDidEnterWindow();
2070
2071 #if PLATFORM(MAC)
2072     void didPerformImmediateActionHitTest(const WebHitTestResultData&, bool contentPreventsDefault, const UserData&);
2073 #endif
2074
2075     void useFixedLayoutDidChange(bool useFixedLayout) { m_useFixedLayout = useFixedLayout; }
2076     void fixedLayoutSizeDidChange(WebCore::IntSize fixedLayoutSize) { m_fixedLayoutSize = fixedLayoutSize; }
2077
2078     void imageOrMediaDocumentSizeChanged(const WebCore::IntSize&);
2079 #if ENABLE(VIDEO) && USE(GSTREAMER)
2080     void requestInstallMissingMediaPlugins(const String& details, const String& description);
2081 #endif
2082
2083     void startURLSchemeTask(URLSchemeTaskParameters&&);
2084     void stopURLSchemeTask(uint64_t handlerIdentifier, uint64_t taskIdentifier);
2085     void loadSynchronousURLSchemeTask(URLSchemeTaskParameters&&, Messages::WebPageProxy::LoadSynchronousURLSchemeTaskDelayedReply&&);
2086
2087     bool checkURLReceivedFromCurrentOrPreviousWebProcess(WebProcessProxy&, const String&);
2088     bool checkURLReceivedFromCurrentOrPreviousWebProcess(WebProcessProxy&, const URL&);
2089     void willAcquireUniversalFileReadSandboxExtension(WebProcessProxy&);
2090
2091     void handleAutoFillButtonClick(const UserData&);
2092
2093     void didResignInputElementStrongPasswordAppearance(const UserData&);
2094
2095     void handleMessage(IPC::Connection&, const String& messageName, const UserData& messageBody);
2096     void handleSynchronousMessage(IPC::Connection&, const String& messageName, const UserData& messageBody, CompletionHandler<void(UserData&&)>&&);
2097
2098     void viewIsBecomingVisible();
2099
2100     void stopAllURLSchemeTasks(WebProcessProxy* = nullptr);
2101
2102 #if ENABLE(ATTACHMENT_ELEMENT)
2103     void registerAttachmentIdentifierFromData(const String&, const String& contentType, const String& preferredFileName, const IPC::DataReference&);
2104     void registerAttachmentIdentifierFromFilePath(const String&, const String& contentType, const String& filePath);
2105     void registerAttachmentsFromSerializedData(Vector<WebCore::SerializedAttachmentData>&&);
2106     void cloneAttachmentData(const String& fromIdentifier, const String& toIdentifier);
2107
2108     void platformRegisterAttachment(Ref<API::Attachment>&&, const String& preferredFileName, const IPC::DataReference&);
2109     void platformRegisterAttachment(Ref<API::Attachment>&&, const String& filePath);
2110     void platformCloneAttachment(Ref<API::Attachment>&& fromAttachment, Ref<API::Attachment>&& toAttachment);
2111
2112     void didInsertAttachmentWithIdentifier(const String& identifier, const String& source, bool hasEnclosingImage);
2113     void didRemoveAttachmentWithIdentifier(const String& identifier);
2114     void didRemoveAttachment(API::Attachment&);
2115     Ref<API::Attachment> ensureAttachment(const String& identifier);
2116     void invalidateAllAttachments();
2117 #endif
2118
2119     void reportPageLoadResult(const WebCore::ResourceError& = { });
2120
2121     void continueNavigationInNewProcess(API::Navigation&, std::unique_ptr<SuspendedPageProxy>&&, Ref<WebProcessProxy>&&, ProcessSwapRequestedByClient, Optional<WebsitePoliciesData>&&);
2122
2123     void setNeedsFontAttributes(bool);
2124     void updateFontAttributesAfterEditorStateChange();
2125
2126     void didAttachToRunningProcess();
2127
2128 #if ENABLE(RESOURCE_LOAD_STATISTICS)
2129     void logFrameNavigation(const WebFrameProxy&, const URL& pageURL, const WebCore::ResourceRequest&, const URL& redirectURL);
2130 #endif
2131
2132     // WebPaymentCoordinatorProxy::Client
2133 #if ENABLE(APPLE_PAY)
2134     IPC::Connection* paymentCoordinatorConnection(const WebPaymentCoordinatorProxy&) final;
2135     const String& paymentCoordinatorBoundInterfaceIdentifier(const WebPaymentCoordinatorProxy&) final;
2136     const String& paymentCoordinatorSourceApplicationBundleIdentifier(const WebPaymentCoordinatorProxy&) final;
2137     const String& paymentCoordinatorSourceApplicationSecondaryIdentifier(const WebPaymentCoordinatorProxy&) final;
2138     void paymentCoordinatorAddMessageReceiver(WebPaymentCoordinatorProxy&, const IPC::StringReference&, IPC::MessageReceiver&) final;
2139     void paymentCoordinatorRemoveMessageReceiver(WebPaymentCoordinatorProxy&, const IPC::StringReference&) final;
2140 #endif
2141 #if ENABLE(APPLE_PAY) && PLATFORM(IOS_FAMILY)
2142     UIViewController *paymentCoordinatorPresentingViewController(const WebPaymentCoordinatorProxy&) final;
2143     const String& paymentCoordinatorCTDataConnectionServiceType(const WebPaymentCoordinatorProxy&) final;
2144     std::unique_ptr<PaymentAuthorizationPresenter> paymentCoordinatorAuthorizationPresenter(WebPaymentCoordinatorProxy&, PKPaymentRequest *) final;
2145 #endif
2146 #if ENABLE(APPLE_PAY) && PLATFORM(MAC)
2147     NSWindow *paymentCoordinatorPresentingWindow(const WebPaymentCoordinatorProxy&) final;
2148 #endif
2149
2150 #if ENABLE(SPEECH_SYNTHESIS)
2151     void didStartSpeaking(WebCore::PlatformSpeechSynthesisUtterance&) override;
2152     void didFinishSpeaking(WebCore::PlatformSpeechSynthesisUtterance&) override;
2153     void didPauseSpeaking(WebCore::PlatformSpeechSynthesisUtterance&) override;
2154     void didResumeSpeaking(WebCore::PlatformSpeechSynthesisUtterance&) override;
2155     void speakingErrorOccurred(WebCore::PlatformSpeechSynthesisUtterance&) override;
2156     void boundaryEventOccurred(WebCore::PlatformSpeechSynthesisUtterance&, WebCore::SpeechBoundary, unsigned charIndex) override;
2157     void voicesDidChange() override;
2158
2159     struct SpeechSynthesisData;
2160     SpeechSynthesisData& speechSynthesisData();
2161     void resetSpeechSynthesizer();
2162 #endif
2163
2164 #if PLATFORM(IOS_FAMILY)
2165     static bool isInHardwareKeyboardMode();
2166 #endif
2167
2168     void makeStorageSpaceRequest(WebCore::FrameIdentifier, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, CompletionHandler<void(uint64_t)>&&);
2169
2170     const Identifier m_identifier;
2171     WebCore::PageIdentifier m_webPageID;
2172     WeakPtr<PageClient> m_pageClient;
2173     Ref<API::PageConfiguration> m_configuration;
2174
2175     std::unique_ptr<API::LoaderClient> m_loaderClient;
2176     std::unique_ptr<API::PolicyClient> m_policyClient;
2177     UniqueRef<API::NavigationClient> m_navigationClient;
2178     UniqueRef<API::HistoryClient> m_historyClient;
2179     std::unique_ptr<API::IconLoadingClient> m_iconLoadingClient;
2180     std::unique_ptr<API::FormClient> m_formClient;
2181     std::unique_ptr<API::UIClient> m_uiClient;
2182     std::unique_ptr<API::FindClient> m_findClient;
2183     std::unique_ptr<API::FindMatchesClient> m_findMatchesClient;
2184     std::unique_ptr<API::DiagnosticLoggingClient> m_diagnosticLoggingClient;
2185 #if ENABLE(CONTEXT_MENUS)
2186     std::unique_ptr<API::ContextMenuClient> m_contextMenuClient;
2187 #endif
2188     std::unique_ptr<WebPageInjectedBundleClient> m_injectedBundleClient;
2189     std::unique_ptr<PageLoadState::Observer> m_pageLoadStateObserver;
2190
2191     std::unique_ptr<WebNavigationState> m_navigationState;
2192     String m_failingProvisionalLoadURL;
2193     bool m_isLoadingAlternateHTMLStringForFailingProvisionalLoad { false };
2194
2195     std::unique_ptr<DrawingAreaProxy> m_drawingArea;
2196 #if PLATFORM(COCOA)
2197     std::unique_ptr<RemoteLayerTreeHost> m_frozenRemoteLayerTreeHost;
2198 #if ENABLE(ASYNC_SCROLLING)
2199     std::unique_ptr<RemoteScrollingCoordinatorProxy> m_scrollingCoordinatorProxy;
2200 #endif
2201 #endif
2202     Ref<WebProcessProxy> m_process;
2203     Ref<WebPageGroup> m_pageGroup;
2204     Ref<WebPreferences> m_preferences;
2205
2206     Ref<WebUserContentControllerProxy> m_userContentController;
2207     Ref<VisitedLinkStore> m_visitedLinkStore;
2208     Ref<WebsiteDataStore> m_websiteDataStore;
2209
2210     RefPtr<WebFrameProxy> m_mainFrame;
2211
2212     RefPtr<WebFrameProxy> m_focusedFrame;
2213     RefPtr<WebFrameProxy> m_frameSetLargestFrame;
2214
2215     String m_userAgent;
2216     String m_applicationNameForUserAgent;
2217     String m_applicationNameForDesktopUserAgent;
2218     String m_customUserAgent;
2219     String m_customTextEncodingName;
2220     String m_overrideContentSecurityPolicy;
2221
2222     bool m_treatsSHA1CertificatesAsInsecure { true };
2223
2224     RefPtr<WebInspectorProxy> m_inspector;
2225
2226 #if ENABLE(FULLSCREEN_API)
2227     std::unique_ptr<WebFullScreenManagerProxy> m_fullScreenManager;
2228     std::unique_ptr<API::FullscreenClient> m_fullscreenClient;
2229 #endif
2230
2231 #if (PLATFORM(IOS_FAMILY) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
2232     RefPtr<PlaybackSessionManagerProxy> m_playbackSessionManager;
2233     RefPtr<VideoFullscreenManagerProxy> m_videoFullscreenManager;
2234 #endif
2235
2236 #if PLATFORM(IOS_FAMILY)
2237     Optional<WebCore::InputMode> m_pendingInputModeChange;
2238     Optional<WebCore::ViewportArguments> m_overrideViewportArguments;
2239     VisibleContentRectUpdateInfo m_lastVisibleContentRectUpdate;
2240     TransactionID m_firstLayerTreeTransactionIdAfterDidCommitLoad;
2241     int32_t m_deviceOrientation { 0 };
2242     bool m_hasReceivedLayerTreeTransactionAfterDidCommitLoad { true };
2243     bool m_hasNetworkRequestsOnSuspended { false };
2244     bool m_isKeyboardAnimatingIn { false };
2245     bool m_isScrollingOrZooming { false };
2246 #endif
2247         
2248 #if PLATFORM(MAC)
2249     bool m_useSystemAppearance { false };
2250 #endif
2251
2252 #if ENABLE(APPLE_PAY)
2253     std::unique_ptr<WebPaymentCoordinatorProxy> m_paymentCoordinator;
2254 #endif
2255
2256 #if USE(SYSTEM_PREVIEW)
2257     std::unique_ptr<SystemPreviewController> m_systemPreviewController;
2258 #endif
2259
2260 #if ENABLE(WEB_AUTHN)
2261     std::unique_ptr<WebAuthenticatorCoordinatorProxy> m_credentialsMessenger;
2262 #endif
2263
2264     CallbackMap m_callbacks;
2265     HashSet<CallbackID> m_loadDependentStringCallbackIDs;
2266
2267     HashSet<WebEditCommandProxy*> m_editCommandSet;
2268
2269 #if PLATFORM(COCOA)
2270     HashSet<String> m_knownKeypressCommandNames;
2271 #endif
2272
2273     RefPtr<WebPopupMenuProxy> m_activePopupMenu;
2274 #if ENABLE(CONTEXT_MENUS)
2275     RefPtr<WebContextMenuProxy> m_activeContextMenu;
2276     ContextMenuContextData m_activeContextMenuContextData;
2277 #endif
2278     RefPtr<API::HitTestResult> m_lastMouseMoveHitTestResult;
2279
2280     RefPtr<WebOpenPanelResultListenerProxy> m_openPanelResultListener;
2281     GeolocationPermissionRequestManagerProxy m_geolocationPermissionRequestManager;
2282     NotificationPermissionRequestManagerProxy m_notificationPermissionRequestManager;
2283
2284 #if ENABLE(MEDIA_STREAM)
2285     std::unique_ptr<UserMediaPermissionRequestManagerProxy> m_userMediaPermissionRequestManager;
2286 #endif
2287
2288     OptionSet<WebCore::ActivityState::Flag> m_activityState;
2289     bool m_viewWasEverInWindow { false };
2290 #if PLATFORM(IOS_FAMILY)
2291     bool m_allowsMediaDocumentInlinePlayback { false };
2292     bool m_alwaysRunsAtForegroundPriority { false };
2293     std::unique_ptr<ProcessThrottler::ForegroundActivity> m_isVisibleActivity;
2294     std::unique_ptr<ProcessThrottler::ForegroundActivity> m_isAudibleActivity;
2295     std::unique_ptr<ProcessThrottler::ForegroundActivity> m_isCapturingActivity;
2296     std::unique_ptr<ProcessThrottler::ForegroundActivity> m_alwaysRunsAtForegroundPriorityActivity;
2297 #endif
2298     bool m_initialCapitalizationEnabled { false };
2299     Optional<double> m_cpuLimit;
2300     Ref<WebBackForwardList> m_backForwardList;
2301         
2302     bool m_maintainsInactiveSelection { false };
2303
2304     bool m_waitsForPaintAfterViewDidMoveToWindow { false };
2305     bool m_shouldSkipWaitingForPaintAfterNextViewDidMoveToWindow { false };
2306
2307     String m_toolTip;
2308
2309     EditorState m_editorState;
2310     bool m_isEditable { false };
2311
2312 #if PLATFORM(COCOA)
2313     TouchBarMenuData m_touchBarMenuData;
2314 #endif
2315
2316     double m_textZoomFactor { 1 };
2317     double m_pageZoomFactor { 1 };
2318     double m_pageScaleFactor { 1 };
2319     double m_pluginZoomFactor { 1 };
2320     double m_pluginScaleFactor { 1 };
2321     double m_viewScaleFactor { 1 };
2322     float m_intrinsicDeviceScaleFactor { 1 };
2323     Optional<float> m_customDeviceScaleFactor;
2324     float m_topContentInset { 0 };
2325
2326     LayerHostingMode m_layerHostingMode { LayerHostingMode::InProcess };
2327
2328     WebCore::Color m_underlayColor;
2329     WebCore::Color m_pageExtendedBackgroundColor;
2330
2331     bool m_useFixedLayout { false };
2332     WebCore::IntSize m_fixedLayoutSize;
2333
2334     bool m_alwaysShowsHorizontalScroller { false };
2335     bool m_alwaysShowsVerticalScroller { false };
2336
2337     OptionSet<WebCore::LayoutMilestone> m_observedLayoutMilestones;
2338
2339     bool m_suppressScrollbarAnimations { false };
2340
2341     WebCore::Pagination::Mode m_paginationMode { WebCore::Pagination::Unpaginated };
2342     bool m_paginationBehavesLikeColumns { false };
2343     double m_pageLength { 0 };
2344     double m_gapBetweenPages { 0 };
2345     bool m_paginationLineGridEnabled { false };
2346         
2347     // If the process backing the web page is alive and kicking.
2348     bool m_hasRunningProcess { false };
2349
2350     // Whether WebPageProxy::close() has been called on this page.
2351     bool m_isClosed { false };
2352
2353     // Whether it can run modal child web pages.
2354     bool m_canRunModal { false };
2355
2356     bool m_isInPrintingMode { false };
2357     bool m_isPerformingDOMPrintOperation { false };
2358
2359     WebCore::ResourceRequest m_decidePolicyForResponseRequest;
2360     bool m_shouldSuppressAppLinksInNextNavigationPolicyDecision { false };
2361
2362 #if HAVE(APP_SSO)
2363     bool m_shouldSuppressSOAuthorizationInNextNavigationPolicyDecision { false };
2364     bool m_shouldSuppressSOAuthorizationInAllNavigationPolicyDecision { false };
2365 #endif
2366
2367     Deque<NativeWebMouseEvent> m_mouseEventQueue;
2368     Deque<NativeWebKeyboardEvent> m_keyEventQueue;
2369     Deque<NativeWebWheelEvent> m_wheelEventQueue;
2370     Deque<std::unique_ptr<Vector<NativeWebWheelEvent>>> m_currentlyProcessedWheelEvents;
2371 #if ENABLE(MAC_GESTURE_EVENTS)
2372     Deque<NativeWebGestureEvent> m_gestureEventQueue;
2373 #endif
2374
2375 #if ENABLE(TOUCH_EVENTS)
2376     struct TouchEventTracking {
2377         WebCore::TrackingType touchForceChangedTracking { WebCore::TrackingType::NotTracking };
2378         WebCore::TrackingType touchStartTracking { WebCore::TrackingType::NotTracking };
2379         WebCore::TrackingType touchMoveTracking { WebCore::TrackingType::NotTracking };
2380         WebCore::TrackingType touchEndTracking { WebCore::TrackingType::NotTracking };
2381
2382         bool isTrackingAnything() const
2383         {
2384             return touchForceChangedTracking != WebCore::TrackingType::NotTracking
2385                 || touchStartTracking != WebCore::TrackingType::NotTracking
2386                 || touchMoveTracking != WebCore::TrackingType::NotTracking
2387                 || touchEndTracking != WebCore::TrackingType::NotTracking;
2388         }
2389
2390         void reset()
2391         {
2392             touchForceChangedTracking = WebCore::TrackingType::NotTracking;
2393             touchStartTracking = WebCore::TrackingType::NotTracking;
2394             touchMoveTracking = WebCore::TrackingType::NotTracking;
2395             touchEndTracking = WebCore::TrackingType::NotTracking;
2396         }
2397     };
2398     TouchEventTracking m_touchAndPointerEventTracking;
2399 #endif
2400 #if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS)
2401     Deque<QueuedTouchEvents> m_touchEventQueue;
2402 #endif
2403
2404 #if ENABLE(INPUT_TYPE_COLOR)
2405     RefPtr<WebColorPicker> m_colorPicker;
2406 #endif
2407 #if ENABLE(DATALIST_ELEMENT)
2408     RefPtr<WebDataListSuggestionsDropdown> m_dataListSuggestionsDropdown;
2409 #endif
2410 #if PLATFORM(COCOA)
2411     RefPtr<WebCore::ValidationBubble> m_validationBubble;
2412 #endif
2413
2414     bool m_isPageSuspended { false };
2415     bool m_addsVisitedLinks { true };
2416
2417     bool m_controlledByAutomation { false };
2418
2419     unsigned m_inspectorFrontendCount { 0 };
2420
2421 #if PLATFORM(COCOA)
2422     bool m_isSmartInsertDeleteEnabled { false };
2423 #endif
2424
2425     Optional<WebCore::Color> m_backgroundColor;
2426
2427     unsigned m_pendingLearnOrIgnoreWordMessageCount { 0 };
2428
2429     bool m_mainFrameHasCustomContentProvider { false };
2430
2431 #if ENABLE(DRAG_SUPPORT)
2432     // Current drag destination details are delivered as an asynchronous response,
2433     // so we preserve them to be used when the next dragging delegate call is made.
2434     WebCore::DragOperation m_currentDragOperation { WebCore::DragOperationNone };
2435     WebCore::DragHandlingMethod m_currentDragHandlingMethod { WebCore::DragHandlingMethod::None };
2436     bool m_currentDragIsOverFileInput { false };
2437     unsigned m_currentDragNumberOfFilesToBeAccepted { 0 };
2438     WebCore::IntRect m_currentDragCaretRect;
2439     WebCore::IntRect m_currentDragCaretEditableElementRect;
2440 #endif
2441
2442     PageLoadState m_pageLoadState;
2443     
2444     bool m_delegatesScrolling { false };
2445
2446     bool m_mainFrameHasHorizontalScrollbar { false };
2447     bool m_mainFrameHasVerticalScrollbar { false };
2448
2449     // Whether horizontal wheel events can be handled directly for swiping purposes.
2450     bool m_canShortCircuitHorizontalWheelEvents { true };
2451
2452     bool m_mainFrameIsPinnedToLeftSide { true };
2453     bool m_mainFrameIsPinnedToRightSide { true };
2454     bool m_mainFrameIsPinnedToTopSide { true };
2455     bool m_mainFrameIsPinnedToBottomSide { true };
2456
2457     bool m_shouldUseImplicitRubberBandControl { false };
2458     bool m_rubberBandsAtLeft { true };
2459     bool m_rubberBandsAtRight { true };
2460     bool m_rubberBandsAtTop { true };
2461     bool m_rubberBandsAtBottom { true };
2462         
2463     bool m_enableVerticalRubberBanding { true };
2464     bool m_enableHorizontalRubberBanding { true };
2465
2466     bool m_backgroundExtendsBeyondPage { true };
2467
2468     bool m_shouldRecordNavigationSnapshots { false };
2469     bool m_isShowingNavigationGestureSnapshot { false };
2470
2471     bool m_mainFramePluginHandlesPageScaleGesture { false };
2472
2473     unsigned m_pageCount { 0 };
2474
2475     WebCore::IntRect m_visibleScrollerThumbRect;
2476
2477     uint64_t m_renderTreeSize { 0 };
2478     uint64_t m_sessionRestorationRenderTreeSize { 0 };
2479     bool m_hitRenderTreeSizeThreshold { false };
2480
2481     bool m_suppressVisibilityUpdates { false };
2482     bool m_autoSizingShouldExpandToViewHeight { false };
2483     WebCore::IntSize m_minimumSizeForAutoLayout;
2484     Optional<WebCore::IntSize> m_viewportSizeForCSSViewportUnits;
2485
2486     // Visual viewports
2487     WebCore::LayoutSize m_baseLayoutViewportSize;
2488     WebCore::LayoutPoint m_minStableLayoutViewportOrigin;
2489     WebCore::LayoutPoint m_maxStableLayoutViewportOrigin;
2490
2491     float m_mediaVolume { 1 };
2492     WebCore::MediaProducer::MutedStateFlags m_mutedState { WebCore::MediaProducer::NoneMuted };
2493     bool m_mayStartMediaWhenInWindow { true };
2494     bool m_mediaPlaybackIsSuspended { false };
2495     bool m_mediaCaptureEnabled { true };
2496
2497     bool m_waitingForDidUpdateActivityState { false };
2498
2499     bool m_shouldScaleViewToFitDocument { false };
2500     bool m_shouldSuppressNextAutomaticNavigationSnapshot { false };
2501
2502 #if PLATFORM(COCOA)
2503     HashMap<String, String> m_temporaryPDFFiles;
2504     std::unique_ptr<WebCore::RunLoopObserver> m_activityStateChangeDispatcher;
2505
2506     std::unique_ptr<RemoteLayerTreeScrollingPerformanceData> m_scrollingPerformanceData;
2507     bool m_scrollPerformanceDataCollectionEnabled { false };
2508 #endif
2509     UserObservablePageCounter::Token m_pageIsUserObservableCount;
2510     ProcessSuppressionDisabledToken m_preventProcessSuppressionCount;
2511     HiddenPageThrottlingAutoIncreasesCounter::Token m_hiddenPageDOMTimerThrottlingAutoIncreasesCount;
2512     VisibleWebPageToken m_visiblePageToken;
2513         
2514     WebCore::ScrollPinningBehavior m_scrollPinningBehavior { WebCore::DoNotPin };
2515     Optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle;
2516
2517     ActivityStateChangeID m_currentActivityStateChangeID { ActivityStateChangeAsynchronous };
2518
2519     WebPreferencesStore::ValueMap m_configurationPreferenceValues;
2520     OptionSet<WebCore::ActivityState::Flag> m_potentiallyChangedActivityStateFlags;
2521     bool m_activityStateChangeWantsSynchronousReply { false };
2522     Vector<CallbackID> m_nextActivityStateChangeCallbacks;
2523
2524     WebCore::MediaProducer::MediaStateFlags m_mediaState { WebCore::MediaProducer::IsNotPlaying };
2525
2526     bool m_hasHadSelectionChangesFromUserInteraction { false };
2527     bool m_isTouchBarUpdateSupressedForHiddenContentEditable { false };
2528     bool m_isNeverRichlyEditableForTouchBar { false };
2529
2530 #if ENABLE(MEDIA_SESSION)
2531     bool m_hasMediaSessionWithActiveMediaElements { false };
2532 #endif
2533
2534 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
2535     bool m_requiresTargetMonitoring { false };
2536 #endif
2537
2538 #if PLATFORM(IOS_FAMILY)
2539     std::unique_ptr<ElementDidFocusArguments> m_deferredElementDidFocusArguments;
2540     bool m_waitingForPostLayoutEditorStateUpdateAfterFocusingElement { false };
2541     bool m_forceAlwaysUserScalable { false };
2542     WebCore::FloatSize m_viewportConfigurationViewLayoutSize;
2543     double m_viewportConfigurationLayoutSizeScaleFactor { 1 };
2544     double m_viewportConfigurationMinimumEffectiveDeviceWidth { 0 };
2545     WebCore::FloatSize m_maximumUnobscuredSize;
2546     bool m_lastObservedStateWasBackground { false };
2547 #endif
2548
2549     Optional<WebCore::FontAttributes> m_cachedFontAttributesAtSelectionStart;
2550
2551 #if ENABLE(POINTER_LOCK)
2552     bool m_isPointerLockPending { false };
2553     bool m_isPointerLocked { false };
2554 #endif
2555
2556     bool m_isUsingHighPerformanceWebGL { false };
2557     bool m_openedByDOM { false };
2558     bool m_hasCommittedAnyProvisionalLoads { false };
2559     bool m_preferFasterClickOverDoubleTap { false };
2560
2561     HashMap<String, Ref<WebURLSchemeHandler>> m_urlSchemeHandlersByScheme;
2562     HashMap<uint64_t, Ref<WebURLSchemeHandler>> m_urlSchemeHandlersByIdentifier;
2563
2564 #if ENABLE(ATTACHMENT_ELEMENT)
2565     HashMap<String, Ref<API::Attachment>> m_attachmentIdentifierToAttachmentMap;
2566 #endif
2567
2568     const std::unique_ptr<WebPageInspectorController> m_inspectorController;
2569 #if ENABLE(REMOTE_INSPECTOR)
2570     std::unique_ptr<WebPageDebuggable> m_inspectorDebuggable;
2571 #endif
2572
2573     Optional<SpellDocumentTag> m_spellDocumentTag;
2574
2575     Optional<MonotonicTime> m_pageLoadStart;
2576     HashSet<String> m_previouslyVisitedPaths;
2577
2578     RunLoop::Timer<WebPageProxy> m_resetRecentCrashCountTimer;
2579     unsigned m_recentCrashCount { 0 };
2580
2581     bool m_needsFontAttributes { false };
2582     bool m_mayHaveUniversalFileReadSandboxExtension { false };
2583
2584     std::unique_ptr<ProvisionalPageProxy> m_provisionalPage;
2585     std::unique_ptr<SuspendedPageProxy> m_suspendedPageKeptToPreventFlashing;
2586     WeakPtr<SuspendedPageProxy> m_lastSuspendedPage;
2587
2588     TextManipulationItemCallback m_textManipulationItemCallback;
2589
2590 #if HAVE(PENCILKIT)
2591     std::unique_ptr<EditableImageController> m_editableImageController;
2592 #endif
2593
2594 #if HAVE(VISIBILITY_PROPAGATION_VIEW)
2595     LayerHostingContextID m_contextIDForVisibilityPropagation { 0 };
2596 #endif
2597
2598     HashMap<WebViewDidMoveToWindowObserver*, WeakPtr<WebViewDidMoveToWindowObserver>> m_webViewDidMoveToWindowObservers;
2599
2600     mutable RefPtr<Logger> m_logger;
2601
2602 #if ENABLE(SPEECH_SYNTHESIS)
2603     struct SpeechSynthesisData {
2604         std::unique_ptr<WebCore::PlatformSpeechSynthesizer> synthesizer;
2605         RefPtr<WebCore::PlatformSpeechSynthesisUtterance> utterance;
2606         CompletionHandler<void()> speakingStartedCompletionHandler;
2607         CompletionHandler<void()> speakingFinishedCompletionHandler;
2608         CompletionHandler<void()> speakingPausedCompletionHandler;
2609         CompletionHandler<void()> speakingResumedCompletionHandler;
2610     };
2611     Optional<SpeechSynthesisData> m_speechSynthesisData;
2612 #endif
2613 #if USE(DIRECT2D)
2614     COMPtr<ID3D11Device1> m_device;
2615 #endif
2616     bool m_isQuotaIncreaseDenied { false };
2617 };
2618
2619 } // namespace WebKit