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