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