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