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