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