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