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