3a68c79681940730f56b744f998d1269679584a1
[WebKit-https.git] / Source / WebKit / WebProcess / WebPage / WebPage.h
1 /*
2  * Copyright (C) 2010-2019 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #pragma once
27
28 #include "APIInjectedBundleEditorClient.h"
29 #include "APIInjectedBundleFormClient.h"
30 #include "APIInjectedBundlePageContextMenuClient.h"
31 #include "APIInjectedBundlePageLoaderClient.h"
32 #include "APIInjectedBundlePageResourceLoadClient.h"
33 #include "APIInjectedBundlePageUIClient.h"
34 #include "APIObject.h"
35 #include "CallbackID.h"
36 #include "ContentAsStringIncludesChildFrames.h"
37 #include "DrawingAreaInfo.h"
38 #include "EditingRange.h"
39 #include "FocusedElementInformation.h"
40 #include "InjectedBundlePageContextMenuClient.h"
41 #include "InjectedBundlePageFullScreenClient.h"
42 #include "InjectedBundlePagePolicyClient.h"
43 #include "LayerTreeContext.h"
44 #include "MessageReceiver.h"
45 #include "MessageSender.h"
46 #include "OptionalCallbackID.h"
47 #include "Plugin.h"
48 #include "PolicyDecision.h"
49 #include "SandboxExtension.h"
50 #include "ShareSheetCallbackID.h"
51 #include "SharedMemory.h"
52 #include "StorageNamespaceIdentifier.h"
53 #include "TransactionID.h"
54 #include "UserData.h"
55 #include "WebBackForwardListProxy.h"
56 #include "WebPageMessagesReplies.h"
57 #include "WebURLSchemeHandler.h"
58 #include "WebUndoStepID.h"
59 #include "WebUserContentController.h"
60 #include "WebsitePoliciesData.h"
61 #include <JavaScriptCore/InspectorFrontendChannel.h>
62 #include <WebCore/ActivityState.h>
63 #include <WebCore/DictionaryPopupInfo.h>
64 #include <WebCore/DisabledAdaptations.h>
65 #include <WebCore/DragActions.h>
66 #include <WebCore/FrameLoaderTypes.h>
67 #include <WebCore/HTMLMenuElement.h>
68 #include <WebCore/HTMLMenuItemElement.h>
69 #include <WebCore/IntRect.h>
70 #include <WebCore/IntSizeHash.h>
71 #include <WebCore/Page.h>
72 #include <WebCore/PageIdentifier.h>
73 #include <WebCore/PageOverlay.h>
74 #include <WebCore/PluginData.h>
75 #include <WebCore/PointerID.h>
76 #include <WebCore/RenderingMode.h>
77 #include <WebCore/SecurityPolicyViolationEvent.h>
78 #include <WebCore/ShareData.h>
79 #include <WebCore/TextManipulationController.h>
80 #include <WebCore/UserActivity.h>
81 #include <WebCore/UserContentTypes.h>
82 #include <WebCore/UserInterfaceLayoutDirection.h>
83 #include <WebCore/UserScriptTypes.h>
84 #include <WebCore/VisibilityState.h>
85 #include <WebCore/WebCoreKeyboardUIMode.h>
86 #include <memory>
87 #include <pal/HysteresisActivity.h>
88 #include <wtf/HashMap.h>
89 #include <wtf/MonotonicTime.h>
90 #include <wtf/RefPtr.h>
91 #include <wtf/RunLoop.h>
92 #include <wtf/Seconds.h>
93 #include <wtf/WallTime.h>
94 #include <wtf/text/WTFString.h>
95
96 #if ENABLE(ACCESSIBILITY) && USE(ATK)
97 typedef struct _AtkObject AtkObject;
98 #include <wtf/glib/GRefPtr.h>
99 #endif
100
101 #if PLATFORM(GTK)
102 #include "ArgumentCodersGtk.h"
103 #include "WebPrintOperationGtk.h"
104 #endif
105
106 #if PLATFORM(GTK) || PLATFORM(WPE)
107 #include "InputMethodState.h"
108 #endif
109
110 #if PLATFORM(IOS_FAMILY)
111 #include "GestureTypes.h"
112 #include <WebCore/IntPointHash.h>
113 #include <WebCore/WKContentObservation.h>
114 #endif
115
116 #if ENABLE(META_VIEWPORT)
117 #include <WebCore/ViewportConfiguration.h>
118 #endif
119
120 #if ENABLE(APPLICATION_MANIFEST)
121 #include <WebCore/ApplicationManifest.h>
122 #endif
123
124 #if ENABLE(IOS_TOUCH_EVENTS)
125 #include <WebKitAdditions/PlatformTouchEventIOS.h>
126 #elif ENABLE(TOUCH_EVENTS)
127 #include <WebCore/PlatformTouchEvent.h>
128 #endif
129
130 #if ENABLE(DATA_DETECTION)
131 #include <WebCore/DataDetection.h>
132 #endif
133
134 #if ENABLE(MAC_GESTURE_EVENTS)
135 #include <WebKitAdditions/PlatformGestureEventMac.h>
136 #endif
137
138 #if PLATFORM(COCOA)
139 #include "DynamicViewportSizeUpdate.h"
140 #include <WebCore/VisibleSelection.h>
141 #include <wtf/RetainPtr.h>
142 OBJC_CLASS CALayer;
143 OBJC_CLASS NSArray;
144 OBJC_CLASS NSDictionary;
145 OBJC_CLASS NSObject;
146 OBJC_CLASS WKAccessibilityWebPageObject;
147 #endif
148
149 #define ENABLE_VIEWPORT_RESIZING PLATFORM(IOS_FAMILY)
150
151 namespace API {
152 class Array;
153 }
154
155 namespace IPC {
156 class Connection;
157 class Decoder;
158 class FormDataReference;
159 class SharedBufferDataReference;
160 }
161
162 namespace WebCore {
163
164 class CaptureDevice;
165 class DocumentLoader;
166 class DragData;
167 class FontAttributeChanges;
168 class FontChanges;
169 class Frame;
170 class FrameSelection;
171 class FrameView;
172 class GraphicsContext;
173 class HTMLImageElement;
174 class HTMLMenuElement;
175 class HTMLMenuItemElement;
176 class HTMLPlugInElement;
177 class HTMLPlugInImageElement;
178 class IntPoint;
179 class KeyboardEvent;
180 class MediaPlaybackTargetContext;
181 class MediaPlayerRequestInstallMissingPluginsCallback;
182 class Page;
183 class PrintContext;
184 class Range;
185 class ResourceRequest;
186 class ResourceResponse;
187 class SelectionRect;
188 class SharedBuffer;
189 class SubstituteData;
190 class TextCheckingRequest;
191 class VisiblePosition;
192
193 enum SyntheticClickType : int8_t;
194 enum class DOMPasteAccessResponse : uint8_t;
195 enum class DragHandlingMethod : uint8_t;
196 enum class ShouldTreatAsContinuingLoad : bool;
197 enum class StorageAccessPromptWasShown : bool;
198 enum class StorageAccessWasGranted : bool;
199 enum class TextIndicatorPresentationTransition : uint8_t;
200 enum class WritingDirection : uint8_t;
201
202 struct BackForwardItemIdentifier;
203 struct CompositionHighlight;
204 struct CompositionUnderline;
205 struct DictationAlternative;
206 struct ElementContext;
207 struct GlobalFrameIdentifier;
208 struct GlobalWindowIdentifier;
209 struct Highlight;
210 struct KeypressCommand;
211 struct PromisedAttachmentInfo;
212 struct RunJavaScriptParameters;
213 struct TextCheckingResult;
214 struct ViewportArguments;
215
216 #if ENABLE(ATTACHMENT_ELEMENT)
217 class HTMLAttachmentElement;
218 #endif
219 }
220
221 namespace WebKit {
222
223 class DataReference;
224 class DrawingArea;
225 class DownloadID;
226 class FindController;
227 class GamepadData;
228 class GeolocationPermissionRequestManager;
229 class LayerHostingContext;
230 class MediaDeviceSandboxExtensions;
231 class NotificationPermissionRequestManager;
232 class PDFPlugin;
233 class PageBanner;
234 class PluginView;
235 class RemoteWebInspectorUI;
236 class TextCheckingControllerProxy;
237 class UserMediaPermissionRequestManager;
238 class ViewGestureGeometryCollector;
239 class WebColorChooser;
240 class WebContextMenu;
241 class WebContextMenuItemData;
242 class WebDataListSuggestionPicker;
243 class WebDocumentLoader;
244 class WebEvent;
245 class PlaybackSessionManager;
246 class VideoFullscreenManager;
247 class WebFrame;
248 class WebFullScreenManager;
249 class WebGestureEvent;
250 class WebImage;
251 class WebInspector;
252 class WebInspectorClient;
253 class WebInspectorUI;
254 class WebKeyboardEvent;
255 class WebMouseEvent;
256 class WebNotificationClient;
257 class WebOpenPanelResultListener;
258 class WebPageGroupProxy;
259 class WebPageInspectorTargetController;
260 class WebPageOverlay;
261 class WebPaymentCoordinator;
262 class WebPopupMenu;
263 class WebRemoteObjectRegistry;
264 class WebTouchEvent;
265 class WebURLSchemeHandlerProxy;
266 class WebUndoStep;
267 class WebUserContentController;
268 class WebWheelEvent;
269 class RemoteLayerTreeTransaction;
270
271 enum FindOptions : uint16_t;
272 enum class DragControllerAction : uint8_t;
273 enum class SyntheticEditingCommandType : uint8_t;
274
275 struct AttributedString;
276 struct BackForwardListItemState;
277 struct DataDetectionResult;
278 struct DocumentEditingContext;
279 struct DocumentEditingContextRequest;
280 struct EditorState;
281 struct FontInfo;
282 struct InsertTextOptions;
283 struct InteractionInformationAtPosition;
284 struct InteractionInformationRequest;
285 struct LoadParameters;
286 struct PrintInfo;
287 struct TextInputContext;
288 struct UserMessage;
289 struct WebAutocorrectionData;
290 struct WebAutocorrectionContext;
291 struct WebPageCreationParameters;
292 struct WebPreferencesStore;
293 struct WebSelectionData;
294 struct WebsitePoliciesData;
295
296 #if ENABLE(UI_SIDE_COMPOSITING)
297 class VisibleContentRectUpdateInfo;
298 #endif
299
300 using SnapshotOptions = uint32_t;
301 using WKEventModifiers = uint32_t;
302
303 class WebPage : public API::ObjectImpl<API::Object::Type::BundlePage>, public IPC::MessageReceiver, public IPC::MessageSender, public CanMakeWeakPtr<WebPage> {
304 public:
305     static Ref<WebPage> create(WebCore::PageIdentifier, WebPageCreationParameters&&);
306
307     virtual ~WebPage();
308
309     void reinitializeWebPage(WebPageCreationParameters&&);
310
311     void close();
312
313     static WebPage& fromCorePage(WebCore::Page&);
314
315     WebCore::Page* corePage() const { return m_page.get(); }
316     WebCore::PageIdentifier identifier() const { return m_identifier; }
317     StorageNamespaceIdentifier sessionStorageNamespaceIdentifier() const { return makeObjectIdentifier<StorageNamespaceIdentifierType>(m_webPageProxyIdentifier.toUInt64()); }
318     PAL::SessionID sessionID() const;
319     bool usesEphemeralSession() const;
320
321     void setSize(const WebCore::IntSize&);
322     const WebCore::IntSize& size() const { return m_viewSize; }
323     WebCore::IntRect bounds() const { return WebCore::IntRect(WebCore::IntPoint(), size()); }
324
325     DrawingArea* drawingArea() const { return m_drawingArea.get(); }
326
327 #if ENABLE(ASYNC_SCROLLING)
328     WebCore::ScrollingCoordinator* scrollingCoordinator() const;
329 #endif
330
331     WebPageGroupProxy* pageGroup() const { return m_pageGroup.get(); }
332
333     void scrollMainFrameIfNotAtMaxScrollPosition(const WebCore::IntSize& scrollOffset);
334
335     bool scrollBy(uint32_t scrollDirection, uint32_t scrollGranularity);
336
337     void centerSelectionInVisibleArea();
338
339 #if PLATFORM(COCOA)
340     void willCommitLayerTree(RemoteLayerTreeTransaction&);
341     void didFlushLayerTreeAtTime(MonotonicTime);
342 #endif
343
344     void layoutIfNeeded();
345     void updateRendering();
346
347     enum class LazyCreationPolicy { UseExistingOnly, CreateIfNeeded };
348
349     WebInspector* inspector(LazyCreationPolicy = LazyCreationPolicy::CreateIfNeeded);
350     WebInspectorUI* inspectorUI();
351     RemoteWebInspectorUI* remoteInspectorUI();
352     bool isInspectorPage() { return !!m_inspectorUI || !!m_remoteInspectorUI; }
353
354     void inspectorFrontendCountChanged(unsigned);
355
356 #if PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
357     PlaybackSessionManager& playbackSessionManager();
358     VideoFullscreenManager& videoFullscreenManager();
359     void videoControlsManagerDidChange();
360 #endif
361
362 #if PLATFORM(IOS_FAMILY)
363     void setAllowsMediaDocumentInlinePlayback(bool);
364     bool allowsMediaDocumentInlinePlayback() const { return m_allowsMediaDocumentInlinePlayback; }
365 #endif
366
367 #if ENABLE(FULLSCREEN_API)
368     WebFullScreenManager* fullScreenManager();
369 #endif
370
371     void addConsoleMessage(WebCore::FrameIdentifier, MessageSource, MessageLevel, const String&, uint64_t requestID = 0);
372     void sendCSPViolationReport(WebCore::FrameIdentifier, const URL& reportURL, IPC::FormDataReference&&);
373     void enqueueSecurityPolicyViolationEvent(WebCore::FrameIdentifier, WebCore::SecurityPolicyViolationEvent::Init&&);
374
375     // -- Called by the DrawingArea.
376     // FIXME: We could genericize these into a DrawingArea client interface. Would that be beneficial?
377     void drawRect(WebCore::GraphicsContext&, const WebCore::IntRect&);
378
379     // -- Called from WebCore clients.
380     bool handleEditingKeyboardEvent(WebCore::KeyboardEvent&);
381
382     void didStartPageTransition();
383     void didCompletePageTransition();
384     void didCommitLoad(WebFrame*);
385     void willReplaceMultipartContent(const WebFrame&);
386     void didReplaceMultipartContent(const WebFrame&);
387     void didFinishDocumentLoad(WebFrame&);
388     void didFinishLoad(WebFrame&);
389     void show();
390     String userAgent(const URL&) const;
391     String platformUserAgent(const URL&) const;
392     WebCore::KeyboardUIMode keyboardUIMode();
393
394     void didInsertMenuElement(WebCore::HTMLMenuElement&);
395     void didRemoveMenuElement(WebCore::HTMLMenuElement&);
396     void didInsertMenuItemElement(WebCore::HTMLMenuItemElement&);
397     void didRemoveMenuItemElement(WebCore::HTMLMenuItemElement&);
398
399     const String& overrideContentSecurityPolicy() const { return m_overrideContentSecurityPolicy; }
400
401     WebUndoStep* webUndoStep(WebUndoStepID);
402     void addWebUndoStep(WebUndoStepID, Ref<WebUndoStep>&&);
403     void removeWebEditCommand(WebUndoStepID);
404     bool isInRedo() const { return m_isInRedo; }
405
406     bool isAlwaysOnLoggingAllowed() const;
407     void setActivePopupMenu(WebPopupMenu*);
408
409     void setHiddenPageDOMTimerThrottlingIncreaseLimit(Seconds limit)
410     {
411         m_page->setDOMTimerAlignmentIntervalIncreaseLimit(limit);
412     }
413
414 #if ENABLE(INPUT_TYPE_COLOR)
415     WebColorChooser* activeColorChooser() const { return m_activeColorChooser; }
416     void setActiveColorChooser(WebColorChooser*);
417     void didChooseColor(const WebCore::Color&);
418     void didEndColorPicker();
419 #endif
420
421 #if ENABLE(DATALIST_ELEMENT)
422     void setActiveDataListSuggestionPicker(WebDataListSuggestionPicker&);
423     void didSelectDataListOption(const String&);
424     void didCloseSuggestions();
425 #endif
426
427     WebOpenPanelResultListener* activeOpenPanelResultListener() const { return m_activeOpenPanelResultListener.get(); }
428     void setActiveOpenPanelResultListener(Ref<WebOpenPanelResultListener>&&);
429
430     void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
431     void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override;
432
433     // -- InjectedBundle methods
434 #if ENABLE(CONTEXT_MENUS)
435     void setInjectedBundleContextMenuClient(std::unique_ptr<API::InjectedBundle::PageContextMenuClient>&&);
436 #endif
437     void setInjectedBundleEditorClient(std::unique_ptr<API::InjectedBundle::EditorClient>&&);
438     void setInjectedBundleFormClient(std::unique_ptr<API::InjectedBundle::FormClient>&&);
439     void setInjectedBundlePageLoaderClient(std::unique_ptr<API::InjectedBundle::PageLoaderClient>&&);
440     void initializeInjectedBundlePolicyClient(WKBundlePagePolicyClientBase*);
441     void setInjectedBundleResourceLoadClient(std::unique_ptr<API::InjectedBundle::ResourceLoadClient>&&);
442     void setInjectedBundleUIClient(std::unique_ptr<API::InjectedBundle::PageUIClient>&&);
443 #if ENABLE(FULLSCREEN_API)
444     void initializeInjectedBundleFullScreenClient(WKBundlePageFullScreenClientBase*);
445 #endif
446
447 #if ENABLE(CONTEXT_MENUS)
448     API::InjectedBundle::PageContextMenuClient& injectedBundleContextMenuClient() { return *m_contextMenuClient; }
449 #endif
450     API::InjectedBundle::EditorClient& injectedBundleEditorClient() { return *m_editorClient; }
451     API::InjectedBundle::FormClient& injectedBundleFormClient() { return *m_formClient; }
452     API::InjectedBundle::PageLoaderClient& injectedBundleLoaderClient() { return *m_loaderClient; }
453     InjectedBundlePagePolicyClient& injectedBundlePolicyClient() { return m_policyClient; }
454     API::InjectedBundle::ResourceLoadClient& injectedBundleResourceLoadClient() { return *m_resourceLoadClient; }
455     API::InjectedBundle::PageUIClient& injectedBundleUIClient() { return *m_uiClient; }
456 #if ENABLE(FULLSCREEN_API)
457     InjectedBundlePageFullScreenClient& injectedBundleFullScreenClient() { return m_fullScreenClient; }
458 #endif
459
460     bool findStringFromInjectedBundle(const String&, FindOptions);
461     void findStringMatchesFromInjectedBundle(const String&, FindOptions);
462     void replaceStringMatchesFromInjectedBundle(const Vector<uint32_t>& matchIndices, const String& replacementText, bool selectionOnly);
463
464     WebFrame* mainWebFrame() const { return m_mainFrame.get(); }
465
466     WebCore::Frame* mainFrame() const; // May return nullptr.
467     WebCore::FrameView* mainFrameView() const; // May return nullptr.
468
469     RefPtr<WebCore::Range> currentSelectionAsRange();
470
471 #if ENABLE(NETSCAPE_PLUGIN_API)
472     RefPtr<Plugin> createPlugin(WebFrame*, WebCore::HTMLPlugInElement*, const Plugin::Parameters&, String& newMIMEType);
473 #endif
474
475 #if ENABLE(WEBGL)
476     WebCore::WebGLLoadPolicy webGLPolicyForURL(WebFrame*, const URL&);
477     WebCore::WebGLLoadPolicy resolveWebGLPolicyForURL(WebFrame*, const URL&);
478 #endif
479     
480     enum class IncludePostLayoutDataHint { No, Yes };
481     EditorState editorState(IncludePostLayoutDataHint = IncludePostLayoutDataHint::Yes) const;
482     void updateEditorStateAfterLayoutIfEditabilityChanged();
483
484     // options are RenderTreeExternalRepresentationBehavior values.
485     String renderTreeExternalRepresentation(unsigned options = 0) const;
486     String renderTreeExternalRepresentationForPrinting() const;
487     uint64_t renderTreeSize() const;
488
489     void setTracksRepaints(bool);
490     bool isTrackingRepaints() const;
491     void resetTrackedRepaints();
492     Ref<API::Array> trackedRepaintRects();
493
494     void executeEditingCommand(const String& commandName, const String& argument);
495     bool isEditingCommandEnabled(const String& commandName);
496     void clearMainFrameName();
497     void sendClose();
498
499     void suspendForProcessSwap();
500
501     void sendSetWindowFrame(const WebCore::FloatRect&);
502
503     double textZoomFactor() const;
504     void setTextZoomFactor(double);
505     double pageZoomFactor() const;
506     void setPageZoomFactor(double);
507     void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
508     void windowScreenDidChange(uint32_t);
509     String dumpHistoryForTesting(const String& directory);
510     void clearHistory();
511
512     void accessibilitySettingsDidChange();
513     void screenPropertiesDidChange();
514
515     void scalePage(double scale, const WebCore::IntPoint& origin);
516     void scalePageInViewCoordinates(double scale, WebCore::IntPoint centerInViewCoordinates);
517     double pageScaleFactor() const;
518     double totalScaleFactor() const;
519     double viewScaleFactor() const;
520     void scaleView(double scale);
521
522     void setUseFixedLayout(bool);
523     bool useFixedLayout() const { return m_useFixedLayout; }
524     bool setFixedLayoutSize(const WebCore::IntSize&);
525     WebCore::IntSize fixedLayoutSize() const;
526
527     void listenForLayoutMilestones(OptionSet<WebCore::LayoutMilestone>);
528
529     void setSuppressScrollbarAnimations(bool);
530     
531     void setEnableVerticalRubberBanding(bool);
532     void setEnableHorizontalRubberBanding(bool);
533     
534     void setBackgroundExtendsBeyondPage(bool);
535
536     void setPaginationMode(uint32_t /* WebCore::Pagination::Mode */);
537     void setPaginationBehavesLikeColumns(bool);
538     void setPageLength(double);
539     void setGapBetweenPages(double);
540     void setPaginationLineGridEnabled(bool);
541     
542     void postInjectedBundleMessage(const String& messageName, const UserData&);
543
544     void setUnderlayColor(const WebCore::Color& color) { m_underlayColor = color; }
545     WebCore::Color underlayColor() const { return m_underlayColor; }
546
547     void stopLoading();
548     void stopLoadingFrame(WebCore::FrameIdentifier);
549     bool defersLoading() const;
550     void setDefersLoading(bool deferLoading);
551
552     void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*);
553     void exitAcceleratedCompositingMode();
554
555     void addPluginView(PluginView*);
556     void removePluginView(PluginView*);
557
558     bool isVisible() const { return m_activityState.contains(WebCore::ActivityState::IsVisible); }
559     bool isVisibleOrOccluded() const { return m_activityState.contains(WebCore::ActivityState::IsVisibleOrOccluded); }
560
561     LayerHostingMode layerHostingMode() const { return m_layerHostingMode; }
562     void setLayerHostingMode(LayerHostingMode);
563
564 #if PLATFORM(COCOA)
565     void updatePluginsActiveAndFocusedState();
566     const WebCore::FloatRect& windowFrameInScreenCoordinates() const { return m_windowFrameInScreenCoordinates; }
567     const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates() const { return m_windowFrameInUnflippedScreenCoordinates; }
568     const WebCore::FloatRect& viewFrameInWindowCoordinates() const { return m_viewFrameInWindowCoordinates; }
569
570     bool hasCachedWindowFrame() const { return m_hasCachedWindowFrame; }
571
572     void updateHeaderAndFooterLayersForDeviceScaleChange(float scaleFactor);
573 #endif
574
575 #if PLATFORM(MAC)
576     void setTopOverhangImage(WebImage*);
577     void setBottomOverhangImage(WebImage*);
578     
579     void setUseSystemAppearance(bool);
580 #endif
581
582     void effectiveAppearanceDidChange(bool useDarkAppearance, bool useElevatedUserInterfaceLevel);
583
584     bool windowIsFocused() const;
585     bool windowAndWebPageAreFocused() const;
586
587 #if !PLATFORM(IOS_FAMILY)
588     void setHeaderPageBanner(PageBanner*);
589     PageBanner* headerPageBanner();
590     void setFooterPageBanner(PageBanner*);
591     PageBanner* footerPageBanner();
592
593     void hidePageBanners();
594     void showPageBanners();
595     
596     void setHeaderBannerHeightForTesting(int);
597     void setFooterBannerHeightForTesting(int);
598 #endif
599
600     WebCore::IntPoint screenToRootView(const WebCore::IntPoint&);
601     WebCore::IntRect rootViewToScreen(const WebCore::IntRect&);
602     WebCore::IntPoint accessibilityScreenToRootView(const WebCore::IntPoint&);
603     WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&);
604     
605     RefPtr<WebImage> scaledSnapshotWithOptions(const WebCore::IntRect&, double additionalScaleFactor, SnapshotOptions);
606
607     static const WebEvent* currentEvent();
608
609     FindController& findController() { return m_findController.get(); }
610
611 #if ENABLE(GEOLOCATION)
612     GeolocationPermissionRequestManager& geolocationPermissionRequestManager() { return m_geolocationPermissionRequestManager.get(); }
613 #endif
614
615 #if PLATFORM(IOS_FAMILY)
616     void savePageState(WebCore::HistoryItem&);
617     void restorePageState(const WebCore::HistoryItem&);
618 #endif
619
620 #if ENABLE(MEDIA_STREAM)
621     UserMediaPermissionRequestManager& userMediaPermissionRequestManager() { return m_userMediaPermissionRequestManager; }
622     void captureDevicesChanged();
623 #endif
624
625     void elementDidFocus(WebCore::Element&);
626     void elementDidRefocus(WebCore::Element&);
627     void elementDidBlur(WebCore::Element&);
628     void focusedElementDidChangeInputMode(WebCore::Element&, WebCore::InputMode);
629     void resetFocusedElementForFrame(WebFrame*);
630     void updateInputContextAfterBlurringAndRefocusingElementIfNeeded(WebCore::Element&);
631
632     void disabledAdaptationsDidChange(const OptionSet<WebCore::DisabledAdaptations>&);
633     void viewportPropertiesDidChange(const WebCore::ViewportArguments&);
634     void executeEditCommandWithCallback(const String&, const String& argument, CallbackID);
635     void selectAll();
636
637     void textInputContextsInRect(WebCore::FloatRect, CompletionHandler<void(const Vector<WebCore::ElementContext>&)>&&);
638     void focusTextInputContext(const WebCore::ElementContext&, CompletionHandler<void(bool)>&&);
639     void setCanShowPlaceholder(const WebCore::ElementContext&, bool);
640
641 #if PLATFORM(IOS_FAMILY)
642     bool shouldRevealCurrentSelectionAfterInsertion() const { return m_shouldRevealCurrentSelectionAfterInsertion; }
643     void setShouldRevealCurrentSelectionAfterInsertion(bool);
644
645     WebCore::FloatSize screenSize() const;
646     WebCore::FloatSize availableScreenSize() const;
647     WebCore::FloatSize overrideScreenSize() const;
648     int32_t deviceOrientation() const { return m_deviceOrientation; }
649     void didReceiveMobileDocType(bool);
650
651     double minimumPageScaleFactor() const;
652     double maximumPageScaleFactor() const;
653     double maximumPageScaleFactorIgnoringAlwaysScalable() const;
654     bool allowsUserScaling() const;
655     bool hasStablePageScaleFactor() const { return m_hasStablePageScaleFactor; }
656
657     void handleTap(const WebCore::IntPoint&, OptionSet<WebKit::WebEvent::Modifier>, TransactionID lastLayerTreeTransactionId);
658     void potentialTapAtPosition(uint64_t requestID, const WebCore::FloatPoint&, bool shouldRequestMagnificationInformation);
659     void commitPotentialTap(OptionSet<WebKit::WebEvent::Modifier>, TransactionID lastLayerTreeTransactionId, WebCore::PointerID);
660     void commitPotentialTapFailed();
661     void cancelPotentialTap();
662     void cancelPotentialTapInFrame(WebFrame&);
663     void tapHighlightAtPosition(uint64_t requestID, const WebCore::FloatPoint&);
664     void didRecognizeLongPress();
665     void handleDoubleTapForDoubleClickAtPoint(const WebCore::IntPoint&, OptionSet<WebKit::WebEvent::Modifier>, TransactionID lastLayerTreeTransactionId);
666
667     void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&);
668     void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&);
669
670     void blurFocusedElement();
671     void requestFocusedElementInformation(CallbackID);
672     void selectWithGesture(const WebCore::IntPoint&, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithFocusedElement, CallbackID);
673     void updateSelectionWithTouches(const WebCore::IntPoint&, uint32_t touches, bool baseIsStart, CallbackID);
674     void selectWithTwoTouches(const WebCore::IntPoint& from, const WebCore::IntPoint& to, uint32_t gestureType, uint32_t gestureState, CallbackID);
675     void extendSelection(uint32_t granularity);
676     void selectWordBackward();
677     void moveSelectionByOffset(int32_t offset, CallbackID);
678     void selectTextWithGranularityAtPoint(const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithFocusedElement, CallbackID);
679     void selectPositionAtBoundaryWithDirection(const WebCore::IntPoint&, uint32_t granularity, uint32_t direction, bool isInteractingWithFocusedElement, CallbackID);
680     void moveSelectionAtBoundaryWithDirection(uint32_t granularity, uint32_t direction, CallbackID);
681     void selectPositionAtPoint(const WebCore::IntPoint&, bool isInteractingWithFocusedElement, CallbackID);
682     void beginSelectionInDirection(uint32_t direction, CallbackID);
683     void updateSelectionWithExtentPoint(const WebCore::IntPoint&, bool isInteractingWithFocusedElement, RespectSelectionAnchor, CallbackID);
684     void updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithFocusedElement, CallbackID);
685
686     void requestDictationContext(CallbackID);
687     void replaceDictatedText(const String& oldText, const String& newText);
688     void replaceSelectedText(const String& oldText, const String& newText);
689     void requestAutocorrectionData(const String& textForAutocorrection, CompletionHandler<void(WebAutocorrectionData)>&& reply);
690     void applyAutocorrection(const String& correction, const String& originalText, CallbackID);
691     void syncApplyAutocorrection(const String& correction, const String& originalText, CompletionHandler<void(bool)>&&);
692     void requestAutocorrectionContext();
693     void getPositionInformation(const InteractionInformationRequest&, CompletionHandler<void(InteractionInformationAtPosition&&)>&&);
694     void requestPositionInformation(const InteractionInformationRequest&);
695     void startInteractionWithElementContextOrPosition(Optional<WebCore::ElementContext>&&, WebCore::IntPoint&&);
696     void stopInteraction();
697     void performActionOnElement(uint32_t action);
698     void focusNextFocusedElement(bool isForward, CallbackID);
699     void autofillLoginCredentials(const String&, const String&);
700     void setFocusedElementValue(const String&);
701     void setFocusedElementValueAsNumber(double);
702     void setFocusedElementSelectedIndex(uint32_t index, bool allowMultipleSelection);
703     void setIsShowingInputViewForFocusedElement(bool);
704     bool isShowingInputViewForFocusedElement() const { return m_isShowingInputViewForFocusedElement; }
705     void updateSelectionAppearance();
706     void getSelectionContext(CallbackID);
707     void handleTwoFingerTapAtPoint(const WebCore::IntPoint&, OptionSet<WebKit::WebEvent::Modifier>, uint64_t requestID);
708     void handleStylusSingleTapAtPoint(const WebCore::IntPoint&, uint64_t requestID);
709     void getRectsForGranularityWithSelectionOffset(uint32_t, int32_t, CallbackID);
710     void getRectsAtSelectionOffsetWithText(int32_t, const String&, CallbackID);
711     void storeSelectionForAccessibility(bool);
712     void startAutoscrollAtPosition(const WebCore::FloatPoint&);
713     void cancelAutoscroll();
714     void requestEvasionRectsAboveSelection(CompletionHandler<void(const Vector<WebCore::FloatRect>&)>&&);
715
716     void contentSizeCategoryDidChange(const String&);
717
718     Seconds eventThrottlingDelay() const;
719
720     void showInspectorHighlight(const WebCore::Highlight&);
721     void hideInspectorHighlight();
722
723     void showInspectorIndication();
724     void hideInspectorIndication();
725
726     void enableInspectorNodeSearch();
727     void disableInspectorNodeSearch();
728
729     bool forceAlwaysUserScalable() const { return m_forceAlwaysUserScalable; }
730     void setForceAlwaysUserScalable(bool);
731
732     void updateSelectionWithDelta(int64_t locationDelta, int64_t lengthDelta, CompletionHandler<void()>&&);
733     void requestDocumentEditingContext(WebKit::DocumentEditingContextRequest, CompletionHandler<void(WebKit::DocumentEditingContext)>&&);
734 #endif
735
736 #if PLATFORM(IOS_FAMILY) && ENABLE(IOS_TOUCH_EVENTS)
737     void dispatchAsynchronousTouchEvents(const Vector<std::pair<WebTouchEvent, Optional<CallbackID>>, 1>& queue);
738 #endif
739
740     bool hasRichlyEditableSelection() const;
741
742     enum class LayerTreeFreezeReason {
743         PageTransition          = 1 << 0,
744         BackgroundApplication   = 1 << 1,
745         ProcessSuspended        = 1 << 2,
746         PageSuspended           = 1 << 3,
747         Printing                = 1 << 4,
748         ProcessSwap             = 1 << 5,
749         SwipeAnimation          = 1 << 6,
750     };
751     void freezeLayerTree(LayerTreeFreezeReason);
752     void unfreezeLayerTree(LayerTreeFreezeReason);
753
754     void markLayersVolatile(Function<void(bool)>&& completionHandler = { });
755     void cancelMarkLayersVolatile();
756
757     void freezeLayerTreeDueToSwipeAnimation();
758     void unfreezeLayerTreeDueToSwipeAnimation();
759
760     NotificationPermissionRequestManager* notificationPermissionRequestManager();
761
762     void pageDidScroll();
763
764 #if ENABLE(CONTEXT_MENUS)
765     WebContextMenu* contextMenu();
766     WebContextMenu* contextMenuAtPointInWindow(const WebCore::IntPoint&);
767 #endif
768
769     bool hasLocalDataForURL(const URL&);
770
771     static bool canHandleRequest(const WebCore::ResourceRequest&);
772
773     class SandboxExtensionTracker {
774     public:
775         ~SandboxExtensionTracker();
776
777         void invalidate();
778
779         void beginLoad(WebFrame*, SandboxExtension::Handle&&);
780         void beginReload(WebFrame*, SandboxExtension::Handle&&);
781         void willPerformLoadDragDestinationAction(RefPtr<SandboxExtension>&& pendingDropSandboxExtension);
782         void didStartProvisionalLoad(WebFrame*);
783         void didCommitProvisionalLoad(WebFrame*);
784         void didFailProvisionalLoad(WebFrame*);
785
786     private:
787         void setPendingProvisionalSandboxExtension(RefPtr<SandboxExtension>&&);
788         bool shouldReuseCommittedSandboxExtension(WebFrame*);
789
790         RefPtr<SandboxExtension> m_pendingProvisionalSandboxExtension;
791         RefPtr<SandboxExtension> m_provisionalSandboxExtension;
792         RefPtr<SandboxExtension> m_committedSandboxExtension;
793     };
794
795     SandboxExtensionTracker& sandboxExtensionTracker() { return m_sandboxExtensionTracker; }
796
797 #if PLATFORM(GTK) || PLATFORM(WPE)
798     void cancelComposition(const String& text);
799     void deleteSurrounding(int64_t offset, unsigned characterCount);
800 #endif
801
802 #if PLATFORM(GTK)
803     void collapseSelectionInFrame(WebCore::FrameIdentifier);
804     void showEmojiPicker(WebCore::Frame&);
805
806     void getCenterForZoomGesture(const WebCore::IntPoint& centerInViewCoordinates, CompletionHandler<void(WebCore::IntPoint&&)>&&);
807
808     void themeDidChange(String&&);
809 #endif
810
811     void didApplyStyle();
812     void didChangeSelection();
813     void didChangeOverflowScrollPosition();
814     void didChangeContents();
815     void discardedComposition();
816     void canceledComposition();
817     void didUpdateComposition();
818     void didEndUserTriggeredSelectionChanges();
819
820 #if PLATFORM(COCOA)
821     void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
822     WKAccessibilityWebPageObject* accessibilityRemoteObject();
823     NSObject *accessibilityObjectForMainFramePlugin();
824     const WebCore::FloatPoint& accessibilityPosition() const { return m_accessibilityPosition; }
825     
826     void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
827
828     void setTextAsync(const String&);
829     void insertTextAsync(const String& text, const EditingRange& replacementRange, InsertTextOptions&&);
830     void hasMarkedText(CompletionHandler<void(bool)>&&);
831     void getMarkedRangeAsync(CallbackID);
832     void getSelectedRangeAsync(CallbackID);
833     void characterIndexForPointAsync(const WebCore::IntPoint&, CallbackID);
834     void firstRectForCharacterRangeAsync(const EditingRange&, CallbackID);
835     void setCompositionAsync(const String& text, const Vector<WebCore::CompositionUnderline>&, const Vector<WebCore::CompositionHighlight>&, const EditingRange& selectionRange, const EditingRange& replacementRange);
836     void confirmCompositionAsync();
837
838     void readSelectionFromPasteboard(const String& pasteboardName, CompletionHandler<void(bool&&)>&&);
839     void getStringSelectionForPasteboard(CompletionHandler<void(String&&)>&&);
840     void getDataSelectionForPasteboard(const String pasteboardType, CompletionHandler<void(SharedMemory::Handle&&, uint64_t)>&&);
841     void shouldDelayWindowOrderingEvent(const WebKit::WebMouseEvent&, CompletionHandler<void(bool)>&&);
842     void acceptsFirstMouse(int eventNumber, const WebKit::WebMouseEvent&, CompletionHandler<void(bool)>&&);
843     bool performNonEditingBehaviorForSelector(const String&, WebCore::KeyboardEvent*);
844 #endif
845
846 #if PLATFORM(MAC)
847     void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::DictationAlternative>& dictationAlternativeLocations, bool registerUndoGroup = false);
848     void attributedSubstringForCharacterRangeAsync(const EditingRange&, CallbackID);
849     void fontAtSelection(CallbackID);
850 #endif
851
852 #if PLATFORM(COCOA) && ENABLE(SERVICE_CONTROLS)
853     void replaceSelectionWithPasteboardData(const Vector<String>& types, const IPC::DataReference&);
854 #endif
855
856     void setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length, bool suppressUnderline, const Vector<WebCore::CompositionHighlight>&);
857     bool hasCompositionForTesting();
858     void confirmCompositionForTesting(const String& compositionString);
859
860 #if PLATFORM(COCOA)
861     bool isSpeaking();
862     void speak(const String&);
863     void stopSpeaking();
864
865     void performDictionaryLookupForSelection(WebCore::Frame&, const WebCore::VisibleSelection&, WebCore::TextIndicatorPresentationTransition);
866 #endif
867
868     bool isSmartInsertDeleteEnabled();
869     void setSmartInsertDeleteEnabled(bool);
870
871     bool isSelectTrailingWhitespaceEnabled() const;
872     void setSelectTrailingWhitespaceEnabled(bool);
873
874     void replaceSelectionWithText(WebCore::Frame*, const String&);
875     void clearSelection();
876     void restoreSelectionInFocusedEditableElement();
877
878 #if ENABLE(DRAG_SUPPORT) && PLATFORM(GTK)
879     void performDragControllerAction(DragControllerAction, const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t draggingSourceOperationMask, WebSelectionData&&, uint32_t flags);
880 #endif
881
882 #if ENABLE(DRAG_SUPPORT) && !PLATFORM(GTK)
883     void performDragControllerAction(DragControllerAction, const WebCore::DragData&, SandboxExtension::Handle&&, SandboxExtension::HandleArray&&);
884 #endif
885
886 #if ENABLE(DRAG_SUPPORT)
887     void dragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation);
888
889     void willPerformLoadDragDestinationAction();
890     void mayPerformUploadDragDestinationAction();
891
892     void willStartDrag() { ASSERT(!m_isStartingDrag); m_isStartingDrag = true; }
893     void didStartDrag();
894     void dragCancelled();
895     WebCore::DragSourceAction allowedDragSourceActions() const { return m_allowedDragSourceActions; }
896 #endif
897
898     void beginPrinting(WebCore::FrameIdentifier, const PrintInfo&);
899     void endPrinting();
900     void computePagesForPrinting(WebCore::FrameIdentifier, const PrintInfo&, CallbackID);
901     void computePagesForPrintingImpl(WebCore::FrameIdentifier, const PrintInfo&, Vector<WebCore::IntRect>& pageRects, double& totalScaleFactor, WebCore::FloatBoxExtent& computedMargin);
902
903 #if PLATFORM(COCOA)
904     void drawRectToImage(WebCore::FrameIdentifier, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, CallbackID);
905     void drawPagesToPDF(WebCore::FrameIdentifier, const PrintInfo&, uint32_t first, uint32_t count, CallbackID);
906     void drawPagesToPDFImpl(WebCore::FrameIdentifier, const PrintInfo&, uint32_t first, uint32_t count, RetainPtr<CFMutableDataRef>& pdfPageData);
907 #endif
908
909 #if PLATFORM(IOS_FAMILY)
910     void computePagesForPrintingAndDrawToPDF(WebCore::FrameIdentifier, const PrintInfo&, CallbackID, Messages::WebPage::ComputePagesForPrintingAndDrawToPDFDelayedReply&&);
911 #endif
912
913     void drawToPDF(WebCore::FrameIdentifier, const Optional<WebCore::FloatRect>&, CallbackID);
914
915 #if PLATFORM(GTK)
916     void drawPagesForPrinting(WebCore::FrameIdentifier, const PrintInfo&, CallbackID);
917     void didFinishPrintOperation(const WebCore::ResourceError&, CallbackID);
918 #endif
919
920     void addResourceRequest(unsigned long, const WebCore::ResourceRequest&);
921     void removeResourceRequest(unsigned long);
922
923     void setMediaVolume(float);
924     void setMuted(WebCore::MediaProducer::MutedStateFlags);
925     void setMayStartMediaWhenInWindow(bool);
926     void stopMediaCapture();
927
928 #if ENABLE(MEDIA_SESSION)
929     void handleMediaEvent(uint32_t /* WebCore::MediaEventType */);
930     void setVolumeOfMediaElement(double, uint64_t);
931 #endif
932
933     void updateMainFrameScrollOffsetPinning();
934
935     bool mainFrameHasCustomContentProvider() const;
936     void addMIMETypeWithCustomContentProvider(const String&);
937
938     void mainFrameDidLayout();
939
940     bool canRunBeforeUnloadConfirmPanel() const { return m_canRunBeforeUnloadConfirmPanel; }
941     void setCanRunBeforeUnloadConfirmPanel(bool canRunBeforeUnloadConfirmPanel) { m_canRunBeforeUnloadConfirmPanel = canRunBeforeUnloadConfirmPanel; }
942
943     bool canRunModal() const { return m_canRunModal; }
944     void setCanRunModal(bool canRunModal) { m_canRunModal = canRunModal; }
945
946     void runModal();
947
948     void setDeviceScaleFactor(float);
949     float deviceScaleFactor() const;
950
951     void forceRepaintWithoutCallback();
952
953     void unmarkAllMisspellings();
954     void unmarkAllBadGrammar();
955
956 #if PLATFORM(COCOA)
957     void handleAlternativeTextUIResult(const String&);
958 #endif
959
960     // For testing purpose.
961     void simulateMouseDown(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, WallTime);
962     void simulateMouseUp(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, WallTime);
963     void simulateMouseMotion(WebCore::IntPoint, WallTime);
964
965 #if ENABLE(CONTEXT_MENUS)
966     void contextMenuShowing() { m_isShowingContextMenu = true; }
967 #endif
968
969     void wheelEvent(const WebWheelEvent&);
970
971     void wheelEventHandlersChanged(bool);
972     void recomputeShortCircuitHorizontalWheelEventsState();
973
974 #if ENABLE(MAC_GESTURE_EVENTS)
975     void gestureEvent(const WebGestureEvent&);
976 #endif
977
978     void updateVisibilityState(bool isInitialState = false);
979
980 #if PLATFORM(IOS_FAMILY)
981     void setMaximumUnobscuredSize(const WebCore::FloatSize&);
982     void setDeviceOrientation(int32_t);
983     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& targetUnobscuredSafeAreaInsets, double scale, int32_t deviceOrientation, double minimumEffectiveDeviceWidth, DynamicViewportSizeUpdateID);
984     bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; }
985     void willStartUserTriggeredZooming();
986     void applicationWillResignActive();
987     void applicationDidEnterBackground(bool isSuspendedUnderLock);
988     void applicationDidFinishSnapshottingAfterEnteringBackground();
989     void applicationWillEnterForeground(bool isSuspendedUnderLock);
990     void applicationDidBecomeActive();
991     void applicationDidEnterBackgroundForMedia(bool isSuspendedUnderLock);
992     void applicationWillEnterForegroundForMedia(bool isSuspendedUnderLock);
993     void didFinishContentChangeObserving(WKContentChange);
994
995     bool platformPrefersTextLegibilityBasedZoomScaling() const;
996
997     void hardwareKeyboardAvailabilityChanged(bool keyboardIsAttached);
998
999     void updateStringForFind(const String&);
1000     
1001     bool canShowWhileLocked() const { return m_canShowWhileLocked; }
1002 #endif
1003
1004 #if ENABLE(META_VIEWPORT)
1005     void setViewportConfigurationViewLayoutSize(const WebCore::FloatSize&, double scaleFactor, double minimumEffectiveDeviceWidth);
1006     void setOverrideViewportArguments(const Optional<WebCore::ViewportArguments>&);
1007     const WebCore::ViewportConfiguration& viewportConfiguration() const { return m_viewportConfiguration; }
1008
1009     void setUseTestingViewportConfiguration(bool useTestingViewport) { m_useTestingViewportConfiguration = useTestingViewport; }
1010     bool isUsingTestingViewportConfiguration() const { return m_useTestingViewportConfiguration; }
1011 #endif
1012
1013 #if ENABLE(UI_SIDE_COMPOSITING)
1014     Optional<float> scaleFromUIProcess(const VisibleContentRectUpdateInfo&) const;
1015     void updateVisibleContentRects(const VisibleContentRectUpdateInfo&, MonotonicTime oldestTimestamp);
1016 #endif
1017
1018 #if ENABLE(IOS_TOUCH_EVENTS)
1019     void dispatchTouchEvent(const WebTouchEvent&, bool& handled);
1020 #endif
1021
1022     bool shouldUseCustomContentProviderForResponse(const WebCore::ResourceResponse&);
1023
1024     bool asynchronousPluginInitializationEnabled() const { return m_asynchronousPluginInitializationEnabled; }
1025     void setAsynchronousPluginInitializationEnabled(bool enabled) { m_asynchronousPluginInitializationEnabled = enabled; }
1026     bool asynchronousPluginInitializationEnabledForAllPlugins() const { return m_asynchronousPluginInitializationEnabledForAllPlugins; }
1027     void setAsynchronousPluginInitializationEnabledForAllPlugins(bool enabled) { m_asynchronousPluginInitializationEnabledForAllPlugins = enabled; }
1028     bool artificialPluginInitializationDelayEnabled() const { return m_artificialPluginInitializationDelayEnabled; }
1029     void setArtificialPluginInitializationDelayEnabled(bool enabled) { m_artificialPluginInitializationDelayEnabled = enabled; }
1030     void setTabToLinksEnabled(bool enabled) { m_tabToLinks = enabled; }
1031     bool tabToLinksEnabled() const { return m_tabToLinks; }
1032
1033     bool scrollingPerformanceLoggingEnabled() const { return m_scrollingPerformanceLoggingEnabled; }
1034     void setScrollingPerformanceLoggingEnabled(bool);
1035
1036 #if PLATFORM(COCOA)
1037     bool shouldUsePDFPlugin() const;
1038     bool pdfPluginEnabled() const { return m_pdfPluginEnabled; }
1039     void setPDFPluginEnabled(bool enabled) { m_pdfPluginEnabled = enabled; }
1040
1041     NSDictionary *dataDetectionContext() const { return m_dataDetectionContext.get(); }
1042 #endif
1043
1044     void savePDFToFileInDownloadsFolder(const String& suggestedFilename, const URL& originatingURL, const uint8_t* data, unsigned long size);
1045
1046 #if PLATFORM(COCOA)
1047     void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
1048 #endif
1049
1050     bool mainFrameIsScrollable() const { return m_mainFrameIsScrollable; }
1051
1052     void setAlwaysShowsHorizontalScroller(bool);
1053     void setAlwaysShowsVerticalScroller(bool);
1054
1055     bool alwaysShowsHorizontalScroller() const { return m_alwaysShowsHorizontalScroller; };
1056     bool alwaysShowsVerticalScroller() const { return m_alwaysShowsVerticalScroller; };
1057
1058     void setMinimumSizeForAutoLayout(const WebCore::IntSize&);
1059     WebCore::IntSize minimumSizeForAutoLayout() const { return m_minimumSizeForAutoLayout; }
1060
1061     void setAutoSizingShouldExpandToViewHeight(bool shouldExpand);
1062     bool autoSizingShouldExpandToViewHeight() { return m_autoSizingShouldExpandToViewHeight; }
1063
1064     void setViewportSizeForCSSViewportUnits(Optional<WebCore::IntSize>);
1065     Optional<WebCore::IntSize> viewportSizeForCSSViewportUnits() const { return m_viewportSizeForCSSViewportUnits; }
1066
1067     bool canShowMIMEType(const String& MIMEType) const;
1068     bool canShowResponse(const WebCore::ResourceResponse&) const;
1069
1070     void addTextCheckingRequest(uint64_t requestID, Ref<WebCore::TextCheckingRequest>&&);
1071     void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
1072     void didCancelCheckingText(uint64_t requestID);
1073
1074 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
1075     void determinePrimarySnapshottedPlugIn();
1076     void determinePrimarySnapshottedPlugInTimerFired();
1077     void resetPrimarySnapshottedPlugIn();
1078     bool matchesPrimaryPlugIn(const String& pageOrigin, const String& pluginOrigin, const String& mimeType) const;
1079     bool plugInIntersectsSearchRect(WebCore::HTMLPlugInImageElement& pluginImageElement);
1080     bool plugInIsPrimarySize(WebCore::HTMLPlugInImageElement& pluginImageElement, unsigned &pluginArea);
1081 #endif
1082
1083 #if ENABLE(DATA_DETECTION)
1084     void setDataDetectionResults(NSArray *);
1085     void detectDataInAllFrames(uint64_t, CompletionHandler<void(const DataDetectionResult&)>&&);
1086     void removeDataDetectedLinks(CompletionHandler<void(const DataDetectionResult&)>&&);
1087 #endif
1088
1089     unsigned extendIncrementalRenderingSuppression();
1090     void stopExtendingIncrementalRenderingSuppression(unsigned token);
1091     bool shouldExtendIncrementalRenderingSuppression() { return !m_activeRenderingSuppressionTokens.isEmpty(); }
1092
1093     WebCore::ScrollPinningBehavior scrollPinningBehavior() { return m_scrollPinningBehavior; }
1094     void setScrollPinningBehavior(uint32_t /* WebCore::ScrollPinningBehavior */ pinning);
1095
1096     Optional<WebCore::ScrollbarOverlayStyle> scrollbarOverlayStyle() { return m_scrollbarOverlayStyle; }
1097     void setScrollbarOverlayStyle(Optional<uint32_t /* WebCore::ScrollbarOverlayStyle */> scrollbarStyle);
1098
1099     Ref<WebCore::DocumentLoader> createDocumentLoader(WebCore::Frame&, const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
1100     void updateCachedDocumentLoader(WebDocumentLoader&, WebCore::Frame&);
1101
1102     void getBytecodeProfile(CallbackID);
1103     void getSamplingProfilerOutput(CallbackID);
1104     
1105 #if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION)
1106     void handleTelephoneNumberClick(const String& number, const WebCore::IntPoint&);
1107     void handleSelectionServiceClick(WebCore::FrameSelection&, const Vector<String>& telephoneNumbers, const WebCore::IntPoint&);
1108 #endif
1109
1110     void didChangeScrollOffsetForFrame(WebCore::Frame*);
1111
1112     void setMainFrameProgressCompleted(bool completed) { m_mainFrameProgressCompleted = completed; }
1113     bool shouldDispatchFakeMouseMoveEvents() const { return m_shouldDispatchFakeMouseMoveEvents; }
1114
1115     void postMessage(const String& messageName, API::Object* messageBody);
1116     void postSynchronousMessageForTesting(const String& messageName, API::Object* messageBody, RefPtr<API::Object>& returnData);
1117     void postMessageIgnoringFullySynchronousMode(const String& messageName, API::Object* messageBody);
1118
1119 #if PLATFORM(GTK) || PLATFORM(WPE)
1120     void setInputMethodState(WebCore::Element*);
1121 #endif
1122
1123     void imageOrMediaDocumentSizeChanged(const WebCore::IntSize&);
1124
1125 #if ENABLE(VIDEO) && USE(GSTREAMER)
1126     void requestInstallMissingMediaPlugins(const String& details, const String& description, WebCore::MediaPlayerRequestInstallMissingPluginsCallback&);
1127 #endif
1128
1129     void addUserScript(String&& source, WebCore::UserContentInjectedFrames, WebCore::UserScriptInjectionTime);
1130     void addUserStyleSheet(const String& source, WebCore::UserContentInjectedFrames);
1131     void removeAllUserContent();
1132
1133     void dispatchDidReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone>);
1134
1135     void didRestoreScrollPosition();
1136
1137     bool isControlledByAutomation() const;
1138     void setControlledByAutomation(bool);
1139
1140     void connectInspector(const String& targetId, Inspector::FrontendChannel::ConnectionType);
1141     void disconnectInspector(const String& targetId);
1142     void sendMessageToTargetBackend(const String& targetId, const String& message);
1143
1144     void insertNewlineInQuotedContent();
1145
1146 #if USE(OS_STATE)
1147     WallTime loadCommitTime() const { return m_loadCommitTime; }
1148 #endif
1149
1150 #if ENABLE(GAMEPAD)
1151     void gamepadActivity(const Vector<GamepadData>&, bool shouldMakeGamepadsVisible);
1152 #endif
1153     
1154 #if ENABLE(POINTER_LOCK)
1155     void didAcquirePointerLock();
1156     void didNotAcquirePointerLock();
1157     void didLosePointerLock();
1158 #endif
1159
1160     void didGetLoadDecisionForIcon(bool decision, CallbackID loadIdentifier, OptionalCallbackID);
1161     void setUseIconLoadingClient(bool);
1162
1163 #if PLATFORM(IOS_FAMILY) && ENABLE(DRAG_SUPPORT)
1164     void didConcludeEditDrag();
1165     void didConcludeDrop();
1166 #endif
1167
1168     void didFinishLoadingImageForElement(WebCore::HTMLImageElement&);
1169
1170     WebURLSchemeHandlerProxy* urlSchemeHandlerForScheme(const String&);
1171     void stopAllURLSchemeTasks();
1172
1173     Optional<double> cpuLimit() const { return m_cpuLimit; }
1174
1175     static PluginView* pluginViewForFrame(WebCore::Frame*);
1176
1177     void flushPendingEditorStateUpdate();
1178
1179 #if ENABLE(RESOURCE_LOAD_STATISTICS)
1180     void hasStorageAccess(WebCore::RegistrableDomain&& subFrameDomain, WebCore::RegistrableDomain&& topFrameDomain, WebFrame&, CompletionHandler<void(bool)>&&);
1181     void requestStorageAccess(WebCore::RegistrableDomain&& subFrameDomain, WebCore::RegistrableDomain&& topFrameDomain, WebFrame&, CompletionHandler<void(WebCore::StorageAccessWasGranted, WebCore::StorageAccessPromptWasShown)>&&);
1182     bool hasPageLevelStorageAccess(const WebCore::RegistrableDomain& topLevelDomain, const WebCore::RegistrableDomain& resourceDomain) const;
1183     void addDomainWithPageLevelStorageAccess(const WebCore::RegistrableDomain& topLevelDomain, const WebCore::RegistrableDomain& resourceDomain);
1184     void wasLoadedWithDataTransferFromPrevalentResource();
1185     void addLoadedRegistrableDomain(WebCore::RegistrableDomain&&);
1186     void clearPrevalentDomains();
1187     void getPrevalentDomains(CompletionHandler<void(Vector<WebCore::RegistrableDomain>)>&&);
1188 #endif
1189
1190 #if ENABLE(DEVICE_ORIENTATION)
1191     void shouldAllowDeviceOrientationAndMotionAccess(WebCore::FrameIdentifier, FrameInfoData&&, bool mayPrompt, CompletionHandler<void(WebCore::DeviceOrientationOrMotionPermissionState)>&&);
1192 #endif
1193
1194     void showShareSheet(WebCore::ShareDataWithParsedURL&, CompletionHandler<void(bool)>&& callback);
1195     void didCompleteShareSheet(bool wasCompleted, ShareSheetCallbackID contextId);
1196     
1197 #if ENABLE(ATTACHMENT_ELEMENT)
1198     void insertAttachment(const String& identifier, Optional<uint64_t>&& fileSize, const String& fileName, const String& contentType, CallbackID);
1199     void updateAttachmentAttributes(const String& identifier, Optional<uint64_t>&& fileSize, const String& contentType, const String& fileName, const IPC::SharedBufferDataReference& enclosingImageData, CallbackID);
1200 #endif
1201
1202 #if ENABLE(APPLICATION_MANIFEST)
1203     void getApplicationManifest(CallbackID);
1204     void didFinishLoadingApplicationManifest(uint64_t, const Optional<WebCore::ApplicationManifest>&);
1205 #endif
1206
1207 #if USE(WPE_RENDERER)
1208     int hostFileDescriptor() const { return m_hostFileDescriptor.fileDescriptor(); }
1209 #endif
1210
1211     void updateCurrentModifierState(OptionSet<WebCore::PlatformEvent::Modifier> modifiers);
1212
1213     UserContentControllerIdentifier userContentControllerIdentifier() const { return m_userContentController->identifier(); }
1214
1215     WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() const { return m_userInterfaceLayoutDirection; }
1216
1217     bool isSuspended() const { return m_isSuspended; }
1218
1219     void didReceiveWebPageMessage(IPC::Connection&, IPC::Decoder&);
1220
1221     template<typename T>
1222     bool sendSyncWithDelayedReply(T&& message, typename T::Reply&& reply)
1223     {
1224         cancelGesturesBlockedOnSynchronousReplies();
1225         return sendSync(WTFMove(message), WTFMove(reply), Seconds::infinity(), IPC::SendSyncOption::InformPlatformProcessWillSuspend);
1226     }
1227
1228     WebCore::DOMPasteAccessResponse requestDOMPasteAccess(const String& originIdentifier);
1229     WebCore::IntRect rectForElementAtInteractionLocation() const;
1230
1231     const Optional<WebCore::Color>& backgroundColor() const { return m_backgroundColor; }
1232
1233     void suspendAllMediaBuffering();
1234     void resumeAllMediaBuffering();
1235
1236     void configureLoggingChannel(const String&, WTFLogChannelState, WTFLogLevel);
1237
1238     WebCore::Element* elementForContext(const WebCore::ElementContext&) const;
1239     Optional<WebCore::ElementContext> contextForElement(WebCore::Element&) const;
1240
1241     void startTextManipulations(Vector<WebCore::TextManipulationController::ExclusionRule>&&, CompletionHandler<void()>&&);
1242     void completeTextManipulation(WebCore::TextManipulationController::ItemIdentifier,
1243         const Vector<WebCore::TextManipulationController::ManipulationToken>&,
1244         CompletionHandler<void(WebCore::TextManipulationController::ManipulationResult)>&&);
1245
1246 #if ENABLE(APPLE_PAY)
1247     WebPaymentCoordinator* paymentCoordinator();
1248 #endif
1249
1250 #if ENABLE(PLATFORM_DRIVEN_TEXT_CHECKING)
1251     TextCheckingControllerProxy& textCheckingController() { return m_textCheckingControllerProxy.get(); }
1252 #endif
1253
1254 #if PLATFORM(COCOA)
1255     void setRemoteObjectRegistry(WebRemoteObjectRegistry*);
1256     WebRemoteObjectRegistry* remoteObjectRegistry();
1257 #endif
1258
1259     WebPageProxyIdentifier webPageProxyIdentifier() const { return m_webPageProxyIdentifier; }
1260
1261     void updateIntrinsicContentSizeIfNeeded(const WebCore::IntSize&);
1262     void scheduleFullEditorStateUpdate();
1263     bool isThrottleable() const;
1264
1265     bool userIsInteracting() const { return m_userIsInteracting; }
1266     void setUserIsInteracting(bool userIsInteracting) { m_userIsInteracting = userIsInteracting; }
1267
1268     bool firstFlushAfterCommit() const { return m_firstFlushAfterCommit; }
1269     void setFirstFlushAfterCommit(bool f) { m_firstFlushAfterCommit = f; }
1270
1271 #if PLATFORM(IOS_FAMILY)
1272     // This excludes layout overflow, includes borders.
1273     static WebCore::IntRect rootViewBoundsForElement(const WebCore::Element&);
1274     // These include layout overflow for overflow:visible elements, but exclude borders.
1275     static WebCore::IntRect absoluteInteractionBoundsForElement(const WebCore::Element&);
1276     static WebCore::IntRect rootViewInteractionBoundsForElement(const WebCore::Element&);
1277 #endif // PLATFORM(IOS_FAMILY)
1278
1279 #if USE(QUICK_LOOK)
1280     void didStartLoadForQuickLookDocumentInMainFrame(const String& fileName, const String& uti);
1281     void didFinishLoadForQuickLookDocumentInMainFrame(const WebCore::SharedBuffer&);
1282     void requestPasswordForQuickLookDocumentInMainFrame(const String& fileName, CompletionHandler<void(const String&)>&&);
1283 #endif
1284
1285     const String& overriddenMediaType() const { return m_overriddenMediaType; }
1286     void setOverriddenMediaType(const String&);
1287
1288     void getProcessDisplayName(CompletionHandler<void(String&&)>&&);
1289
1290     WebCore::AllowsContentJavaScript allowsContentJavaScriptFromMostRecentNavigation() const { return m_allowsContentJavaScriptFromMostRecentNavigation; }
1291     void setAllowsContentJavaScriptFromMostRecentNavigation(WebCore::AllowsContentJavaScript allows) { m_allowsContentJavaScriptFromMostRecentNavigation = allows; }
1292
1293     void getAllFrames(CompletionHandler<void(Vector<FrameInfoData>&&)>&&);
1294
1295     void setIsNavigatingToAppBoundDomain(NavigatingToAppBoundDomain);
1296     NavigatingToAppBoundDomain isNavigatingToAppBoundDomain() const { return m_isNavigatingToAppBoundDomain; }
1297
1298     bool shouldUseRemoteRenderingFor(WebCore::RenderingPurpose);
1299     
1300 private:
1301     WebPage(WebCore::PageIdentifier, WebPageCreationParameters&&);
1302
1303     void updateThrottleState();
1304
1305     // IPC::MessageSender
1306     IPC::Connection* messageSenderConnection() const override;
1307     uint64_t messageSenderDestinationID() const override;
1308
1309     void platformInitialize();
1310     void platformReinitialize();
1311     void platformDetach();
1312     void platformEditorState(WebCore::Frame&, EditorState& result, IncludePostLayoutDataHint) const;
1313     void platformWillPerformEditingCommand();
1314     void sendEditorStateUpdate();
1315
1316 #if HAVE(TOUCH_BAR)
1317     void sendTouchBarMenuDataAddedUpdate(WebCore::HTMLMenuElement&);
1318     void sendTouchBarMenuDataRemovedUpdate(WebCore::HTMLMenuElement&);
1319     void sendTouchBarMenuItemDataAddedUpdate(WebCore::HTMLMenuItemElement&);
1320     void sendTouchBarMenuItemDataRemovedUpdate(WebCore::HTMLMenuItemElement&);
1321 #endif
1322
1323     void didReceiveSyncWebPageMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&);
1324
1325 #if PLATFORM(IOS_FAMILY)
1326     void updateViewportSizeForCSSViewportUnits();
1327
1328     static void convertSelectionRectsToRootView(WebCore::FrameView*, Vector<WebCore::SelectionRect>&);
1329
1330     void getFocusedElementInformation(FocusedElementInformation&);
1331     void platformInitializeAccessibility();
1332     void generateSyntheticEditingCommand(SyntheticEditingCommandType);
1333     void handleSyntheticClick(WebCore::Node& nodeRespondingToClick, const WebCore::FloatPoint& location, OptionSet<WebKit::WebEvent::Modifier>, WebCore::PointerID = WebCore::mousePointerID);
1334     void completeSyntheticClick(WebCore::Node& nodeRespondingToClick, const WebCore::FloatPoint& location, OptionSet<WebKit::WebEvent::Modifier>, WebCore::SyntheticClickType, WebCore::PointerID = WebCore::mousePointerID);
1335     void sendTapHighlightForNodeIfNecessary(uint64_t requestID, WebCore::Node*);
1336     WebCore::VisiblePosition visiblePositionInFocusedNodeForPoint(const WebCore::Frame&, const WebCore::IntPoint&, bool isInteractingWithFocusedElement);
1337     RefPtr<WebCore::Range> rangeForGranularityAtPoint(WebCore::Frame&, const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithFocusedElement);
1338     void setFocusedFrameBeforeSelectingTextAtLocation(const WebCore::IntPoint&);
1339     void dispatchSyntheticMouseEventsForSelectionGesture(SelectionTouch, const WebCore::IntPoint&);
1340
1341     void sendPositionInformation(InteractionInformationAtPosition&&);
1342     InteractionInformationAtPosition positionInformation(const InteractionInformationRequest&);
1343     RefPtr<ShareableBitmap> shareableBitmapSnapshotForNode(WebCore::Element&);
1344     WebAutocorrectionContext autocorrectionContext();
1345     bool applyAutocorrectionInternal(const String& correction, const String& originalText);
1346 #endif
1347
1348 #if ENABLE(META_VIEWPORT)
1349     void resetViewportDefaultConfiguration(WebFrame* mainFrame, bool hasMobileDocType = false);
1350     enum class ZoomToInitialScale { No, Yes };
1351     void viewportConfigurationChanged(ZoomToInitialScale = ZoomToInitialScale::No);
1352     bool shouldIgnoreMetaViewport() const;
1353 #endif
1354
1355 #if ENABLE(TEXT_AUTOSIZING)
1356     void textAutoSizingAdjustmentTimerFired();
1357     void resetTextAutosizing();
1358     void resetIdempotentTextAutosizingIfNeeded(double previousInitialScale);
1359 #endif
1360
1361 #if ENABLE(VIEWPORT_RESIZING)
1362     void scheduleShrinkToFitContent();
1363     void shrinkToFitContentTimerFired();
1364     bool immediatelyShrinkToFitContent();
1365 #endif
1366
1367 #if PLATFORM(IOS_FAMILY) && ENABLE(DATA_INTERACTION)
1368     void requestDragStart(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t allowedActions);
1369     void requestAdditionalItemsForDragSession(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t allowedActions);
1370     void insertDroppedImagePlaceholders(const Vector<WebCore::IntSize>&, CompletionHandler<void(const Vector<WebCore::IntRect>&, Optional<WebCore::TextIndicatorData>)>&& reply);
1371     void computeAndSendEditDragSnapshot();
1372 #endif
1373
1374 #if !PLATFORM(COCOA) && !PLATFORM(WPE)
1375     static const char* interpretKeyEvent(const WebCore::KeyboardEvent*);
1376 #endif
1377
1378     bool performDefaultBehaviorForKeyEvent(const WebKeyboardEvent&);
1379
1380 #if PLATFORM(MAC)
1381     bool executeKeypressCommandsInternal(const Vector<WebCore::KeypressCommand>&, WebCore::KeyboardEvent*);
1382 #endif
1383
1384     void testProcessIncomingSyncMessagesWhenWaitingForSyncReply(Messages::WebPage::TestProcessIncomingSyncMessagesWhenWaitingForSyncReplyDelayedReply&&);
1385
1386     void updateDrawingAreaLayerTreeFreezeState();
1387     bool markLayersVolatileImmediatelyIfPossible();
1388     void layerVolatilityTimerFired();
1389     void callVolatilityCompletionHandlers(bool succeeded);
1390
1391     String sourceForFrame(WebFrame*);
1392
1393     void loadDataImpl(uint64_t navigationID, bool shouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&&, Ref<WebCore::SharedBuffer>&&, const String& MIMEType, const String& encodingName, const URL& baseURL, const URL& failingURL, const UserData&, NavigatingToAppBoundDomain, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow);
1394
1395     // Actions
1396     void tryClose(CompletionHandler<void(bool)>&&);
1397     void platformDidReceiveLoadParameters(const LoadParameters&);
1398     void loadRequest(LoadParameters&&);
1399     NO_RETURN void loadRequestWaitingForProcessLaunch(LoadParameters&&, URL&&, WebPageProxyIdentifier, bool);
1400     void loadData(LoadParameters&&);
1401     void loadAlternateHTML(LoadParameters&&);
1402     void navigateToPDFLinkWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint);
1403     void reload(uint64_t navigationID, uint32_t reloadOptions, SandboxExtension::Handle&&);
1404     void goToBackForwardItem(uint64_t navigationID, const WebCore::BackForwardItemIdentifier&, WebCore::FrameLoadType, WebCore::ShouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&&);
1405     void tryRestoreScrollPosition();
1406     void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, CallbackID);
1407     void updateIsInWindow(bool isInitialState = false);
1408     void visibilityDidChange();
1409     void setActivityState(OptionSet<WebCore::ActivityState::Flag>, ActivityStateChangeID, const Vector<CallbackID>& callbackIDs);
1410     void validateCommand(const String&, CallbackID);
1411     void executeEditCommand(const String&, const String&);
1412     void setEditable(bool);
1413
1414     void didChangeSelectionOrOverflowScrollPosition();
1415
1416     void increaseListLevel();
1417     void decreaseListLevel();
1418     void changeListType();
1419
1420     void setBaseWritingDirection(WebCore::WritingDirection);
1421
1422     void setNeedsFontAttributes(bool);
1423
1424     void mouseEvent(const WebMouseEvent&);
1425     void keyEvent(const WebKeyboardEvent&);
1426
1427 #if ENABLE(IOS_TOUCH_EVENTS)
1428     void touchEventSync(const WebTouchEvent&, CompletionHandler<void(bool)>&&);
1429     void resetPotentialTapSecurityOrigin();
1430     void updatePotentialTapSecurityOrigin(const WebTouchEvent&, bool wasHandled);
1431 #elif ENABLE(TOUCH_EVENTS)
1432     void touchEvent(const WebTouchEvent&);
1433 #endif
1434
1435 #if ENABLE(POINTER_EVENTS)
1436     void cancelPointer(WebCore::PointerID, const WebCore::IntPoint&);
1437     void touchWithIdentifierWasRemoved(WebCore::PointerID);
1438 #endif
1439
1440 #if ENABLE(CONTEXT_MENUS)
1441     void contextMenuHidden() { m_isShowingContextMenu = false; }
1442 #endif
1443 #if ENABLE(CONTEXT_MENU_EVENT)
1444     void contextMenuForKeyEvent();
1445 #endif
1446
1447     static bool scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity);
1448     static bool logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity);
1449
1450     void loadURLInFrame(URL&&, const String& referrer, WebCore::FrameIdentifier);
1451     void loadDataInFrame(IPC::DataReference&&, String&& MIMEType, String&& encodingName, URL&& baseURL, WebCore::FrameIdentifier);
1452
1453     enum class WasRestoredByAPIRequest { No, Yes };
1454     void restoreSessionInternal(const Vector<BackForwardListItemState>&, WasRestoredByAPIRequest, WebBackForwardListProxy::OverwriteExistingItem);
1455     void restoreSession(const Vector<BackForwardListItemState>&);
1456     void didRemoveBackForwardItem(const WebCore::BackForwardItemIdentifier&);
1457     void updateBackForwardListForReattach(const Vector<WebKit::BackForwardListItemState>&);
1458     void setCurrentHistoryItemForReattach(WebKit::BackForwardListItemState&&);
1459
1460     void requestFontAttributesAtSelectionStart(CallbackID);
1461
1462 #if ENABLE(REMOTE_INSPECTOR)
1463     void setIndicating(bool);
1464 #endif
1465
1466     void setBackgroundColor(const Optional<WebCore::Color>&);
1467
1468 #if PLATFORM(COCOA)
1469     void setTopContentInsetFenced(float, IPC::Attachment);
1470 #endif
1471     void setTopContentInset(float);
1472
1473     void viewWillStartLiveResize();
1474     void viewWillEndLiveResize();
1475
1476     void getContentsAsString(ContentAsStringIncludesChildFrames, CallbackID);
1477 #if PLATFORM(COCOA)
1478     void getContentsAsAttributedString(CompletionHandler<void(const AttributedString&)>&&);
1479 #endif
1480 #if ENABLE(MHTML)
1481     void getContentsAsMHTMLData(CallbackID);
1482 #endif
1483     void getMainResourceDataOfFrame(WebCore::FrameIdentifier, CallbackID);
1484     void getResourceDataFromFrame(WebCore::FrameIdentifier, const String& resourceURL, CallbackID);
1485     void getRenderTreeExternalRepresentation(CallbackID);
1486     void getSelectionOrContentsAsString(CallbackID);
1487     void getSelectionAsWebArchiveData(CallbackID);
1488     void getSourceForFrame(WebCore::FrameIdentifier, CallbackID);
1489     void getWebArchiveOfFrame(WebCore::FrameIdentifier, CallbackID);
1490     void runJavaScript(WebFrame*, WebCore::RunJavaScriptParameters&&, ContentWorldIdentifier, CallbackID);
1491     void runJavaScriptInMainFrameScriptWorld(WebCore::RunJavaScriptParameters&&, const std::pair<ContentWorldIdentifier, String>& worldData, CallbackID);
1492     void runJavaScriptInFrame(WebCore::FrameIdentifier, const String&, bool forceUserGesture, CallbackID);
1493     void forceRepaint(CallbackID);
1494     void takeSnapshot(WebCore::IntRect snapshotRect, WebCore::IntSize bitmapSize, uint32_t options, CallbackID);
1495
1496     void preferencesDidChange(const WebPreferencesStore&);
1497     void updatePreferences(const WebPreferencesStore&);
1498     void updatePreferencesGenerated(const WebPreferencesStore&);
1499
1500 #if PLATFORM(IOS_FAMILY)
1501     bool parentProcessHasServiceWorkerEntitlement() const;
1502 #else
1503     bool parentProcessHasServiceWorkerEntitlement() const { return true; }
1504 #endif
1505
1506     void didReceivePolicyDecision(WebCore::FrameIdentifier, uint64_t listenerID, PolicyDecision&&);
1507     void continueWillSubmitForm(WebCore::FrameIdentifier, uint64_t listenerID);
1508     void setUserAgent(const String&);
1509     void setCustomTextEncodingName(const String&);
1510     void suspendActiveDOMObjectsAndAnimations();
1511     void resumeActiveDOMObjectsAndAnimations();
1512
1513 #if PLATFORM(COCOA)
1514     void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
1515     void performDictionaryLookupOfCurrentSelection();
1516     void performDictionaryLookupForRange(WebCore::Frame&, WebCore::Range&, NSDictionary *options, WebCore::TextIndicatorPresentationTransition);
1517     WebCore::DictionaryPopupInfo dictionaryPopupInfoForRange(WebCore::Frame&, WebCore::Range&, NSDictionary *options, WebCore::TextIndicatorPresentationTransition);
1518 #if ENABLE(PDFKIT_PLUGIN)
1519     WebCore::DictionaryPopupInfo dictionaryPopupInfoForSelectionInPDFPlugin(PDFSelection *, PDFPlugin&, NSDictionary *options, WebCore::TextIndicatorPresentationTransition);
1520 #endif
1521
1522     void windowAndViewFramesChanged(const WebCore::FloatRect& windowFrameInScreenCoordinates, const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates, const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
1523
1524     RetainPtr<PDFDocument> pdfDocumentForPrintingFrame(WebCore::Frame*);
1525     void computePagesForPrintingPDFDocument(WebCore::FrameIdentifier, const PrintInfo&, Vector<WebCore::IntRect>& resultPageRects);
1526     void drawPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, const WebCore::IntRect&);
1527     void drawPagesToPDFFromPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, uint32_t first, uint32_t count);
1528 #endif
1529
1530     void setMainFrameIsScrollable(bool);
1531
1532     void unapplyEditCommand(WebUndoStepID commandID);
1533     void reapplyEditCommand(WebUndoStepID commandID);
1534     void didRemoveEditCommand(WebUndoStepID commandID);
1535
1536     void findString(const String&, uint32_t findOptions, uint32_t maxMatchCount, Optional<CallbackID>);
1537     void findStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1538     void getImageForFindMatch(uint32_t matchIndex);
1539     void selectFindMatch(uint32_t matchIndex);
1540     void indicateFindMatch(uint32_t matchIndex);
1541     void hideFindUI();
1542     void countStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1543     void replaceMatches(const Vector<uint32_t>& matchIndices, const String& replacementText, bool selectionOnly, CallbackID);
1544
1545 #if USE(COORDINATED_GRAPHICS)
1546     void sendViewportAttributesChanged(const WebCore::ViewportArguments&);
1547 #endif
1548
1549     void didChangeSelectedIndexForActivePopupMenu(int32_t newIndex);
1550     void setTextForActivePopupMenu(int32_t index);
1551
1552 #if PLATFORM(GTK)
1553     void failedToShowPopupMenu();
1554 #endif
1555
1556     void didChooseFilesForOpenPanel(const Vector<String>&);
1557     void didCancelForOpenPanel();
1558
1559 #if PLATFORM(IOS_FAMILY)
1560     void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const IPC::DataReference& iconData);
1561     bool isTransparentOrFullyClipped(const WebCore::Element&) const;
1562 #endif
1563
1564 #if ENABLE(SANDBOX_EXTENSIONS)
1565     void extendSandboxForFilesFromOpenPanel(SandboxExtension::HandleArray&&);
1566 #endif
1567
1568     void didReceiveGeolocationPermissionDecision(uint64_t geolocationID, const String& authorizationToken);
1569
1570     void didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed);
1571
1572 #if ENABLE(MEDIA_STREAM)
1573     void userMediaAccessWasGranted(uint64_t userMediaID, WebCore::CaptureDevice&& audioDeviceUID, WebCore::CaptureDevice&& videoDeviceUID, String&& mediaDeviceIdentifierHashSalt, SandboxExtension::Handle&&, CompletionHandler<void()>&&);
1574     void userMediaAccessWasDenied(uint64_t userMediaID, uint64_t reason, String&& invalidConstraint);
1575
1576 #endif
1577
1578 #if ENABLE(WEB_RTC)
1579     void disableICECandidateFiltering();
1580     void enableICECandidateFiltering();
1581 #endif
1582
1583 #if ENABLE(WEB_RTC) && USE(LIBWEBRTC)
1584     void disableEnumeratingAllNetworkInterfaces();
1585     void enableEnumeratingAllNetworkInterfaces();
1586 #endif
1587
1588     void stopAllMediaPlayback();
1589     void suspendAllMediaPlayback();
1590     void resumeAllMediaPlayback();
1591
1592     void advanceToNextMisspelling(bool startBeforeSelection);
1593     void changeSpellingToWord(const String& word);
1594
1595 #if USE(APPKIT)
1596     void uppercaseWord();
1597     void lowercaseWord();
1598     void capitalizeWord();
1599 #endif
1600
1601     bool shouldDispatchSyntheticMouseEventsWhenModifyingSelection() const;
1602     void platformDidSelectAll();
1603     
1604     void setHasResourceLoadClient(bool);
1605
1606 #if ENABLE(CONTEXT_MENUS)
1607     void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&);
1608 #endif
1609
1610     void changeSelectedIndex(int32_t index);
1611     void setCanStartMediaTimerFired();
1612
1613     static bool platformCanHandleRequest(const WebCore::ResourceRequest&);
1614
1615     static PluginView* focusedPluginViewForFrame(WebCore::Frame&);
1616
1617     void reportUsedFeatures();
1618
1619     void updateWebsitePolicies(WebsitePoliciesData&&);
1620
1621     void changeFont(WebCore::FontChanges&&);
1622     void changeFontAttributes(WebCore::FontAttributeChanges&&);
1623
1624 #if PLATFORM(MAC)
1625     void performImmediateActionHitTestAtLocation(WebCore::FloatPoint);
1626     std::tuple<RefPtr<WebCore::Range>, NSDictionary *> lookupTextAtLocation(WebCore::FloatPoint);
1627     void immediateActionDidUpdate();
1628     void immediateActionDidCancel();
1629     void immediateActionDidComplete();
1630
1631     void dataDetectorsDidPresentUI(WebCore::PageOverlay::PageOverlayID);
1632     void dataDetectorsDidChangeUI(WebCore::PageOverlay::PageOverlayID);
1633     void dataDetectorsDidHideUI(WebCore::PageOverlay::PageOverlayID);
1634
1635     void handleAcceptedCandidate(WebCore::TextCheckingResult);
1636 #endif
1637
1638 #if PLATFORM(COCOA)
1639     void requestActiveNowPlayingSessionInfo(CallbackID);
1640     RetainPtr<NSData> accessibilityRemoteTokenData() const;
1641     void accessibilityTransferRemoteToken(RetainPtr<NSData>);
1642 #endif
1643
1644     void setShouldDispatchFakeMouseMoveEvents(bool dispatch) { m_shouldDispatchFakeMouseMoveEvents = dispatch; }
1645
1646 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
1647     void playbackTargetSelected(uint64_t, const WebCore::MediaPlaybackTargetContext& outputDevice) const;
1648     void playbackTargetAvailabilityDidChange(uint64_t, bool);
1649     void setShouldPlayToPlaybackTarget(uint64_t, bool);
1650     void playbackTargetPickerWasDismissed(uint64_t);
1651 #endif
1652
1653     void clearWheelEventTestMonitor();
1654
1655     void setShouldScaleViewToFitDocument(bool);
1656
1657     void pageStoppedScrolling();
1658
1659 #if ENABLE(VIDEO) && USE(GSTREAMER)
1660     void didEndRequestInstallMissingMediaPlugins(uint32_t result);
1661 #endif
1662
1663     void setUserInterfaceLayoutDirection(uint32_t);
1664
1665     bool canPluginHandleResponse(const WebCore::ResourceResponse&);
1666
1667     void simulateDeviceOrientationChange(double alpha, double beta, double gamma);
1668
1669 #if USE(SYSTEM_PREVIEW)
1670     void systemPreviewActionTriggered(WebCore::SystemPreviewInfo, const String& message);
1671 #endif
1672
1673 #if ENABLE(SPEECH_SYNTHESIS)
1674     void speakingErrorOccurred();
1675     void boundaryEventOccurred(bool wordBoundary, unsigned charIndex);
1676     void voicesDidChange();
1677 #endif
1678
1679     void frameBecameRemote(WebCore::FrameIdentifier, WebCore::GlobalFrameIdentifier&& remoteFrameIdentifier, WebCore::GlobalWindowIdentifier&& remoteWindowIdentifier);
1680
1681     void registerURLSchemeHandler(uint64_t identifier, const String& scheme);
1682
1683     void urlSchemeTaskDidPerformRedirection(uint64_t handlerIdentifier, uint64_t taskIdentifier, WebCore::ResourceResponse&&, WebCore::ResourceRequest&&);
1684     void urlSchemeTaskDidReceiveResponse(uint64_t handlerIdentifier, uint64_t taskIdentifier, const WebCore::ResourceResponse&);
1685     void urlSchemeTaskDidReceiveData(uint64_t handlerIdentifier, uint64_t taskIdentifier, const IPC::SharedBufferDataReference&);
1686     void urlSchemeTaskDidComplete(uint64_t handlerIdentifier, uint64_t taskIdentifier, const WebCore::ResourceError&);
1687
1688     void setIsSuspended(bool);
1689
1690     RefPtr<WebImage> snapshotAtSize(const WebCore::IntRect&, const WebCore::IntSize& bitmapSize, SnapshotOptions);
1691     RefPtr<WebImage> snapshotNode(WebCore::Node&, SnapshotOptions, unsigned maximumPixelCount = std::numeric_limits<unsigned>::max());
1692 #if PLATFORM(COCOA)
1693     RetainPtr<CFDataRef> pdfSnapshotAtSize(WebCore::IntRect, WebCore::IntSize bitmapSize, SnapshotOptions);
1694 #endif
1695
1696 #if ENABLE(ATTACHMENT_ELEMENT)
1697     RefPtr<WebCore::HTMLAttachmentElement> attachmentElementWithIdentifier(const String& identifier) const;
1698 #endif
1699
1700     bool canShowMIMEType(const String&, const Function<bool(const String&, WebCore::PluginData::AllowedPluginTypes)>& supportsPlugin) const;
1701
1702     void cancelGesturesBlockedOnSynchronousReplies();
1703
1704     bool shouldDispatchUpdateAfterFocusingElement(const WebCore::Element&) const;
1705
1706     void updateMockAccessibilityElementAfterCommittingLoad();
1707
1708     void paintSnapshotAtSize(const WebCore::IntRect&, const WebCore::IntSize&, SnapshotOptions, WebCore::Frame&, WebCore::FrameView&, WebCore::GraphicsContext&);
1709
1710 #if PLATFORM(GTK) || PLATFORM(WPE)
1711     void sendMessageToWebExtension(UserMessage&&);
1712     void sendMessageToWebExtensionWithReply(UserMessage&&, CompletionHandler<void(UserMessage&&)>&&);
1713 #endif
1714
1715     WebCore::PageIdentifier m_identifier;
1716
1717     std::unique_ptr<WebCore::Page> m_page;
1718     RefPtr<WebFrame> m_mainFrame;
1719
1720     RefPtr<WebPageGroupProxy> m_pageGroup;
1721
1722     String m_userAgent;
1723
1724     WebCore::IntSize m_viewSize;
1725     std::unique_ptr<DrawingArea> m_drawingArea;
1726
1727     HashSet<PluginView*> m_pluginViews;
1728     bool m_hasSeenPlugin { false };
1729
1730     HashMap<uint64_t, RefPtr<WebCore::TextCheckingRequest>> m_pendingTextCheckingRequestMap;
1731
1732     bool m_useFixedLayout { false };
1733
1734     WebCore::Color m_underlayColor;
1735
1736     bool m_isInRedo { false };
1737     bool m_isClosed { false };
1738     bool m_tabToLinks { false };
1739     
1740     bool m_asynchronousPluginInitializationEnabled { false };
1741     bool m_asynchronousPluginInitializationEnabledForAllPlugins { false };
1742     bool m_artificialPluginInitializationDelayEnabled { false };
1743     bool m_scrollingPerformanceLoggingEnabled { false };
1744     bool m_mainFrameIsScrollable { true };
1745
1746     bool m_alwaysShowsHorizontalScroller { false };
1747     bool m_alwaysShowsVerticalScroller { false };
1748
1749     bool m_shouldRenderCanvasInGPUProcess { false };
1750
1751 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
1752     bool m_readyToFindPrimarySnapshottedPlugin { false };
1753     bool m_didFindPrimarySnapshottedPlugin { false };
1754     unsigned m_numberOfPrimarySnapshotDetectionAttempts { 0 };
1755     String m_primaryPlugInPageOrigin;
1756     String m_primaryPlugInOrigin;
1757     String m_primaryPlugInMimeType;
1758     RunLoop::Timer<WebPage> m_determinePrimarySnapshottedPlugInTimer;
1759 #endif
1760
1761     // The layer hosting mode.
1762     LayerHostingMode m_layerHostingMode;
1763
1764 #if PLATFORM(COCOA)
1765     bool m_pdfPluginEnabled { false };
1766     bool m_hasCachedWindowFrame { false };
1767
1768     // The frame of the containing window in screen coordinates.
1769     WebCore::FloatRect m_windowFrameInScreenCoordinates;
1770
1771     // The frame of the containing window in unflipped screen coordinates.
1772     WebCore::FloatRect m_windowFrameInUnflippedScreenCoordinates;
1773
1774     // The frame of the view in window coordinates.
1775     WebCore::FloatRect m_viewFrameInWindowCoordinates;
1776
1777     // The accessibility position of the view.
1778     WebCore::FloatPoint m_accessibilityPosition;
1779     
1780     RetainPtr<WKAccessibilityWebPageObject> m_mockAccessibilityElement;
1781 #endif
1782
1783 #if ENABLE(PLATFORM_DRIVEN_TEXT_CHECKING)
1784     UniqueRef<TextCheckingControllerProxy> m_textCheckingControllerProxy;
1785 #endif
1786
1787 #if PLATFORM(COCOA) || PLATFORM(GTK)
1788     std::unique_ptr<ViewGestureGeometryCollector> m_viewGestureGeometryCollector;
1789 #endif
1790
1791 #if PLATFORM(COCOA)
1792     RetainPtr<NSDictionary> m_dataDetectionContext;
1793 #endif
1794
1795 #if ENABLE(ACCESSIBILITY) && USE(ATK)
1796     GRefPtr<AtkObject> m_accessibilityObject;
1797 #endif
1798
1799 #if !PLATFORM(IOS_FAMILY)
1800     RefPtr<PageBanner> m_headerBanner;
1801     RefPtr<PageBanner> m_footerBanner;
1802 #endif
1803
1804     RunLoop::Timer<WebPage> m_setCanStartMediaTimer;
1805     bool m_mayStartMediaWhenInWindow { false };
1806
1807     HashMap<WebUndoStepID, RefPtr<WebUndoStep>> m_undoStepMap;
1808
1809 #if ENABLE(CONTEXT_MENUS)
1810     std::unique_ptr<API::InjectedBundle::PageContextMenuClient> m_contextMenuClient;
1811 #endif
1812     std::unique_ptr<API::InjectedBundle::EditorClient> m_editorClient;
1813     std::unique_ptr<API::InjectedBundle::FormClient> m_formClient;
1814     std::unique_ptr<API::InjectedBundle::PageLoaderClient> m_loaderClient;
1815     InjectedBundlePagePolicyClient m_policyClient;
1816     std::unique_ptr<API::InjectedBundle::ResourceLoadClient> m_resourceLoadClient;
1817     std::unique_ptr<API::InjectedBundle::PageUIClient> m_uiClient;
1818 #if ENABLE(FULLSCREEN_API)
1819     InjectedBundlePageFullScreenClient m_fullScreenClient;
1820 #endif
1821
1822     UniqueRef<FindController> m_findController;
1823
1824     RefPtr<WebInspector> m_inspector;
1825     RefPtr<WebInspectorUI> m_inspectorUI;
1826     RefPtr<RemoteWebInspectorUI> m_remoteInspectorUI;
1827     std::unique_ptr<WebPageInspectorTargetController> m_inspectorTargetController;
1828
1829 #if (PLATFORM(IOS_FAMILY) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
1830     RefPtr<PlaybackSessionManager> m_playbackSessionManager;
1831     RefPtr<VideoFullscreenManager> m_videoFullscreenManager;
1832 #endif
1833
1834 #if PLATFORM(IOS_FAMILY)
1835     bool m_allowsMediaDocumentInlinePlayback { false };
1836     RefPtr<WebCore::Range> m_startingGestureRange;
1837 #endif
1838
1839 #if ENABLE(FULLSCREEN_API)
1840     RefPtr<WebFullScreenManager> m_fullScreenManager;
1841 #endif
1842
1843     RefPtr<WebPopupMenu> m_activePopupMenu;
1844
1845 #if ENABLE(CONTEXT_MENUS)
1846     RefPtr<WebContextMenu> m_contextMenu;
1847 #endif
1848
1849 #if ENABLE(INPUT_TYPE_COLOR)
1850     WebColorChooser* m_activeColorChooser { nullptr };
1851 #endif
1852
1853 #if ENABLE(DATALIST_ELEMENT)
1854     WeakPtr<WebDataListSuggestionPicker> m_activeDataListSuggestionPicker;
1855 #endif
1856
1857     RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener;
1858     RefPtr<NotificationPermissionRequestManager> m_notificationPermissionRequestManager;
1859
1860     Ref<WebUserContentController> m_userContentController;
1861
1862 #if ENABLE(GEOLOCATION)
1863     UniqueRef<GeolocationPermissionRequestManager> m_geolocationPermissionRequestManager;
1864 #endif
1865
1866 #if ENABLE(MEDIA_STREAM)
1867     UniqueRef<UserMediaPermissionRequestManager> m_userMediaPermissionRequestManager;
1868 #endif
1869
1870     std::unique_ptr<WebCore::PrintContext> m_printContext;
1871 #if PLATFORM(GTK)
1872     RefPtr<WebPrintOperationGtk> m_printOperation;
1873 #endif
1874
1875     SandboxExtensionTracker m_sandboxExtensionTracker;
1876
1877     RefPtr<SandboxExtension> m_pendingDropSandboxExtension;
1878     Vector<RefPtr<SandboxExtension>> m_pendingDropExtensionsForFileUpload;
1879
1880     PAL::HysteresisActivity m_pageScrolledHysteresis;
1881
1882     bool m_canRunBeforeUnloadConfirmPanel { false };
1883
1884     bool m_canRunModal { false };
1885     bool m_isRunningModal { false };
1886
1887 #if ENABLE(DRAG_SUPPORT)
1888     bool m_isStartingDrag { false };
1889     WebCore::DragSourceAction m_allowedDragSourceActions { WebCore::DragSourceActionAny };
1890 #endif
1891
1892 #if ENABLE(DRAG_SUPPORT) && PLATFORM(IOS_FAMILY)
1893     HashSet<RefPtr<WebCore::HTMLImageElement>> m_pendingImageElementsForDropSnapshot;
1894     RefPtr<WebCore::Range> m_rangeForDropSnapshot;
1895 #endif
1896
1897     bool m_cachedMainFrameIsPinnedToLeftSide { true };
1898     bool m_cachedMainFrameIsPinnedToRightSide { true };
1899     bool m_cachedMainFrameIsPinnedToTopSide { true };
1900     bool m_cachedMainFrameIsPinnedToBottomSide { true };
1901     bool m_canShortCircuitHorizontalWheelEvents { false };
1902     bool m_hasWheelEventHandlers { false };
1903
1904     unsigned m_cachedPageCount { 0 };
1905
1906     HashSet<unsigned long> m_trackedNetworkResourceRequestIdentifiers;
1907
1908     WebCore::IntSize m_minimumSizeForAutoLayout;
1909     bool m_autoSizingShouldExpandToViewHeight { false };
1910     Optional<WebCore::IntSize> m_viewportSizeForCSSViewportUnits;
1911
1912     bool m_userIsInteracting { false };
1913     bool m_hasEverFocusedElementDueToUserInteractionSincePageTransition { false };
1914
1915 #if HAVE(TOUCH_BAR)
1916     bool m_isTouchBarUpdateSupressedForHiddenContentEditable { false };
1917     bool m_isNeverRichlyEditableForTouchBar { false };
1918 #endif
1919     OptionSet<WebCore::ActivityState::Flag> m_lastActivityStateChanges;
1920
1921 #if ENABLE(CONTEXT_MENUS)
1922     bool m_isShowingContextMenu { false };
1923 #endif
1924
1925     RefPtr<WebCore::Element> m_focusedElement;
1926     RefPtr<WebCore::Element> m_recentlyBlurredElement;
1927     bool m_hasPendingInputContextUpdateAfterBlurringAndRefocusingElement { false };
1928     bool m_hasPendingEditorStateUpdate { false };
1929
1930 #if ENABLE(IOS_TOUCH_EVENTS)
1931     CompletionHandler<void(bool)> m_pendingSynchronousTouchEventReply;
1932 #endif
1933
1934 #if ENABLE(META_VIEWPORT)
1935     WebCore::ViewportConfiguration m_viewportConfiguration;
1936     bool m_useTestingViewportConfiguration { false };
1937     bool m_forceAlwaysUserScalable { false };
1938     bool m_ignoreViewportScalingConstraints { false };
1939 #endif
1940
1941 #if PLATFORM(IOS_FAMILY)
1942     RefPtr<WebCore::Range> m_currentWordRange;
1943     RefPtr<WebCore::Node> m_interactionNode;
1944     WebCore::IntPoint m_lastInteractionLocation;
1945
1946     bool m_isShowingInputViewForFocusedElement { false };
1947     
1948     enum SelectionAnchor { Start, End };
1949     SelectionAnchor m_selectionAnchor { Start };
1950
1951     RefPtr<WebCore::Node> m_potentialTapNode;
1952     WebCore::FloatPoint m_potentialTapLocation;
1953     RefPtr<WebCore::SecurityOrigin> m_potentialTapSecurityOrigin;
1954
1955     bool m_hasReceivedVisibleContentRectsAfterDidCommitLoad { false };
1956     bool m_hasRestoredExposedContentRectAfterDidCommitLoad { false };
1957     bool m_scaleWasSetByUIProcess { false };
1958     bool m_userHasChangedPageScaleFactor { false };
1959     bool m_hasStablePageScaleFactor { true };
1960     bool m_isInStableState { true };
1961     bool m_shouldRevealCurrentSelectionAfterInsertion { true };
1962     MonotonicTime m_oldestNonStableUpdateVisibleContentRectsTimestamp;
1963     Seconds m_estimatedLatency { 0 };
1964     WebCore::FloatSize m_screenSize;
1965     WebCore::FloatSize m_availableScreenSize;
1966     WebCore::FloatSize m_overrideScreenSize;
1967
1968     RefPtr<WebCore::Range> m_initialSelection;
1969     WebCore::VisibleSelection m_storedSelectionForAccessibility { WebCore::VisibleSelection() };
1970     WebCore::FloatSize m_maximumUnobscuredSize;
1971     int32_t m_deviceOrientation { 0 };
1972     bool m_keyboardIsAttached { false };
1973     bool m_canShowWhileLocked { false };
1974     bool m_inDynamicSizeUpdate { false };
1975     HashMap<std::pair<WebCore::IntSize, double>, WebCore::IntPoint> m_dynamicSizeUpdateHistory;
1976     RefPtr<WebCore::Node> m_pendingSyntheticClickNode;
1977     WebCore::FloatPoint m_pendingSyntheticClickLocation;
1978     WebCore::FloatRect m_previousExposedContentRect;
1979     OptionSet<WebKit::WebEvent::Modifier> m_pendingSyntheticClickModifiers;
1980     WebCore::PointerID m_pendingSyntheticClickPointerId { 0 };
1981     FocusedElementIdentifier m_currentFocusedElementIdentifier { 0 };
1982     Optional<DynamicViewportSizeUpdateID> m_pendingDynamicViewportSizeUpdateID;
1983     double m_lastTransactionPageScaleFactor { 0 };
1984     TransactionID m_lastTransactionIDWithScaleChange;
1985
1986     CompletionHandler<void(InteractionInformationAtPosition&&)> m_pendingSynchronousPositionInformationReply;
1987 #endif
1988
1989     WebCore::Timer m_layerVolatilityTimer;
1990     Vector<Function<void(bool)>> m_markLayersAsVolatileCompletionHandlers;
1991     bool m_isSuspendedUnderLock { false };
1992
1993     HashSet<String, ASCIICaseInsensitiveHash> m_mimeTypesWithCustomContentProviders;
1994     Optional<WebCore::Color> m_backgroundColor { WebCore::Color::white };
1995
1996     HashSet<unsigned> m_activeRenderingSuppressionTokens;
1997     unsigned m_maximumRenderingSuppressionToken { 0 };
1998     
1999     WebCore::ScrollPinningBehavior m_scrollPinningBehavior { WebCore::DoNotPin };
2000     Optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle;
2001
2002     bool m_useAsyncScrolling { false };
2003
2004     OptionSet<WebCore::ActivityState::Flag> m_activityState;
2005
2006     bool m_isAppNapEnabled { true };
2007     UserActivity m_userActivity;
2008
2009     uint64_t m_pendingNavigationID { 0 };
2010     Optional<WebsitePoliciesData> m_pendingWebsitePolicies;
2011
2012     bool m_mainFrameProgressCompleted { false };
2013     bool m_shouldDispatchFakeMouseMoveEvents { true };
2014     bool m_isEditorStateMissingPostLayoutData { false };
2015     bool m_isSelectingTextWhileInsertingAsynchronously { false };
2016
2017     enum class EditorStateIsContentEditable { No, Yes, Unset };
2018     mutable EditorStateIsContentEditable m_lastEditorStateWasContentEditable { EditorStateIsContentEditable::Unset };
2019
2020 #if PLATFORM(GTK) || PLATFORM(WPE)
2021     Optional<InputMethodState> m_inputMethodState;
2022 #endif
2023
2024 #if ENABLE(VIDEO) && USE(GSTREAMER)
2025     RefPtr<WebCore::MediaPlayerRequestInstallMissingPluginsCallback> m_installMediaPluginsCallback;
2026 #endif
2027
2028 #if USE(OS_STATE)
2029     WallTime m_loadCommitTime;
2030 #endif
2031
2032     WebCore::UserInterfaceLayoutDirection m_userInterfaceLayoutDirection { WebCore::UserInterfaceLayoutDirection::LTR };
2033
2034     const String m_overrideContentSecurityPolicy;
2035     const Optional<double> m_cpuLimit;
2036
2037 #if USE(WPE_RENDERER)
2038     IPC::Attachment m_hostFileDescriptor;
2039 #endif
2040
2041     HashMap<String, RefPtr<WebURLSchemeHandlerProxy>> m_schemeToURLSchemeHandlerProxyMap;
2042     HashMap<uint64_t, WebURLSchemeHandlerProxy*> m_identifierToURLSchemeHandlerProxyMap;
2043
2044     HashMap<uint64_t, Function<void(bool granted)>> m_storageAccessResponseCallbackMap;
2045     HashMap<ShareSheetCallbackID, Function<void(bool completed)>> m_shareSheetResponseCallbackMap;
2046
2047 #if ENABLE(APPLICATION_MANIFEST)
2048     HashMap<uint64_t, uint64_t> m_applicationManifestFetchCallbackMap;
2049 #endif
2050
2051     OptionSet<LayerTreeFreezeReason> m_layerTreeFreezeReasons;
2052     bool m_isSuspended { false };
2053     bool m_needsFontAttributes { false };
2054     bool m_firstFlushAfterCommit { false };
2055 #if PLATFORM(COCOA)
2056     WeakPtr<WebRemoteObjectRegistry> m_remoteObjectRegistry;
2057 #endif
2058     WebPageProxyIdentifier m_webPageProxyIdentifier;
2059     WebCore::IntSize m_lastSentIntrinsicContentSize;
2060 #if ENABLE(VIEWPORT_RESIZING)
2061     WebCore::DeferrableOneShotTimer m_shrinkToFitContentTimer;
2062 #endif
2063 #if HAVE(VISIBILITY_PROPAGATION_VIEW)
2064     std::unique_ptr<LayerHostingContext> m_contextForVisibilityPropagation;
2065 #endif
2066 #if ENABLE(TEXT_AUTOSIZING)
2067     WebCore::Timer m_textAutoSizingAdjustmentTimer;
2068 #endif
2069
2070 #if ENABLE(RESOURCE_LOAD_STATISTICS)
2071     HashMap<WebCore::RegistrableDomain, WebCore::RegistrableDomain> m_domainsWithPageLevelStorageAccess;
2072     HashSet<WebCore::RegistrableDomain> m_loadedDomains;
2073     HashSet<WebCore::RegistrableDomain> m_prevalentDomains;
2074 #endif
2075
2076     String m_overriddenMediaType;
2077     String m_processDisplayName;
2078     WebCore::AllowsContentJavaScript m_allowsContentJavaScriptFromMostRecentNavigation { WebCore::AllowsContentJavaScript::Yes };
2079
2080 #if PLATFORM(GTK)
2081     String m_themeName;
2082 #endif
2083     
2084     NavigatingToAppBoundDomain m_isNavigatingToAppBoundDomain { NavigatingToAppBoundDomain::No };
2085 };
2086
2087 #if !PLATFORM(IOS_FAMILY)
2088 inline void WebPage::platformWillPerformEditingCommand() { }
2089 #endif
2090
2091 } // namespace WebKit
2092