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