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