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