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