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