Unreviewed, rolling out r207443.
[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&);
848     bool canPluginHandleResponse(const WebCore::ResourceResponse& response);
849
850     bool asynchronousPluginInitializationEnabled() const { return m_asynchronousPluginInitializationEnabled; }
851     void setAsynchronousPluginInitializationEnabled(bool enabled) { m_asynchronousPluginInitializationEnabled = enabled; }
852     bool asynchronousPluginInitializationEnabledForAllPlugins() const { return m_asynchronousPluginInitializationEnabledForAllPlugins; }
853     void setAsynchronousPluginInitializationEnabledForAllPlugins(bool enabled) { m_asynchronousPluginInitializationEnabledForAllPlugins = enabled; }
854     bool artificialPluginInitializationDelayEnabled() const { return m_artificialPluginInitializationDelayEnabled; }
855     void setArtificialPluginInitializationDelayEnabled(bool enabled) { m_artificialPluginInitializationDelayEnabled = enabled; }
856     void setTabToLinksEnabled(bool enabled) { m_tabToLinks = enabled; }
857     bool tabToLinksEnabled() const { return m_tabToLinks; }
858
859     bool scrollingPerformanceLoggingEnabled() const { return m_scrollingPerformanceLoggingEnabled; }
860     void setScrollingPerformanceLoggingEnabled(bool);
861
862 #if PLATFORM(COCOA)
863     bool shouldUsePDFPlugin() const;
864     bool pdfPluginEnabled() const { return m_pdfPluginEnabled; }
865     void setPDFPluginEnabled(bool enabled) { m_pdfPluginEnabled = enabled; }
866
867     NSDictionary *dataDetectionContext() const { return m_dataDetectionContext.get(); }
868 #endif
869
870     void savePDFToFileInDownloadsFolder(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size);
871 #if PLATFORM(COCOA)
872     void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
873 #endif
874
875     bool mainFrameIsScrollable() const { return m_mainFrameIsScrollable; }
876
877     void setMinimumLayoutSize(const WebCore::IntSize&);
878     WebCore::IntSize minimumLayoutSize() const { return m_minimumLayoutSize; }
879
880     void setAutoSizingShouldExpandToViewHeight(bool shouldExpand);
881     bool autoSizingShouldExpandToViewHeight() { return m_autoSizingShouldExpandToViewHeight; }
882
883     bool canShowMIMEType(const String& MIMEType) const;
884
885     void addTextCheckingRequest(uint64_t requestID, PassRefPtr<WebCore::TextCheckingRequest>);
886     void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
887     void didCancelCheckingText(uint64_t requestID);
888
889 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
890     void determinePrimarySnapshottedPlugIn();
891     void determinePrimarySnapshottedPlugInTimerFired();
892     void resetPrimarySnapshottedPlugIn();
893     bool matchesPrimaryPlugIn(const String& pageOrigin, const String& pluginOrigin, const String& mimeType) const;
894     bool plugInIntersectsSearchRect(WebCore::HTMLPlugInImageElement& pluginImageElement);
895     bool plugInIsPrimarySize(WebCore::HTMLPlugInImageElement& pluginImageElement, unsigned &pluginArea);
896 #endif
897
898 #if ENABLE(DATA_DETECTION)
899     void setDataDetectionResults(NSArray *);
900 #endif
901
902     unsigned extendIncrementalRenderingSuppression();
903     void stopExtendingIncrementalRenderingSuppression(unsigned token);
904     bool shouldExtendIncrementalRenderingSuppression() { return !m_activeRenderingSuppressionTokens.isEmpty(); }
905
906     WebCore::ScrollPinningBehavior scrollPinningBehavior() { return m_scrollPinningBehavior; }
907     void setScrollPinningBehavior(uint32_t /* WebCore::ScrollPinningBehavior */ pinning);
908
909     WTF::Optional<WebCore::ScrollbarOverlayStyle> scrollbarOverlayStyle() { return m_scrollbarOverlayStyle; }
910     void setScrollbarOverlayStyle(WTF::Optional<uint32_t /* WebCore::ScrollbarOverlayStyle */> scrollbarStyle);
911
912     Ref<WebCore::DocumentLoader> createDocumentLoader(WebCore::Frame&, const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
913     void updateCachedDocumentLoader(WebDocumentLoader&, WebCore::Frame&);
914
915     void getBytecodeProfile(uint64_t callbackID);
916     void getSamplingProfilerOutput(uint64_t callbackID);
917     
918 #if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION)
919     void handleTelephoneNumberClick(const String& number, const WebCore::IntPoint&);
920     void handleSelectionServiceClick(WebCore::FrameSelection&, const Vector<String>& telephoneNumbers, const WebCore::IntPoint&);
921 #endif
922
923     void didChangeScrollOffsetForFrame(WebCore::Frame*);
924
925     void setMainFrameProgressCompleted(bool completed) { m_mainFrameProgressCompleted = completed; }
926     bool shouldDispatchFakeMouseMoveEvents() const { return m_shouldDispatchFakeMouseMoveEvents; }
927
928     void setPageActivityState(WebCore::PageActivityState::Flags);
929     void setPageSuppressed(bool);
930
931     void postMessage(const String& messageName, API::Object* messageBody);
932     void postSynchronousMessageForTesting(const String& messageName, API::Object* messageBody, RefPtr<API::Object>& returnData);
933
934 #if PLATFORM(GTK)
935     void setInputMethodState(bool);
936 #endif
937
938     void imageOrMediaDocumentSizeChanged(const WebCore::IntSize&);
939 #if ENABLE(VIDEO)
940 #if USE(GSTREAMER)
941     void requestInstallMissingMediaPlugins(const String& details, const String& description, WebCore::MediaPlayerRequestInstallMissingPluginsCallback&);
942 #endif
943 #endif
944
945     void addUserScript(const String& source, WebCore::UserContentInjectedFrames, WebCore::UserScriptInjectionTime);
946     void addUserStyleSheet(const String& source, WebCore::UserContentInjectedFrames);
947     void removeAllUserContent();
948
949     void dispatchDidReachLayoutMilestone(WebCore::LayoutMilestones);
950
951     void didRestoreScrollPosition();
952
953     bool isControlledByAutomation() const;
954     void setControlledByAutomation(bool);
955
956     void insertNewlineInQuotedContent();
957
958 #if USE(OS_STATE)
959     std::chrono::system_clock::time_point loadCommitTime() const { return m_loadCommitTime; }
960 #endif
961
962 #if ENABLE(GAMEPAD)
963     void gamepadActivity(const Vector<GamepadData>&);
964 #endif
965
966 private:
967     WebPage(uint64_t pageID, const WebPageCreationParameters&);
968
969     // IPC::MessageSender
970     IPC::Connection* messageSenderConnection() override;
971     uint64_t messageSenderDestinationID() override;
972
973     void platformInitialize();
974     void platformDetach();
975     void platformEditorState(WebCore::Frame&, EditorState& result, IncludePostLayoutDataHint) const;
976
977     void didReceiveWebPageMessage(IPC::Connection&, IPC::Decoder&);
978     void didReceiveSyncWebPageMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&);
979
980 #if PLATFORM(IOS)
981     void resetViewportDefaultConfiguration(WebFrame* mainFrame);
982     void viewportConfigurationChanged();
983     void updateViewportSizeForCSSViewportUnits();
984
985     static void convertSelectionRectsToRootView(WebCore::FrameView*, Vector<WebCore::SelectionRect>&);
986     PassRefPtr<WebCore::Range> rangeForWebSelectionAtPosition(const WebCore::IntPoint&, const WebCore::VisiblePosition&, SelectionFlags&);
987     PassRefPtr<WebCore::Range> rangeForBlockAtPoint(const WebCore::IntPoint&);
988     void computeExpandAndShrinkThresholdsForHandle(const WebCore::IntPoint&, SelectionHandlePosition, float& growThreshold, float& shrinkThreshold);
989     PassRefPtr<WebCore::Range> changeBlockSelection(const WebCore::IntPoint&, SelectionHandlePosition, float& growThreshold, float& shrinkThreshold, SelectionFlags&);
990     PassRefPtr<WebCore::Range> expandedRangeFromHandle(WebCore::Range*, SelectionHandlePosition);
991     PassRefPtr<WebCore::Range> contractedRangeFromHandle(WebCore::Range* currentRange, SelectionHandlePosition, SelectionFlags&);
992     void getAssistedNodeInformation(AssistedNodeInformation&);
993     void platformInitializeAccessibility();
994     void handleSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location);
995     void completeSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location, WebCore::SyntheticClickType);
996     void sendTapHighlightForNodeIfNecessary(uint64_t requestID, WebCore::Node*);
997     void resetTextAutosizing();
998     WebCore::VisiblePosition visiblePositionInFocusedNodeForPoint(const WebCore::Frame&, const WebCore::IntPoint&, bool isInteractingWithAssistedNode);
999     PassRefPtr<WebCore::Range> rangeForGranularityAtPoint(const WebCore::Frame&, const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithAssistedNode);
1000     bool shouldSwitchToBlockModeForHandle(const WebCore::IntPoint& handlePoint, SelectionHandlePosition);
1001     RefPtr<WebCore::Range> switchToBlockSelectionAtPoint(const WebCore::IntPoint&, SelectionHandlePosition);
1002 #endif
1003 #if !PLATFORM(COCOA)
1004     static const char* interpretKeyEvent(const WebCore::KeyboardEvent*);
1005 #endif
1006     bool performDefaultBehaviorForKeyEvent(const WebKeyboardEvent&);
1007
1008 #if PLATFORM(MAC)
1009     bool executeKeypressCommandsInternal(const Vector<WebCore::KeypressCommand>&, WebCore::KeyboardEvent*);
1010 #endif
1011
1012     bool markLayersVolatileImmediatelyIfPossible();
1013     void layerVolatilityTimerFired();
1014     void callVolatilityCompletionHandlers();
1015
1016     String sourceForFrame(WebFrame*);
1017
1018     void loadDataImpl(uint64_t navigationID, PassRefPtr<WebCore::SharedBuffer>, const String& MIMEType, const String& encodingName, const WebCore::URL& baseURL, const WebCore::URL& failingURL, const UserData&);
1019     void loadStringImpl(uint64_t navigationID, const String&, const String& MIMEType, const WebCore::URL& baseURL, const WebCore::URL& failingURL, const UserData&);
1020
1021     bool platformHasLocalDataForURL(const WebCore::URL&);
1022
1023     // Actions
1024     void tryClose();
1025     void platformDidReceiveLoadParameters(const LoadParameters&);
1026     void loadRequest(const LoadParameters&);
1027     void loadData(const LoadParameters&);
1028     void loadString(const LoadParameters&);
1029     void loadAlternateHTMLString(const LoadParameters&);
1030     void navigateToPDFLinkWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint);
1031     void reload(uint64_t navigationID, bool reloadFromOrigin, bool contentBlockersEnabled, const SandboxExtension::Handle&);
1032     void goForward(uint64_t navigationID, uint64_t);
1033     void goBack(uint64_t navigationID, uint64_t);
1034     void goToBackForwardItem(uint64_t navigationID, uint64_t);
1035     void tryRestoreScrollPosition();
1036     void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, uint64_t callbackID);
1037     void updateIsInWindow(bool isInitialState = false);
1038     void setViewState(WebCore::ViewState::Flags, bool wantsDidUpdateViewState, const Vector<uint64_t>& callbackIDs);
1039     void validateCommand(const String&, uint64_t);
1040     void executeEditCommand(const String&, const String&);
1041     void setEditable(bool);
1042
1043     void mouseEvent(const WebMouseEvent&);
1044     void keyEvent(const WebKeyboardEvent&);
1045 #if ENABLE(IOS_TOUCH_EVENTS)
1046     void touchEventSync(const WebTouchEvent&, bool& handled);
1047 #elif ENABLE(TOUCH_EVENTS)
1048     void touchEvent(const WebTouchEvent&);
1049 #endif
1050 #if ENABLE(CONTEXT_MENUS)
1051     void contextMenuHidden() { m_isShowingContextMenu = false; }
1052 #endif
1053
1054     static bool scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity);
1055     static bool logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity);
1056
1057     void loadURLInFrame(const String&, uint64_t frameID);
1058
1059     enum class WasRestoredByAPIRequest { No, Yes };
1060     void restoreSessionInternal(const Vector<BackForwardListItemState>&, WasRestoredByAPIRequest);
1061     void restoreSession(const Vector<BackForwardListItemState>&);
1062     void didRemoveBackForwardItem(uint64_t);
1063
1064 #if ENABLE(REMOTE_INSPECTOR)
1065     void setAllowsRemoteInspection(bool);
1066     void setRemoteInspectionNameOverride(const String&);
1067 #endif
1068
1069     void setDrawsBackground(bool);
1070
1071 #if PLATFORM(COCOA)
1072     void setTopContentInsetFenced(float, IPC::Attachment);
1073 #endif
1074     void setTopContentInset(float);
1075
1076     void viewWillStartLiveResize();
1077     void viewWillEndLiveResize();
1078
1079     void getContentsAsString(uint64_t callbackID);
1080 #if ENABLE(MHTML)
1081     void getContentsAsMHTMLData(uint64_t callbackID);
1082 #endif
1083     void getMainResourceDataOfFrame(uint64_t frameID, uint64_t callbackID);
1084     void getResourceDataFromFrame(uint64_t frameID, const String& resourceURL, uint64_t callbackID);
1085     void getRenderTreeExternalRepresentation(uint64_t callbackID);
1086     void getSelectionOrContentsAsString(uint64_t callbackID);
1087     void getSelectionAsWebArchiveData(uint64_t callbackID);
1088     void getSourceForFrame(uint64_t frameID, uint64_t callbackID);
1089     void getWebArchiveOfFrame(uint64_t frameID, uint64_t callbackID);
1090     void runJavaScriptInMainFrame(const String&, uint64_t callbackID);
1091     void forceRepaint(uint64_t callbackID);
1092     void takeSnapshot(WebCore::IntRect snapshotRect, WebCore::IntSize bitmapSize, uint32_t options, uint64_t callbackID);
1093
1094     void preferencesDidChange(const WebPreferencesStore&);
1095     void platformPreferencesDidChange(const WebPreferencesStore&);
1096     void updatePreferences(const WebPreferencesStore&);
1097
1098     void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t navigationID, DownloadID);
1099     void setUserAgent(const String&);
1100     void setCustomTextEncodingName(const String&);
1101     void suspendActiveDOMObjectsAndAnimations();
1102     void resumeActiveDOMObjectsAndAnimations();
1103
1104 #if PLATFORM(COCOA)
1105     void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
1106     void performDictionaryLookupOfCurrentSelection();
1107     void performDictionaryLookupForRange(WebCore::Frame*, WebCore::Range&, NSDictionary *options, WebCore::TextIndicatorPresentationTransition);
1108     WebCore::DictionaryPopupInfo dictionaryPopupInfoForRange(WebCore::Frame*, WebCore::Range&, NSDictionary **options, WebCore::TextIndicatorPresentationTransition);
1109 #if ENABLE(PDFKIT_PLUGIN)
1110     WebCore::DictionaryPopupInfo dictionaryPopupInfoForSelectionInPDFPlugin(PDFSelection *, PDFPlugin&, NSDictionary **options, WebCore::TextIndicatorPresentationTransition);
1111 #endif
1112
1113     void windowAndViewFramesChanged(const WebCore::FloatRect& windowFrameInScreenCoordinates, const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates, const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
1114
1115     RetainPtr<PDFDocument> pdfDocumentForPrintingFrame(WebCore::Frame*);
1116     void computePagesForPrintingPDFDocument(uint64_t frameID, const PrintInfo&, Vector<WebCore::IntRect>& resultPageRects);
1117     void drawPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, const WebCore::IntRect&);
1118     void drawPagesToPDFFromPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, uint32_t first, uint32_t count);
1119 #endif
1120
1121     void setMainFrameIsScrollable(bool);
1122
1123     void unapplyEditCommand(uint64_t commandID);
1124     void reapplyEditCommand(uint64_t commandID);
1125     void didRemoveEditCommand(uint64_t commandID);
1126
1127     void findString(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1128     void findStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1129     void getImageForFindMatch(uint32_t matchIndex);
1130     void selectFindMatch(uint32_t matchIndex);
1131     void hideFindUI();
1132     void countStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1133
1134 #if USE(COORDINATED_GRAPHICS)
1135     void sendViewportAttributesChanged(const WebCore::ViewportArguments&);
1136 #endif
1137
1138 #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
1139     void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize& area);
1140 #endif
1141
1142     void didChangeSelectedIndexForActivePopupMenu(int32_t newIndex);
1143     void setTextForActivePopupMenu(int32_t index);
1144
1145 #if PLATFORM(GTK)
1146     void failedToShowPopupMenu();
1147 #endif
1148
1149 #if PLATFORM(IOS)
1150     void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const IPC::DataReference& iconData);
1151 #endif
1152     void didChooseFilesForOpenPanel(const Vector<String>&);
1153     void didCancelForOpenPanel();
1154 #if ENABLE(SANDBOX_EXTENSIONS)
1155     void extendSandboxForFileFromOpenPanel(const SandboxExtension::Handle&);
1156 #endif
1157
1158     void didReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed);
1159
1160     void didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed);
1161
1162 #if ENABLE(MEDIA_STREAM)
1163     void userMediaAccessWasGranted(uint64_t userMediaID, const String& audioDeviceUID, const String& videoDeviceUID);
1164     void userMediaAccessWasDenied(uint64_t userMediaID, uint64_t reason, String invalidConstraint);
1165
1166     void didCompleteMediaDeviceEnumeration(uint64_t userMediaID, const Vector<WebCore::CaptureDevice>& devices, const String& deviceIdentifierHashSalt, bool originHasPersistentAccess);
1167 #endif
1168
1169     void advanceToNextMisspelling(bool startBeforeSelection);
1170     void changeSpellingToWord(const String& word);
1171 #if USE(APPKIT)
1172     void uppercaseWord();
1173     void lowercaseWord();
1174     void capitalizeWord();
1175 #endif
1176
1177 #if ENABLE(CONTEXT_MENUS)
1178     void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&);
1179 #endif
1180
1181     void changeSelectedIndex(int32_t index);
1182     void setCanStartMediaTimerFired();
1183
1184     static bool platformCanHandleRequest(const WebCore::ResourceRequest&);
1185
1186     static PluginView* focusedPluginViewForFrame(WebCore::Frame&);
1187     static PluginView* pluginViewForFrame(WebCore::Frame*);
1188
1189     static PassRefPtr<WebCore::Range> rangeFromEditingRange(WebCore::Frame&, const EditingRange&, EditingRangeIsRelativeTo = EditingRangeIsRelativeTo::EditableRoot);
1190
1191     void reportUsedFeatures();
1192
1193 #if PLATFORM(MAC)
1194     void performImmediateActionHitTestAtLocation(WebCore::FloatPoint);
1195     RefPtr<WebCore::Range> lookupTextAtLocation(WebCore::FloatPoint, NSDictionary **options);
1196     void immediateActionDidUpdate();
1197     void immediateActionDidCancel();
1198     void immediateActionDidComplete();
1199     void setFont(const String& fontFamily, double fontSize, uint64_t fontTraits);
1200
1201     void dataDetectorsDidPresentUI(WebCore::PageOverlay::PageOverlayID);
1202     void dataDetectorsDidChangeUI(WebCore::PageOverlay::PageOverlayID);
1203     void dataDetectorsDidHideUI(WebCore::PageOverlay::PageOverlayID);
1204
1205     void handleAcceptedCandidate(WebCore::TextCheckingResult);
1206     void requestActiveNowPlayingSessionInfo();
1207 #endif
1208
1209     void setShouldDispatchFakeMouseMoveEvents(bool dispatch) { m_shouldDispatchFakeMouseMoveEvents = dispatch; }
1210
1211 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
1212     void playbackTargetSelected(uint64_t, const WebCore::MediaPlaybackTargetContext& outputDevice) const;
1213     void playbackTargetAvailabilityDidChange(uint64_t, bool);
1214     void setShouldPlayToPlaybackTarget(uint64_t, bool);
1215 #endif
1216
1217     void clearWheelEventTestTrigger();
1218
1219     void setShouldScaleViewToFitDocument(bool);
1220
1221     void pageStoppedScrolling();
1222
1223 #if ENABLE(VIDEO) && USE(GSTREAMER)
1224     void didEndRequestInstallMissingMediaPlugins(uint32_t result);
1225 #endif
1226
1227     void setResourceCachingDisabled(bool);
1228     void setUserInterfaceLayoutDirection(uint32_t);
1229
1230     uint64_t m_pageID;
1231
1232     std::unique_ptr<WebCore::Page> m_page;
1233     RefPtr<WebFrame> m_mainFrame;
1234     RefPtr<InjectedBundleBackForwardList> m_backForwardList;
1235
1236     RefPtr<WebPageGroupProxy> m_pageGroup;
1237
1238     String m_userAgent;
1239
1240     WebCore::IntSize m_viewSize;
1241     std::unique_ptr<DrawingArea> m_drawingArea;
1242
1243     HashSet<PluginView*> m_pluginViews;
1244     bool m_hasSeenPlugin;
1245
1246     HashMap<uint64_t, RefPtr<WebCore::TextCheckingRequest>> m_pendingTextCheckingRequestMap;
1247
1248     bool m_useFixedLayout;
1249
1250     bool m_drawsBackground;
1251
1252     WebCore::Color m_underlayColor;
1253
1254     bool m_isInRedo;
1255     bool m_isClosed;
1256
1257     bool m_tabToLinks;
1258     
1259     bool m_asynchronousPluginInitializationEnabled;
1260     bool m_asynchronousPluginInitializationEnabledForAllPlugins;
1261     bool m_artificialPluginInitializationDelayEnabled;
1262
1263     bool m_scrollingPerformanceLoggingEnabled;
1264
1265     bool m_mainFrameIsScrollable;
1266
1267 #if PLATFORM(IOS)
1268     bool m_ignoreViewportScalingConstraints { false };
1269 #endif
1270
1271 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
1272     bool m_readyToFindPrimarySnapshottedPlugin;
1273     bool m_didFindPrimarySnapshottedPlugin;
1274     unsigned m_numberOfPrimarySnapshotDetectionAttempts;
1275     String m_primaryPlugInPageOrigin;
1276     String m_primaryPlugInOrigin;
1277     String m_primaryPlugInMimeType;
1278     RunLoop::Timer<WebPage> m_determinePrimarySnapshottedPlugInTimer;
1279 #endif
1280
1281     // The layer hosting mode.
1282     LayerHostingMode m_layerHostingMode;
1283
1284 #if PLATFORM(COCOA)
1285     bool m_pdfPluginEnabled;
1286
1287     bool m_hasCachedWindowFrame;
1288
1289     // The frame of the containing window in screen coordinates.
1290     WebCore::FloatRect m_windowFrameInScreenCoordinates;
1291
1292     // The frame of the containing window in unflipped screen coordinates.
1293     WebCore::FloatRect m_windowFrameInUnflippedScreenCoordinates;
1294
1295     // The frame of the view in window coordinates.
1296     WebCore::FloatRect m_viewFrameInWindowCoordinates;
1297
1298     // The accessibility position of the view.
1299     WebCore::FloatPoint m_accessibilityPosition;
1300     
1301     RetainPtr<WKAccessibilityWebPageObject> m_mockAccessibilityElement;
1302
1303     ViewGestureGeometryCollector m_viewGestureGeometryCollector;
1304
1305     RetainPtr<NSDictionary> m_dataDetectionContext;
1306
1307 #elif HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
1308     GRefPtr<WebPageAccessibilityObject> m_accessibilityObject;
1309 #endif
1310
1311 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
1312     // Our view's window in the UI process.
1313     uint64_t m_nativeWindowHandle;
1314 #endif
1315
1316 #if !PLATFORM(IOS)
1317     RefPtr<PageBanner> m_headerBanner;
1318     RefPtr<PageBanner> m_footerBanner;
1319 #endif // !PLATFORM(IOS)
1320
1321     RunLoop::Timer<WebPage> m_setCanStartMediaTimer;
1322     bool m_mayStartMediaWhenInWindow;
1323
1324     HashMap<uint64_t, RefPtr<WebUndoStep>> m_undoStepMap;
1325
1326 #if ENABLE(CONTEXT_MENUS)
1327     std::unique_ptr<API::InjectedBundle::PageContextMenuClient> m_contextMenuClient;
1328 #endif
1329     InjectedBundlePageEditorClient m_editorClient;
1330     std::unique_ptr<API::InjectedBundle::FormClient> m_formClient;
1331     InjectedBundlePageLoaderClient m_loaderClient;
1332     InjectedBundlePagePolicyClient m_policyClient;
1333     InjectedBundlePageResourceLoadClient m_resourceLoadClient;
1334     std::unique_ptr<API::InjectedBundle::PageUIClient> m_uiClient;
1335 #if ENABLE(FULLSCREEN_API)
1336     InjectedBundlePageFullScreenClient m_fullScreenClient;
1337 #endif
1338     InjectedBundlePageDiagnosticLoggingClient m_logDiagnosticMessageClient;
1339
1340     FindController m_findController;
1341
1342     RefPtr<WebInspector> m_inspector;
1343     RefPtr<WebInspectorUI> m_inspectorUI;
1344     RefPtr<RemoteWebInspectorUI> m_remoteInspectorUI;
1345
1346 #if (PLATFORM(IOS) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
1347     RefPtr<WebPlaybackSessionManager> m_playbackSessionManager;
1348     RefPtr<WebVideoFullscreenManager> m_videoFullscreenManager;
1349 #endif
1350 #if PLATFORM(IOS)
1351     bool m_allowsMediaDocumentInlinePlayback { false };
1352 #endif
1353 #if ENABLE(FULLSCREEN_API)
1354     RefPtr<WebFullScreenManager> m_fullScreenManager;
1355 #endif
1356     RefPtr<WebPopupMenu> m_activePopupMenu;
1357 #if ENABLE(CONTEXT_MENUS)
1358     RefPtr<WebContextMenu> m_contextMenu;
1359 #endif
1360 #if ENABLE(INPUT_TYPE_COLOR)
1361     WebColorChooser* m_activeColorChooser;
1362 #endif
1363     RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener;
1364     RefPtr<NotificationPermissionRequestManager> m_notificationPermissionRequestManager;
1365
1366     Ref<WebUserContentController> m_userContentController;
1367
1368 #if ENABLE(GEOLOCATION)
1369     GeolocationPermissionRequestManager m_geolocationPermissionRequestManager;
1370 #endif
1371
1372 #if ENABLE(MEDIA_STREAM)
1373     UserMediaPermissionRequestManager m_userMediaPermissionRequestManager;
1374 #endif
1375
1376     std::unique_ptr<WebCore::PrintContext> m_printContext;
1377 #if PLATFORM(GTK)
1378     RefPtr<WebPrintOperationGtk> m_printOperation;
1379 #endif
1380
1381     SandboxExtensionTracker m_sandboxExtensionTracker;
1382
1383     RefPtr<SandboxExtension> m_pendingDropSandboxExtension;
1384     Vector<RefPtr<SandboxExtension>> m_pendingDropExtensionsForFileUpload;
1385
1386     WebCore::HysteresisActivity m_pageScrolledHysteresis;
1387
1388     bool m_canRunBeforeUnloadConfirmPanel;
1389
1390     bool m_canRunModal;
1391     bool m_isRunningModal;
1392
1393 #if ENABLE(DRAG_SUPPORT)
1394     bool m_isStartingDrag;
1395 #endif
1396
1397     bool m_cachedMainFrameIsPinnedToLeftSide;
1398     bool m_cachedMainFrameIsPinnedToRightSide;
1399     bool m_cachedMainFrameIsPinnedToTopSide;
1400     bool m_cachedMainFrameIsPinnedToBottomSide;
1401     bool m_canShortCircuitHorizontalWheelEvents;
1402     bool m_hasWheelEventHandlers;
1403
1404     unsigned m_cachedPageCount;
1405
1406     HashSet<unsigned long> m_trackedNetworkResourceRequestIdentifiers;
1407
1408     WebCore::IntSize m_minimumLayoutSize;
1409     bool m_autoSizingShouldExpandToViewHeight;
1410
1411     bool m_userIsInteracting;
1412     bool m_isAssistingNodeDueToUserInteraction { false };
1413     bool m_hasEverFocusedElementDueToUserInteractionSincePageTransition { false };
1414     bool m_needsHiddenContentEditableQuirk { false };
1415     bool m_needsPlainTextQuirk { false };
1416
1417 #if ENABLE(CONTEXT_MENUS)
1418     bool m_isShowingContextMenu;
1419 #endif
1420
1421     RefPtr<WebCore::Node> m_assistedNode;
1422     bool m_hasPendingBlurNotification;
1423     
1424 #if PLATFORM(IOS)
1425     RefPtr<WebCore::Range> m_currentWordRange;
1426     RefPtr<WebCore::Node> m_interactionNode;
1427     WebCore::IntPoint m_lastInteractionLocation;
1428     
1429     enum SelectionAnchor {
1430         Start,
1431         End
1432     };
1433     SelectionAnchor m_selectionAnchor;
1434
1435     RefPtr<WebCore::Node> m_potentialTapNode;
1436     WebCore::FloatPoint m_potentialTapLocation;
1437
1438     WebCore::ViewportConfiguration m_viewportConfiguration;
1439     bool m_hasReceivedVisibleContentRectsAfterDidCommitLoad;
1440     bool m_scaleWasSetByUIProcess;
1441     bool m_userHasChangedPageScaleFactor;
1442     bool m_hasStablePageScaleFactor;
1443     bool m_useTestingViewportConfiguration;
1444     bool m_isInStableState;
1445     bool m_forceAlwaysUserScalable;
1446     std::chrono::milliseconds m_oldestNonStableUpdateVisibleContentRectsTimestamp;
1447     std::chrono::milliseconds m_estimatedLatency;
1448     WebCore::FloatSize m_screenSize;
1449     WebCore::FloatSize m_availableScreenSize;
1450     RefPtr<WebCore::Range> m_currentBlockSelection;
1451     WebCore::IntRect m_blockRectForTextSelection;
1452
1453     RefPtr<WebCore::Range> m_initialSelection;
1454     WebCore::IntSize m_blockSelectionDesiredSize;
1455     WebCore::FloatSize m_maximumUnobscuredSize;
1456     int32_t m_deviceOrientation;
1457     bool m_inDynamicSizeUpdate;
1458     HashMap<std::pair<WebCore::IntSize, double>, WebCore::IntPoint> m_dynamicSizeUpdateHistory;
1459     RefPtr<WebCore::Node> m_pendingSyntheticClickNode;
1460     WebCore::FloatPoint m_pendingSyntheticClickLocation;
1461     WebCore::FloatRect m_previousExposedContentRect;
1462 #endif
1463
1464     WebCore::Timer m_layerVolatilityTimer;
1465     Vector<std::function<void ()>> m_markLayersAsVolatileCompletionHandlers;
1466     bool m_isSuspendedUnderLock { false };
1467
1468     HashSet<String, ASCIICaseInsensitiveHash> m_mimeTypesWithCustomContentProviders;
1469     WebCore::Color m_backgroundColor;
1470
1471     HashSet<unsigned> m_activeRenderingSuppressionTokens;
1472     unsigned m_maximumRenderingSuppressionToken;
1473     
1474     WebCore::ScrollPinningBehavior m_scrollPinningBehavior;
1475     WTF::Optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle;
1476
1477     bool m_useAsyncScrolling;
1478
1479     WebCore::ViewState::Flags m_viewState;
1480
1481     UserActivity m_userActivity;
1482
1483     uint64_t m_pendingNavigationID;
1484
1485 #if ENABLE(WEBGL)
1486     WebCore::WebGLLoadPolicy m_systemWebGLPolicy;
1487 #endif
1488
1489     bool m_mainFrameProgressCompleted;
1490     bool m_shouldDispatchFakeMouseMoveEvents;
1491     bool m_isEditorStateMissingPostLayoutData { false };
1492     bool m_isGettingDictionaryPopupInfo { false };
1493     bool m_isSelectingTextWhileInsertingAsynchronously { false };
1494
1495     enum class EditorStateIsContentEditable { No, Yes, Unset };
1496     mutable EditorStateIsContentEditable m_lastEditorStateWasContentEditable { EditorStateIsContentEditable::Unset };
1497
1498 #if PLATFORM(GTK)
1499     bool m_inputMethodEnabled { false };
1500 #endif
1501
1502 #if ENABLE(VIDEO) && USE(GSTREAMER)
1503     RefPtr<WebCore::MediaPlayerRequestInstallMissingPluginsCallback> m_installMediaPluginsCallback;
1504 #endif
1505
1506 #if USE(OS_STATE)
1507     std::chrono::system_clock::time_point m_loadCommitTime;
1508 #endif
1509
1510     WebCore::UserInterfaceLayoutDirection m_userInterfaceLayoutDirection { WebCore::UserInterfaceLayoutDirection::LTR };
1511 };
1512
1513 } // namespace WebKit
1514