Regression(PSON) View becomes blank after click a cross-site download link
[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         ProcessSwap             = 1 << 5,
700     };
701     void freezeLayerTree(LayerTreeFreezeReason);
702     void unfreezeLayerTree(LayerTreeFreezeReason);
703
704     void markLayersVolatile(WTF::Function<void (bool)>&& completionHandler = { });
705     void cancelMarkLayersVolatile();
706
707     NotificationPermissionRequestManager* notificationPermissionRequestManager();
708
709     void pageDidScroll();
710
711 #if ENABLE(CONTEXT_MENUS)
712     WebContextMenu* contextMenu();
713     WebContextMenu* contextMenuAtPointInWindow(const WebCore::IntPoint&);
714 #endif
715
716     bool hasLocalDataForURL(const URL&);
717
718     static bool canHandleRequest(const WebCore::ResourceRequest&);
719
720     class SandboxExtensionTracker {
721     public:
722         ~SandboxExtensionTracker();
723
724         void invalidate();
725
726         void beginLoad(WebFrame*, SandboxExtension::Handle&&);
727         void beginReload(WebFrame*, SandboxExtension::Handle&&);
728         void willPerformLoadDragDestinationAction(RefPtr<SandboxExtension>&& pendingDropSandboxExtension);
729         void didStartProvisionalLoad(WebFrame*);
730         void didCommitProvisionalLoad(WebFrame*);
731         void didFailProvisionalLoad(WebFrame*);
732
733     private:
734         void setPendingProvisionalSandboxExtension(RefPtr<SandboxExtension>&&);
735
736         RefPtr<SandboxExtension> m_pendingProvisionalSandboxExtension;
737         RefPtr<SandboxExtension> m_provisionalSandboxExtension;
738         RefPtr<SandboxExtension> m_committedSandboxExtension;
739     };
740
741     SandboxExtensionTracker& sandboxExtensionTracker() { return m_sandboxExtensionTracker; }
742
743 #if PLATFORM(GTK)
744     void setComposition(const String& text, const Vector<WebCore::CompositionUnderline>& underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeLength);
745     void confirmComposition(const String& text, int64_t selectionStart, int64_t selectionLength);
746     void cancelComposition();
747
748     void collapseSelectionInFrame(uint64_t frameID);
749 #endif
750
751 #if PLATFORM (GTK) && HAVE(GTK_GESTURES)
752     void getCenterForZoomGesture(const WebCore::IntPoint& centerInViewCoordinates, WebCore::IntPoint& result);
753 #endif
754
755     void didApplyStyle();
756     void didChangeSelection();
757     void didChangeContents();
758     void discardedComposition();
759     void canceledComposition();
760     void didUpdateComposition();
761     void didEndUserTriggeredSelectionChanges();
762
763 #if PLATFORM(COCOA)
764     void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
765     WKAccessibilityWebPageObject* accessibilityRemoteObject();
766     NSObject *accessibilityObjectForMainFramePlugin();
767     const WebCore::FloatPoint& accessibilityPosition() const { return m_accessibilityPosition; }
768     
769     void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
770
771     void setTextAsync(const String&);
772     void insertTextAsync(const String& text, const EditingRange& replacementRange, bool registerUndoGroup = false, uint32_t editingRangeIsRelativeTo = (uint32_t)EditingRangeIsRelativeTo::EditableRoot, bool suppressSelectionUpdate = false);
773     void getMarkedRangeAsync(CallbackID);
774     void getSelectedRangeAsync(CallbackID);
775     void characterIndexForPointAsync(const WebCore::IntPoint&, CallbackID);
776     void firstRectForCharacterRangeAsync(const EditingRange&, CallbackID);
777     void setCompositionAsync(const String& text, const Vector<WebCore::CompositionUnderline>& underlines, const EditingRange& selectionRange, const EditingRange& replacementRange);
778     void confirmCompositionAsync();
779
780     void readSelectionFromPasteboard(const WTF::String& pasteboardName, bool& result);
781     void getStringSelectionForPasteboard(WTF::String& stringValue);
782     void getDataSelectionForPasteboard(const WTF::String pasteboardType, SharedMemory::Handle& handle, uint64_t& size);
783     void shouldDelayWindowOrderingEvent(const WebKit::WebMouseEvent&, bool& result);
784     void acceptsFirstMouse(int eventNumber, const WebKit::WebMouseEvent&, bool& result);
785     bool performNonEditingBehaviorForSelector(const String&, WebCore::KeyboardEvent*);
786 #endif
787
788 #if PLATFORM(MAC)
789     void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::DictationAlternative>& dictationAlternativeLocations, bool registerUndoGroup = false);
790     void attributedSubstringForCharacterRangeAsync(const EditingRange&, CallbackID);
791     void fontAtSelection(CallbackID);
792 #endif
793
794 #if PLATFORM(COCOA) && ENABLE(SERVICE_CONTROLS)
795     void replaceSelectionWithPasteboardData(const Vector<String>& types, const IPC::DataReference&);
796 #endif
797
798 #if HAVE(ACCESSIBILITY) && PLATFORM(GTK)
799     void updateAccessibilityTree();
800 #endif
801
802     void setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length, bool suppressUnderline);
803     bool hasCompositionForTesting();
804     void confirmCompositionForTesting(const String& compositionString);
805
806 #if PLATFORM(COCOA)
807     bool isSpeaking();
808     void speak(const String&);
809     void stopSpeaking();
810
811     void performDictionaryLookupForSelection(WebCore::Frame&, const WebCore::VisibleSelection&, WebCore::TextIndicatorPresentationTransition);
812 #endif
813
814     bool isSmartInsertDeleteEnabled();
815     void setSmartInsertDeleteEnabled(bool);
816
817     bool isSelectTrailingWhitespaceEnabled() const;
818     void setSelectTrailingWhitespaceEnabled(bool);
819
820     void replaceSelectionWithText(WebCore::Frame*, const String&);
821     void clearSelection();
822     void restoreSelectionInFocusedEditableElement();
823
824 #if ENABLE(DRAG_SUPPORT) && PLATFORM(GTK)
825     void performDragControllerAction(DragControllerAction, const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t draggingSourceOperationMask, WebSelectionData&&, uint32_t flags);
826 #endif
827
828 #if ENABLE(DRAG_SUPPORT) && !PLATFORM(GTK)
829     void performDragControllerAction(DragControllerAction, const WebCore::DragData&, SandboxExtension::Handle&&, SandboxExtension::HandleArray&&);
830 #endif
831
832 #if ENABLE(DRAG_SUPPORT)
833     void dragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation);
834
835     void willPerformLoadDragDestinationAction();
836     void mayPerformUploadDragDestinationAction();
837
838     void willStartDrag() { ASSERT(!m_isStartingDrag); m_isStartingDrag = true; }
839     void didStartDrag();
840     void dragCancelled();
841 #endif
842
843     void beginPrinting(uint64_t frameID, const PrintInfo&);
844     void endPrinting();
845     void computePagesForPrinting(uint64_t frameID, const PrintInfo&, CallbackID);
846     void computePagesForPrintingImpl(uint64_t frameID, const PrintInfo&, Vector<WebCore::IntRect>& pageRects, double& totalScaleFactor);
847
848 #if PLATFORM(COCOA)
849     void drawRectToImage(uint64_t frameID, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, CallbackID);
850     void drawPagesToPDF(uint64_t frameID, const PrintInfo&, uint32_t first, uint32_t count, CallbackID);
851     void drawPagesToPDFImpl(uint64_t frameID, const PrintInfo&, uint32_t first, uint32_t count, RetainPtr<CFMutableDataRef>& pdfPageData);
852 #endif
853
854 #if PLATFORM(IOS_FAMILY)
855     void computePagesForPrintingAndDrawToPDF(uint64_t frameID, const PrintInfo&, CallbackID, Messages::WebPage::ComputePagesForPrintingAndDrawToPDF::DelayedReply&&);
856 #endif
857
858 #if PLATFORM(GTK)
859     void drawPagesForPrinting(uint64_t frameID, const PrintInfo&, CallbackID);
860     void didFinishPrintOperation(const WebCore::ResourceError&, CallbackID);
861 #endif
862
863     void addResourceRequest(unsigned long, const WebCore::ResourceRequest&);
864     void removeResourceRequest(unsigned long);
865
866     void setMediaVolume(float);
867     void setMuted(WebCore::MediaProducer::MutedStateFlags);
868     void setMayStartMediaWhenInWindow(bool);
869     void stopMediaCapture();
870
871 #if ENABLE(MEDIA_SESSION)
872     void handleMediaEvent(uint32_t /* WebCore::MediaEventType */);
873     void setVolumeOfMediaElement(double, uint64_t);
874 #endif
875
876     void updateMainFrameScrollOffsetPinning();
877
878     bool mainFrameHasCustomContentProvider() const;
879     void addMIMETypeWithCustomContentProvider(const String&);
880
881     void mainFrameDidLayout();
882
883     bool canRunBeforeUnloadConfirmPanel() const { return m_canRunBeforeUnloadConfirmPanel; }
884     void setCanRunBeforeUnloadConfirmPanel(bool canRunBeforeUnloadConfirmPanel) { m_canRunBeforeUnloadConfirmPanel = canRunBeforeUnloadConfirmPanel; }
885
886     bool canRunModal() const { return m_canRunModal; }
887     void setCanRunModal(bool canRunModal) { m_canRunModal = canRunModal; }
888
889     void runModal();
890
891     void setDeviceScaleFactor(float);
892     float deviceScaleFactor() const;
893
894     void forceRepaintWithoutCallback();
895
896     void unmarkAllMisspellings();
897     void unmarkAllBadGrammar();
898
899 #if PLATFORM(COCOA)
900     void handleAlternativeTextUIResult(const String&);
901 #endif
902
903     // For testing purpose.
904     void simulateMouseDown(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, WallTime);
905     void simulateMouseUp(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, WallTime);
906     void simulateMouseMotion(WebCore::IntPoint, WallTime);
907
908 #if ENABLE(CONTEXT_MENUS)
909     void contextMenuShowing() { m_isShowingContextMenu = true; }
910 #endif
911
912     void wheelEvent(const WebWheelEvent&);
913
914     void wheelEventHandlersChanged(bool);
915     void recomputeShortCircuitHorizontalWheelEventsState();
916
917 #if ENABLE(MAC_GESTURE_EVENTS)
918     void gestureEvent(const WebGestureEvent&);
919 #endif
920
921     void updateVisibilityState(bool isInitialState = false);
922
923 #if PLATFORM(IOS_FAMILY)
924     void setViewportConfigurationViewLayoutSize(const WebCore::FloatSize&, double scaleFactor, double minimumEffectiveDeviceWidth);
925     void setMaximumUnobscuredSize(const WebCore::FloatSize&);
926     void setDeviceOrientation(int32_t);
927     void setOverrideViewportArguments(const Optional<WebCore::ViewportArguments>&);
928     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);
929     Optional<float> scaleFromUIProcess(const VisibleContentRectUpdateInfo&) const;
930     void updateVisibleContentRects(const VisibleContentRectUpdateInfo&, MonotonicTime oldestTimestamp);
931     bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; }
932     void willStartUserTriggeredZooming();
933     void applicationWillResignActive();
934     void applicationDidEnterBackground(bool isSuspendedUnderLock);
935     void applicationDidFinishSnapshottingAfterEnteringBackground();
936     void applicationWillEnterForeground(bool isSuspendedUnderLock);
937     void applicationDidBecomeActive();
938     void completePendingSyntheticClickForContentChangeObserver();
939
940     bool platformPrefersTextLegibilityBasedZoomScaling() const;
941     const WebCore::ViewportConfiguration& viewportConfiguration() const { return m_viewportConfiguration; }
942
943     void hardwareKeyboardAvailabilityChanged();
944
945     void updateStringForFind(const String&);
946 #endif
947
948 #if ENABLE(IOS_TOUCH_EVENTS)
949     void dispatchTouchEvent(const WebTouchEvent&, bool& handled);
950 #endif
951
952 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
953     uint64_t nativeWindowHandle() { return m_nativeWindowHandle; }
954 #endif
955
956     bool shouldUseCustomContentProviderForResponse(const WebCore::ResourceResponse&);
957
958     bool asynchronousPluginInitializationEnabled() const { return m_asynchronousPluginInitializationEnabled; }
959     void setAsynchronousPluginInitializationEnabled(bool enabled) { m_asynchronousPluginInitializationEnabled = enabled; }
960     bool asynchronousPluginInitializationEnabledForAllPlugins() const { return m_asynchronousPluginInitializationEnabledForAllPlugins; }
961     void setAsynchronousPluginInitializationEnabledForAllPlugins(bool enabled) { m_asynchronousPluginInitializationEnabledForAllPlugins = enabled; }
962     bool artificialPluginInitializationDelayEnabled() const { return m_artificialPluginInitializationDelayEnabled; }
963     void setArtificialPluginInitializationDelayEnabled(bool enabled) { m_artificialPluginInitializationDelayEnabled = enabled; }
964     void setTabToLinksEnabled(bool enabled) { m_tabToLinks = enabled; }
965     bool tabToLinksEnabled() const { return m_tabToLinks; }
966
967     bool scrollingPerformanceLoggingEnabled() const { return m_scrollingPerformanceLoggingEnabled; }
968     void setScrollingPerformanceLoggingEnabled(bool);
969
970 #if PLATFORM(COCOA)
971     bool shouldUsePDFPlugin() const;
972     bool pdfPluginEnabled() const { return m_pdfPluginEnabled; }
973     void setPDFPluginEnabled(bool enabled) { m_pdfPluginEnabled = enabled; }
974
975     NSDictionary *dataDetectionContext() const { return m_dataDetectionContext.get(); }
976 #endif
977
978     void savePDFToFileInDownloadsFolder(const String& suggestedFilename, const URL& originatingURL, const uint8_t* data, unsigned long size);
979
980 #if PLATFORM(COCOA)
981     void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
982 #endif
983
984     bool mainFrameIsScrollable() const { return m_mainFrameIsScrollable; }
985
986     void setAlwaysShowsHorizontalScroller(bool);
987     void setAlwaysShowsVerticalScroller(bool);
988
989     bool alwaysShowsHorizontalScroller() const { return m_alwaysShowsHorizontalScroller; };
990     bool alwaysShowsVerticalScroller() const { return m_alwaysShowsVerticalScroller; };
991
992     void setViewLayoutSize(const WebCore::IntSize&);
993     WebCore::IntSize viewLayoutSize() const { return m_viewLayoutSize; }
994
995     void setAutoSizingShouldExpandToViewHeight(bool shouldExpand);
996     bool autoSizingShouldExpandToViewHeight() { return m_autoSizingShouldExpandToViewHeight; }
997
998     void setViewportSizeForCSSViewportUnits(Optional<WebCore::IntSize>);
999     Optional<WebCore::IntSize> viewportSizeForCSSViewportUnits() const { return m_viewportSizeForCSSViewportUnits; }
1000
1001     bool canShowMIMEType(const String& MIMEType) const;
1002     bool canShowResponse(const WebCore::ResourceResponse&) const;
1003
1004     void addTextCheckingRequest(uint64_t requestID, Ref<WebCore::TextCheckingRequest>&&);
1005     void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
1006     void didCancelCheckingText(uint64_t requestID);
1007
1008 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
1009     void determinePrimarySnapshottedPlugIn();
1010     void determinePrimarySnapshottedPlugInTimerFired();
1011     void resetPrimarySnapshottedPlugIn();
1012     bool matchesPrimaryPlugIn(const String& pageOrigin, const String& pluginOrigin, const String& mimeType) const;
1013     bool plugInIntersectsSearchRect(WebCore::HTMLPlugInImageElement& pluginImageElement);
1014     bool plugInIsPrimarySize(WebCore::HTMLPlugInImageElement& pluginImageElement, unsigned &pluginArea);
1015 #endif
1016
1017 #if ENABLE(DATA_DETECTION)
1018     void setDataDetectionResults(NSArray *);
1019     void detectDataInAllFrames(uint64_t, CompletionHandler<void(const DataDetectionResult&)>&&);
1020     void removeDataDetectedLinks(CompletionHandler<void(const DataDetectionResult&)>&&);
1021 #endif
1022
1023     unsigned extendIncrementalRenderingSuppression();
1024     void stopExtendingIncrementalRenderingSuppression(unsigned token);
1025     bool shouldExtendIncrementalRenderingSuppression() { return !m_activeRenderingSuppressionTokens.isEmpty(); }
1026
1027     WebCore::ScrollPinningBehavior scrollPinningBehavior() { return m_scrollPinningBehavior; }
1028     void setScrollPinningBehavior(uint32_t /* WebCore::ScrollPinningBehavior */ pinning);
1029
1030     Optional<WebCore::ScrollbarOverlayStyle> scrollbarOverlayStyle() { return m_scrollbarOverlayStyle; }
1031     void setScrollbarOverlayStyle(Optional<uint32_t /* WebCore::ScrollbarOverlayStyle */> scrollbarStyle);
1032
1033     Ref<WebCore::DocumentLoader> createDocumentLoader(WebCore::Frame&, const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
1034     void updateCachedDocumentLoader(WebDocumentLoader&, WebCore::Frame&);
1035
1036     void getBytecodeProfile(CallbackID);
1037     void getSamplingProfilerOutput(CallbackID);
1038     
1039 #if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION)
1040     void handleTelephoneNumberClick(const String& number, const WebCore::IntPoint&);
1041     void handleSelectionServiceClick(WebCore::FrameSelection&, const Vector<String>& telephoneNumbers, const WebCore::IntPoint&);
1042 #endif
1043
1044     void didChangeScrollOffsetForFrame(WebCore::Frame*);
1045
1046     void setMainFrameProgressCompleted(bool completed) { m_mainFrameProgressCompleted = completed; }
1047     bool shouldDispatchFakeMouseMoveEvents() const { return m_shouldDispatchFakeMouseMoveEvents; }
1048
1049     void postMessage(const String& messageName, API::Object* messageBody);
1050     void postSynchronousMessageForTesting(const String& messageName, API::Object* messageBody, RefPtr<API::Object>& returnData);
1051     void postMessageIgnoringFullySynchronousMode(const String& messageName, API::Object* messageBody);
1052
1053 #if PLATFORM(GTK)
1054     void setInputMethodState(bool);
1055 #endif
1056
1057     void imageOrMediaDocumentSizeChanged(const WebCore::IntSize&);
1058
1059 #if ENABLE(VIDEO) && USE(GSTREAMER)
1060     void requestInstallMissingMediaPlugins(const String& details, const String& description, WebCore::MediaPlayerRequestInstallMissingPluginsCallback&);
1061 #endif
1062
1063     void addUserScript(String&& source, WebCore::UserContentInjectedFrames, WebCore::UserScriptInjectionTime);
1064     void addUserStyleSheet(const String& source, WebCore::UserContentInjectedFrames);
1065     void removeAllUserContent();
1066
1067     void dispatchDidReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone>);
1068
1069     void didRestoreScrollPosition();
1070
1071     bool isControlledByAutomation() const;
1072     void setControlledByAutomation(bool);
1073
1074     void connectInspector(const String& targetId, Inspector::FrontendChannel::ConnectionType);
1075     void disconnectInspector(const String& targetId);
1076     void sendMessageToTargetBackend(const String& targetId, const String& message);
1077
1078     void insertNewlineInQuotedContent();
1079
1080 #if USE(OS_STATE)
1081     WallTime loadCommitTime() const { return m_loadCommitTime; }
1082 #endif
1083
1084 #if ENABLE(GAMEPAD)
1085     void gamepadActivity(const Vector<GamepadData>&, bool shouldMakeGamepadsVisible);
1086 #endif
1087     
1088 #if ENABLE(POINTER_LOCK)
1089     void didAcquirePointerLock();
1090     void didNotAcquirePointerLock();
1091     void didLosePointerLock();
1092 #endif
1093
1094     void didGetLoadDecisionForIcon(bool decision, CallbackID loadIdentifier, OptionalCallbackID);
1095     void setUseIconLoadingClient(bool);
1096
1097 #if ENABLE(DATA_INTERACTION)
1098     void didConcludeEditDataInteraction();
1099 #endif
1100
1101     WebURLSchemeHandlerProxy* urlSchemeHandlerForScheme(const String&);
1102     void stopAllURLSchemeTasks();
1103
1104     Optional<double> cpuLimit() const { return m_cpuLimit; }
1105
1106     static PluginView* pluginViewForFrame(WebCore::Frame*);
1107
1108     void sendPartialEditorStateAndSchedulePostLayoutUpdate();
1109     void flushPendingEditorStateUpdate();
1110
1111 #if ENABLE(RESOURCE_LOAD_STATISTICS)
1112     void hasStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, CompletionHandler<void(bool)>&& callback);
1113     void requestStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, CompletionHandler<void(bool)>&& callback);
1114     void storageAccessResponse(bool wasGranted, uint64_t contextId);
1115 #endif
1116
1117     void showShareSheet(WebCore::ShareDataWithParsedURL&, WTF::CompletionHandler<void(bool)>&& callback);
1118     void didCompleteShareSheet(bool wasCompleted, ShareSheetCallbackID contextId);
1119     
1120 #if ENABLE(ATTACHMENT_ELEMENT)
1121     void insertAttachment(const String& identifier, Optional<uint64_t>&& fileSize, const String& fileName, const String& contentType, CallbackID);
1122     void updateAttachmentAttributes(const String& identifier, Optional<uint64_t>&& fileSize, const String& contentType, const String& fileName, const IPC::DataReference& enclosingImageData, CallbackID);
1123 #endif
1124
1125 #if ENABLE(APPLICATION_MANIFEST)
1126     void getApplicationManifest(CallbackID);
1127     void didFinishLoadingApplicationManifest(uint64_t, const Optional<WebCore::ApplicationManifest>&);
1128 #endif
1129
1130     void updateCurrentModifierState(OptionSet<WebCore::PlatformEvent::Modifier> modifiers);
1131
1132     UserContentControllerIdentifier userContentControllerIdentifier() const { return m_userContentController->identifier(); }
1133
1134     WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() const { return m_userInterfaceLayoutDirection; }
1135
1136     bool isSuspended() const { return m_isSuspended; }
1137
1138     void didReceiveWebPageMessage(IPC::Connection&, IPC::Decoder&);
1139
1140 private:
1141     WebPage(uint64_t pageID, WebPageCreationParameters&&);
1142
1143     void updateThrottleState();
1144     void updateUserActivity();
1145
1146     // IPC::MessageSender
1147     IPC::Connection* messageSenderConnection() override;
1148     uint64_t messageSenderDestinationID() override;
1149
1150     void platformInitialize();
1151     void platformDetach();
1152     void platformEditorState(WebCore::Frame&, EditorState& result, IncludePostLayoutDataHint) const;
1153     void sendEditorStateUpdate();
1154     void scheduleFullEditorStateUpdate();
1155
1156 #if PLATFORM(COCOA)
1157     void sendTouchBarMenuDataAddedUpdate(WebCore::HTMLMenuElement&);
1158     void sendTouchBarMenuDataRemovedUpdate(WebCore::HTMLMenuElement&);
1159     void sendTouchBarMenuItemDataAddedUpdate(WebCore::HTMLMenuItemElement&);
1160     void sendTouchBarMenuItemDataRemovedUpdate(WebCore::HTMLMenuItemElement&);
1161 #endif
1162
1163     void didReceiveSyncWebPageMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&);
1164
1165 #if PLATFORM(IOS_FAMILY)
1166     void resetViewportDefaultConfiguration(WebFrame* mainFrame, bool hasMobileDocType = false);
1167     enum class ZoomToInitialScale { No, Yes };
1168     void viewportConfigurationChanged(ZoomToInitialScale = ZoomToInitialScale::No);
1169     void updateViewportSizeForCSSViewportUnits();
1170
1171     static void convertSelectionRectsToRootView(WebCore::FrameView*, Vector<WebCore::SelectionRect>&);
1172     RefPtr<WebCore::Range> rangeForWebSelectionAtPosition(const WebCore::IntPoint&, const WebCore::VisiblePosition&, SelectionFlags&);
1173     void getFocusedElementInformation(FocusedElementInformation&);
1174     void platformInitializeAccessibility();
1175     void handleSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location);
1176     void completeSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location, WebCore::SyntheticClickType);
1177     void sendTapHighlightForNodeIfNecessary(uint64_t requestID, WebCore::Node*);
1178     void resetTextAutosizing();
1179     WebCore::VisiblePosition visiblePositionInFocusedNodeForPoint(const WebCore::Frame&, const WebCore::IntPoint&, bool isInteractingWithFocusedElement);
1180     RefPtr<WebCore::Range> rangeForGranularityAtPoint(WebCore::Frame&, const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithFocusedElement);
1181 #endif
1182
1183 #if PLATFORM(IOS_FAMILY) && ENABLE(DATA_INTERACTION)
1184     void requestStartDataInteraction(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition);
1185     void requestAdditionalItemsForDragSession(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition);
1186 #endif
1187
1188 #if !PLATFORM(COCOA) && !PLATFORM(WPE)
1189     static const char* interpretKeyEvent(const WebCore::KeyboardEvent*);
1190 #endif
1191
1192     bool performDefaultBehaviorForKeyEvent(const WebKeyboardEvent&);
1193
1194 #if PLATFORM(MAC)
1195     bool executeKeypressCommandsInternal(const Vector<WebCore::KeypressCommand>&, WebCore::KeyboardEvent*);
1196 #endif
1197
1198     void updateDrawingAreaLayerTreeFreezeState();
1199     bool markLayersVolatileImmediatelyIfPossible();
1200     void layerVolatilityTimerFired();
1201     void callVolatilityCompletionHandlers(bool succeeded);
1202
1203     String sourceForFrame(WebFrame*);
1204
1205     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&);
1206
1207     // Actions
1208     void tryClose();
1209     void platformDidReceiveLoadParameters(const LoadParameters&);
1210     void loadRequest(LoadParameters&&);
1211     void loadData(LoadParameters&&);
1212     void loadAlternateHTML(LoadParameters&&);
1213     void navigateToPDFLinkWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint);
1214     void reload(uint64_t navigationID, uint32_t reloadOptions, SandboxExtension::Handle&&);
1215     void goToBackForwardItem(uint64_t navigationID, const WebCore::BackForwardItemIdentifier&, WebCore::FrameLoadType, WebCore::ShouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&&);
1216     void tryRestoreScrollPosition();
1217     void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, CallbackID);
1218     void updateIsInWindow(bool isInitialState = false);
1219     void visibilityDidChange();
1220     void setActivityState(OptionSet<WebCore::ActivityState::Flag>, ActivityStateChangeID, const Vector<CallbackID>& callbackIDs);
1221     void validateCommand(const String&, CallbackID);
1222     void executeEditCommand(const String&, const String&);
1223     void setEditable(bool);
1224
1225     void increaseListLevel();
1226     void decreaseListLevel();
1227     void changeListType();
1228
1229     void setBaseWritingDirection(WebCore::WritingDirection);
1230
1231     void setNeedsFontAttributes(bool);
1232
1233     void mouseEvent(const WebMouseEvent&);
1234     void keyEvent(const WebKeyboardEvent&);
1235
1236 #if ENABLE(IOS_TOUCH_EVENTS)
1237     void touchEventSync(const WebTouchEvent&, bool& handled);
1238     void updatePotentialTapSecurityOrigin(const WebTouchEvent&, bool wasHandled);
1239 #elif ENABLE(TOUCH_EVENTS)
1240     void touchEvent(const WebTouchEvent&);
1241 #endif
1242
1243 #if ENABLE(CONTEXT_MENUS)
1244     void contextMenuHidden() { m_isShowingContextMenu = false; }
1245     void contextMenuForKeyEvent();
1246 #endif
1247
1248     static bool scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity);
1249     static bool logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity);
1250
1251     void loadURLInFrame(URL&&, uint64_t frameID);
1252
1253     enum class WasRestoredByAPIRequest { No, Yes };
1254     void restoreSessionInternal(const Vector<BackForwardListItemState>&, WasRestoredByAPIRequest, WebBackForwardListProxy::OverwriteExistingItem);
1255     void restoreSession(const Vector<BackForwardListItemState>&);
1256     void didRemoveBackForwardItem(const WebCore::BackForwardItemIdentifier&);
1257     void updateBackForwardListForReattach(const Vector<WebKit::BackForwardListItemState>&);
1258     void setCurrentHistoryItemForReattach(WebKit::BackForwardListItemState&&);
1259
1260     void requestFontAttributesAtSelectionStart(CallbackID);
1261
1262 #if ENABLE(REMOTE_INSPECTOR)
1263     void setIndicating(bool);
1264 #endif
1265
1266     void setDrawsBackground(bool);
1267
1268 #if PLATFORM(COCOA)
1269     void setTopContentInsetFenced(float, IPC::Attachment);
1270 #endif
1271     void setTopContentInset(float);
1272
1273     void viewWillStartLiveResize();
1274     void viewWillEndLiveResize();
1275
1276     void getContentsAsString(CallbackID);
1277 #if ENABLE(MHTML)
1278     void getContentsAsMHTMLData(CallbackID);
1279 #endif
1280     void getMainResourceDataOfFrame(uint64_t frameID, CallbackID);
1281     void getResourceDataFromFrame(uint64_t frameID, const String& resourceURL, CallbackID);
1282     void getRenderTreeExternalRepresentation(CallbackID);
1283     void getSelectionOrContentsAsString(CallbackID);
1284     void getSelectionAsWebArchiveData(CallbackID);
1285     void getSourceForFrame(uint64_t frameID, CallbackID);
1286     void getWebArchiveOfFrame(uint64_t frameID, CallbackID);
1287     void runJavaScript(const String&, bool forceUserGesture, Optional<String> worldName, CallbackID);
1288     void runJavaScriptInMainFrame(const String&, bool forceUserGesture, CallbackID);
1289     void runJavaScriptInMainFrameScriptWorld(const String&, bool forceUserGesture, const String& worldName, CallbackID);
1290     void forceRepaint(CallbackID);
1291     void takeSnapshot(WebCore::IntRect snapshotRect, WebCore::IntSize bitmapSize, uint32_t options, CallbackID);
1292
1293     void preferencesDidChange(const WebPreferencesStore&);
1294     void updatePreferences(const WebPreferencesStore&);
1295     void updatePreferencesGenerated(const WebPreferencesStore&);
1296
1297 #if PLATFORM(IOS_FAMILY)
1298     bool parentProcessHasServiceWorkerEntitlement() const;
1299 #else
1300     bool parentProcessHasServiceWorkerEntitlement() const { return true; }
1301 #endif
1302
1303     void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, WebPolicyAction, uint64_t navigationID, const DownloadID&, Optional<WebsitePoliciesData>&&);
1304     void continueWillSubmitForm(uint64_t frameID, uint64_t listenerID);
1305     void setUserAgent(const String&);
1306     void setCustomTextEncodingName(const String&);
1307     void suspendActiveDOMObjectsAndAnimations();
1308     void resumeActiveDOMObjectsAndAnimations();
1309
1310 #if PLATFORM(COCOA)
1311     void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
1312     void performDictionaryLookupOfCurrentSelection();
1313     void performDictionaryLookupForRange(WebCore::Frame&, WebCore::Range&, NSDictionary *options, WebCore::TextIndicatorPresentationTransition);
1314     WebCore::DictionaryPopupInfo dictionaryPopupInfoForRange(WebCore::Frame&, WebCore::Range&, NSDictionary *options, WebCore::TextIndicatorPresentationTransition);
1315 #if ENABLE(PDFKIT_PLUGIN)
1316     WebCore::DictionaryPopupInfo dictionaryPopupInfoForSelectionInPDFPlugin(PDFSelection *, PDFPlugin&, NSDictionary *options, WebCore::TextIndicatorPresentationTransition);
1317 #endif
1318
1319     void windowAndViewFramesChanged(const WebCore::FloatRect& windowFrameInScreenCoordinates, const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates, const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
1320
1321     RetainPtr<PDFDocument> pdfDocumentForPrintingFrame(WebCore::Frame*);
1322     void computePagesForPrintingPDFDocument(uint64_t frameID, const PrintInfo&, Vector<WebCore::IntRect>& resultPageRects);
1323     void drawPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, const WebCore::IntRect&);
1324     void drawPagesToPDFFromPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, uint32_t first, uint32_t count);
1325 #endif
1326
1327     void setMainFrameIsScrollable(bool);
1328
1329     void unapplyEditCommand(WebUndoStepID commandID);
1330     void reapplyEditCommand(WebUndoStepID commandID);
1331     void didRemoveEditCommand(WebUndoStepID commandID);
1332
1333     void findString(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1334     void findStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1335     void getImageForFindMatch(uint32_t matchIndex);
1336     void selectFindMatch(uint32_t matchIndex);
1337     void hideFindUI();
1338     void countStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1339     void replaceMatches(const Vector<uint32_t>& matchIndices, const String& replacementText, bool selectionOnly, CallbackID);
1340
1341 #if USE(COORDINATED_GRAPHICS)
1342     void sendViewportAttributesChanged(const WebCore::ViewportArguments&);
1343 #endif
1344
1345     void didChangeSelectedIndexForActivePopupMenu(int32_t newIndex);
1346     void setTextForActivePopupMenu(int32_t index);
1347
1348 #if PLATFORM(GTK)
1349     void failedToShowPopupMenu();
1350 #endif
1351
1352     void didChooseFilesForOpenPanel(const Vector<String>&);
1353     void didCancelForOpenPanel();
1354
1355 #if PLATFORM(IOS_FAMILY)
1356     void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const IPC::DataReference& iconData);
1357 #endif
1358
1359 #if ENABLE(SANDBOX_EXTENSIONS)
1360     void extendSandboxForFilesFromOpenPanel(SandboxExtension::HandleArray&&);
1361 #endif
1362
1363     void didReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed);
1364
1365     void didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed);
1366
1367 #if ENABLE(MEDIA_STREAM)
1368     void userMediaAccessWasGranted(uint64_t userMediaID, WebCore::CaptureDevice&& audioDeviceUID, WebCore::CaptureDevice&& videoDeviceUID, String&& mediaDeviceIdentifierHashSalt);
1369     void userMediaAccessWasDenied(uint64_t userMediaID, uint64_t reason, String&& invalidConstraint);
1370
1371     void didCompleteMediaDeviceEnumeration(uint64_t userMediaID, const Vector<WebCore::CaptureDevice>& devices, String&& deviceIdentifierHashSalt, bool originHasPersistentAccess);
1372 #endif
1373
1374 #if ENABLE(MEDIA_STREAM) && ENABLE(SANDBOX_EXTENSIONS)
1375     void grantUserMediaDeviceSandboxExtensions(MediaDeviceSandboxExtensions&&);
1376     void revokeUserMediaDeviceSandboxExtensions(const Vector<String>&);
1377 #endif
1378
1379 #if ENABLE(WEB_RTC)
1380     void disableICECandidateFiltering();
1381     void enableICECandidateFiltering();
1382 #endif
1383
1384 #if ENABLE(WEB_RTC) && USE(LIBWEBRTC)
1385     void disableEnumeratingAllNetworkInterfaces();
1386     void enableEnumeratingAllNetworkInterfaces();
1387 #endif
1388
1389     void stopAllMediaPlayback();
1390     void suspendAllMediaPlayback();
1391     void resumeAllMediaPlayback();
1392
1393     void advanceToNextMisspelling(bool startBeforeSelection);
1394     void changeSpellingToWord(const String& word);
1395
1396 #if USE(APPKIT)
1397     void uppercaseWord();
1398     void lowercaseWord();
1399     void capitalizeWord();
1400 #endif
1401
1402 #if ENABLE(CONTEXT_MENUS)
1403     void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&);
1404 #endif
1405
1406     void changeSelectedIndex(int32_t index);
1407     void setCanStartMediaTimerFired();
1408
1409     static bool platformCanHandleRequest(const WebCore::ResourceRequest&);
1410
1411     static PluginView* focusedPluginViewForFrame(WebCore::Frame&);
1412
1413     static RefPtr<WebCore::Range> rangeFromEditingRange(WebCore::Frame&, const EditingRange&, EditingRangeIsRelativeTo = EditingRangeIsRelativeTo::EditableRoot);
1414
1415     void reportUsedFeatures();
1416
1417     void updateWebsitePolicies(WebsitePoliciesData&&);
1418
1419     void changeFont(WebCore::FontChanges&&);
1420     void changeFontAttributes(WebCore::FontAttributeChanges&&);
1421
1422 #if PLATFORM(MAC)
1423     void performImmediateActionHitTestAtLocation(WebCore::FloatPoint);
1424     std::tuple<RefPtr<WebCore::Range>, NSDictionary *> lookupTextAtLocation(WebCore::FloatPoint);
1425     void immediateActionDidUpdate();
1426     void immediateActionDidCancel();
1427     void immediateActionDidComplete();
1428
1429     void dataDetectorsDidPresentUI(WebCore::PageOverlay::PageOverlayID);
1430     void dataDetectorsDidChangeUI(WebCore::PageOverlay::PageOverlayID);
1431     void dataDetectorsDidHideUI(WebCore::PageOverlay::PageOverlayID);
1432
1433     void handleAcceptedCandidate(WebCore::TextCheckingResult);
1434 #endif
1435
1436 #if PLATFORM(COCOA)
1437     void requestActiveNowPlayingSessionInfo(CallbackID);
1438 #endif
1439
1440     void setShouldDispatchFakeMouseMoveEvents(bool dispatch) { m_shouldDispatchFakeMouseMoveEvents = dispatch; }
1441
1442 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
1443     void playbackTargetSelected(uint64_t, const WebCore::MediaPlaybackTargetContext& outputDevice) const;
1444     void playbackTargetAvailabilityDidChange(uint64_t, bool);
1445     void setShouldPlayToPlaybackTarget(uint64_t, bool);
1446 #endif
1447
1448     void clearWheelEventTestTrigger();
1449
1450     void setShouldScaleViewToFitDocument(bool);
1451
1452     void pageStoppedScrolling();
1453
1454 #if ENABLE(VIDEO) && USE(GSTREAMER)
1455     void didEndRequestInstallMissingMediaPlugins(uint32_t result);
1456 #endif
1457
1458     void setResourceCachingDisabled(bool);
1459     void setUserInterfaceLayoutDirection(uint32_t);
1460
1461     bool canPluginHandleResponse(const WebCore::ResourceResponse&);
1462
1463 #if USE(QUICK_LOOK)
1464     void didReceivePasswordForQuickLookDocument(const String&);
1465 #endif
1466
1467     void simulateDeviceOrientationChange(double alpha, double beta, double gamma);
1468
1469     void frameBecameRemote(uint64_t frameID, WebCore::GlobalFrameIdentifier&& remoteFrameIdentifier, WebCore::GlobalWindowIdentifier&& remoteWindowIdentifier);
1470
1471     void registerURLSchemeHandler(uint64_t identifier, const String& scheme);
1472
1473     void urlSchemeTaskDidPerformRedirection(uint64_t handlerIdentifier, uint64_t taskIdentifier, WebCore::ResourceResponse&&, WebCore::ResourceRequest&&);
1474     void urlSchemeTaskDidReceiveResponse(uint64_t handlerIdentifier, uint64_t taskIdentifier, const WebCore::ResourceResponse&);
1475     void urlSchemeTaskDidReceiveData(uint64_t handlerIdentifier, uint64_t taskIdentifier, const IPC::DataReference&);
1476     void urlSchemeTaskDidComplete(uint64_t handlerIdentifier, uint64_t taskIdentifier, const WebCore::ResourceError&);
1477
1478     void setIsSuspended(bool);
1479
1480     RefPtr<WebImage> snapshotAtSize(const WebCore::IntRect&, const WebCore::IntSize& bitmapSize, SnapshotOptions);
1481     RefPtr<WebImage> snapshotNode(WebCore::Node&, SnapshotOptions, unsigned maximumPixelCount = std::numeric_limits<unsigned>::max());
1482 #if USE(CF)
1483     RetainPtr<CFDataRef> pdfSnapshotAtSize(const WebCore::IntRect&, const WebCore::IntSize& bitmapSize, SnapshotOptions);
1484 #endif
1485
1486 #if ENABLE(ATTACHMENT_ELEMENT)
1487     RefPtr<WebCore::HTMLAttachmentElement> attachmentElementWithIdentifier(const String& identifier) const;
1488 #endif
1489
1490     bool canShowMIMEType(const String&, const Function<bool(const String&, WebCore::PluginData::AllowedPluginTypes)>& supportsPlugin) const;
1491
1492     uint64_t m_pageID;
1493
1494     std::unique_ptr<WebCore::Page> m_page;
1495     RefPtr<WebFrame> m_mainFrame;
1496
1497     RefPtr<WebPageGroupProxy> m_pageGroup;
1498
1499     String m_userAgent;
1500
1501     WebCore::IntSize m_viewSize;
1502     std::unique_ptr<DrawingArea> m_drawingArea;
1503     bool m_shouldResetDrawingAreaAfterSuspend { false };
1504
1505     HashSet<PluginView*> m_pluginViews;
1506     bool m_hasSeenPlugin { false };
1507
1508     HashMap<uint64_t, RefPtr<WebCore::TextCheckingRequest>> m_pendingTextCheckingRequestMap;
1509
1510     bool m_useFixedLayout { false };
1511     bool m_drawsBackground { true };
1512
1513     WebCore::Color m_underlayColor;
1514
1515     bool m_isInRedo { false };
1516     bool m_isClosed { false };
1517     bool m_tabToLinks { false };
1518     
1519     bool m_asynchronousPluginInitializationEnabled { false };
1520     bool m_asynchronousPluginInitializationEnabledForAllPlugins { false };
1521     bool m_artificialPluginInitializationDelayEnabled { false };
1522     bool m_scrollingPerformanceLoggingEnabled { false };
1523     bool m_mainFrameIsScrollable { true };
1524
1525     bool m_alwaysShowsHorizontalScroller { false };
1526     bool m_alwaysShowsVerticalScroller { false };
1527
1528 #if PLATFORM(IOS_FAMILY)
1529     bool m_ignoreViewportScalingConstraints { false };
1530 #endif
1531
1532 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
1533     bool m_readyToFindPrimarySnapshottedPlugin { false };
1534     bool m_didFindPrimarySnapshottedPlugin { false };
1535     unsigned m_numberOfPrimarySnapshotDetectionAttempts { 0 };
1536     String m_primaryPlugInPageOrigin;
1537     String m_primaryPlugInOrigin;
1538     String m_primaryPlugInMimeType;
1539     RunLoop::Timer<WebPage> m_determinePrimarySnapshottedPlugInTimer;
1540 #endif
1541
1542     // The layer hosting mode.
1543     LayerHostingMode m_layerHostingMode;
1544
1545 #if PLATFORM(COCOA)
1546     bool m_pdfPluginEnabled { false };
1547     bool m_hasCachedWindowFrame { false };
1548
1549     // The frame of the containing window in screen coordinates.
1550     WebCore::FloatRect m_windowFrameInScreenCoordinates;
1551
1552     // The frame of the containing window in unflipped screen coordinates.
1553     WebCore::FloatRect m_windowFrameInUnflippedScreenCoordinates;
1554
1555     // The frame of the view in window coordinates.
1556     WebCore::FloatRect m_viewFrameInWindowCoordinates;
1557
1558     // The accessibility position of the view.
1559     WebCore::FloatPoint m_accessibilityPosition;
1560     
1561     RetainPtr<WKAccessibilityWebPageObject> m_mockAccessibilityElement;
1562
1563     UniqueRef<ViewGestureGeometryCollector> m_viewGestureGeometryCollector;
1564
1565     RetainPtr<NSDictionary> m_dataDetectionContext;
1566 #endif
1567
1568 #if HAVE(ACCESSIBILITY) && PLATFORM(GTK)
1569     GRefPtr<WebPageAccessibilityObject> m_accessibilityObject;
1570 #endif
1571
1572 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
1573     // Our view's window in the UI process.
1574     uint64_t m_nativeWindowHandle { 0 };
1575 #endif
1576
1577 #if !PLATFORM(IOS_FAMILY)
1578     RefPtr<PageBanner> m_headerBanner;
1579     RefPtr<PageBanner> m_footerBanner;
1580 #endif
1581
1582     RunLoop::Timer<WebPage> m_setCanStartMediaTimer;
1583     bool m_mayStartMediaWhenInWindow { false };
1584
1585     HashMap<WebUndoStepID, RefPtr<WebUndoStep>> m_undoStepMap;
1586
1587 #if ENABLE(CONTEXT_MENUS)
1588     std::unique_ptr<API::InjectedBundle::PageContextMenuClient> m_contextMenuClient;
1589 #endif
1590     std::unique_ptr<API::InjectedBundle::EditorClient> m_editorClient;
1591     std::unique_ptr<API::InjectedBundle::FormClient> m_formClient;
1592     std::unique_ptr<API::InjectedBundle::PageLoaderClient> m_loaderClient;
1593     InjectedBundlePagePolicyClient m_policyClient;
1594     std::unique_ptr<API::InjectedBundle::ResourceLoadClient> m_resourceLoadClient;
1595     std::unique_ptr<API::InjectedBundle::PageUIClient> m_uiClient;
1596 #if ENABLE(FULLSCREEN_API)
1597     InjectedBundlePageFullScreenClient m_fullScreenClient;
1598 #endif
1599
1600     UniqueRef<FindController> m_findController;
1601
1602     RefPtr<WebInspector> m_inspector;
1603     RefPtr<WebInspectorUI> m_inspectorUI;
1604     RefPtr<RemoteWebInspectorUI> m_remoteInspectorUI;
1605     std::unique_ptr<WebPageInspectorTargetController> m_inspectorTargetController;
1606
1607 #if (PLATFORM(IOS_FAMILY) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
1608     RefPtr<PlaybackSessionManager> m_playbackSessionManager;
1609     RefPtr<VideoFullscreenManager> m_videoFullscreenManager;
1610 #endif
1611
1612 #if PLATFORM(IOS_FAMILY)
1613     bool m_allowsMediaDocumentInlinePlayback { false };
1614     RefPtr<WebCore::Range> m_startingGestureRange;
1615 #endif
1616
1617 #if ENABLE(FULLSCREEN_API)
1618     RefPtr<WebFullScreenManager> m_fullScreenManager;
1619 #endif
1620
1621     RefPtr<WebPopupMenu> m_activePopupMenu;
1622
1623 #if ENABLE(CONTEXT_MENUS)
1624     RefPtr<WebContextMenu> m_contextMenu;
1625 #endif
1626
1627 #if ENABLE(INPUT_TYPE_COLOR)
1628     WebColorChooser* m_activeColorChooser { nullptr };
1629 #endif
1630
1631 #if ENABLE(DATALIST_ELEMENT)
1632     WebDataListSuggestionPicker* m_activeDataListSuggestionPicker { nullptr };
1633 #endif
1634
1635     RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener;
1636     RefPtr<NotificationPermissionRequestManager> m_notificationPermissionRequestManager;
1637
1638     Ref<WebUserContentController> m_userContentController;
1639
1640 #if ENABLE(GEOLOCATION)
1641     UniqueRef<GeolocationPermissionRequestManager> m_geolocationPermissionRequestManager;
1642 #endif
1643
1644 #if ENABLE(MEDIA_STREAM)
1645     UniqueRef<UserMediaPermissionRequestManager> m_userMediaPermissionRequestManager;
1646 #endif
1647
1648     std::unique_ptr<WebCore::PrintContext> m_printContext;
1649 #if PLATFORM(GTK)
1650     RefPtr<WebPrintOperationGtk> m_printOperation;
1651 #endif
1652
1653     SandboxExtensionTracker m_sandboxExtensionTracker;
1654
1655     RefPtr<SandboxExtension> m_pendingDropSandboxExtension;
1656     Vector<RefPtr<SandboxExtension>> m_pendingDropExtensionsForFileUpload;
1657
1658     PAL::HysteresisActivity m_pageScrolledHysteresis;
1659
1660     bool m_canRunBeforeUnloadConfirmPanel { false };
1661
1662     bool m_canRunModal { false };
1663     bool m_isRunningModal { false };
1664
1665 #if ENABLE(DRAG_SUPPORT)
1666     bool m_isStartingDrag { false };
1667 #endif
1668
1669     bool m_cachedMainFrameIsPinnedToLeftSide { true };
1670     bool m_cachedMainFrameIsPinnedToRightSide { true };
1671     bool m_cachedMainFrameIsPinnedToTopSide { true };
1672     bool m_cachedMainFrameIsPinnedToBottomSide { true };
1673     bool m_canShortCircuitHorizontalWheelEvents { false };
1674     bool m_hasWheelEventHandlers { false };
1675
1676     unsigned m_cachedPageCount { 0 };
1677
1678     HashSet<unsigned long> m_trackedNetworkResourceRequestIdentifiers;
1679
1680     WebCore::IntSize m_viewLayoutSize;
1681     bool m_autoSizingShouldExpandToViewHeight { false };
1682     Optional<WebCore::IntSize> m_viewportSizeForCSSViewportUnits;
1683
1684     bool m_userIsInteracting { false };
1685     bool m_isFocusingElementDueToUserInteraction { false };
1686     bool m_hasEverFocusedElementDueToUserInteractionSincePageTransition { false };
1687     bool m_needsHiddenContentEditableQuirk { false };
1688     bool m_needsPlainTextQuirk { false };
1689     bool m_changingActivityState { false };
1690
1691 #if ENABLE(CONTEXT_MENUS)
1692     bool m_isShowingContextMenu { false };
1693 #endif
1694
1695     RefPtr<WebCore::Element> m_focusedElement;
1696     bool m_hasPendingBlurNotification { false };
1697     bool m_hasPendingEditorStateUpdate { false };
1698     
1699 #if PLATFORM(IOS_FAMILY)
1700     RefPtr<WebCore::Range> m_currentWordRange;
1701     RefPtr<WebCore::Node> m_interactionNode;
1702     WebCore::IntPoint m_lastInteractionLocation;
1703     
1704     enum SelectionAnchor { Start, End };
1705     SelectionAnchor m_selectionAnchor { Start };
1706
1707     RefPtr<WebCore::Node> m_potentialTapNode;
1708     WebCore::FloatPoint m_potentialTapLocation;
1709     RefPtr<WebCore::SecurityOrigin> m_potentialTapSecurityOrigin;
1710
1711     WebCore::ViewportConfiguration m_viewportConfiguration;
1712     bool m_hasReceivedVisibleContentRectsAfterDidCommitLoad { false };
1713     bool m_scaleWasSetByUIProcess { false };
1714     bool m_userHasChangedPageScaleFactor { false };
1715     bool m_hasStablePageScaleFactor { true };
1716     bool m_useTestingViewportConfiguration { false };
1717     bool m_isInStableState { true };
1718     bool m_forceAlwaysUserScalable { false };
1719     MonotonicTime m_oldestNonStableUpdateVisibleContentRectsTimestamp;
1720     Seconds m_estimatedLatency { 0 };
1721     WebCore::FloatSize m_screenSize;
1722     WebCore::FloatSize m_availableScreenSize;
1723     WebCore::FloatSize m_overrideScreenSize;
1724     RefPtr<WebCore::Range> m_currentBlockSelection;
1725     WebCore::IntRect m_blockRectForTextSelection;
1726
1727     RefPtr<WebCore::Range> m_initialSelection;
1728     WebCore::VisibleSelection m_storedSelectionForAccessibility { WebCore::VisibleSelection() };
1729     WebCore::IntSize m_blockSelectionDesiredSize;
1730     WebCore::FloatSize m_maximumUnobscuredSize;
1731     int32_t m_deviceOrientation { 0 };
1732     bool m_inDynamicSizeUpdate { false };
1733     HashMap<std::pair<WebCore::IntSize, double>, WebCore::IntPoint> m_dynamicSizeUpdateHistory;
1734     RefPtr<WebCore::Node> m_pendingSyntheticClickNode;
1735     WebCore::FloatPoint m_pendingSyntheticClickLocation;
1736     WebCore::FloatRect m_previousExposedContentRect;
1737     FocusedElementIdentifier m_currentFocusedElementIdentifier { 0 };
1738     Optional<DynamicViewportSizeUpdateID> m_pendingDynamicViewportSizeUpdateID;
1739     double m_lastTransactionPageScaleFactor { 0 };
1740     uint64_t m_lastTransactionIDWithScaleChange { 0 };
1741 #endif
1742
1743     WebCore::Timer m_layerVolatilityTimer;
1744     Vector<WTF::Function<void (bool)>> m_markLayersAsVolatileCompletionHandlers;
1745     bool m_isSuspendedUnderLock { false };
1746
1747     HashSet<String, ASCIICaseInsensitiveHash> m_mimeTypesWithCustomContentProviders;
1748     WebCore::Color m_backgroundColor { WebCore::Color::white };
1749
1750     HashSet<unsigned> m_activeRenderingSuppressionTokens;
1751     unsigned m_maximumRenderingSuppressionToken { 0 };
1752     
1753     WebCore::ScrollPinningBehavior m_scrollPinningBehavior { WebCore::DoNotPin };
1754     Optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle;
1755
1756     bool m_useAsyncScrolling { false };
1757
1758     OptionSet<WebCore::ActivityState::Flag> m_activityState;
1759
1760     bool m_processSuppressionEnabled;
1761     UserActivity m_userActivity;
1762     PAL::HysteresisActivity m_userActivityHysteresis;
1763
1764     uint64_t m_pendingNavigationID { 0 };
1765     Optional<WebsitePoliciesData> m_pendingWebsitePolicies;
1766
1767     bool m_mainFrameProgressCompleted { false };
1768     bool m_shouldDispatchFakeMouseMoveEvents { true };
1769     bool m_isEditorStateMissingPostLayoutData { false };
1770     bool m_isSelectingTextWhileInsertingAsynchronously { false };
1771
1772     enum class EditorStateIsContentEditable { No, Yes, Unset };
1773     mutable EditorStateIsContentEditable m_lastEditorStateWasContentEditable { EditorStateIsContentEditable::Unset };
1774
1775 #if PLATFORM(GTK)
1776     bool m_inputMethodEnabled { false };
1777 #endif
1778
1779 #if ENABLE(VIDEO) && USE(GSTREAMER)
1780     RefPtr<WebCore::MediaPlayerRequestInstallMissingPluginsCallback> m_installMediaPluginsCallback;
1781 #endif
1782
1783 #if USE(OS_STATE)
1784     WallTime m_loadCommitTime;
1785 #endif
1786
1787     WebCore::UserInterfaceLayoutDirection m_userInterfaceLayoutDirection { WebCore::UserInterfaceLayoutDirection::LTR };
1788
1789     const String m_overrideContentSecurityPolicy;
1790     const Optional<double> m_cpuLimit;
1791
1792     HashMap<String, RefPtr<WebURLSchemeHandlerProxy>> m_schemeToURLSchemeHandlerProxyMap;
1793     HashMap<uint64_t, WebURLSchemeHandlerProxy*> m_identifierToURLSchemeHandlerProxyMap;
1794
1795     HashMap<uint64_t, WTF::Function<void(bool granted)>> m_storageAccessResponseCallbackMap;
1796     HashMap<ShareSheetCallbackID, WTF::Function<void(bool completed)>> m_shareSheetResponseCallbackMap;
1797
1798 #if ENABLE(APPLICATION_MANIFEST)
1799     HashMap<uint64_t, uint64_t> m_applicationManifestFetchCallbackMap;
1800 #endif
1801
1802     OptionSet<LayerTreeFreezeReason> m_LayerTreeFreezeReasons;
1803     bool m_isSuspended { false };
1804     bool m_needsFontAttributes { false };
1805 #if PLATFORM(MAC)
1806     bool m_shouldAttachDrawingAreaOnPageTransition { false };
1807 #endif
1808 };
1809
1810 } // namespace WebKit
1811