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