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