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