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