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