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