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