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