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