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