Temporarily restore block selection code conditionally
[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)>&&);
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 insertTextAsync(const String& text, const EditingRange& replacementRange, bool registerUndoGroup = false, EditingRangeIsRelativeTo = EditingRangeIsRelativeTo::EditableRoot, bool suppressSelectionUpdate = false);
642     void getMarkedRangeAsync(WTF::Function<void (EditingRange, CallbackBase::Error)>&&);
643     void getSelectedRangeAsync(WTF::Function<void (EditingRange, CallbackBase::Error)>&&);
644     void characterIndexForPointAsync(const WebCore::IntPoint&, WTF::Function<void (uint64_t, CallbackBase::Error)>&&);
645     void firstRectForCharacterRangeAsync(const EditingRange&, WTF::Function<void (const WebCore::IntRect&, const EditingRange&, CallbackBase::Error)>&&);
646     void setCompositionAsync(const String& text, const Vector<WebCore::CompositionUnderline>& underlines, const EditingRange& selectionRange, const EditingRange& replacementRange);
647     void confirmCompositionAsync();
648
649     void setScrollPerformanceDataCollectionEnabled(bool);
650     bool scrollPerformanceDataCollectionEnabled() const { return m_scrollPerformanceDataCollectionEnabled; }
651     RemoteLayerTreeScrollingPerformanceData* scrollingPerformanceData() { return m_scrollingPerformanceData.get(); }
652 #endif // PLATFORM(COCOA)
653
654 #if PLATFORM(MAC)
655     void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::TextAlternativeWithRange>& dictationAlternatives, bool registerUndoGroup);
656     void attributedSubstringForCharacterRangeAsync(const EditingRange&, WTF::Function<void (const AttributedString&, const EditingRange&, CallbackBase::Error)>&&);
657     void setFont(const String& fontFamily, double fontSize, uint64_t fontTraits);
658     void fontAtSelection(WTF::Function<void (const String&, double, bool, CallbackBase::Error)>&&);
659
660     void startWindowDrag();
661     NSWindow *platformWindow();
662     void rootViewToWindow(const WebCore::IntRect& viewRect, WebCore::IntRect& windowRect);
663
664 #if WK_API_ENABLED
665     NSView *inspectorAttachmentView();
666     _WKRemoteObjectRegistry *remoteObjectRegistry();
667 #endif
668
669     void intrinsicContentSizeDidChange(const WebCore::IntSize& intrinsicContentSize);
670     CGRect boundsOfLayerInLayerBackedWindowCoordinates(CALayer *) const;
671 #endif // PLATFORM(MAC)
672
673 #if PLATFORM(GTK)
674     PlatformWidget viewWidget();
675     const WebCore::Color& backgroundColor() const { return m_backgroundColor; }
676     void setBackgroundColor(const WebCore::Color& color) { m_backgroundColor = color; }
677 #endif
678
679 #if PLATFORM(GTK) || PLATFORM(WPE)
680     JSGlobalContextRef javascriptGlobalContext();
681 #endif
682
683     void handleMouseEvent(const NativeWebMouseEvent&);
684     void handleWheelEvent(const NativeWebWheelEvent&);
685     void handleKeyboardEvent(const NativeWebKeyboardEvent&);
686
687 #if ENABLE(MAC_GESTURE_EVENTS)
688     void handleGestureEvent(const NativeWebGestureEvent&);
689 #endif
690
691 #if ENABLE(IOS_TOUCH_EVENTS)
692     void handleTouchEventSynchronously(NativeWebTouchEvent&);
693     void handleTouchEventAsynchronously(const NativeWebTouchEvent&);
694
695 #elif ENABLE(TOUCH_EVENTS)
696     void handleTouchEvent(const NativeWebTouchEvent&);
697 #endif
698
699     void scrollBy(WebCore::ScrollDirection, WebCore::ScrollGranularity);
700     void centerSelectionInVisibleArea();
701
702     const String& toolTip() const { return m_toolTip; }
703
704     const String& userAgent() const { return m_userAgent; }
705     void setApplicationNameForUserAgent(const String&);
706     const String& applicationNameForUserAgent() const { return m_applicationNameForUserAgent; }
707     void setCustomUserAgent(const String&);
708     const String& customUserAgent() const { return m_customUserAgent; }
709     static String standardUserAgent(const String& applicationName = String());
710
711     bool supportsTextEncoding() const;
712     void setCustomTextEncodingName(const String&);
713     String customTextEncodingName() const { return m_customTextEncodingName; }
714
715     bool areActiveDOMObjectsAndAnimationsSuspended() const { return m_isPageSuspended; }
716     void resumeActiveDOMObjectsAndAnimations();
717     void suspendActiveDOMObjectsAndAnimations();
718
719     double estimatedProgress() const;
720
721     SessionState sessionState(WTF::Function<bool (WebBackForwardListItem&)>&& = nullptr) const;
722     RefPtr<API::Navigation> restoreFromSessionState(SessionState, bool navigate);
723
724     bool supportsTextZoom() const;
725     double textZoomFactor() const { return m_textZoomFactor; }
726     void setTextZoomFactor(double);
727     double pageZoomFactor() const;
728     void setPageZoomFactor(double);
729     void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
730
731     void scalePage(double scale, const WebCore::IntPoint& origin);
732     void scalePageInViewCoordinates(double scale, const WebCore::IntPoint& centerInViewCoordinates);
733     double pageScaleFactor() const;
734     double viewScaleFactor() const { return m_viewScaleFactor; }
735     void scaleView(double scale);
736     void setShouldScaleViewToFitDocument(bool);
737     
738     float deviceScaleFactor() const;
739     void setIntrinsicDeviceScaleFactor(float);
740     void setCustomDeviceScaleFactor(float);
741     void windowScreenDidChange(WebCore::PlatformDisplayID);
742     void accessibilitySettingsDidChange();
743
744     void setUseFixedLayout(bool);
745     void setFixedLayoutSize(const WebCore::IntSize&);
746     bool useFixedLayout() const { return m_useFixedLayout; };
747     const WebCore::IntSize& fixedLayoutSize() const { return m_fixedLayoutSize; };
748
749     void setAlwaysShowsHorizontalScroller(bool);
750     void setAlwaysShowsVerticalScroller(bool);
751     bool alwaysShowsHorizontalScroller() const { return m_alwaysShowsHorizontalScroller; }
752     bool alwaysShowsVerticalScroller() const { return m_alwaysShowsVerticalScroller; }
753
754     void listenForLayoutMilestones(WebCore::LayoutMilestones);
755
756     bool hasHorizontalScrollbar() const { return m_mainFrameHasHorizontalScrollbar; }
757     bool hasVerticalScrollbar() const { return m_mainFrameHasVerticalScrollbar; }
758
759     void setSuppressScrollbarAnimations(bool);
760     bool areScrollbarAnimationsSuppressed() const { return m_suppressScrollbarAnimations; }
761
762     bool isPinnedToLeftSide() const { return m_mainFrameIsPinnedToLeftSide; }
763     bool isPinnedToRightSide() const { return m_mainFrameIsPinnedToRightSide; }
764     bool isPinnedToTopSide() const { return m_mainFrameIsPinnedToTopSide; }
765     bool isPinnedToBottomSide() const { return m_mainFrameIsPinnedToBottomSide; }
766
767     bool rubberBandsAtLeft() const;
768     void setRubberBandsAtLeft(bool);
769     bool rubberBandsAtRight() const;
770     void setRubberBandsAtRight(bool);
771     bool rubberBandsAtTop() const;
772     void setRubberBandsAtTop(bool);
773     bool rubberBandsAtBottom() const;
774     void setRubberBandsAtBottom(bool);
775
776     void setShouldUseImplicitRubberBandControl(bool shouldUseImplicitRubberBandControl) { m_shouldUseImplicitRubberBandControl = shouldUseImplicitRubberBandControl; }
777     bool shouldUseImplicitRubberBandControl() const { return m_shouldUseImplicitRubberBandControl; }
778         
779     void setEnableVerticalRubberBanding(bool);
780     bool verticalRubberBandingIsEnabled() const;
781     void setEnableHorizontalRubberBanding(bool);
782     bool horizontalRubberBandingIsEnabled() const;
783         
784     void setBackgroundExtendsBeyondPage(bool);
785     bool backgroundExtendsBeyondPage() const;
786
787     void setPaginationMode(WebCore::Pagination::Mode);
788     WebCore::Pagination::Mode paginationMode() const { return m_paginationMode; }
789     void setPaginationBehavesLikeColumns(bool);
790     bool paginationBehavesLikeColumns() const { return m_paginationBehavesLikeColumns; }
791     void setPageLength(double);
792     double pageLength() const { return m_pageLength; }
793     void setGapBetweenPages(double);
794     double gapBetweenPages() const { return m_gapBetweenPages; }
795     void setPaginationLineGridEnabled(bool);
796     bool paginationLineGridEnabled() const { return m_paginationLineGridEnabled; }
797     unsigned pageCount() const { return m_pageCount; }
798
799 #if PLATFORM(COCOA)
800     // Called by the web process through a message.
801     void registerWebProcessAccessibilityToken(const IPC::DataReference&);
802     // Called by the UI process when it is ready to send its tokens to the web process.
803     void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
804     bool readSelectionFromPasteboard(const String& pasteboardName);
805     String stringSelectionForPasteboard();
806     RefPtr<WebCore::SharedBuffer> dataSelectionForPasteboard(const String& pasteboardType);
807     void makeFirstResponder();
808
809     ColorSpaceData colorSpace();
810 #endif
811
812 #if ENABLE(SERVICE_CONTROLS)
813     void replaceSelectionWithPasteboardData(const Vector<String>& types, const IPC::DataReference&);
814 #endif
815
816     void pageScaleFactorDidChange(double);
817     void pluginScaleFactorDidChange(double);
818     void pluginZoomFactorDidChange(double);
819
820     // Find.
821     void findString(const String&, FindOptions, unsigned maxMatchCount);
822     void findStringMatches(const String&, FindOptions, unsigned maxMatchCount);
823     void getImageForFindMatch(int32_t matchIndex);
824     void selectFindMatch(int32_t matchIndex);
825     void didGetImageForFindMatch(const ShareableBitmap::Handle& contentImageHandle, uint32_t matchIndex);
826     void hideFindUI();
827     void countStringMatches(const String&, FindOptions, unsigned maxMatchCount);
828     void didCountStringMatches(const String&, uint32_t matchCount);
829     void setTextIndicator(const WebCore::TextIndicatorData&, uint64_t /* WebCore::TextIndicatorWindowLifetime */ lifetime = 0 /* Permanent */);
830     void setTextIndicatorAnimationProgress(float);
831     void clearTextIndicator();
832     void didFindString(const String&, const Vector<WebCore::IntRect>&, uint32_t matchCount, int32_t matchIndex, bool didWrapAround);
833     void didFailToFindString(const String&);
834     void didFindStringMatches(const String&, const Vector<Vector<WebCore::IntRect>>& matchRects, int32_t firstIndexAfterSelection);
835
836     void getContentsAsString(WTF::Function<void (const String&, CallbackBase::Error)>&&);
837     void getBytecodeProfile(WTF::Function<void (const String&, CallbackBase::Error)>&&);
838     void getSamplingProfilerOutput(WTF::Function<void (const String&, CallbackBase::Error)>&&);
839     void isWebProcessResponsive(WTF::Function<void (bool isWebProcessResponsive)>&&);
840
841 #if ENABLE(MHTML)
842     void getContentsAsMHTMLData(Function<void (API::Data*, CallbackBase::Error)>&&);
843 #endif
844     void getMainResourceDataOfFrame(WebFrameProxy*, Function<void (API::Data*, CallbackBase::Error)>&&);
845     void getResourceDataFromFrame(WebFrameProxy*, API::URL*, Function<void (API::Data*, CallbackBase::Error)>&&);
846     void getRenderTreeExternalRepresentation(WTF::Function<void (const String&, CallbackBase::Error)>&&);
847     void getSelectionOrContentsAsString(WTF::Function<void (const String&, CallbackBase::Error)>&&);
848     void getSelectionAsWebArchiveData(Function<void (API::Data*, CallbackBase::Error)>&&);
849     void getSourceForFrame(WebFrameProxy*, WTF::Function<void (const String&, CallbackBase::Error)>&&);
850     void getWebArchiveOfFrame(WebFrameProxy*, Function<void (API::Data*, CallbackBase::Error)>&&);
851     void runJavaScriptInMainFrame(const String&, bool, WTF::Function<void (API::SerializedScriptValue*, bool hadException, const WebCore::ExceptionDetails&, CallbackBase::Error)>&& callbackFunction);
852     void forceRepaint(RefPtr<VoidCallback>&&);
853
854     float headerHeight(WebFrameProxy&);
855     float footerHeight(WebFrameProxy&);
856     void drawHeader(WebFrameProxy&, WebCore::FloatRect&&);
857     void drawFooter(WebFrameProxy&, WebCore::FloatRect&&);
858
859 #if PLATFORM(COCOA)
860     // Dictionary.
861     void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
862     void performDictionaryLookupOfCurrentSelection();
863 #endif
864
865     void receivedPolicyDecision(WebCore::PolicyAction, WebFrameProxy&, uint64_t listenerID, API::Navigation* navigationID, std::optional<WebsitePoliciesData>&&);
866
867     void backForwardRemovedItem(uint64_t itemID);
868
869 #if ENABLE(DRAG_SUPPORT)    
870     // Drag and drop support.
871     void dragEntered(WebCore::DragData&, const String& dragStorageName = String());
872     void dragUpdated(WebCore::DragData&, const String& dragStorageName = String());
873     void dragExited(WebCore::DragData&, const String& dragStorageName = String());
874     void performDragOperation(WebCore::DragData&, const String& dragStorageName, SandboxExtension::Handle&&, SandboxExtension::HandleArray&&);
875
876     void didPerformDragControllerAction(uint64_t dragOperation, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, const WebCore::IntRect& insertionRect);
877     void dragEnded(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t operation);
878     void didStartDrag();
879     void dragCancelled();
880     void setDragCaretRect(const WebCore::IntRect&);
881 #if PLATFORM(COCOA)
882     void startDrag(const WebCore::DragItem&, const ShareableBitmap::Handle& dragImageHandle);
883     void setPromisedDataForImage(const String& pasteboardName, const SharedMemory::Handle& imageHandle, uint64_t imageSize, const String& filename, const String& extension,
884                          const String& title, const String& url, const String& visibleURL, const SharedMemory::Handle& archiveHandle, uint64_t archiveSize);
885 #endif
886 #if PLATFORM(GTK)
887     void startDrag(WebSelectionData&&, uint64_t dragOperation, const ShareableBitmap::Handle& dragImage);
888 #endif
889 #endif
890
891     void processDidBecomeUnresponsive();
892     void processDidBecomeResponsive();
893     void processDidTerminate(ProcessTerminationReason);
894     void willChangeProcessIsResponsive();
895     void didChangeProcessIsResponsive();
896
897 #if PLATFORM(IOS)
898     void processWillBecomeSuspended();
899     void processWillBecomeForeground();
900 #endif
901
902     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
903     virtual void exitAcceleratedCompositingMode();
904     virtual void updateAcceleratedCompositingMode(const LayerTreeContext&);
905
906     enum UndoOrRedo { Undo, Redo };
907     void addEditCommand(WebEditCommandProxy*);
908     void removeEditCommand(WebEditCommandProxy*);
909     bool isValidEditCommand(WebEditCommandProxy*);
910     void registerEditCommand(Ref<WebEditCommandProxy>&&, UndoOrRedo);
911
912     bool canUndo();
913     bool canRedo();
914
915 #if PLATFORM(COCOA)
916     void registerKeypressCommandName(const String& name) { m_knownKeypressCommandNames.add(name); }
917     bool isValidKeypressCommandName(const String& name) const { return m_knownKeypressCommandNames.contains(name); }
918 #endif
919
920     WebProcessProxy& process() { return m_process; }
921     ProcessID processIdentifier() const;
922
923     WebPreferences& preferences() { return m_preferences; }
924     void setPreferences(WebPreferences&);
925
926     WebPageGroup& pageGroup() { return m_pageGroup; }
927
928     bool isValid() const;
929
930 #if ENABLE(DRAG_SUPPORT)
931     WebCore::DragOperation currentDragOperation() const { return m_currentDragOperation; }
932     bool currentDragIsOverFileInput() const { return m_currentDragIsOverFileInput; }
933     unsigned currentDragNumberOfFilesToBeAccepted() const { return m_currentDragNumberOfFilesToBeAccepted; }
934     WebCore::IntRect currentDragCaretRect() const { return m_currentDragCaretRect; }
935     void resetCurrentDragInformation();
936     void didEndDragging();
937 #endif
938
939     void preferencesDidChange();
940
941 #if ENABLE(CONTEXT_MENUS)
942     // Called by the WebContextMenuProxy.
943     void contextMenuItemSelected(const WebContextMenuItemData&);
944     void handleContextMenuKeyEvent();
945 #endif
946
947     // Called by the WebOpenPanelResultListenerProxy.
948 #if PLATFORM(IOS)
949     void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const API::Data* iconData);
950 #endif
951     void didChooseFilesForOpenPanel(const Vector<String>&);
952     void didCancelForOpenPanel();
953
954     WebPageCreationParameters creationParameters();
955
956     void handleDownloadRequest(DownloadProxy*);
957
958     void advanceToNextMisspelling(bool startBeforeSelection);
959     void changeSpellingToWord(const String& word);
960 #if USE(APPKIT)
961     void uppercaseWord();
962     void lowercaseWord();
963     void capitalizeWord();
964 #endif
965
966 #if PLATFORM(COCOA)
967     bool isSmartInsertDeleteEnabled() const { return m_isSmartInsertDeleteEnabled; }
968     void setSmartInsertDeleteEnabled(bool);
969 #endif
970
971 #if PLATFORM(GTK)
972     String accessibilityPlugID() const { return m_accessibilityPlugID; }
973 #endif
974
975     void setCanRunModal(bool);
976     bool canRunModal();
977
978     void beginPrinting(WebFrameProxy*, const PrintInfo&);
979     void endPrinting();
980     void computePagesForPrinting(WebFrameProxy*, const PrintInfo&, Ref<ComputedPagesCallback>&&);
981 #if PLATFORM(COCOA)
982     void drawRectToImage(WebFrameProxy*, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, Ref<ImageCallback>&&);
983     void drawPagesToPDF(WebFrameProxy*, const PrintInfo&, uint32_t first, uint32_t count, Ref<DataCallback>&&);
984 #if PLATFORM(IOS)
985     uint32_t computePagesForPrintingAndDrawToPDF(uint64_t frameID, const PrintInfo&, DrawToPDFCallback::CallbackFunction&&);
986     void drawToPDFCallback(const IPC::DataReference& pdfData, WebKit::CallbackID);
987 #endif
988 #elif PLATFORM(GTK)
989     void drawPagesForPrinting(WebFrameProxy*, const PrintInfo&, Ref<PrintFinishedCallback>&&);
990 #endif
991
992     PageLoadState& pageLoadState() { return m_pageLoadState; }
993
994 #if PLATFORM(COCOA)
995     void handleAlternativeTextUIResult(const String& result);
996 #endif
997
998     void saveDataToFileInDownloadsFolder(String&& suggestedFilename, String&& mimeType, WebCore::URL&& originatingURL, API::Data&);
999     void savePDFToFileInDownloadsFolder(String&& suggestedFilename, WebCore::URL&& originatingURL, const IPC::DataReference&);
1000 #if PLATFORM(COCOA)
1001     void savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
1002     void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const IPC::DataReference&, const String& pdfUUID);
1003     void openPDFFromTemporaryFolderWithNativeApplication(const String& pdfUUID);
1004 #endif
1005
1006     WebCore::IntRect visibleScrollerThumbRect() const { return m_visibleScrollerThumbRect; }
1007
1008     uint64_t renderTreeSize() const { return m_renderTreeSize; }
1009
1010     void printMainFrame();
1011     
1012     void setMediaVolume(float);
1013     void setMuted(WebCore::MediaProducer::MutedStateFlags);
1014     void setMayStartMediaWhenInWindow(bool);
1015     bool mayStartMediaWhenInWindow() const { return m_mayStartMediaWhenInWindow; }
1016     void setMediaCaptureEnabled(bool);
1017     bool mediaCaptureEnabled() const { return m_mediaCaptureEnabled; }
1018     void stopMediaCapture();
1019
1020 #if ENABLE(MEDIA_SESSION)
1021     bool hasMediaSessionWithActiveMediaElements() const { return m_hasMediaSessionWithActiveMediaElements; }
1022     void handleMediaEvent(WebCore::MediaEventType);
1023     void setVolumeOfMediaElement(double, uint64_t);
1024 #endif
1025         
1026 #if ENABLE(POINTER_LOCK)
1027     void didAllowPointerLock();
1028     void didDenyPointerLock();
1029 #endif
1030
1031     // WebPopupMenuProxy::Client
1032     NativeWebMouseEvent* currentlyProcessedMouseDownEvent() override;
1033
1034     void setSuppressVisibilityUpdates(bool flag);
1035     bool suppressVisibilityUpdates() { return m_suppressVisibilityUpdates; }
1036
1037 #if PLATFORM(IOS)
1038     void willStartUserTriggeredZooming();
1039
1040     void potentialTapAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
1041     void commitPotentialTap(uint64_t layerTreeTransactionIdAtLastTouchStart);
1042     void cancelPotentialTap();
1043     void tapHighlightAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
1044     void handleTap(const WebCore::FloatPoint&, uint64_t layerTreeTransactionIdAtLastTouchStart);
1045
1046     void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&);
1047     void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&);
1048
1049     void blurAssistedNode();
1050 #endif
1051
1052     void postMessageToInjectedBundle(const String& messageName, API::Object* messageBody);
1053
1054 #if ENABLE(INPUT_TYPE_COLOR)
1055     void setColorPickerColor(const WebCore::Color&);
1056     void endColorPicker();
1057 #endif
1058
1059     WebCore::IntSize minimumLayoutSize() const { return m_minimumLayoutSize; }
1060     void setMinimumLayoutSize(const WebCore::IntSize&);
1061
1062     bool autoSizingShouldExpandToViewHeight() const { return m_autoSizingShouldExpandToViewHeight; }
1063     void setAutoSizingShouldExpandToViewHeight(bool);
1064
1065     void setViewportSizeForCSSViewportUnits(const WebCore::IntSize&);
1066     WebCore::IntSize viewportSizeForCSSViewportUnits() const { return m_viewportSizeForCSSViewportUnits.value_or(WebCore::IntSize()); }
1067
1068     void didReceiveAuthenticationChallengeProxy(uint64_t frameID, Ref<AuthenticationChallengeProxy>&&);
1069
1070     int64_t spellDocumentTag();
1071     void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
1072     void didCancelCheckingText(uint64_t requestID);
1073
1074     void connectionWillOpen(IPC::Connection&);
1075     void webProcessWillShutDown();
1076
1077     void processDidFinishLaunching();
1078
1079     void didSaveToPageCache();
1080         
1081     void setScrollPinningBehavior(WebCore::ScrollPinningBehavior);
1082     WebCore::ScrollPinningBehavior scrollPinningBehavior() const { return m_scrollPinningBehavior; }
1083
1084     void setOverlayScrollbarStyle(std::optional<WebCore::ScrollbarOverlayStyle>);
1085     std::optional<WebCore::ScrollbarOverlayStyle> overlayScrollbarStyle() const { return m_scrollbarOverlayStyle; }
1086
1087     bool shouldRecordNavigationSnapshots() const { return m_shouldRecordNavigationSnapshots; }
1088     void setShouldRecordNavigationSnapshots(bool shouldRecordSnapshots) { m_shouldRecordNavigationSnapshots = shouldRecordSnapshots; }
1089     void recordAutomaticNavigationSnapshot();
1090     void recordNavigationSnapshot(WebBackForwardListItem&);
1091
1092 #if PLATFORM(COCOA)
1093     RefPtr<ViewSnapshot> takeViewSnapshot();
1094 #endif
1095
1096 #if ENABLE(SUBTLE_CRYPTO)
1097     void wrapCryptoKey(const Vector<uint8_t>&, bool& succeeded, Vector<uint8_t>&);
1098     void unwrapCryptoKey(const Vector<uint8_t>&, bool& succeeded, Vector<uint8_t>&);
1099 #endif
1100
1101     void takeSnapshot(WebCore::IntRect, WebCore::IntSize bitmapSize, SnapshotOptions, WTF::Function<void (const ShareableBitmap::Handle&, CallbackBase::Error)>&&);
1102
1103     void navigationGestureDidBegin();
1104     void navigationGestureWillEnd(bool willNavigate, WebBackForwardListItem&);
1105     void navigationGestureDidEnd(bool willNavigate, WebBackForwardListItem&);
1106     void navigationGestureDidEnd();
1107     void navigationGestureSnapshotWasRemoved();
1108     void willRecordNavigationSnapshot(WebBackForwardListItem&);
1109
1110     bool isShowingNavigationGestureSnapshot() const { return m_isShowingNavigationGestureSnapshot; }
1111
1112     bool isPlayingAudio() const { return !!(m_mediaState & WebCore::MediaProducer::IsPlayingAudio); }
1113     void isPlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags, uint64_t);
1114     bool hasActiveAudioStream() const { return m_mediaState & WebCore::MediaProducer::HasActiveAudioCaptureDevice; }
1115     bool hasActiveVideoStream() const { return m_mediaState & WebCore::MediaProducer::HasActiveVideoCaptureDevice; }
1116     WebCore::MediaProducer::MediaStateFlags mediaStateFlags() const { return m_mediaState; }
1117     void handleAutoplayEvent(WebCore::AutoplayEvent, OptionSet<WebCore::AutoplayEventFlags>);
1118
1119 #if PLATFORM(MAC)
1120     void videoControlsManagerDidChange();
1121     bool hasActiveVideoForControlsManager() const;
1122     void requestControlledElementID() const;
1123     void handleControlledElementIDResponse(const String&) const;
1124     bool isPlayingVideoInEnhancedFullscreen() const;
1125 #endif
1126
1127 #if PLATFORM(COCOA)
1128     void requestActiveNowPlayingSessionInfo(Ref<NowPlayingInfoCallback>&&);
1129     void nowPlayingInfoCallback(bool, bool, const String&, double, double, uint64_t, CallbackID);
1130 #endif
1131
1132 #if ENABLE(MEDIA_SESSION)
1133     void hasMediaSessionWithActiveMediaElementsDidChange(bool);
1134     void mediaSessionMetadataDidChange(const WebCore::MediaSessionMetadata&);
1135     void focusedContentMediaElementDidChange(uint64_t);
1136 #endif
1137
1138 #if PLATFORM(MAC)
1139     API::HitTestResult* lastMouseMoveHitTestResult() const { return m_lastMouseMoveHitTestResult.get(); }
1140     void performImmediateActionHitTestAtLocation(WebCore::FloatPoint);
1141
1142     void immediateActionDidUpdate();
1143     void immediateActionDidCancel();
1144     void immediateActionDidComplete();
1145
1146     void* immediateActionAnimationControllerForHitTestResult(RefPtr<API::HitTestResult>, uint64_t, RefPtr<API::Object>);
1147
1148     void installActivityStateChangeCompletionHandler(WTF::Function<void ()>&&);
1149
1150     void handleAcceptedCandidate(WebCore::TextCheckingResult);
1151     void didHandleAcceptedCandidate();
1152
1153     void setHeaderBannerHeightForTesting(int);
1154     void setFooterBannerHeightForTesting(int);
1155 #endif
1156
1157 #if USE(UNIFIED_TEXT_CHECKING)
1158     void checkTextOfParagraph(const String& text, uint64_t checkingTypes, int32_t insertionPoint, Vector<WebCore::TextCheckingResult>& results);
1159 #endif
1160     void getGuessesForWord(const String& word, const String& context, int32_t insertionPoint, Vector<String>& guesses);
1161
1162     void setShouldDispatchFakeMouseMoveEvents(bool);
1163
1164     // Diagnostic messages logging.
1165     void logDiagnosticMessage(const String& message, const String& description, WebCore::ShouldSample);
1166     void logDiagnosticMessageWithResult(const String& message, const String& description, uint32_t result, WebCore::ShouldSample);
1167     void logDiagnosticMessageWithValue(const String& message, const String& description, double value, unsigned significantFigures, WebCore::ShouldSample);
1168     void logDiagnosticMessageWithEnhancedPrivacy(const String& message, const String& description, WebCore::ShouldSample);
1169
1170     // Performance logging.
1171     void logScrollingEvent(uint32_t eventType, MonotonicTime, uint64_t);
1172
1173     // Form validation messages.
1174     void showValidationMessage(const WebCore::IntRect& anchorClientRect, const String& message);
1175     void hideValidationMessage();
1176 #if PLATFORM(COCOA)
1177     WebCore::ValidationBubble* validationBubble() const { return m_validationBubble.get(); } // For testing.
1178 #endif
1179
1180 #if PLATFORM(IOS)
1181     void setIsKeyboardAnimatingIn(bool isKeyboardAnimatingIn) { m_isKeyboardAnimatingIn = isKeyboardAnimatingIn; }
1182 #endif
1183
1184 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
1185     void addPlaybackTargetPickerClient(uint64_t);
1186     void removePlaybackTargetPickerClient(uint64_t);
1187     void showPlaybackTargetPicker(uint64_t, const WebCore::FloatRect&, bool hasVideo);
1188     void playbackTargetPickerClientStateDidChange(uint64_t, WebCore::MediaProducer::MediaStateFlags);
1189     void setMockMediaPlaybackTargetPickerEnabled(bool);
1190     void setMockMediaPlaybackTargetPickerState(const String&, WebCore::MediaPlaybackTargetContext::State);
1191
1192     // WebMediaSessionManagerClient
1193     void setPlaybackTarget(uint64_t, Ref<WebCore::MediaPlaybackTarget>&&) override;
1194     void externalOutputDeviceAvailableDidChange(uint64_t, bool) override;
1195     void setShouldPlayToPlaybackTarget(uint64_t, bool) override;
1196 #endif
1197
1198     void didChangeBackgroundColor();
1199     void didLayoutForCustomContentProvider();
1200
1201     // For testing
1202     void clearWheelEventTestTrigger();
1203     void callAfterNextPresentationUpdate(WTF::Function<void (CallbackBase::Error)>&&);
1204
1205     void didReachLayoutMilestone(uint32_t layoutMilestones);
1206
1207     void didRestoreScrollPosition();
1208
1209     void getLoadDecisionForIcon(const WebCore::LinkIcon&, WebKit::CallbackID);
1210     void finishedLoadingIcon(WebKit::CallbackID, const IPC::DataReference&);
1211
1212     void setFocus(bool focused);
1213     void setWindowFrame(const WebCore::FloatRect&);
1214     void getWindowFrame(Ref<Messages::WebPageProxy::GetWindowFrame::DelayedReply>&&);
1215     void getWindowFrameWithCallback(Function<void(WebCore::FloatRect)>&&);
1216
1217     bool isResourceCachingDisabled() const { return m_isResourceCachingDisabled; }
1218     void setResourceCachingDisabled(bool);
1219
1220     WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection();
1221     void setUserInterfaceLayoutDirection(WebCore::UserInterfaceLayoutDirection);
1222
1223     bool hasHadSelectionChangesFromUserInteraction() const { return m_hasHadSelectionChangesFromUserInteraction; }
1224     bool needsHiddenContentEditableQuirk() const { return m_needsHiddenContentEditableQuirk; }
1225     bool needsPlainTextQuirk() const { return m_needsPlainTextQuirk; }
1226
1227     bool isAlwaysOnLoggingAllowed() const;
1228
1229     void canAuthenticateAgainstProtectionSpace(uint64_t loaderID, uint64_t frameID, const WebCore::ProtectionSpace&);
1230
1231 #if ENABLE(GAMEPAD)
1232     void gamepadActivity(const Vector<GamepadData>&, bool shouldMakeGamepadsVisible);
1233 #endif
1234         
1235     WeakPtr<WebPageProxy> createWeakPtr() const { return m_weakPtrFactory.createWeakPtr(*const_cast<WebPageProxy*>(this)); }
1236
1237     void isLoadingChanged() { activityStateDidChange(WebCore::ActivityState::IsLoading); }
1238
1239     void clearUserMediaState();
1240
1241     void setShouldSkipWaitingForPaintAfterNextViewDidMoveToWindow(bool shouldSkip) { m_shouldSkipWaitingForPaintAfterNextViewDidMoveToWindow = shouldSkip; }
1242
1243     void setURLSchemeHandlerForScheme(Ref<WebURLSchemeHandler>&&, const String& scheme);
1244     WebURLSchemeHandler* urlSchemeHandlerForScheme(const String& scheme);
1245
1246 #if PLATFORM(COCOA)
1247     void createSandboxExtensionsIfNeeded(const Vector<String>& files, SandboxExtension::Handle& fileReadHandle, SandboxExtension::HandleArray& fileUploadHandles);
1248 #endif
1249     void editorStateChanged(const EditorState&);
1250
1251 #if PLATFORM(COCOA)
1252     void touchBarMenuDataRemoved();
1253     void touchBarMenuDataChanged(const TouchBarMenuData&);
1254     void touchBarMenuItemDataAdded(const TouchBarMenuItemData&);
1255     void touchBarMenuItemDataRemoved(const TouchBarMenuItemData&);
1256 #endif
1257
1258 #if HAVE(CFNETWORK_STORAGE_PARTITIONING)
1259     void hasStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, uint64_t pageID, uint64_t webProcessContextId);
1260     void requestStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, uint64_t pageID, uint64_t webProcessContextId);
1261 #endif
1262
1263 #if ENABLE(ATTACHMENT_ELEMENT)
1264     void insertAttachment(const String& identifier, const WebCore::AttachmentDisplayOptions&, const String& filename, std::optional<String> contentType, WebCore::SharedBuffer& data, Function<void(CallbackBase::Error)>&&);
1265     void requestAttachmentInfo(const String& identifier, Function<void(const WebCore::AttachmentInfo&, CallbackBase::Error)>&&);
1266     void setAttachmentDisplayOptions(const String& identifier, WebCore::AttachmentDisplayOptions, Function<void(CallbackBase::Error)>&&);
1267     void setAttachmentDataAndContentType(const String& identifier, WebCore::SharedBuffer& data, std::optional<String>&& newContentType, std::optional<String>&& newFilename, Function<void(CallbackBase::Error)>&&);
1268     void attachmentInfoCallback(const WebCore::AttachmentInfo&, CallbackID);
1269 #endif
1270
1271 #if ENABLE(APPLICATION_MANIFEST)
1272     void getApplicationManifest(Function<void(const std::optional<WebCore::ApplicationManifest>&, CallbackBase::Error)>&&);
1273 #endif
1274
1275     void writeBlobToFilePath(const WebCore::URL& blobURL, const String& path, Function<void(bool success)>&&);
1276
1277     WebPreferencesStore preferencesStore() const;
1278
1279 private:
1280     WebPageProxy(PageClient&, WebProcessProxy&, uint64_t pageID, Ref<API::PageConfiguration>&&);
1281     void platformInitialize();
1282
1283     void updateActivityState(WebCore::ActivityState::Flags flagsToUpdate = WebCore::ActivityState::AllFlags);
1284     void updateThrottleState();
1285     void updateHiddenPageThrottlingAutoIncreases();
1286
1287     enum class ResetStateReason {
1288         PageInvalidated,
1289         WebProcessExited,
1290     };
1291     void resetState(ResetStateReason);
1292     void resetStateAfterProcessExited();
1293
1294     void setUserAgent(String&&);
1295
1296     // IPC::MessageReceiver
1297     // Implemented in generated WebPageProxyMessageReceiver.cpp
1298     void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
1299     void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override;
1300
1301
1302     // IPC::MessageSender
1303     bool sendMessage(std::unique_ptr<IPC::Encoder>, OptionSet<IPC::SendOption>) override;
1304     IPC::Connection* messageSenderConnection() override;
1305     uint64_t messageSenderDestinationID() override;
1306
1307     // WebPopupMenuProxy::Client
1308     void valueChangedForPopupMenu(WebPopupMenuProxy*, int32_t newSelectedIndex) override;
1309     void setTextFromItemForPopupMenu(WebPopupMenuProxy*, int32_t index) override;
1310 #if PLATFORM(GTK)
1311     void failedToShowPopupMenu() override;
1312 #endif
1313
1314 #if ENABLE(POINTER_LOCK)
1315     void requestPointerLock();
1316     void requestPointerUnlock();
1317 #endif
1318
1319     void didCreateMainFrame(uint64_t frameID);
1320     void didCreateSubframe(uint64_t frameID);
1321
1322     void didStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL&&, WebCore::URL&& unreachableURL, const UserData&);
1323     void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL&&, const UserData&);
1324     void willPerformClientRedirectForFrame(uint64_t frameID, const String& url, double delay);
1325     void didCancelClientRedirectForFrame(uint64_t frameID);
1326     void didChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL&&);
1327     void didFailProvisionalLoadForFrame(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, const UserData&);
1328     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&);
1329     void didFinishDocumentLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
1330     void didFinishLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
1331     void didFailLoadForFrame(uint64_t frameID, uint64_t navigationID, const WebCore::ResourceError&, const UserData&);
1332     void didSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t sameDocumentNavigationType, WebCore::URL&&, const UserData&);
1333     void didChangeMainDocument(uint64_t frameID);
1334
1335     void didReceiveTitleForFrame(uint64_t frameID, const String&, const UserData&);
1336     void didFirstLayoutForFrame(uint64_t frameID, const UserData&);
1337     void didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, const UserData&);
1338     void didDisplayInsecureContentForFrame(uint64_t frameID, const UserData&);
1339     void didRunInsecureContentForFrame(uint64_t frameID, const UserData&);
1340     void didDetectXSSForFrame(uint64_t frameID, const UserData&);
1341     void mainFramePluginHandlesPageScaleGestureDidChange(bool);
1342     void frameDidBecomeFrameSet(uint64_t frameID, bool);
1343     void didStartProgress();
1344     void didChangeProgress(double);
1345     void didFinishProgress();
1346     void setNetworkRequestsInProgress(bool);
1347
1348     void hasInsecureContent(WebCore::HasInsecureContent&);
1349
1350     void didDestroyNavigation(uint64_t navigationID);
1351
1352     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>&);
1353     void decidePolicyForNewWindowAction(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, NavigationActionData&&, WebCore::ResourceRequest&&, const String& frameName, uint64_t listenerID, const UserData&);
1354     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&);
1355     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&);
1356     void unableToImplementPolicy(uint64_t frameID, const WebCore::ResourceError&, const UserData&);
1357
1358     void willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const Vector<std::pair<String, String>>& textFieldValues, uint64_t listenerID, const UserData&);
1359         
1360     void contentRuleListNotification(WebCore::URL&&, Vector<String>&& identifiers, Vector<String>&& notifications);
1361
1362     // History client
1363     void didNavigateWithNavigationData(const WebNavigationDataStore&, uint64_t frameID);
1364     void didPerformClientRedirect(const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
1365     void didPerformServerRedirect(const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
1366     void didUpdateHistoryTitle(const String& title, const String& url, uint64_t frameID);
1367
1368     // UI client
1369     void createNewPage(const FrameInfoData&, uint64_t originatingPageID, WebCore::ResourceRequest&&, WebCore::WindowFeatures&&, NavigationActionData&&, Ref<Messages::WebPageProxy::CreateNewPage::DelayedReply>&&);
1370     void showPage();
1371     void runJavaScriptAlert(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, Ref<Messages::WebPageProxy::RunJavaScriptAlert::DelayedReply>&&);
1372     void runJavaScriptConfirm(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, Ref<Messages::WebPageProxy::RunJavaScriptConfirm::DelayedReply>&&);
1373     void runJavaScriptPrompt(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, const String&, Ref<Messages::WebPageProxy::RunJavaScriptPrompt::DelayedReply>&&);
1374     void setStatusText(const String&);
1375     void mouseDidMoveOverElement(WebHitTestResultData&&, uint32_t modifiers, UserData&&);
1376
1377 #if ENABLE(NETSCAPE_PLUGIN_API)
1378     void unavailablePluginButtonClicked(uint32_t opaquePluginUnavailabilityReason, const String& mimeType, const String& pluginURLString, const String& pluginsPageURLString, const String& frameURLString, const String& pageURLString);
1379 #endif // ENABLE(NETSCAPE_PLUGIN_API)
1380 #if ENABLE(WEBGL)
1381     void webGLPolicyForURL(WebCore::URL&&, Ref<Messages::WebPageProxy::WebGLPolicyForURL::DelayedReply>&&);
1382     void resolveWebGLPolicyForURL(WebCore::URL&&, Ref<Messages::WebPageProxy::ResolveWebGLPolicyForURL::DelayedReply>&&);
1383 #endif // ENABLE(WEBGL)
1384     void setToolbarsAreVisible(bool toolbarsAreVisible);
1385     void getToolbarsAreVisible(Ref<Messages::WebPageProxy::GetToolbarsAreVisible::DelayedReply>&&);
1386     void setMenuBarIsVisible(bool menuBarIsVisible);
1387     void getMenuBarIsVisible(Ref<Messages::WebPageProxy::GetMenuBarIsVisible::DelayedReply>&&);
1388     void setStatusBarIsVisible(bool statusBarIsVisible);
1389     void getStatusBarIsVisible(Ref<Messages::WebPageProxy::GetStatusBarIsVisible::DelayedReply>&&);
1390     void setIsResizable(bool isResizable);
1391     void screenToRootView(const WebCore::IntPoint& screenPoint, Ref<Messages::WebPageProxy::ScreenToRootView::DelayedReply>&&);
1392     void rootViewToScreen(const WebCore::IntRect& viewRect, Ref<Messages::WebPageProxy::RootViewToScreen::DelayedReply>&&);
1393 #if PLATFORM(IOS)
1394     void accessibilityScreenToRootView(const WebCore::IntPoint& screenPoint, WebCore::IntPoint& windowPoint);
1395     void rootViewToAccessibilityScreen(const WebCore::IntRect& viewRect, WebCore::IntRect& result);
1396 #endif
1397     void runBeforeUnloadConfirmPanel(uint64_t frameID, const WebCore::SecurityOriginData&, const String& message, RefPtr<Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::DelayedReply>);
1398     void didChangeViewportProperties(const WebCore::ViewportAttributes&);
1399     void pageDidScroll();
1400     void runOpenPanel(uint64_t frameID, const WebCore::SecurityOriginData&, const WebCore::FileChooserSettings&);
1401     void printFrame(uint64_t frameID);
1402     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>&&);
1403     void reachedApplicationCacheOriginQuota(const String& originIdentifier, uint64_t currentQuota, uint64_t totalBytesNeeded, Ref<Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::DelayedReply>&&);
1404     void requestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, String originIdentifier);
1405
1406 #if ENABLE(MEDIA_STREAM)
1407     UserMediaPermissionRequestManagerProxy& userMediaPermissionRequestManager();
1408 #endif
1409     void requestUserMediaPermissionForFrame(uint64_t userMediaID, uint64_t frameID, const WebCore::SecurityOriginData& userMediaDocumentOriginIdentifier, const WebCore::SecurityOriginData& topLevelDocumentOriginIdentifier, const WebCore::MediaStreamRequest&);
1410     void enumerateMediaDevicesForFrame(uint64_t userMediaID, uint64_t frameID, const WebCore::SecurityOriginData& userMediaDocumentOriginData, const WebCore::SecurityOriginData& topLevelDocumentOriginData);
1411
1412     void runModal();
1413     void notifyScrollerThumbIsVisibleInRect(const WebCore::IntRect&);
1414     void recommendedScrollbarStyleDidChange(int32_t newStyle);
1415     void didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar);
1416     void didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide, bool pinnedToTopSide, bool pinnedToBottomSide);
1417     void didChangePageCount(unsigned);
1418     void pageExtendedBackgroundColorDidChange(const WebCore::Color&);
1419 #if ENABLE(NETSCAPE_PLUGIN_API)
1420     void didFailToInitializePlugin(const String& mimeType, const String& frameURLString, const String& pageURLString);
1421     void didBlockInsecurePluginVersion(const String& mimeType, const String& pluginURLString, const String& frameURLString, const String& pageURLString, bool replacementObscured);
1422 #endif // ENABLE(NETSCAPE_PLUGIN_API)
1423     void setCanShortCircuitHorizontalWheelEvents(bool canShortCircuitHorizontalWheelEvents) { m_canShortCircuitHorizontalWheelEvents = canShortCircuitHorizontalWheelEvents; }
1424
1425     void reattachToWebProcess();
1426     RefPtr<API::Navigation> reattachToWebProcessForReload();
1427     RefPtr<API::Navigation> reattachToWebProcessWithItem(WebBackForwardListItem*);
1428
1429     void requestNotificationPermission(uint64_t notificationID, const String& originString);
1430     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);
1431     void cancelNotification(uint64_t notificationID);
1432     void clearNotifications(const Vector<uint64_t>& notificationIDs);
1433     void didDestroyNotification(uint64_t notificationID);
1434
1435     void didChangeContentSize(const WebCore::IntSize&);
1436
1437 #if ENABLE(INPUT_TYPE_COLOR)
1438     void showColorPicker(const WebCore::Color& initialColor, const WebCore::IntRect&);
1439     void didChooseColor(const WebCore::Color&) override;
1440     void didEndColorPicker() override;
1441 #endif
1442
1443     void compositionWasCanceled();
1444     void setHasHadSelectionChangesFromUserInteraction(bool);
1445     void setNeedsHiddenContentEditableQuirk(bool);
1446     void setNeedsPlainTextQuirk(bool);
1447
1448     // Back/Forward list management
1449     void backForwardAddItem(uint64_t itemID);
1450     void backForwardGoToItem(uint64_t itemID, SandboxExtension::Handle&);
1451     void backForwardItemAtIndex(int32_t index, uint64_t& itemID);
1452     void backForwardBackListCount(int32_t& count);
1453     void backForwardForwardListCount(int32_t& count);
1454     void backForwardClear();
1455
1456     // Undo management
1457     void registerEditCommandForUndo(uint64_t commandID, uint32_t editAction);
1458     void registerInsertionUndoGrouping();
1459     void clearAllEditCommands();
1460     void canUndoRedo(uint32_t action, bool& result);
1461     void executeUndoRedo(uint32_t action, bool& result);
1462
1463     // Keyboard handling
1464 #if PLATFORM(COCOA)
1465     void executeSavedCommandBySelector(const String& selector, bool& handled);
1466 #endif
1467
1468 #if PLATFORM(GTK)
1469     void getEditorCommandsForKeyEvent(const AtomicString&, Vector<String>&);
1470     void bindAccessibilityTree(const String&);
1471 #endif
1472
1473     // Popup Menu.
1474     void showPopupMenu(const WebCore::IntRect& rect, uint64_t textDirection, const Vector<WebPopupItem>& items, int32_t selectedIndex, const PlatformPopupMenuData&);
1475     void hidePopupMenu();
1476
1477 #if ENABLE(CONTEXT_MENUS)
1478     void showContextMenu(ContextMenuContextData&&, const UserData&);
1479 #endif
1480
1481 #if ENABLE(TELEPHONE_NUMBER_DETECTION)
1482 #if PLATFORM(MAC)
1483     void showTelephoneNumberMenu(const String& telephoneNumber, const WebCore::IntPoint&);
1484 #endif
1485 #endif
1486
1487     // Search popup results
1488     void saveRecentSearches(const String&, const Vector<WebCore::RecentSearch>&);
1489     void loadRecentSearches(const String&, Vector<WebCore::RecentSearch>&);
1490
1491 #if PLATFORM(COCOA)
1492     // Speech.
1493     void getIsSpeaking(bool&);
1494     void speak(const String&);
1495     void stopSpeaking();
1496
1497     // Spotlight.
1498     void searchWithSpotlight(const String&);
1499         
1500     void searchTheWeb(const String&);
1501
1502     // Dictionary.
1503     void didPerformDictionaryLookup(const WebCore::DictionaryPopupInfo&);
1504 #endif
1505
1506 #if PLATFORM(MAC)
1507     bool appleMailPaginationQuirkEnabled();
1508 #endif
1509
1510     // Spelling and grammar.
1511     void checkSpellingOfString(const String& text, int32_t& misspellingLocation, int32_t& misspellingLength);
1512     void checkGrammarOfString(const String& text, Vector<WebCore::GrammarDetail>&, int32_t& badGrammarLocation, int32_t& badGrammarLength);
1513     void spellingUIIsShowing(bool&);
1514     void updateSpellingUIWithMisspelledWord(const String& misspelledWord);
1515     void updateSpellingUIWithGrammarString(const String& badGrammarPhrase, const WebCore::GrammarDetail&);
1516     void learnWord(const String& word);
1517     void ignoreWord(const String& word);
1518     void requestCheckingOfString(uint64_t requestID, const WebCore::TextCheckingRequestData&, int32_t insertionPoint);
1519
1520     void takeFocus(uint32_t direction);
1521     void setToolTip(const String&);
1522     void setCursor(const WebCore::Cursor&);
1523     void setCursorHiddenUntilMouseMoves(bool);
1524
1525     void didReceiveEvent(uint32_t opaqueType, bool handled);
1526
1527     void voidCallback(CallbackID);
1528     void dataCallback(const IPC::DataReference&, CallbackID);
1529     void imageCallback(const ShareableBitmap::Handle&, CallbackID);
1530     void stringCallback(const String&, CallbackID);
1531     void invalidateStringCallback(CallbackID);
1532     void scriptValueCallback(const IPC::DataReference&, bool hadException, const WebCore::ExceptionDetails&, CallbackID);
1533     void computedPagesCallback(const Vector<WebCore::IntRect>&, double totalScaleFactorForPrinting, CallbackID);
1534     void validateCommandCallback(const String&, bool, int, CallbackID);
1535     void unsignedCallback(uint64_t, CallbackID);
1536     void editingRangeCallback(const EditingRange&, CallbackID);
1537 #if ENABLE(APPLICATION_MANIFEST)
1538     void applicationManifestCallback(const std::optional<WebCore::ApplicationManifest>&, CallbackID);
1539 #endif
1540 #if PLATFORM(COCOA)
1541     void machSendRightCallback(const WebCore::MachSendRight&, CallbackID);
1542 #endif
1543     void rectForCharacterRangeCallback(const WebCore::IntRect&, const EditingRange&, CallbackID);
1544 #if PLATFORM(MAC)
1545     void attributedStringForCharacterRangeCallback(const AttributedString&, const EditingRange&, CallbackID);
1546     void fontAtSelectionCallback(const String&, double, bool, CallbackID);
1547 #endif
1548 #if PLATFORM(IOS)
1549     void gestureCallback(const WebCore::IntPoint&, uint32_t gestureType, uint32_t gestureState, uint32_t flags, CallbackID);
1550     void touchesCallback(const WebCore::IntPoint&, uint32_t touches, uint32_t flags, CallbackID);
1551     void autocorrectionDataCallback(const Vector<WebCore::FloatRect>&, const String& fontName, float fontSize, uint64_t fontTraits, CallbackID);
1552     void autocorrectionContextCallback(const String& beforeText, const String& markedText, const String& selectedText, const String& afterText, uint64_t location, uint64_t length, CallbackID);
1553     void selectionContextCallback(const String& selectedText, const String& beforeText, const String& afterText, CallbackID);
1554     void interpretKeyEvent(const EditorState&, bool isCharEvent, bool& handled);
1555     void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect);
1556     void selectionRectsCallback(const Vector<WebCore::SelectionRect>&, CallbackID);
1557 #endif
1558 #if PLATFORM(GTK)
1559     void printFinishedCallback(const WebCore::ResourceError&, CallbackID);
1560 #endif
1561
1562     void focusedFrameChanged(uint64_t frameID);
1563     void frameSetLargestFrameChanged(uint64_t frameID);
1564
1565     void didReceiveAuthenticationChallenge(uint64_t frameID, const WebCore::AuthenticationChallenge&, uint64_t challengeID);
1566
1567     void didFinishLoadingDataForCustomContentProvider(const String& suggestedFilename, const IPC::DataReference&);
1568
1569 #if PLATFORM(COCOA)
1570     void pluginFocusOrWindowFocusChanged(uint64_t pluginComplexTextInputIdentifier, bool pluginHasFocusAndWindowHasFocus);
1571     void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, uint64_t complexTextInputState);
1572 #endif
1573
1574     bool maybeInitializeSandboxExtensionHandle(const WebCore::URL&, SandboxExtension::Handle&);
1575
1576 #if USE(AUTOMATIC_TEXT_REPLACEMENT)
1577     void toggleSmartInsertDelete();
1578     void toggleAutomaticQuoteSubstitution();
1579     void toggleAutomaticLinkDetection();
1580     void toggleAutomaticDashSubstitution();
1581     void toggleAutomaticTextReplacement();
1582 #endif
1583
1584 #if PLATFORM(MAC)
1585     void substitutionsPanelIsShowing(bool&);
1586     void showCorrectionPanel(int32_t panelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings);
1587     void dismissCorrectionPanel(int32_t reason);
1588     void dismissCorrectionPanelSoon(int32_t reason, String& result);
1589     void recordAutocorrectionResponse(int32_t responseType, const String& replacedString, const String& replacementString);
1590
1591 #if USE(DICTATION_ALTERNATIVES)
1592     void showDictationAlternativeUI(const WebCore::FloatRect& boundingBoxOfDictatedText, uint64_t dictationContext);
1593     void removeDictationAlternatives(uint64_t dictationContext);
1594     void dictationAlternatives(uint64_t dictationContext, Vector<String>& result);
1595 #endif
1596
1597     void setEditableElementIsFocused(bool);
1598 #endif // PLATFORM(MAC)
1599
1600 #if PLATFORM(IOS)
1601     WebCore::FloatSize screenSize();
1602     WebCore::FloatSize availableScreenSize();
1603     float textAutosizingWidth();
1604
1605     void dynamicViewportUpdateChangedTarget(double newTargetScale, const WebCore::FloatPoint& newScrollPosition, uint64_t dynamicViewportSizeUpdateID);
1606     void couldNotRestorePageState();
1607     void restorePageState(std::optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatBoxExtent& obscuredInsetsOnSave, double scale);
1608     void restorePageCenterAndScale(std::optional<WebCore::FloatPoint>, double scale);
1609
1610     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);
1611
1612     void startAssistingNode(const AssistedNodeInformation&, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, const UserData&);
1613     void stopAssistingNode();
1614
1615     void showInspectorHighlight(const WebCore::Highlight&);
1616     void hideInspectorHighlight();
1617
1618     void showInspectorIndication();
1619     void hideInspectorIndication();
1620
1621     void enableInspectorNodeSearch();
1622     void disableInspectorNodeSearch();
1623 #endif // PLATFORM(IOS)
1624
1625 #if ENABLE(DATA_DETECTION)
1626     RetainPtr<NSArray> m_dataDetectionResults;
1627 #endif
1628
1629     void clearLoadDependentCallbacks();
1630
1631     void performDragControllerAction(DragControllerAction, WebCore::DragData&, const String& dragStorageName, SandboxExtension::Handle&&, SandboxExtension::HandleArray&&);
1632
1633     void updateBackingStoreDiscardableState();
1634
1635     void setRenderTreeSize(uint64_t treeSize) { m_renderTreeSize = treeSize; }
1636
1637 #if PLATFORM(X11)
1638     void createPluginContainer(uint64_t& windowID);
1639     void windowedPluginGeometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect, uint64_t windowID);
1640     void windowedPluginVisibilityDidChange(bool isVisible, uint64_t windowID);
1641 #endif
1642
1643     void processNextQueuedWheelEvent();
1644     void sendWheelEvent(const WebWheelEvent&);
1645     bool shouldProcessWheelEventNow(const WebWheelEvent&) const;
1646
1647 #if ENABLE(TOUCH_EVENTS)
1648     void updateTouchEventTracking(const WebTouchEvent&);
1649     WebCore::TrackingType touchEventTrackingType(const WebTouchEvent&) const;
1650 #endif
1651
1652 #if ENABLE(NETSCAPE_PLUGIN_API)
1653     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);
1654 #endif
1655
1656 #if USE(QUICK_LOOK)
1657     void didStartLoadForQuickLookDocumentInMainFrame(const String& fileName, const String& uti);
1658     void didFinishLoadForQuickLookDocumentInMainFrame(const QuickLookDocumentData&);
1659     void didRequestPasswordForQuickLookDocumentInMainFrame(const String& fileName);
1660 #endif
1661
1662 #if ENABLE(CONTENT_FILTERING)
1663     void contentFilterDidBlockLoadForFrame(const WebCore::ContentFilterUnblockHandler&, uint64_t frameID);
1664 #endif
1665
1666     uint64_t generateNavigationID();
1667     API::DiagnosticLoggingClient* effectiveDiagnosticLoggingClient(WebCore::ShouldSample);
1668
1669     void dispatchActivityStateChange();
1670     void viewDidLeaveWindow();
1671     void viewDidEnterWindow();
1672
1673 #if PLATFORM(MAC)
1674     void didPerformImmediateActionHitTest(const WebHitTestResultData&, bool contentPreventsDefault, const UserData&);
1675 #endif
1676
1677     void useFixedLayoutDidChange(bool useFixedLayout) { m_useFixedLayout = useFixedLayout; }
1678     void fixedLayoutSizeDidChange(WebCore::IntSize fixedLayoutSize) { m_fixedLayoutSize = fixedLayoutSize; }
1679
1680     void imageOrMediaDocumentSizeChanged(const WebCore::IntSize&);
1681 #if ENABLE(VIDEO)
1682 #if USE(GSTREAMER)
1683     void requestInstallMissingMediaPlugins(const String& details, const String& description);
1684 #endif
1685 #endif
1686
1687     void startURLSchemeTask(URLSchemeTaskParameters&&);
1688     void stopURLSchemeTask(uint64_t handlerIdentifier, uint64_t taskIdentifier);
1689
1690     void handleAutoFillButtonClick(const UserData&);
1691
1692     void finishInitializingWebPageAfterProcessLaunch();
1693
1694     void handleMessage(IPC::Connection&, const String& messageName, const UserData& messageBody);
1695     void handleSynchronousMessage(IPC::Connection&, const String& messageName, const UserData& messageBody, UserData& returnUserData);
1696
1697     void viewIsBecomingVisible();
1698
1699     void stopAllURLSchemeTasks();
1700
1701 #if ENABLE(ATTACHMENT_ELEMENT)
1702     void didInsertAttachment(const String& identifier, const String& source);
1703     void didRemoveAttachment(const String& identifier);
1704 #endif
1705
1706     PageClient& m_pageClient;
1707     Ref<API::PageConfiguration> m_configuration;
1708
1709     std::unique_ptr<API::LoaderClient> m_loaderClient;
1710     std::unique_ptr<API::PolicyClient> m_policyClient;
1711     std::unique_ptr<API::NavigationClient> m_navigationClient;
1712     std::unique_ptr<API::HistoryClient> m_historyClient;
1713     std::unique_ptr<API::IconLoadingClient> m_iconLoadingClient;
1714     std::unique_ptr<API::FormClient> m_formClient;
1715     std::unique_ptr<API::UIClient> m_uiClient;
1716     std::unique_ptr<API::FindClient> m_findClient;
1717     std::unique_ptr<API::FindMatchesClient> m_findMatchesClient;
1718     std::unique_ptr<API::DiagnosticLoggingClient> m_diagnosticLoggingClient;
1719 #if ENABLE(CONTEXT_MENUS)
1720     std::unique_ptr<API::ContextMenuClient> m_contextMenuClient;
1721 #endif
1722     std::unique_ptr<WebPageInjectedBundleClient> m_injectedBundleClient;
1723
1724     std::unique_ptr<WebNavigationState> m_navigationState;
1725     String m_failingProvisionalLoadURL;
1726     bool m_isLoadingAlternateHTMLStringForFailingProvisionalLoad { false };
1727
1728     std::unique_ptr<DrawingAreaProxy> m_drawingArea;
1729 #if ENABLE(ASYNC_SCROLLING)
1730     std::unique_ptr<RemoteScrollingCoordinatorProxy> m_scrollingCoordinatorProxy;
1731 #endif
1732
1733     Ref<WebProcessProxy> m_process;
1734     Ref<WebPageGroup> m_pageGroup;
1735     Ref<WebPreferences> m_preferences;
1736
1737     WebProcessLifetimeTracker m_webProcessLifetimeTracker { *this };
1738
1739     Ref<WebUserContentControllerProxy> m_userContentController;
1740     Ref<VisitedLinkStore> m_visitedLinkStore;
1741     Ref<WebsiteDataStore> m_websiteDataStore;
1742
1743     RefPtr<WebFrameProxy> m_mainFrame;
1744     RefPtr<WebFrameProxy> m_focusedFrame;
1745     RefPtr<WebFrameProxy> m_frameSetLargestFrame;
1746
1747     String m_userAgent;
1748     String m_applicationNameForUserAgent;
1749     String m_customUserAgent;
1750     String m_customTextEncodingName;
1751     String m_overrideContentSecurityPolicy;
1752
1753     bool m_treatsSHA1CertificatesAsInsecure { true };
1754
1755     RefPtr<WebInspectorProxy> m_inspector;
1756
1757 #if ENABLE(FULLSCREEN_API)
1758     RefPtr<WebFullScreenManagerProxy> m_fullScreenManager;
1759     std::unique_ptr<API::FullscreenClient> m_fullscreenClient;
1760 #endif
1761
1762 #if (PLATFORM(IOS) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
1763     RefPtr<PlaybackSessionManagerProxy> m_playbackSessionManager;
1764     RefPtr<VideoFullscreenManagerProxy> m_videoFullscreenManager;
1765 #endif
1766
1767 #if PLATFORM(IOS)
1768     VisibleContentRectUpdateInfo m_lastVisibleContentRectUpdate;
1769     uint64_t m_firstLayerTreeTransactionIdAfterDidCommitLoad { 0 };
1770     int32_t m_deviceOrientation { 0 };
1771     uint64_t m_dynamicViewportSizeUpdateLayerTreeTransactionID { 0 };
1772     uint64_t m_currentDynamicViewportSizeUpdateID { 0 };
1773     bool m_hasReceivedLayerTreeTransactionAfterDidCommitLoad { true };
1774     bool m_dynamicViewportSizeUpdateWaitingForTarget { false };
1775     bool m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit { false };
1776     bool m_hasNetworkRequestsOnSuspended { false };
1777     bool m_isKeyboardAnimatingIn { false };
1778     bool m_isScrollingOrZooming { false };
1779 #endif
1780
1781 #if ENABLE(APPLE_PAY)
1782     std::unique_ptr<WebPaymentCoordinatorProxy> m_paymentCoordinator;
1783 #endif
1784
1785     CallbackMap m_callbacks;
1786     HashSet<CallbackID> m_loadDependentStringCallbackIDs;
1787
1788     HashSet<WebEditCommandProxy*> m_editCommandSet;
1789
1790 #if PLATFORM(COCOA)
1791     HashSet<String> m_knownKeypressCommandNames;
1792 #endif
1793
1794     RefPtr<WebPopupMenuProxy> m_activePopupMenu;
1795 #if ENABLE(CONTEXT_MENUS)
1796     RefPtr<WebContextMenuProxy> m_activeContextMenu;
1797     ContextMenuContextData m_activeContextMenuContextData;
1798 #endif
1799     RefPtr<API::HitTestResult> m_lastMouseMoveHitTestResult;
1800
1801     RefPtr<WebOpenPanelResultListenerProxy> m_openPanelResultListener;
1802     GeolocationPermissionRequestManagerProxy m_geolocationPermissionRequestManager;
1803     NotificationPermissionRequestManagerProxy m_notificationPermissionRequestManager;
1804
1805 #if ENABLE(MEDIA_STREAM)
1806     std::unique_ptr<UserMediaPermissionRequestManagerProxy> m_userMediaPermissionRequestManager;
1807 #endif
1808
1809     WebCore::ActivityState::Flags m_activityState { WebCore::ActivityState::NoFlags };
1810     bool m_viewWasEverInWindow { false };
1811 #if PLATFORM(IOS)
1812     bool m_allowsMediaDocumentInlinePlayback { false };
1813     bool m_alwaysRunsAtForegroundPriority { false };
1814     ProcessThrottler::ForegroundActivityToken m_activityToken;
1815 #endif
1816     bool m_initialCapitalizationEnabled { false };
1817     std::optional<double> m_cpuLimit;
1818     Ref<WebBackForwardList> m_backForwardList;
1819         
1820     bool m_maintainsInactiveSelection { false };
1821
1822     bool m_waitsForPaintAfterViewDidMoveToWindow { false };
1823     bool m_shouldSkipWaitingForPaintAfterNextViewDidMoveToWindow { false };
1824
1825     String m_toolTip;
1826
1827     EditorState m_editorState;
1828     bool m_isEditable { false };
1829
1830 #if PLATFORM(COCOA)
1831     TouchBarMenuData m_touchBarMenuData;
1832 #endif
1833
1834     double m_textZoomFactor { 1 };
1835     double m_pageZoomFactor { 1 };
1836     double m_pageScaleFactor { 1 };
1837     double m_pluginZoomFactor { 1 };
1838     double m_pluginScaleFactor { 1 };
1839     double m_viewScaleFactor { 1 };
1840     float m_intrinsicDeviceScaleFactor { 1 };
1841     std::optional<float> m_customDeviceScaleFactor;
1842     float m_topContentInset { 0 };
1843
1844     LayerHostingMode m_layerHostingMode { LayerHostingMode::InProcess };
1845
1846     bool m_drawsBackground { true };
1847
1848     WebCore::Color m_underlayColor;
1849     WebCore::Color m_pageExtendedBackgroundColor;
1850
1851     bool m_useFixedLayout { false };
1852     WebCore::IntSize m_fixedLayoutSize;
1853
1854     bool m_alwaysShowsHorizontalScroller { false };
1855     bool m_alwaysShowsVerticalScroller { false };
1856
1857     WebCore::LayoutMilestones m_observedLayoutMilestones { 0 };
1858
1859     bool m_suppressScrollbarAnimations { false };
1860
1861     WebCore::Pagination::Mode m_paginationMode { WebCore::Pagination::Unpaginated };
1862     bool m_paginationBehavesLikeColumns { false };
1863     double m_pageLength { 0 };
1864     double m_gapBetweenPages { 0 };
1865     bool m_paginationLineGridEnabled { false };
1866         
1867     // If the process backing the web page is alive and kicking.
1868     bool m_isValid { true };
1869
1870     // Whether WebPageProxy::close() has been called on this page.
1871     bool m_isClosed { false };
1872
1873     // Whether it can run modal child web pages.
1874     bool m_canRunModal { false };
1875
1876     bool m_needsToFinishInitializingWebPageAfterProcessLaunch { false };
1877
1878     bool m_isInPrintingMode { false };
1879     bool m_isPerformingDOMPrintOperation { false };
1880
1881     bool m_inDecidePolicyForResponseSync { false };
1882     const WebCore::ResourceRequest* m_decidePolicyForResponseRequest { nullptr };
1883     bool m_syncMimeTypePolicyActionIsValid { false };
1884     WebCore::PolicyAction m_syncMimeTypePolicyAction { WebCore::PolicyAction::Use };
1885     DownloadID m_syncMimeTypePolicyDownloadID { 0 };
1886     bool m_inDecidePolicyForNavigationAction { false };
1887     bool m_syncNavigationActionPolicyActionIsValid { false };
1888     WebCore::PolicyAction m_syncNavigationActionPolicyAction { WebCore::PolicyAction::Use };
1889     DownloadID m_syncNavigationActionPolicyDownloadID { 0 };
1890     std::optional<WebsitePoliciesData> m_syncNavigationActionPolicyWebsitePolicies;
1891
1892     bool m_shouldSuppressAppLinksInNextNavigationPolicyDecision { false };
1893
1894     Deque<NativeWebKeyboardEvent> m_keyEventQueue;
1895     Deque<NativeWebWheelEvent> m_wheelEventQueue;
1896     Deque<std::unique_ptr<Vector<NativeWebWheelEvent>>> m_currentlyProcessedWheelEvents;
1897 #if ENABLE(MAC_GESTURE_EVENTS)
1898     Deque<NativeWebGestureEvent> m_gestureEventQueue;
1899 #endif
1900
1901     bool m_processingMouseMoveEvent { false };
1902     std::unique_ptr<NativeWebMouseEvent> m_nextMouseMoveEvent;
1903     std::unique_ptr<NativeWebMouseEvent> m_currentlyProcessedMouseDownEvent;
1904
1905 #if ENABLE(TOUCH_EVENTS)
1906     struct TouchEventTracking {
1907         WebCore::TrackingType touchForceChangedTracking { WebCore::TrackingType::NotTracking };
1908         WebCore::TrackingType touchStartTracking { WebCore::TrackingType::NotTracking };
1909         WebCore::TrackingType touchMoveTracking { WebCore::TrackingType::NotTracking };
1910         WebCore::TrackingType touchEndTracking { WebCore::TrackingType::NotTracking };
1911
1912         bool isTrackingAnything() const
1913         {
1914             return touchForceChangedTracking != WebCore::TrackingType::NotTracking
1915                 || touchStartTracking != WebCore::TrackingType::NotTracking
1916                 || touchMoveTracking != WebCore::TrackingType::NotTracking
1917                 || touchEndTracking != WebCore::TrackingType::NotTracking;
1918         }
1919
1920         void reset()
1921         {
1922             touchForceChangedTracking = WebCore::TrackingType::NotTracking;
1923             touchStartTracking = WebCore::TrackingType::NotTracking;
1924             touchMoveTracking = WebCore::TrackingType::NotTracking;
1925             touchEndTracking = WebCore::TrackingType::NotTracking;
1926         }
1927     };
1928     TouchEventTracking m_touchEventTracking;
1929 #endif
1930 #if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS)
1931     Deque<QueuedTouchEvents> m_touchEventQueue;
1932 #endif
1933
1934 #if ENABLE(INPUT_TYPE_COLOR)
1935     RefPtr<WebColorPicker> m_colorPicker;
1936 #endif
1937 #if PLATFORM(COCOA)
1938     RefPtr<WebCore::ValidationBubble> m_validationBubble;
1939 #endif
1940
1941     const uint64_t m_pageID;
1942
1943     bool m_isPageSuspended { false };
1944     bool m_addsVisitedLinks { true };
1945
1946     bool m_controlledByAutomation { false };
1947
1948 #if ENABLE(REMOTE_INSPECTOR)
1949     bool m_allowsRemoteInspection { true };
1950     String m_remoteInspectionNameOverride;
1951 #endif
1952
1953 #if PLATFORM(COCOA)
1954     bool m_isSmartInsertDeleteEnabled { false };
1955 #endif
1956
1957 #if PLATFORM(GTK)
1958     String m_accessibilityPlugID;
1959     WebCore::Color m_backgroundColor { WebCore::Color::white };
1960 #endif
1961
1962     int64_t m_spellDocumentTag { 0 }; // FIXME: use std::optional<>.
1963     bool m_hasSpellDocumentTag { false }; 
1964     unsigned m_pendingLearnOrIgnoreWordMessageCount { 0 };
1965
1966     bool m_mainFrameHasCustomContentProvider { false };
1967
1968 #if ENABLE(DRAG_SUPPORT)
1969     // Current drag destination details are delivered as an asynchronous response,
1970     // so we preserve them to be used when the next dragging delegate call is made.
1971     WebCore::DragOperation m_currentDragOperation { WebCore::DragOperationNone };
1972     bool m_currentDragIsOverFileInput { false };
1973     unsigned m_currentDragNumberOfFilesToBeAccepted { 0 };
1974     WebCore::IntRect m_currentDragCaretRect;
1975 #endif
1976
1977     PageLoadState m_pageLoadState;
1978     
1979     bool m_delegatesScrolling { false };
1980
1981     bool m_mainFrameHasHorizontalScrollbar { false };
1982     bool m_mainFrameHasVerticalScrollbar { false };
1983
1984     // Whether horizontal wheel events can be handled directly for swiping purposes.
1985     bool m_canShortCircuitHorizontalWheelEvents { true };
1986
1987     bool m_mainFrameIsPinnedToLeftSide { true };
1988     bool m_mainFrameIsPinnedToRightSide { true };
1989     bool m_mainFrameIsPinnedToTopSide { true };
1990     bool m_mainFrameIsPinnedToBottomSide { true };
1991
1992     bool m_shouldUseImplicitRubberBandControl { false };
1993     bool m_rubberBandsAtLeft { true };
1994     bool m_rubberBandsAtRight { true };
1995     bool m_rubberBandsAtTop { true };
1996     bool m_rubberBandsAtBottom { true };
1997         
1998     bool m_enableVerticalRubberBanding { true };
1999     bool m_enableHorizontalRubberBanding { true };
2000
2001     bool m_backgroundExtendsBeyondPage { false };
2002
2003     bool m_shouldRecordNavigationSnapshots { false };
2004     bool m_isShowingNavigationGestureSnapshot { false };
2005
2006     bool m_mainFramePluginHandlesPageScaleGesture { false };
2007
2008     unsigned m_pageCount { 0 };
2009
2010     WebCore::IntRect m_visibleScrollerThumbRect;
2011
2012     uint64_t m_renderTreeSize { 0 };
2013     uint64_t m_sessionRestorationRenderTreeSize { 0 };
2014     bool m_hitRenderTreeSizeThreshold { false };
2015
2016     bool m_suppressVisibilityUpdates { false };
2017     bool m_autoSizingShouldExpandToViewHeight { false };
2018     WebCore::IntSize m_minimumLayoutSize;
2019     std::optional<WebCore::IntSize> m_viewportSizeForCSSViewportUnits;
2020
2021     // Visual viewports
2022     WebCore::LayoutSize m_baseLayoutViewportSize;
2023     WebCore::LayoutPoint m_minStableLayoutViewportOrigin;
2024     WebCore::LayoutPoint m_maxStableLayoutViewportOrigin;
2025
2026     float m_mediaVolume { 1 };
2027     WebCore::MediaProducer::MutedStateFlags m_mutedState { WebCore::MediaProducer::NoneMuted };
2028     bool m_mayStartMediaWhenInWindow { true };
2029     bool m_mediaCaptureEnabled { true };
2030
2031     bool m_waitingForDidUpdateActivityState { false };
2032
2033     bool m_shouldScaleViewToFitDocument { false };
2034     bool m_suppressAutomaticNavigationSnapshotting { false };
2035
2036 #if PLATFORM(COCOA)
2037     HashMap<String, String> m_temporaryPDFFiles;
2038     std::unique_ptr<WebCore::RunLoopObserver> m_activityStateChangeDispatcher;
2039
2040     std::unique_ptr<RemoteLayerTreeScrollingPerformanceData> m_scrollingPerformanceData;
2041     bool m_scrollPerformanceDataCollectionEnabled { false };
2042 #endif
2043     UserObservablePageCounter::Token m_pageIsUserObservableCount;
2044     ProcessSuppressionDisabledToken m_preventProcessSuppressionCount;
2045     HiddenPageThrottlingAutoIncreasesCounter::Token m_hiddenPageDOMTimerThrottlingAutoIncreasesCount;
2046     VisibleWebPageToken m_visiblePageToken;
2047         
2048     WebCore::ScrollPinningBehavior m_scrollPinningBehavior { WebCore::DoNotPin };
2049     std::optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle;
2050
2051     uint64_t m_navigationID { 0 };
2052
2053     WebPreferencesStore::ValueMap m_configurationPreferenceValues;
2054     WebCore::ActivityState::Flags m_potentiallyChangedActivityStateFlags { WebCore::ActivityState::NoFlags };
2055     bool m_activityStateChangeWantsSynchronousReply { false };
2056     Vector<CallbackID> m_nextActivityStateChangeCallbacks;
2057
2058     WebCore::MediaProducer::MediaStateFlags m_mediaState { WebCore::MediaProducer::IsNotPlaying };
2059
2060     bool m_isResourceCachingDisabled { false };
2061
2062     bool m_hasHadSelectionChangesFromUserInteraction { false };
2063     bool m_needsHiddenContentEditableQuirk { false };
2064     bool m_needsPlainTextQuirk { false };
2065
2066 #if ENABLE(MEDIA_SESSION)
2067     bool m_hasMediaSessionWithActiveMediaElements { false };
2068 #endif
2069
2070 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
2071     bool m_requiresTargetMonitoring { false };
2072 #endif
2073
2074 #if PLATFORM(IOS)
2075     bool m_hasDeferredStartAssistingNode { false };
2076     std::unique_ptr<NodeAssistanceArguments> m_deferredNodeAssistanceArguments;
2077     bool m_forceAlwaysUserScalable { false };
2078     WebCore::FloatSize m_viewportConfigurationMinimumLayoutSize;
2079     WebCore::FloatSize m_maximumUnobscuredSize;
2080 #endif
2081
2082 #if ENABLE(POINTER_LOCK)
2083     bool m_isPointerLockPending { false };
2084     bool m_isPointerLocked { false };
2085 #endif
2086
2087     bool m_isUsingHighPerformanceWebGL { false };
2088
2089     WeakPtrFactory<WebPageProxy> m_weakPtrFactory;
2090
2091     HashMap<String, Ref<WebURLSchemeHandler>> m_urlSchemeHandlersByScheme;
2092     HashMap<uint64_t, Ref<WebURLSchemeHandler>> m_urlSchemeHandlersByIdentifier;
2093 };
2094
2095 } // namespace WebKit