Have insertDictatedTextAsync() take an InsertTextOptions
[WebKit-https.git] / Source / WebKit / WebProcess / WebPage / WebPage.h
1 /*
2  * Copyright (C) 2010-2020 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #pragma once
27
28 #include "APIInjectedBundleEditorClient.h"
29 #include "APIInjectedBundleFormClient.h"
30 #include "APIInjectedBundlePageContextMenuClient.h"
31 #include "APIInjectedBundlePageLoaderClient.h"
32 #include "APIInjectedBundlePageResourceLoadClient.h"
33 #include "APIInjectedBundlePageUIClient.h"
34 #include "APIObject.h"
35 #include "CallbackID.h"
36 #include "ContentAsStringIncludesChildFrames.h"
37 #include "DrawingAreaInfo.h"
38 #include "EditingRange.h"
39 #include "FocusedElementInformation.h"
40 #include "InjectedBundlePageContextMenuClient.h"
41 #include "InjectedBundlePageFullScreenClient.h"
42 #include "InjectedBundlePagePolicyClient.h"
43 #include "LayerTreeContext.h"
44 #include "MessageReceiver.h"
45 #include "MessageSender.h"
46 #include "OptionalCallbackID.h"
47 #include "Plugin.h"
48 #include "PolicyDecision.h"
49 #include "SandboxExtension.h"
50 #include "ShareSheetCallbackID.h"
51 #include "SharedMemory.h"
52 #include "StorageNamespaceIdentifier.h"
53 #include "TransactionID.h"
54 #include "UserData.h"
55 #include "WebBackForwardListProxy.h"
56 #include "WebPageMessagesReplies.h"
57 #include "WebURLSchemeHandler.h"
58 #include "WebUndoStepID.h"
59 #include "WebUserContentController.h"
60 #include "WebsitePoliciesData.h"
61 #include <JavaScriptCore/InspectorFrontendChannel.h>
62 #include <WebCore/ActivityState.h>
63 #include <WebCore/DictionaryPopupInfo.h>
64 #include <WebCore/DisabledAdaptations.h>
65 #include <WebCore/DragActions.h>
66 #include <WebCore/FrameLoaderTypes.h>
67 #include <WebCore/HTMLMenuElement.h>
68 #include <WebCore/HTMLMenuItemElement.h>
69 #include <WebCore/IntRect.h>
70 #include <WebCore/IntSizeHash.h>
71 #include <WebCore/Page.h>
72 #include <WebCore/PageIdentifier.h>
73 #include <WebCore/PageOverlay.h>
74 #include <WebCore/PluginData.h>
75 #include <WebCore/PointerID.h>
76 #include <WebCore/RenderingMode.h>
77 #include <WebCore/SecurityPolicyViolationEvent.h>
78 #include <WebCore/ShareData.h>
79 #include <WebCore/TextManipulationController.h>
80 #include <WebCore/UserActivity.h>
81 #include <WebCore/UserContentTypes.h>
82 #include <WebCore/UserInterfaceLayoutDirection.h>
83 #include <WebCore/UserScriptTypes.h>
84 #include <WebCore/VisibilityState.h>
85 #include <WebCore/WebCoreKeyboardUIMode.h>
86 #include <memory>
87 #include <pal/HysteresisActivity.h>
88 #include <wtf/HashMap.h>
89 #include <wtf/MonotonicTime.h>
90 #include <wtf/RefPtr.h>
91 #include <wtf/RunLoop.h>
92 #include <wtf/Seconds.h>
93 #include <wtf/WallTime.h>
94 #include <wtf/text/WTFString.h>
95
96 #if ENABLE(ACCESSIBILITY) && USE(ATK)
97 typedef struct _AtkObject AtkObject;
98 #include <wtf/glib/GRefPtr.h>
99 #endif
100
101 #if PLATFORM(GTK)
102 #include "ArgumentCodersGtk.h"
103 #include "WebPrintOperationGtk.h"
104 #endif
105
106 #if PLATFORM(GTK) || PLATFORM(WPE)
107 #include "InputMethodState.h"
108 #endif
109
110 #if PLATFORM(IOS_FAMILY)
111 #include "GestureTypes.h"
112 #include <WebCore/IntPointHash.h>
113 #include <WebCore/WKContentObservation.h>
114 #endif
115
116 #if ENABLE(META_VIEWPORT)
117 #include <WebCore/ViewportConfiguration.h>
118 #endif
119
120 #if ENABLE(APPLICATION_MANIFEST)
121 #include <WebCore/ApplicationManifest.h>
122 #endif
123
124 #if ENABLE(IOS_TOUCH_EVENTS)
125 #include <WebKitAdditions/PlatformTouchEventIOS.h>
126 #elif ENABLE(TOUCH_EVENTS)
127 #include <WebCore/PlatformTouchEvent.h>
128 #endif
129
130 #if ENABLE(DATA_DETECTION)
131 #include <WebCore/DataDetection.h>
132 #endif
133
134 #if ENABLE(MAC_GESTURE_EVENTS)
135 #include <WebKitAdditions/PlatformGestureEventMac.h>
136 #endif
137
138 #if PLATFORM(COCOA)
139 #include "DynamicViewportSizeUpdate.h"
140 #include <WebCore/VisibleSelection.h>
141 #include <wtf/RetainPtr.h>
142 OBJC_CLASS CALayer;
143 OBJC_CLASS NSArray;
144 OBJC_CLASS NSDictionary;
145 OBJC_CLASS NSObject;
146 OBJC_CLASS WKAccessibilityWebPageObject;
147 #endif
148
149 #define ENABLE_VIEWPORT_RESIZING PLATFORM(IOS_FAMILY)
150
151 namespace API {
152 class Array;
153 }
154
155 namespace IPC {
156 class Connection;
157 class Decoder;
158 class FormDataReference;
159 class SharedBufferDataReference;
160 }
161
162 namespace WebCore {
163
164 class CaptureDevice;
165 class DocumentLoader;
166 class DragData;
167 class FontAttributeChanges;
168 class FontChanges;
169 class Frame;
170 class FrameSelection;
171 class FrameView;
172 class GraphicsContext;
173 class HTMLImageElement;
174 class HTMLMenuElement;
175 class HTMLMenuItemElement;
176 class HTMLPlugInElement;
177 class HTMLPlugInImageElement;
178 class IntPoint;
179 class KeyboardEvent;
180 class MediaPlaybackTargetContext;
181 class MediaPlayerRequestInstallMissingPluginsCallback;
182 class Page;
183 class PrintContext;
184 class Range;
185 class ResourceRequest;
186 class ResourceResponse;
187 class SelectionRect;
188 class SharedBuffer;
189 class SubstituteData;
190 class TextCheckingRequest;
191 class VisiblePosition;
192
193 enum SyntheticClickType : int8_t;
194 enum class DOMPasteAccessResponse : uint8_t;
195 enum class DragHandlingMethod : uint8_t;
196 enum class ShouldTreatAsContinuingLoad : bool;
197 enum class StorageAccessPromptWasShown : bool;
198 enum class StorageAccessWasGranted : bool;
199 enum class TextIndicatorPresentationTransition : uint8_t;
200 enum class WritingDirection : uint8_t;
201
202 struct BackForwardItemIdentifier;
203 struct CompositionHighlight;
204 struct CompositionUnderline;
205 struct DictationAlternative;
206 struct ElementContext;
207 struct GlobalFrameIdentifier;
208 struct GlobalWindowIdentifier;
209 struct Highlight;
210 struct KeypressCommand;
211 struct PromisedAttachmentInfo;
212 struct RunJavaScriptParameters;
213 struct TextCheckingResult;
214 struct ViewportArguments;
215
216 #if ENABLE(ATTACHMENT_ELEMENT)
217 class HTMLAttachmentElement;
218 #endif
219 }
220
221 namespace WebKit {
222
223 class DataReference;
224 class DrawingArea;
225 class DownloadID;
226 class FindController;
227 class GamepadData;
228 class GeolocationPermissionRequestManager;
229 class LayerHostingContext;
230 class MediaDeviceSandboxExtensions;
231 class NotificationPermissionRequestManager;
232 class PDFPlugin;
233 class PageBanner;
234 class PluginView;
235 class RemoteWebInspectorUI;
236 class TextCheckingControllerProxy;
237 class UserMediaPermissionRequestManager;
238 class ViewGestureGeometryCollector;
239 class WebColorChooser;
240 class WebContextMenu;
241 class WebContextMenuItemData;
242 class WebDataListSuggestionPicker;
243 class WebDocumentLoader;
244 class WebEvent;
245 class PlaybackSessionManager;
246 class VideoFullscreenManager;
247 class WebFrame;
248 class WebFullScreenManager;
249 class WebGestureEvent;
250 class WebImage;
251 class WebInspector;
252 class WebInspectorClient;
253 class WebInspectorUI;
254 class WebKeyboardEvent;
255 class WebMouseEvent;
256 class WebNotificationClient;
257 class WebOpenPanelResultListener;
258 class WebPageGroupProxy;
259 class WebPageInspectorTargetController;
260 class WebPageOverlay;
261 class WebPaymentCoordinator;
262 class WebPopupMenu;
263 class WebRemoteObjectRegistry;
264 class WebTouchEvent;
265 class WebURLSchemeHandlerProxy;
266 class WebUndoStep;
267 class WebUserContentController;
268 class WebWheelEvent;
269 class RemoteLayerTreeTransaction;
270
271 enum FindOptions : uint16_t;
272 enum class DragControllerAction : uint8_t;
273 enum class SyntheticEditingCommandType : uint8_t;
274
275 struct AttributedString;
276 struct BackForwardListItemState;
277 struct DataDetectionResult;
278 struct DocumentEditingContext;
279 struct DocumentEditingContextRequest;
280 struct EditorState;
281 struct FrameTreeNodeData;
282 struct FontInfo;
283 struct InsertTextOptions;
284 struct InteractionInformationAtPosition;
285 struct InteractionInformationRequest;
286 struct LoadParameters;
287 struct PrintInfo;
288 struct TextInputContext;
289 struct UserMessage;
290 struct WebAutocorrectionData;
291 struct WebAutocorrectionContext;
292 struct WebPageCreationParameters;
293 struct WebPreferencesStore;
294 struct WebSelectionData;
295 struct WebsitePoliciesData;
296
297 #if ENABLE(UI_SIDE_COMPOSITING)
298 class VisibleContentRectUpdateInfo;
299 #endif
300
301 using SnapshotOptions = uint32_t;
302 using WKEventModifiers = uint32_t;
303
304 class WebPage : public API::ObjectImpl<API::Object::Type::BundlePage>, public IPC::MessageReceiver, public IPC::MessageSender, public CanMakeWeakPtr<WebPage> {
305 public:
306     static Ref<WebPage> create(WebCore::PageIdentifier, WebPageCreationParameters&&);
307
308     virtual ~WebPage();
309
310     void reinitializeWebPage(WebPageCreationParameters&&);
311
312     void close();
313
314     static WebPage& fromCorePage(WebCore::Page&);
315
316     WebCore::Page* corePage() const { return m_page.get(); }
317     WebCore::PageIdentifier identifier() const { return m_identifier; }
318     StorageNamespaceIdentifier sessionStorageNamespaceIdentifier() const { return makeObjectIdentifier<StorageNamespaceIdentifierType>(m_webPageProxyIdentifier.toUInt64()); }
319     PAL::SessionID sessionID() const;
320     bool usesEphemeralSession() const;
321
322     void setSize(const WebCore::IntSize&);
323     const WebCore::IntSize& size() const { return m_viewSize; }
324     WebCore::IntRect bounds() const { return WebCore::IntRect(WebCore::IntPoint(), size()); }
325
326     DrawingArea* drawingArea() const { return m_drawingArea.get(); }
327
328 #if ENABLE(ASYNC_SCROLLING)
329     WebCore::ScrollingCoordinator* scrollingCoordinator() const;
330 #endif
331
332     WebPageGroupProxy* pageGroup() const { return m_pageGroup.get(); }
333
334     void scrollMainFrameIfNotAtMaxScrollPosition(const WebCore::IntSize& scrollOffset);
335
336     bool scrollBy(uint32_t scrollDirection, uint32_t scrollGranularity);
337
338     void centerSelectionInVisibleArea();
339
340 #if PLATFORM(COCOA)
341     void willCommitLayerTree(RemoteLayerTreeTransaction&);
342     void didFlushLayerTreeAtTime(MonotonicTime);
343 #endif
344
345     void layoutIfNeeded();
346     void updateRendering();
347
348     enum class LazyCreationPolicy { UseExistingOnly, CreateIfNeeded };
349
350     WebInspector* inspector(LazyCreationPolicy = LazyCreationPolicy::CreateIfNeeded);
351     WebInspectorUI* inspectorUI();
352     RemoteWebInspectorUI* remoteInspectorUI();
353     bool isInspectorPage() { return !!m_inspectorUI || !!m_remoteInspectorUI; }
354
355     void inspectorFrontendCountChanged(unsigned);
356
357 #if PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
358     PlaybackSessionManager& playbackSessionManager();
359     VideoFullscreenManager& videoFullscreenManager();
360     void videoControlsManagerDidChange();
361 #endif
362
363 #if PLATFORM(IOS_FAMILY)
364     void setAllowsMediaDocumentInlinePlayback(bool);
365     bool allowsMediaDocumentInlinePlayback() const { return m_allowsMediaDocumentInlinePlayback; }
366 #endif
367
368 #if ENABLE(FULLSCREEN_API)
369     WebFullScreenManager* fullScreenManager();
370 #endif
371
372     void addConsoleMessage(WebCore::FrameIdentifier, MessageSource, MessageLevel, const String&, uint64_t requestID = 0);
373     void sendCSPViolationReport(WebCore::FrameIdentifier, const URL& reportURL, IPC::FormDataReference&&);
374     void enqueueSecurityPolicyViolationEvent(WebCore::FrameIdentifier, WebCore::SecurityPolicyViolationEvent::Init&&);
375
376     // -- Called by the DrawingArea.
377     // FIXME: We could genericize these into a DrawingArea client interface. Would that be beneficial?
378     void drawRect(WebCore::GraphicsContext&, const WebCore::IntRect&);
379
380     // -- Called from WebCore clients.
381     bool handleEditingKeyboardEvent(WebCore::KeyboardEvent&);
382
383     void didStartPageTransition();
384     void didCompletePageTransition();
385     void didCommitLoad(WebFrame*);
386     void willReplaceMultipartContent(const WebFrame&);
387     void didReplaceMultipartContent(const WebFrame&);
388     void didFinishDocumentLoad(WebFrame&);
389     void didFinishLoad(WebFrame&);
390     void show();
391     String userAgent(const URL&) const;
392     String platformUserAgent(const URL&) const;
393     WebCore::KeyboardUIMode keyboardUIMode();
394
395     void didInsertMenuElement(WebCore::HTMLMenuElement&);
396     void didRemoveMenuElement(WebCore::HTMLMenuElement&);
397     void didInsertMenuItemElement(WebCore::HTMLMenuItemElement&);
398     void didRemoveMenuItemElement(WebCore::HTMLMenuItemElement&);
399
400     const String& overrideContentSecurityPolicy() const { return m_overrideContentSecurityPolicy; }
401
402     WebUndoStep* webUndoStep(WebUndoStepID);
403     void addWebUndoStep(WebUndoStepID, Ref<WebUndoStep>&&);
404     void removeWebEditCommand(WebUndoStepID);
405     bool isInRedo() const { return m_isInRedo; }
406
407     bool isAlwaysOnLoggingAllowed() const;
408     void setActivePopupMenu(WebPopupMenu*);
409
410     void setHiddenPageDOMTimerThrottlingIncreaseLimit(Seconds limit)
411     {
412         m_page->setDOMTimerAlignmentIntervalIncreaseLimit(limit);
413     }
414
415 #if ENABLE(INPUT_TYPE_COLOR)
416     WebColorChooser* activeColorChooser() const { return m_activeColorChooser; }
417     void setActiveColorChooser(WebColorChooser*);
418     void didChooseColor(const WebCore::Color&);
419     void didEndColorPicker();
420 #endif
421
422 #if ENABLE(DATALIST_ELEMENT)
423     void setActiveDataListSuggestionPicker(WebDataListSuggestionPicker&);
424     void didSelectDataListOption(const String&);
425     void didCloseSuggestions();
426 #endif
427
428     WebOpenPanelResultListener* activeOpenPanelResultListener() const { return m_activeOpenPanelResultListener.get(); }
429     void setActiveOpenPanelResultListener(Ref<WebOpenPanelResultListener>&&);
430
431     void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
432     void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override;
433
434     // -- InjectedBundle methods
435 #if ENABLE(CONTEXT_MENUS)
436     void setInjectedBundleContextMenuClient(std::unique_ptr<API::InjectedBundle::PageContextMenuClient>&&);
437 #endif
438     void setInjectedBundleEditorClient(std::unique_ptr<API::InjectedBundle::EditorClient>&&);
439     void setInjectedBundleFormClient(std::unique_ptr<API::InjectedBundle::FormClient>&&);
440     void setInjectedBundlePageLoaderClient(std::unique_ptr<API::InjectedBundle::PageLoaderClient>&&);
441     void initializeInjectedBundlePolicyClient(WKBundlePagePolicyClientBase*);
442     void setInjectedBundleResourceLoadClient(std::unique_ptr<API::InjectedBundle::ResourceLoadClient>&&);
443     void setInjectedBundleUIClient(std::unique_ptr<API::InjectedBundle::PageUIClient>&&);
444 #if ENABLE(FULLSCREEN_API)
445     void initializeInjectedBundleFullScreenClient(WKBundlePageFullScreenClientBase*);
446 #endif
447
448 #if ENABLE(CONTEXT_MENUS)
449     API::InjectedBundle::PageContextMenuClient& injectedBundleContextMenuClient() { return *m_contextMenuClient; }
450 #endif
451     API::InjectedBundle::EditorClient& injectedBundleEditorClient() { return *m_editorClient; }
452     API::InjectedBundle::FormClient& injectedBundleFormClient() { return *m_formClient; }
453     API::InjectedBundle::PageLoaderClient& injectedBundleLoaderClient() { return *m_loaderClient; }
454     InjectedBundlePagePolicyClient& injectedBundlePolicyClient() { return m_policyClient; }
455     API::InjectedBundle::ResourceLoadClient& injectedBundleResourceLoadClient() { return *m_resourceLoadClient; }
456     API::InjectedBundle::PageUIClient& injectedBundleUIClient() { return *m_uiClient; }
457 #if ENABLE(FULLSCREEN_API)
458     InjectedBundlePageFullScreenClient& injectedBundleFullScreenClient() { return m_fullScreenClient; }
459 #endif
460
461     bool findStringFromInjectedBundle(const String&, FindOptions);
462     void findStringMatchesFromInjectedBundle(const String&, FindOptions);
463     void replaceStringMatchesFromInjectedBundle(const Vector<uint32_t>& matchIndices, const String& replacementText, bool selectionOnly);
464
465     WebFrame& mainWebFrame() const { return m_mainFrame; }
466
467     WebCore::Frame* mainFrame() const; // May return nullptr.
468     WebCore::FrameView* mainFrameView() const; // May return nullptr.
469
470     RefPtr<WebCore::Range> currentSelectionAsRange();
471
472 #if ENABLE(NETSCAPE_PLUGIN_API)
473     RefPtr<Plugin> createPlugin(WebFrame*, WebCore::HTMLPlugInElement*, const Plugin::Parameters&, String& newMIMEType);
474 #endif
475
476 #if ENABLE(WEBGL)
477     WebCore::WebGLLoadPolicy webGLPolicyForURL(WebFrame*, const URL&);
478     WebCore::WebGLLoadPolicy resolveWebGLPolicyForURL(WebFrame*, const URL&);
479 #endif
480     
481     enum class IncludePostLayoutDataHint { No, Yes };
482     EditorState editorState(IncludePostLayoutDataHint = IncludePostLayoutDataHint::Yes) const;
483     void updateEditorStateAfterLayoutIfEditabilityChanged();
484
485     // options are RenderTreeExternalRepresentationBehavior values.
486     String renderTreeExternalRepresentation(unsigned options = 0) const;
487     String renderTreeExternalRepresentationForPrinting() const;
488     uint64_t renderTreeSize() const;
489
490     void setTracksRepaints(bool);
491     bool isTrackingRepaints() const;
492     void resetTrackedRepaints();
493     Ref<API::Array> trackedRepaintRects();
494
495     void executeEditingCommand(const String& commandName, const String& argument);
496     bool isEditingCommandEnabled(const String& commandName);
497     void clearMainFrameName();
498     void sendClose();
499
500     void suspendForProcessSwap();
501
502     void sendSetWindowFrame(const WebCore::FloatRect&);
503
504     double textZoomFactor() const;
505     void setTextZoomFactor(double);
506     double pageZoomFactor() const;
507     void setPageZoomFactor(double);
508     void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
509     void windowScreenDidChange(uint32_t);
510     String dumpHistoryForTesting(const String& directory);
511     void clearHistory();
512
513     void accessibilitySettingsDidChange();
514     void screenPropertiesDidChange();
515
516     void scalePage(double scale, const WebCore::IntPoint& origin);
517     void scalePageInViewCoordinates(double scale, WebCore::IntPoint centerInViewCoordinates);
518     double pageScaleFactor() const;
519     double totalScaleFactor() const;
520     double viewScaleFactor() const;
521     void scaleView(double scale);
522
523     void setUseFixedLayout(bool);
524     bool useFixedLayout() const { return m_useFixedLayout; }
525     bool setFixedLayoutSize(const WebCore::IntSize&);
526     WebCore::IntSize fixedLayoutSize() const;
527
528     void listenForLayoutMilestones(OptionSet<WebCore::LayoutMilestone>);
529
530     void setSuppressScrollbarAnimations(bool);
531     
532     void setEnableVerticalRubberBanding(bool);
533     void setEnableHorizontalRubberBanding(bool);
534     
535     void setBackgroundExtendsBeyondPage(bool);
536
537     void setPaginationMode(uint32_t /* WebCore::Pagination::Mode */);
538     void setPaginationBehavesLikeColumns(bool);
539     void setPageLength(double);
540     void setGapBetweenPages(double);
541     void setPaginationLineGridEnabled(bool);
542     
543     void postInjectedBundleMessage(const String& messageName, const UserData&);
544
545     void setUnderlayColor(const WebCore::Color& color) { m_underlayColor = color; }
546     WebCore::Color underlayColor() const { return m_underlayColor; }
547
548     void stopLoading();
549     void stopLoadingFrame(WebCore::FrameIdentifier);
550     bool defersLoading() const;
551     void setDefersLoading(bool deferLoading);
552
553     void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*);
554     void exitAcceleratedCompositingMode();
555
556     void addPluginView(PluginView*);
557     void removePluginView(PluginView*);
558
559     bool isVisible() const { return m_activityState.contains(WebCore::ActivityState::IsVisible); }
560     bool isVisibleOrOccluded() const { return m_activityState.contains(WebCore::ActivityState::IsVisibleOrOccluded); }
561
562     LayerHostingMode layerHostingMode() const { return m_layerHostingMode; }
563     void setLayerHostingMode(LayerHostingMode);
564
565 #if PLATFORM(COCOA)
566     void updatePluginsActiveAndFocusedState();
567     const WebCore::FloatRect& windowFrameInScreenCoordinates() const { return m_windowFrameInScreenCoordinates; }
568     const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates() const { return m_windowFrameInUnflippedScreenCoordinates; }
569     const WebCore::FloatRect& viewFrameInWindowCoordinates() const { return m_viewFrameInWindowCoordinates; }
570
571     bool hasCachedWindowFrame() const { return m_hasCachedWindowFrame; }
572
573     void updateHeaderAndFooterLayersForDeviceScaleChange(float scaleFactor);
574 #endif
575
576 #if PLATFORM(MAC)
577     void setTopOverhangImage(WebImage*);
578     void setBottomOverhangImage(WebImage*);
579     
580     void setUseSystemAppearance(bool);
581 #endif
582
583     void effectiveAppearanceDidChange(bool useDarkAppearance, bool useElevatedUserInterfaceLevel);
584
585     bool windowIsFocused() const;
586     bool windowAndWebPageAreFocused() const;
587
588 #if !PLATFORM(IOS_FAMILY)
589     void setHeaderPageBanner(PageBanner*);
590     PageBanner* headerPageBanner();
591     void setFooterPageBanner(PageBanner*);
592     PageBanner* footerPageBanner();
593
594     void hidePageBanners();
595     void showPageBanners();
596     
597     void setHeaderBannerHeightForTesting(int);
598     void setFooterBannerHeightForTesting(int);
599 #endif
600
601     WebCore::IntPoint screenToRootView(const WebCore::IntPoint&);
602     WebCore::IntRect rootViewToScreen(const WebCore::IntRect&);
603     WebCore::IntPoint accessibilityScreenToRootView(const WebCore::IntPoint&);
604     WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&);
605     
606     RefPtr<WebImage> scaledSnapshotWithOptions(const WebCore::IntRect&, double additionalScaleFactor, SnapshotOptions);
607
608     static const WebEvent* currentEvent();
609
610     FindController& findController() { return m_findController.get(); }
611
612 #if ENABLE(GEOLOCATION)
613     GeolocationPermissionRequestManager& geolocationPermissionRequestManager() { return m_geolocationPermissionRequestManager.get(); }
614 #endif
615
616 #if PLATFORM(IOS_FAMILY)
617     void savePageState(WebCore::HistoryItem&);
618     void restorePageState(const WebCore::HistoryItem&);
619 #endif
620
621 #if ENABLE(MEDIA_STREAM)
622     UserMediaPermissionRequestManager& userMediaPermissionRequestManager() { return m_userMediaPermissionRequestManager; }
623     void captureDevicesChanged();
624 #endif
625
626     void elementDidFocus(WebCore::Element&);
627     void elementDidRefocus(WebCore::Element&);
628     void elementDidBlur(WebCore::Element&);
629     void focusedElementDidChangeInputMode(WebCore::Element&, WebCore::InputMode);
630     void resetFocusedElementForFrame(WebFrame*);
631     void updateInputContextAfterBlurringAndRefocusingElementIfNeeded(WebCore::Element&);
632
633     void disabledAdaptationsDidChange(const OptionSet<WebCore::DisabledAdaptations>&);
634     void viewportPropertiesDidChange(const WebCore::ViewportArguments&);
635     void executeEditCommandWithCallback(const String&, const String& argument, CallbackID);
636     void selectAll();
637
638     void textInputContextsInRect(WebCore::FloatRect, CompletionHandler<void(const Vector<WebCore::ElementContext>&)>&&);
639     void focusTextInputContext(const WebCore::ElementContext&, CompletionHandler<void(bool)>&&);
640     void setCanShowPlaceholder(const WebCore::ElementContext&, bool);
641
642 #if PLATFORM(IOS_FAMILY)
643     bool shouldRevealCurrentSelectionAfterInsertion() const { return m_shouldRevealCurrentSelectionAfterInsertion; }
644     void setShouldRevealCurrentSelectionAfterInsertion(bool);
645
646     void insertTextPlaceholder(const WebCore::IntSize&, CompletionHandler<void(const Optional<WebCore::ElementContext>&)>&&);
647     void removeTextPlaceholder(const WebCore::ElementContext&, CompletionHandler<void()>&&);
648
649     WebCore::FloatSize screenSize() const;
650     WebCore::FloatSize availableScreenSize() const;
651     WebCore::FloatSize overrideScreenSize() const;
652     int32_t deviceOrientation() const { return m_deviceOrientation; }
653     void didReceiveMobileDocType(bool);
654
655     double minimumPageScaleFactor() const;
656     double maximumPageScaleFactor() const;
657     double maximumPageScaleFactorIgnoringAlwaysScalable() const;
658     bool allowsUserScaling() const;
659     bool hasStablePageScaleFactor() const { return m_hasStablePageScaleFactor; }
660
661     void handleTap(const WebCore::IntPoint&, OptionSet<WebKit::WebEvent::Modifier>, TransactionID lastLayerTreeTransactionId);
662     void potentialTapAtPosition(uint64_t requestID, const WebCore::FloatPoint&, bool shouldRequestMagnificationInformation);
663     void commitPotentialTap(OptionSet<WebKit::WebEvent::Modifier>, TransactionID lastLayerTreeTransactionId, WebCore::PointerID);
664     void commitPotentialTapFailed();
665     void cancelPotentialTap();
666     void cancelPotentialTapInFrame(WebFrame&);
667     void tapHighlightAtPosition(uint64_t requestID, const WebCore::FloatPoint&);
668     void didRecognizeLongPress();
669     void handleDoubleTapForDoubleClickAtPoint(const WebCore::IntPoint&, OptionSet<WebKit::WebEvent::Modifier>, TransactionID lastLayerTreeTransactionId);
670
671     void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&);
672     void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&);
673
674     void blurFocusedElement();
675     void requestFocusedElementInformation(CallbackID);
676     void selectWithGesture(const WebCore::IntPoint&, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithFocusedElement, CallbackID);
677     void updateSelectionWithTouches(const WebCore::IntPoint&, uint32_t touches, bool baseIsStart, CallbackID);
678     void selectWithTwoTouches(const WebCore::IntPoint& from, const WebCore::IntPoint& to, uint32_t gestureType, uint32_t gestureState, CallbackID);
679     void extendSelection(uint32_t granularity);
680     void selectWordBackward();
681     void moveSelectionByOffset(int32_t offset, CallbackID);
682     void selectTextWithGranularityAtPoint(const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithFocusedElement, CallbackID);
683     void selectPositionAtBoundaryWithDirection(const WebCore::IntPoint&, uint32_t granularity, uint32_t direction, bool isInteractingWithFocusedElement, CallbackID);
684     void moveSelectionAtBoundaryWithDirection(uint32_t granularity, uint32_t direction, CallbackID);
685     void selectPositionAtPoint(const WebCore::IntPoint&, bool isInteractingWithFocusedElement, CallbackID);
686     void beginSelectionInDirection(uint32_t direction, CallbackID);
687     void updateSelectionWithExtentPoint(const WebCore::IntPoint&, bool isInteractingWithFocusedElement, RespectSelectionAnchor, CallbackID);
688     void updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithFocusedElement, CallbackID);
689
690     void requestDictationContext(CallbackID);
691     void replaceDictatedText(const String& oldText, const String& newText);
692     void replaceSelectedText(const String& oldText, const String& newText);
693     void requestAutocorrectionData(const String& textForAutocorrection, CompletionHandler<void(WebAutocorrectionData)>&& reply);
694     void applyAutocorrection(const String& correction, const String& originalText, CallbackID);
695     void syncApplyAutocorrection(const String& correction, const String& originalText, CompletionHandler<void(bool)>&&);
696     void requestAutocorrectionContext();
697     void getPositionInformation(const InteractionInformationRequest&, CompletionHandler<void(InteractionInformationAtPosition&&)>&&);
698     void requestPositionInformation(const InteractionInformationRequest&);
699     void startInteractionWithElementContextOrPosition(Optional<WebCore::ElementContext>&&, WebCore::IntPoint&&);
700     void stopInteraction();
701     void performActionOnElement(uint32_t action);
702     void focusNextFocusedElement(bool isForward, CallbackID);
703     void autofillLoginCredentials(const String&, const String&);
704     void setFocusedElementValue(const String&);
705     void setFocusedElementValueAsNumber(double);
706     void setFocusedElementSelectedIndex(uint32_t index, bool allowMultipleSelection);
707     void setIsShowingInputViewForFocusedElement(bool);
708     bool isShowingInputViewForFocusedElement() const { return m_isShowingInputViewForFocusedElement; }
709     void updateSelectionAppearance();
710     void getSelectionContext(CallbackID);
711     void handleTwoFingerTapAtPoint(const WebCore::IntPoint&, OptionSet<WebKit::WebEvent::Modifier>, uint64_t requestID);
712     void handleStylusSingleTapAtPoint(const WebCore::IntPoint&, uint64_t requestID);
713     void getRectsForGranularityWithSelectionOffset(uint32_t, int32_t, CallbackID);
714     void getRectsAtSelectionOffsetWithText(int32_t, const String&, CallbackID);
715     void storeSelectionForAccessibility(bool);
716     void startAutoscrollAtPosition(const WebCore::FloatPoint&);
717     void cancelAutoscroll();
718     void requestEvasionRectsAboveSelection(CompletionHandler<void(const Vector<WebCore::FloatRect>&)>&&);
719
720     void contentSizeCategoryDidChange(const String&);
721
722     Seconds eventThrottlingDelay() const;
723
724     void showInspectorHighlight(const WebCore::Highlight&);
725     void hideInspectorHighlight();
726
727     void showInspectorIndication();
728     void hideInspectorIndication();
729
730     void enableInspectorNodeSearch();
731     void disableInspectorNodeSearch();
732
733     bool forceAlwaysUserScalable() const { return m_forceAlwaysUserScalable; }
734     void setForceAlwaysUserScalable(bool);
735
736     void updateSelectionWithDelta(int64_t locationDelta, int64_t lengthDelta, CompletionHandler<void()>&&);
737     void requestDocumentEditingContext(WebKit::DocumentEditingContextRequest, CompletionHandler<void(WebKit::DocumentEditingContext)>&&);
738 #endif
739
740 #if PLATFORM(IOS_FAMILY) && ENABLE(IOS_TOUCH_EVENTS)
741     void dispatchAsynchronousTouchEvents(const Vector<std::pair<WebTouchEvent, Optional<CallbackID>>, 1>& queue);
742 #endif
743
744     bool hasRichlyEditableSelection() const;
745
746     enum class LayerTreeFreezeReason {
747         PageTransition          = 1 << 0,
748         BackgroundApplication   = 1 << 1,
749         ProcessSuspended        = 1 << 2,
750         PageSuspended           = 1 << 3,
751         Printing                = 1 << 4,
752         ProcessSwap             = 1 << 5,
753         SwipeAnimation          = 1 << 6,
754     };
755     void freezeLayerTree(LayerTreeFreezeReason);
756     void unfreezeLayerTree(LayerTreeFreezeReason);
757
758     void markLayersVolatile(Function<void(bool)>&& completionHandler = { });
759     void cancelMarkLayersVolatile();
760
761     void freezeLayerTreeDueToSwipeAnimation();
762     void unfreezeLayerTreeDueToSwipeAnimation();
763
764     NotificationPermissionRequestManager* notificationPermissionRequestManager();
765
766     void pageDidScroll();
767
768 #if ENABLE(CONTEXT_MENUS)
769     WebContextMenu* contextMenu();
770     WebContextMenu* contextMenuAtPointInWindow(const WebCore::IntPoint&);
771 #endif
772
773     bool hasLocalDataForURL(const URL&);
774
775     static bool canHandleRequest(const WebCore::ResourceRequest&);
776
777     class SandboxExtensionTracker {
778     public:
779         ~SandboxExtensionTracker();
780
781         void invalidate();
782
783         void beginLoad(WebFrame*, SandboxExtension::Handle&&);
784         void beginReload(WebFrame*, SandboxExtension::Handle&&);
785         void willPerformLoadDragDestinationAction(RefPtr<SandboxExtension>&& pendingDropSandboxExtension);
786         void didStartProvisionalLoad(WebFrame*);
787         void didCommitProvisionalLoad(WebFrame*);
788         void didFailProvisionalLoad(WebFrame*);
789
790     private:
791         void setPendingProvisionalSandboxExtension(RefPtr<SandboxExtension>&&);
792         bool shouldReuseCommittedSandboxExtension(WebFrame*);
793
794         RefPtr<SandboxExtension> m_pendingProvisionalSandboxExtension;
795         RefPtr<SandboxExtension> m_provisionalSandboxExtension;
796         RefPtr<SandboxExtension> m_committedSandboxExtension;
797     };
798
799     SandboxExtensionTracker& sandboxExtensionTracker() { return m_sandboxExtensionTracker; }
800
801 #if PLATFORM(GTK) || PLATFORM(WPE)
802     void cancelComposition(const String& text);
803     void deleteSurrounding(int64_t offset, unsigned characterCount);
804 #endif
805
806 #if PLATFORM(GTK)
807     void collapseSelectionInFrame(WebCore::FrameIdentifier);
808     void showEmojiPicker(WebCore::Frame&);
809
810     void getCenterForZoomGesture(const WebCore::IntPoint& centerInViewCoordinates, CompletionHandler<void(WebCore::IntPoint&&)>&&);
811
812     void themeDidChange(String&&);
813 #endif
814
815     void didApplyStyle();
816     void didChangeSelection();
817     void didChangeOverflowScrollPosition();
818     void didChangeContents();
819     void discardedComposition();
820     void canceledComposition();
821     void didUpdateComposition();
822     void didEndUserTriggeredSelectionChanges();
823
824 #if PLATFORM(COCOA)
825     void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
826     WKAccessibilityWebPageObject* accessibilityRemoteObject();
827     NSObject *accessibilityObjectForMainFramePlugin();
828     const WebCore::FloatPoint& accessibilityPosition() const { return m_accessibilityPosition; }
829     
830     void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
831
832     void setTextAsync(const String&);
833     void insertTextAsync(const String& text, const EditingRange& replacementRange, InsertTextOptions&&);
834     void hasMarkedText(CompletionHandler<void(bool)>&&);
835     void getMarkedRangeAsync(CallbackID);
836     void getSelectedRangeAsync(CallbackID);
837     void characterIndexForPointAsync(const WebCore::IntPoint&, CallbackID);
838     void firstRectForCharacterRangeAsync(const EditingRange&, CallbackID);
839     void setCompositionAsync(const String& text, const Vector<WebCore::CompositionUnderline>&, const Vector<WebCore::CompositionHighlight>&, const EditingRange& selectionRange, const EditingRange& replacementRange);
840     void confirmCompositionAsync();
841
842     void readSelectionFromPasteboard(const String& pasteboardName, CompletionHandler<void(bool&&)>&&);
843     void getStringSelectionForPasteboard(CompletionHandler<void(String&&)>&&);
844     void getDataSelectionForPasteboard(const String pasteboardType, CompletionHandler<void(SharedMemory::Handle&&, uint64_t)>&&);
845     void shouldDelayWindowOrderingEvent(const WebKit::WebMouseEvent&, CompletionHandler<void(bool)>&&);
846     void acceptsFirstMouse(int eventNumber, const WebKit::WebMouseEvent&, CompletionHandler<void(bool)>&&);
847     bool performNonEditingBehaviorForSelector(const String&, WebCore::KeyboardEvent*);
848
849     void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::DictationAlternative>& dictationAlternativeLocations, InsertTextOptions&&);
850 #endif
851
852 #if PLATFORM(MAC)
853     void attributedSubstringForCharacterRangeAsync(const EditingRange&, CallbackID);
854     void fontAtSelection(CallbackID);
855 #endif
856
857 #if PLATFORM(COCOA) && ENABLE(SERVICE_CONTROLS)
858     void replaceSelectionWithPasteboardData(const Vector<String>& types, const IPC::DataReference&);
859 #endif
860
861     void setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length, bool suppressUnderline, const Vector<WebCore::CompositionHighlight>&);
862     bool hasCompositionForTesting();
863     void confirmCompositionForTesting(const String& compositionString);
864
865 #if PLATFORM(COCOA)
866     bool isSpeaking();
867     void speak(const String&);
868     void stopSpeaking();
869
870     void performDictionaryLookupForSelection(WebCore::Frame&, const WebCore::VisibleSelection&, WebCore::TextIndicatorPresentationTransition);
871 #endif
872
873     bool isSmartInsertDeleteEnabled();
874     void setSmartInsertDeleteEnabled(bool);
875
876     bool isSelectTrailingWhitespaceEnabled() const;
877     void setSelectTrailingWhitespaceEnabled(bool);
878
879     void replaceSelectionWithText(WebCore::Frame*, const String&);
880     void clearSelection();
881     void restoreSelectionInFocusedEditableElement();
882
883 #if ENABLE(DRAG_SUPPORT) && PLATFORM(GTK)
884     void performDragControllerAction(DragControllerAction, const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t draggingSourceOperationMask, WebSelectionData&&, uint32_t flags);
885 #endif
886
887 #if ENABLE(DRAG_SUPPORT) && !PLATFORM(GTK)
888     void performDragControllerAction(DragControllerAction, const WebCore::DragData&, SandboxExtension::Handle&&, SandboxExtension::HandleArray&&);
889 #endif
890
891 #if ENABLE(DRAG_SUPPORT)
892     void dragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation);
893
894     void willPerformLoadDragDestinationAction();
895     void mayPerformUploadDragDestinationAction();
896
897     void willStartDrag() { ASSERT(!m_isStartingDrag); m_isStartingDrag = true; }
898     void didStartDrag();
899     void dragCancelled();
900     WebCore::DragSourceAction allowedDragSourceActions() const { return m_allowedDragSourceActions; }
901 #endif
902
903     void beginPrinting(WebCore::FrameIdentifier, const PrintInfo&);
904     void endPrinting();
905     void computePagesForPrinting(WebCore::FrameIdentifier, const PrintInfo&, CallbackID);
906     void computePagesForPrintingImpl(WebCore::FrameIdentifier, const PrintInfo&, Vector<WebCore::IntRect>& pageRects, double& totalScaleFactor, WebCore::FloatBoxExtent& computedMargin);
907
908 #if PLATFORM(COCOA)
909     void drawRectToImage(WebCore::FrameIdentifier, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, CallbackID);
910     void drawPagesToPDF(WebCore::FrameIdentifier, const PrintInfo&, uint32_t first, uint32_t count, CallbackID);
911     void drawPagesToPDFImpl(WebCore::FrameIdentifier, const PrintInfo&, uint32_t first, uint32_t count, RetainPtr<CFMutableDataRef>& pdfPageData);
912 #endif
913
914 #if PLATFORM(IOS_FAMILY)
915     void computePagesForPrintingAndDrawToPDF(WebCore::FrameIdentifier, const PrintInfo&, CallbackID, Messages::WebPage::ComputePagesForPrintingAndDrawToPDFDelayedReply&&);
916 #endif
917
918     void drawToPDF(WebCore::FrameIdentifier, const Optional<WebCore::FloatRect>&, CallbackID);
919
920 #if PLATFORM(GTK)
921     void drawPagesForPrinting(WebCore::FrameIdentifier, const PrintInfo&, CallbackID);
922     void didFinishPrintOperation(const WebCore::ResourceError&, CallbackID);
923 #endif
924
925     void addResourceRequest(unsigned long, const WebCore::ResourceRequest&);
926     void removeResourceRequest(unsigned long);
927
928     void setMediaVolume(float);
929     void setMuted(WebCore::MediaProducer::MutedStateFlags);
930     void setMayStartMediaWhenInWindow(bool);
931     void stopMediaCapture();
932
933 #if ENABLE(MEDIA_SESSION)
934     void handleMediaEvent(uint32_t /* WebCore::MediaEventType */);
935     void setVolumeOfMediaElement(double, uint64_t);
936 #endif
937
938     void updateMainFrameScrollOffsetPinning();
939
940     bool mainFrameHasCustomContentProvider() const;
941     void addMIMETypeWithCustomContentProvider(const String&);
942
943     void mainFrameDidLayout();
944
945     bool canRunBeforeUnloadConfirmPanel() const { return m_canRunBeforeUnloadConfirmPanel; }
946     void setCanRunBeforeUnloadConfirmPanel(bool canRunBeforeUnloadConfirmPanel) { m_canRunBeforeUnloadConfirmPanel = canRunBeforeUnloadConfirmPanel; }
947
948     bool canRunModal() const { return m_canRunModal; }
949     void setCanRunModal(bool canRunModal) { m_canRunModal = canRunModal; }
950
951     void runModal();
952
953     void setDeviceScaleFactor(float);
954     float deviceScaleFactor() const;
955
956     void forceRepaintWithoutCallback();
957
958     void unmarkAllMisspellings();
959     void unmarkAllBadGrammar();
960
961 #if PLATFORM(COCOA)
962     void handleAlternativeTextUIResult(const String&);
963 #endif
964
965     // For testing purpose.
966     void simulateMouseDown(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, WallTime);
967     void simulateMouseUp(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, WallTime);
968     void simulateMouseMotion(WebCore::IntPoint, WallTime);
969
970 #if ENABLE(CONTEXT_MENUS)
971     void contextMenuShowing() { m_isShowingContextMenu = true; }
972 #endif
973
974     void wheelEvent(const WebWheelEvent&);
975
976     void wheelEventHandlersChanged(bool);
977     void recomputeShortCircuitHorizontalWheelEventsState();
978
979 #if ENABLE(MAC_GESTURE_EVENTS)
980     void gestureEvent(const WebGestureEvent&);
981 #endif
982
983     void updateVisibilityState(bool isInitialState = false);
984
985 #if PLATFORM(IOS_FAMILY)
986     void setMaximumUnobscuredSize(const WebCore::FloatSize&);
987     void setDeviceOrientation(int32_t);
988     void dynamicViewportSizeUpdate(const WebCore::FloatSize& viewLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& targetUnobscuredSafeAreaInsets, double scale, int32_t deviceOrientation, double minimumEffectiveDeviceWidth, DynamicViewportSizeUpdateID);
989     bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; }
990     void willStartUserTriggeredZooming();
991     void applicationWillResignActive();
992     void applicationDidEnterBackground(bool isSuspendedUnderLock);
993     void applicationDidFinishSnapshottingAfterEnteringBackground();
994     void applicationWillEnterForeground(bool isSuspendedUnderLock);
995     void applicationDidBecomeActive();
996     void applicationDidEnterBackgroundForMedia(bool isSuspendedUnderLock);
997     void applicationWillEnterForegroundForMedia(bool isSuspendedUnderLock);
998     void didFinishContentChangeObserving(WKContentChange);
999
1000     bool platformPrefersTextLegibilityBasedZoomScaling() const;
1001
1002     void hardwareKeyboardAvailabilityChanged(bool keyboardIsAttached);
1003
1004     void updateStringForFind(const String&);
1005     
1006     bool canShowWhileLocked() const { return m_canShowWhileLocked; }
1007 #endif
1008
1009 #if ENABLE(META_VIEWPORT)
1010     void setViewportConfigurationViewLayoutSize(const WebCore::FloatSize&, double scaleFactor, double minimumEffectiveDeviceWidth);
1011     void setOverrideViewportArguments(const Optional<WebCore::ViewportArguments>&);
1012     const WebCore::ViewportConfiguration& viewportConfiguration() const { return m_viewportConfiguration; }
1013
1014     void setUseTestingViewportConfiguration(bool useTestingViewport) { m_useTestingViewportConfiguration = useTestingViewport; }
1015     bool isUsingTestingViewportConfiguration() const { return m_useTestingViewportConfiguration; }
1016 #endif
1017
1018 #if ENABLE(UI_SIDE_COMPOSITING)
1019     Optional<float> scaleFromUIProcess(const VisibleContentRectUpdateInfo&) const;
1020     void updateVisibleContentRects(const VisibleContentRectUpdateInfo&, MonotonicTime oldestTimestamp);
1021 #endif
1022
1023 #if ENABLE(IOS_TOUCH_EVENTS)
1024     void dispatchTouchEvent(const WebTouchEvent&, bool& handled);
1025 #endif
1026
1027     bool shouldUseCustomContentProviderForResponse(const WebCore::ResourceResponse&);
1028
1029     bool asynchronousPluginInitializationEnabled() const { return m_asynchronousPluginInitializationEnabled; }
1030     void setAsynchronousPluginInitializationEnabled(bool enabled) { m_asynchronousPluginInitializationEnabled = enabled; }
1031     bool asynchronousPluginInitializationEnabledForAllPlugins() const { return m_asynchronousPluginInitializationEnabledForAllPlugins; }
1032     void setAsynchronousPluginInitializationEnabledForAllPlugins(bool enabled) { m_asynchronousPluginInitializationEnabledForAllPlugins = enabled; }
1033     bool artificialPluginInitializationDelayEnabled() const { return m_artificialPluginInitializationDelayEnabled; }
1034     void setArtificialPluginInitializationDelayEnabled(bool enabled) { m_artificialPluginInitializationDelayEnabled = enabled; }
1035     void setTabToLinksEnabled(bool enabled) { m_tabToLinks = enabled; }
1036     bool tabToLinksEnabled() const { return m_tabToLinks; }
1037
1038     bool scrollingPerformanceLoggingEnabled() const { return m_scrollingPerformanceLoggingEnabled; }
1039     void setScrollingPerformanceLoggingEnabled(bool);
1040
1041 #if PLATFORM(COCOA)
1042     bool shouldUsePDFPlugin() const;
1043     bool pdfPluginEnabled() const { return m_pdfPluginEnabled; }
1044     void setPDFPluginEnabled(bool enabled) { m_pdfPluginEnabled = enabled; }
1045
1046     NSDictionary *dataDetectionContext() const { return m_dataDetectionContext.get(); }
1047 #endif
1048
1049     void savePDFToFileInDownloadsFolder(const String& suggestedFilename, const URL& originatingURL, const uint8_t* data, unsigned long size);
1050
1051 #if PLATFORM(COCOA)
1052     void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
1053 #endif
1054
1055     bool mainFrameIsScrollable() const { return m_mainFrameIsScrollable; }
1056
1057     void setAlwaysShowsHorizontalScroller(bool);
1058     void setAlwaysShowsVerticalScroller(bool);
1059
1060     bool alwaysShowsHorizontalScroller() const { return m_alwaysShowsHorizontalScroller; };
1061     bool alwaysShowsVerticalScroller() const { return m_alwaysShowsVerticalScroller; };
1062
1063     void setMinimumSizeForAutoLayout(const WebCore::IntSize&);
1064     WebCore::IntSize minimumSizeForAutoLayout() const { return m_minimumSizeForAutoLayout; }
1065
1066     void setAutoSizingShouldExpandToViewHeight(bool shouldExpand);
1067     bool autoSizingShouldExpandToViewHeight() { return m_autoSizingShouldExpandToViewHeight; }
1068
1069     void setViewportSizeForCSSViewportUnits(Optional<WebCore::IntSize>);
1070     Optional<WebCore::IntSize> viewportSizeForCSSViewportUnits() const { return m_viewportSizeForCSSViewportUnits; }
1071
1072     bool canShowMIMEType(const String& MIMEType) const;
1073     bool canShowResponse(const WebCore::ResourceResponse&) const;
1074
1075     void addTextCheckingRequest(uint64_t requestID, Ref<WebCore::TextCheckingRequest>&&);
1076     void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
1077     void didCancelCheckingText(uint64_t requestID);
1078
1079 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
1080     void determinePrimarySnapshottedPlugIn();
1081     void determinePrimarySnapshottedPlugInTimerFired();
1082     void resetPrimarySnapshottedPlugIn();
1083     bool matchesPrimaryPlugIn(const String& pageOrigin, const String& pluginOrigin, const String& mimeType) const;
1084     bool plugInIntersectsSearchRect(WebCore::HTMLPlugInImageElement& pluginImageElement);
1085     bool plugInIsPrimarySize(WebCore::HTMLPlugInImageElement& pluginImageElement, unsigned &pluginArea);
1086 #endif
1087
1088 #if ENABLE(DATA_DETECTION)
1089     void setDataDetectionResults(NSArray *);
1090     void detectDataInAllFrames(uint64_t, CompletionHandler<void(const DataDetectionResult&)>&&);
1091     void removeDataDetectedLinks(CompletionHandler<void(const DataDetectionResult&)>&&);
1092 #endif
1093
1094     unsigned extendIncrementalRenderingSuppression();
1095     void stopExtendingIncrementalRenderingSuppression(unsigned token);
1096     bool shouldExtendIncrementalRenderingSuppression() { return !m_activeRenderingSuppressionTokens.isEmpty(); }
1097
1098     WebCore::ScrollPinningBehavior scrollPinningBehavior() { return m_scrollPinningBehavior; }
1099     void setScrollPinningBehavior(uint32_t /* WebCore::ScrollPinningBehavior */ pinning);
1100
1101     Optional<WebCore::ScrollbarOverlayStyle> scrollbarOverlayStyle() { return m_scrollbarOverlayStyle; }
1102     void setScrollbarOverlayStyle(Optional<uint32_t /* WebCore::ScrollbarOverlayStyle */> scrollbarStyle);
1103
1104     Ref<WebCore::DocumentLoader> createDocumentLoader(WebCore::Frame&, const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
1105     void updateCachedDocumentLoader(WebDocumentLoader&, WebCore::Frame&);
1106
1107     void getBytecodeProfile(CallbackID);
1108     void getSamplingProfilerOutput(CallbackID);
1109     
1110 #if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION)
1111     void handleTelephoneNumberClick(const String& number, const WebCore::IntPoint&);
1112     void handleSelectionServiceClick(WebCore::FrameSelection&, const Vector<String>& telephoneNumbers, const WebCore::IntPoint&);
1113 #endif
1114
1115     void didChangeScrollOffsetForFrame(WebCore::Frame*);
1116
1117     void setMainFrameProgressCompleted(bool completed) { m_mainFrameProgressCompleted = completed; }
1118     bool shouldDispatchFakeMouseMoveEvents() const { return m_shouldDispatchFakeMouseMoveEvents; }
1119
1120     void postMessage(const String& messageName, API::Object* messageBody);
1121     void postSynchronousMessageForTesting(const String& messageName, API::Object* messageBody, RefPtr<API::Object>& returnData);
1122     void postMessageIgnoringFullySynchronousMode(const String& messageName, API::Object* messageBody);
1123
1124 #if PLATFORM(GTK) || PLATFORM(WPE)
1125     void setInputMethodState(WebCore::Element*);
1126 #endif
1127
1128     void imageOrMediaDocumentSizeChanged(const WebCore::IntSize&);
1129
1130 #if ENABLE(VIDEO) && USE(GSTREAMER)
1131     void requestInstallMissingMediaPlugins(const String& details, const String& description, WebCore::MediaPlayerRequestInstallMissingPluginsCallback&);
1132 #endif
1133
1134     void addUserScript(String&& source, WebCore::UserContentInjectedFrames, WebCore::UserScriptInjectionTime);
1135     void addUserStyleSheet(const String& source, WebCore::UserContentInjectedFrames);
1136     void removeAllUserContent();
1137
1138     void dispatchDidReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone>);
1139
1140     void didRestoreScrollPosition();
1141
1142     bool isControlledByAutomation() const;
1143     void setControlledByAutomation(bool);
1144
1145     void connectInspector(const String& targetId, Inspector::FrontendChannel::ConnectionType);
1146     void disconnectInspector(const String& targetId);
1147     void sendMessageToTargetBackend(const String& targetId, const String& message);
1148
1149     void insertNewlineInQuotedContent();
1150
1151 #if USE(OS_STATE)
1152     WallTime loadCommitTime() const { return m_loadCommitTime; }
1153 #endif
1154
1155 #if ENABLE(GAMEPAD)
1156     void gamepadActivity(const Vector<GamepadData>&, bool shouldMakeGamepadsVisible);
1157 #endif
1158     
1159 #if ENABLE(POINTER_LOCK)
1160     void didAcquirePointerLock();
1161     void didNotAcquirePointerLock();
1162     void didLosePointerLock();
1163 #endif
1164
1165     void didGetLoadDecisionForIcon(bool decision, CallbackID loadIdentifier, OptionalCallbackID);
1166     void setUseIconLoadingClient(bool);
1167
1168 #if PLATFORM(IOS_FAMILY) && ENABLE(DRAG_SUPPORT)
1169     void didConcludeEditDrag();
1170     void didConcludeDrop();
1171 #endif
1172
1173     void didFinishLoadingImageForElement(WebCore::HTMLImageElement&);
1174
1175     WebURLSchemeHandlerProxy* urlSchemeHandlerForScheme(const String&);
1176     void stopAllURLSchemeTasks();
1177
1178     Optional<double> cpuLimit() const { return m_cpuLimit; }
1179
1180     static PluginView* pluginViewForFrame(WebCore::Frame*);
1181
1182     void flushPendingEditorStateUpdate();
1183
1184 #if ENABLE(RESOURCE_LOAD_STATISTICS)
1185     void hasStorageAccess(WebCore::RegistrableDomain&& subFrameDomain, WebCore::RegistrableDomain&& topFrameDomain, WebFrame&, CompletionHandler<void(bool)>&&);
1186     void requestStorageAccess(WebCore::RegistrableDomain&& subFrameDomain, WebCore::RegistrableDomain&& topFrameDomain, WebFrame&, CompletionHandler<void(WebCore::StorageAccessWasGranted, WebCore::StorageAccessPromptWasShown)>&&);
1187     bool hasPageLevelStorageAccess(const WebCore::RegistrableDomain& topLevelDomain, const WebCore::RegistrableDomain& resourceDomain) const;
1188     void addDomainWithPageLevelStorageAccess(const WebCore::RegistrableDomain& topLevelDomain, const WebCore::RegistrableDomain& resourceDomain);
1189     void wasLoadedWithDataTransferFromPrevalentResource();
1190     void didLoadFromRegistrableDomain(WebCore::RegistrableDomain&&);
1191     void clearLoadedThirdPartyDomains();
1192     void loadedThirdPartyDomains(CompletionHandler<void(Vector<WebCore::RegistrableDomain>)>&&);
1193 #endif
1194
1195 #if ENABLE(DEVICE_ORIENTATION)
1196     void shouldAllowDeviceOrientationAndMotionAccess(WebCore::FrameIdentifier, FrameInfoData&&, bool mayPrompt, CompletionHandler<void(WebCore::DeviceOrientationOrMotionPermissionState)>&&);
1197 #endif
1198
1199     void showShareSheet(WebCore::ShareDataWithParsedURL&, CompletionHandler<void(bool)>&& callback);
1200     void didCompleteShareSheet(bool wasCompleted, ShareSheetCallbackID contextId);
1201     
1202 #if ENABLE(ATTACHMENT_ELEMENT)
1203     void insertAttachment(const String& identifier, Optional<uint64_t>&& fileSize, const String& fileName, const String& contentType, CallbackID);
1204     void updateAttachmentAttributes(const String& identifier, Optional<uint64_t>&& fileSize, const String& contentType, const String& fileName, const IPC::SharedBufferDataReference& enclosingImageData, CallbackID);
1205 #endif
1206
1207 #if ENABLE(APPLICATION_MANIFEST)
1208     void getApplicationManifest(CallbackID);
1209     void didFinishLoadingApplicationManifest(uint64_t, const Optional<WebCore::ApplicationManifest>&);
1210 #endif
1211
1212 #if USE(WPE_RENDERER)
1213     int hostFileDescriptor() const { return m_hostFileDescriptor.fileDescriptor(); }
1214 #endif
1215
1216     void updateCurrentModifierState(OptionSet<WebCore::PlatformEvent::Modifier> modifiers);
1217
1218     UserContentControllerIdentifier userContentControllerIdentifier() const { return m_userContentController->identifier(); }
1219
1220     WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() const { return m_userInterfaceLayoutDirection; }
1221
1222     bool isSuspended() const { return m_isSuspended; }
1223
1224     void didReceiveWebPageMessage(IPC::Connection&, IPC::Decoder&);
1225
1226     template<typename T>
1227     bool sendSyncWithDelayedReply(T&& message, typename T::Reply&& reply)
1228     {
1229         cancelGesturesBlockedOnSynchronousReplies();
1230         return sendSync(WTFMove(message), WTFMove(reply), Seconds::infinity(), IPC::SendSyncOption::InformPlatformProcessWillSuspend);
1231     }
1232
1233     WebCore::DOMPasteAccessResponse requestDOMPasteAccess(const String& originIdentifier);
1234     WebCore::IntRect rectForElementAtInteractionLocation() const;
1235
1236     const Optional<WebCore::Color>& backgroundColor() const { return m_backgroundColor; }
1237
1238     void suspendAllMediaBuffering();
1239     void resumeAllMediaBuffering();
1240
1241     void configureLoggingChannel(const String&, WTFLogChannelState, WTFLogLevel);
1242
1243     WebCore::Element* elementForContext(const WebCore::ElementContext&) const;
1244     Optional<WebCore::ElementContext> contextForElement(WebCore::Element&) const;
1245
1246     void startTextManipulations(Vector<WebCore::TextManipulationController::ExclusionRule>&&, CompletionHandler<void()>&&);
1247     void completeTextManipulation(const Vector<WebCore::TextManipulationController::ManipulationItem>&, CompletionHandler<void(bool allFailed, const Vector<WebCore::TextManipulationController::ManipulationFailure>&)>&&);
1248
1249 #if ENABLE(APPLE_PAY)
1250     WebPaymentCoordinator* paymentCoordinator();
1251 #endif
1252
1253 #if ENABLE(PLATFORM_DRIVEN_TEXT_CHECKING)
1254     TextCheckingControllerProxy& textCheckingController() { return m_textCheckingControllerProxy.get(); }
1255 #endif
1256
1257 #if PLATFORM(COCOA)
1258     void setRemoteObjectRegistry(WebRemoteObjectRegistry*);
1259     WebRemoteObjectRegistry* remoteObjectRegistry();
1260 #endif
1261
1262     WebPageProxyIdentifier webPageProxyIdentifier() const { return m_webPageProxyIdentifier; }
1263
1264     void updateIntrinsicContentSizeIfNeeded(const WebCore::IntSize&);
1265     void scheduleFullEditorStateUpdate();
1266     bool isThrottleable() const;
1267
1268     bool userIsInteracting() const { return m_userIsInteracting; }
1269     void setUserIsInteracting(bool userIsInteracting) { m_userIsInteracting = userIsInteracting; }
1270
1271     bool firstFlushAfterCommit() const { return m_firstFlushAfterCommit; }
1272     void setFirstFlushAfterCommit(bool f) { m_firstFlushAfterCommit = f; }
1273
1274 #if PLATFORM(IOS_FAMILY)
1275     // This excludes layout overflow, includes borders.
1276     static WebCore::IntRect rootViewBoundsForElement(const WebCore::Element&);
1277     // These include layout overflow for overflow:visible elements, but exclude borders.
1278     static WebCore::IntRect absoluteInteractionBoundsForElement(const WebCore::Element&);
1279     static WebCore::IntRect rootViewInteractionBoundsForElement(const WebCore::Element&);
1280 #endif // PLATFORM(IOS_FAMILY)
1281
1282 #if USE(QUICK_LOOK)
1283     void didStartLoadForQuickLookDocumentInMainFrame(const String& fileName, const String& uti);
1284     void didFinishLoadForQuickLookDocumentInMainFrame(const WebCore::SharedBuffer&);
1285     void requestPasswordForQuickLookDocumentInMainFrame(const String& fileName, CompletionHandler<void(const String&)>&&);
1286 #endif
1287
1288     const String& overriddenMediaType() const { return m_overriddenMediaType; }
1289     void setOverriddenMediaType(const String&);
1290
1291     void getProcessDisplayName(CompletionHandler<void(String&&)>&&);
1292
1293     WebCore::AllowsContentJavaScript allowsContentJavaScriptFromMostRecentNavigation() const { return m_allowsContentJavaScriptFromMostRecentNavigation; }
1294     void setAllowsContentJavaScriptFromMostRecentNavigation(WebCore::AllowsContentJavaScript allows) { m_allowsContentJavaScriptFromMostRecentNavigation = allows; }
1295
1296     void getAllFrames(CompletionHandler<void(FrameTreeNodeData&&)>&&);
1297
1298     void setIsNavigatingToAppBoundDomainTesting(bool, CompletionHandler<void()>&&);
1299     void setIsNavigatingToAppBoundDomain(NavigatingToAppBoundDomain isNavigatingToAppBoundDomain) { m_isNavigatingToAppBoundDomain = isNavigatingToAppBoundDomain; }
1300     NavigatingToAppBoundDomain isNavigatingToAppBoundDomain() const { return m_isNavigatingToAppBoundDomain; }
1301     NavigatedAwayFromAppBoundDomain hasNavigatedAwayFromAppBoundDomain() const { return m_hasNavigatedAwayFromAppBoundDomain; }
1302     void setHasNavigatedAwayFromAppBoundDomain(NavigatedAwayFromAppBoundDomain navigatedAwayFromAppBoundDomain) { m_hasNavigatedAwayFromAppBoundDomain = navigatedAwayFromAppBoundDomain; }
1303     bool needsInAppBrowserPrivacyQuirks() const { return m_needsInAppBrowserPrivacyQuirks; }
1304     
1305     bool shouldUseRemoteRenderingFor(WebCore::RenderingPurpose);
1306     
1307 private:
1308     WebPage(WebCore::PageIdentifier, WebPageCreationParameters&&);
1309
1310     void updateThrottleState();
1311
1312     // IPC::MessageSender
1313     IPC::Connection* messageSenderConnection() const override;
1314     uint64_t messageSenderDestinationID() const override;
1315
1316     void platformInitialize();
1317     void platformReinitialize();
1318     void platformDetach();
1319     void platformEditorState(WebCore::Frame&, EditorState& result, IncludePostLayoutDataHint) const;
1320     void platformWillPerformEditingCommand();
1321     void sendEditorStateUpdate();
1322
1323 #if HAVE(TOUCH_BAR)
1324     void sendTouchBarMenuDataAddedUpdate(WebCore::HTMLMenuElement&);
1325     void sendTouchBarMenuDataRemovedUpdate(WebCore::HTMLMenuElement&);
1326     void sendTouchBarMenuItemDataAddedUpdate(WebCore::HTMLMenuItemElement&);
1327     void sendTouchBarMenuItemDataRemovedUpdate(WebCore::HTMLMenuItemElement&);
1328 #endif
1329
1330     void didReceiveSyncWebPageMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&);
1331
1332 #if PLATFORM(IOS_FAMILY)
1333     void updateViewportSizeForCSSViewportUnits();
1334
1335     static void convertSelectionRectsToRootView(WebCore::FrameView*, Vector<WebCore::SelectionRect>&);
1336
1337     void getFocusedElementInformation(FocusedElementInformation&);
1338     void platformInitializeAccessibility();
1339     void generateSyntheticEditingCommand(SyntheticEditingCommandType);
1340     void handleSyntheticClick(WebCore::Node& nodeRespondingToClick, const WebCore::FloatPoint& location, OptionSet<WebKit::WebEvent::Modifier>, WebCore::PointerID = WebCore::mousePointerID);
1341     void completeSyntheticClick(WebCore::Node& nodeRespondingToClick, const WebCore::FloatPoint& location, OptionSet<WebKit::WebEvent::Modifier>, WebCore::SyntheticClickType, WebCore::PointerID = WebCore::mousePointerID);
1342     void sendTapHighlightForNodeIfNecessary(uint64_t requestID, WebCore::Node*);
1343     WebCore::VisiblePosition visiblePositionInFocusedNodeForPoint(const WebCore::Frame&, const WebCore::IntPoint&, bool isInteractingWithFocusedElement);
1344     RefPtr<WebCore::Range> rangeForGranularityAtPoint(WebCore::Frame&, const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithFocusedElement);
1345     void setFocusedFrameBeforeSelectingTextAtLocation(const WebCore::IntPoint&);
1346     void dispatchSyntheticMouseEventsForSelectionGesture(SelectionTouch, const WebCore::IntPoint&);
1347
1348     void sendPositionInformation(InteractionInformationAtPosition&&);
1349     InteractionInformationAtPosition positionInformation(const InteractionInformationRequest&);
1350     RefPtr<ShareableBitmap> shareableBitmapSnapshotForNode(WebCore::Element&);
1351     WebAutocorrectionContext autocorrectionContext();
1352     bool applyAutocorrectionInternal(const String& correction, const String& originalText);
1353 #endif
1354
1355 #if ENABLE(META_VIEWPORT)
1356     void resetViewportDefaultConfiguration(WebFrame* mainFrame, bool hasMobileDocType = false);
1357     enum class ZoomToInitialScale { No, Yes };
1358     void viewportConfigurationChanged(ZoomToInitialScale = ZoomToInitialScale::No);
1359     bool shouldIgnoreMetaViewport() const;
1360 #endif
1361
1362 #if ENABLE(TEXT_AUTOSIZING)
1363     void textAutoSizingAdjustmentTimerFired();
1364     void resetTextAutosizing();
1365     void resetIdempotentTextAutosizingIfNeeded(double previousInitialScale);
1366 #endif
1367
1368 #if ENABLE(VIEWPORT_RESIZING)
1369     void scheduleShrinkToFitContent();
1370     void shrinkToFitContentTimerFired();
1371     bool immediatelyShrinkToFitContent();
1372 #endif
1373
1374 #if PLATFORM(IOS_FAMILY) && ENABLE(DATA_INTERACTION)
1375     void requestDragStart(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t allowedActions);
1376     void requestAdditionalItemsForDragSession(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t allowedActions);
1377     void insertDroppedImagePlaceholders(const Vector<WebCore::IntSize>&, CompletionHandler<void(const Vector<WebCore::IntRect>&, Optional<WebCore::TextIndicatorData>)>&& reply);
1378     void computeAndSendEditDragSnapshot();
1379 #endif
1380
1381 #if !PLATFORM(COCOA) && !PLATFORM(WPE)
1382     static const char* interpretKeyEvent(const WebCore::KeyboardEvent*);
1383 #endif
1384
1385     bool performDefaultBehaviorForKeyEvent(const WebKeyboardEvent&);
1386
1387 #if PLATFORM(MAC)
1388     bool executeKeypressCommandsInternal(const Vector<WebCore::KeypressCommand>&, WebCore::KeyboardEvent*);
1389 #endif
1390
1391     void testProcessIncomingSyncMessagesWhenWaitingForSyncReply(Messages::WebPage::TestProcessIncomingSyncMessagesWhenWaitingForSyncReplyDelayedReply&&);
1392
1393     void updateDrawingAreaLayerTreeFreezeState();
1394     bool markLayersVolatileImmediatelyIfPossible();
1395     void layerVolatilityTimerFired();
1396     void callVolatilityCompletionHandlers(bool succeeded);
1397
1398     String sourceForFrame(WebFrame*);
1399
1400     void loadDataImpl(uint64_t navigationID, bool shouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&&, Ref<WebCore::SharedBuffer>&&, const String& MIMEType, const String& encodingName, const URL& baseURL, const URL& failingURL, const UserData&, NavigatingToAppBoundDomain, NavigatedAwayFromAppBoundDomain, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow);
1401
1402     // Actions
1403     void tryClose(CompletionHandler<void(bool)>&&);
1404     void platformDidReceiveLoadParameters(const LoadParameters&);
1405     void loadRequest(LoadParameters&&);
1406     NO_RETURN void loadRequestWaitingForProcessLaunch(LoadParameters&&, URL&&, WebPageProxyIdentifier, bool);
1407     void loadData(LoadParameters&&);
1408     void loadAlternateHTML(LoadParameters&&);
1409     void navigateToPDFLinkWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint);
1410     void reload(uint64_t navigationID, uint32_t reloadOptions, SandboxExtension::Handle&&);
1411     void goToBackForwardItem(uint64_t navigationID, const WebCore::BackForwardItemIdentifier&, WebCore::FrameLoadType, WebCore::ShouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&&);
1412     void tryRestoreScrollPosition();
1413     void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, CallbackID);
1414     void updateIsInWindow(bool isInitialState = false);
1415     void visibilityDidChange();
1416     void setActivityState(OptionSet<WebCore::ActivityState::Flag>, ActivityStateChangeID, const Vector<CallbackID>& callbackIDs);
1417     void validateCommand(const String&, CallbackID);
1418     void executeEditCommand(const String&, const String&);
1419     void setEditable(bool);
1420
1421     void didChangeSelectionOrOverflowScrollPosition();
1422
1423     void increaseListLevel();
1424     void decreaseListLevel();
1425     void changeListType();
1426
1427     void setBaseWritingDirection(WebCore::WritingDirection);
1428
1429     void setNeedsFontAttributes(bool);
1430
1431     void mouseEvent(const WebMouseEvent&);
1432     void keyEvent(const WebKeyboardEvent&);
1433
1434 #if ENABLE(IOS_TOUCH_EVENTS)
1435     void touchEventSync(const WebTouchEvent&, CompletionHandler<void(bool)>&&);
1436     void resetPotentialTapSecurityOrigin();
1437     void updatePotentialTapSecurityOrigin(const WebTouchEvent&, bool wasHandled);
1438 #elif ENABLE(TOUCH_EVENTS)
1439     void touchEvent(const WebTouchEvent&);
1440 #endif
1441
1442     void cancelPointer(WebCore::PointerID, const WebCore::IntPoint&);
1443     void touchWithIdentifierWasRemoved(WebCore::PointerID);
1444
1445 #if ENABLE(CONTEXT_MENUS)
1446     void contextMenuHidden() { m_isShowingContextMenu = false; }
1447 #endif
1448 #if ENABLE(CONTEXT_MENU_EVENT)
1449     void contextMenuForKeyEvent();
1450 #endif
1451
1452     static bool scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity);
1453     static bool logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity);
1454
1455     void loadURLInFrame(URL&&, const String& referrer, WebCore::FrameIdentifier);
1456     void loadDataInFrame(IPC::DataReference&&, String&& MIMEType, String&& encodingName, URL&& baseURL, WebCore::FrameIdentifier);
1457
1458     enum class WasRestoredByAPIRequest { No, Yes };
1459     void restoreSessionInternal(const Vector<BackForwardListItemState>&, WasRestoredByAPIRequest, WebBackForwardListProxy::OverwriteExistingItem);
1460     void restoreSession(const Vector<BackForwardListItemState>&);
1461     void didRemoveBackForwardItem(const WebCore::BackForwardItemIdentifier&);
1462     void updateBackForwardListForReattach(const Vector<WebKit::BackForwardListItemState>&);
1463     void setCurrentHistoryItemForReattach(WebKit::BackForwardListItemState&&);
1464
1465     void requestFontAttributesAtSelectionStart(CallbackID);
1466
1467 #if ENABLE(REMOTE_INSPECTOR)
1468     void setIndicating(bool);
1469 #endif
1470
1471     void setBackgroundColor(const Optional<WebCore::Color>&);
1472
1473 #if PLATFORM(COCOA)
1474     void setTopContentInsetFenced(float, IPC::Attachment);
1475 #endif
1476     void setTopContentInset(float);
1477
1478     void viewWillStartLiveResize();
1479     void viewWillEndLiveResize();
1480
1481     void getContentsAsString(ContentAsStringIncludesChildFrames, CallbackID);
1482 #if PLATFORM(COCOA)
1483     void getContentsAsAttributedString(CompletionHandler<void(const AttributedString&)>&&);
1484 #endif
1485 #if ENABLE(MHTML)
1486     void getContentsAsMHTMLData(CallbackID);
1487 #endif
1488     void getMainResourceDataOfFrame(WebCore::FrameIdentifier, CallbackID);
1489     void getResourceDataFromFrame(WebCore::FrameIdentifier, const String& resourceURL, CallbackID);
1490     void getRenderTreeExternalRepresentation(CallbackID);
1491     void getSelectionOrContentsAsString(CallbackID);
1492     void getSelectionAsWebArchiveData(CallbackID);
1493     void getSourceForFrame(WebCore::FrameIdentifier, CallbackID);
1494     void getWebArchiveOfFrame(WebCore::FrameIdentifier, CallbackID);
1495     void runJavaScript(WebFrame*, WebCore::RunJavaScriptParameters&&, ContentWorldIdentifier, CallbackID);
1496     void runJavaScriptInFrameInScriptWorld(WebCore::RunJavaScriptParameters&&, Optional<WebCore::FrameIdentifier>, const std::pair<ContentWorldIdentifier, String>& worldData, CallbackID);
1497     void forceRepaint(CallbackID);
1498     void takeSnapshot(WebCore::IntRect snapshotRect, WebCore::IntSize bitmapSize, uint32_t options, CallbackID);
1499
1500     void preferencesDidChange(const WebPreferencesStore&);
1501     void updatePreferences(const WebPreferencesStore&);
1502     void updatePreferencesGenerated(const WebPreferencesStore&);
1503
1504 #if PLATFORM(IOS_FAMILY)
1505     bool parentProcessHasServiceWorkerEntitlement() const;
1506 #else
1507     bool parentProcessHasServiceWorkerEntitlement() const { return true; }
1508 #endif
1509
1510     void didReceivePolicyDecision(WebCore::FrameIdentifier, uint64_t listenerID, PolicyDecision&&);
1511     void continueWillSubmitForm(WebCore::FrameIdentifier, uint64_t listenerID);
1512     void setUserAgent(const String&);
1513     void setCustomTextEncodingName(const String&);
1514     void suspendActiveDOMObjectsAndAnimations();
1515     void resumeActiveDOMObjectsAndAnimations();
1516
1517 #if PLATFORM(COCOA)
1518     void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
1519     void performDictionaryLookupOfCurrentSelection();
1520     void performDictionaryLookupForRange(WebCore::Frame&, WebCore::Range&, NSDictionary *options, WebCore::TextIndicatorPresentationTransition);
1521     WebCore::DictionaryPopupInfo dictionaryPopupInfoForRange(WebCore::Frame&, WebCore::Range&, NSDictionary *options, WebCore::TextIndicatorPresentationTransition);
1522 #if ENABLE(PDFKIT_PLUGIN)
1523     WebCore::DictionaryPopupInfo dictionaryPopupInfoForSelectionInPDFPlugin(PDFSelection *, PDFPlugin&, NSDictionary *options, WebCore::TextIndicatorPresentationTransition);
1524 #endif
1525
1526     void windowAndViewFramesChanged(const WebCore::FloatRect& windowFrameInScreenCoordinates, const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates, const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
1527
1528     RetainPtr<PDFDocument> pdfDocumentForPrintingFrame(WebCore::Frame*);
1529     void computePagesForPrintingPDFDocument(WebCore::FrameIdentifier, const PrintInfo&, Vector<WebCore::IntRect>& resultPageRects);
1530     void drawPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, const WebCore::IntRect&);
1531     void drawPagesToPDFFromPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, uint32_t first, uint32_t count);
1532 #endif
1533
1534     void setMainFrameIsScrollable(bool);
1535
1536     void unapplyEditCommand(WebUndoStepID commandID);
1537     void reapplyEditCommand(WebUndoStepID commandID);
1538     void didRemoveEditCommand(WebUndoStepID commandID);
1539
1540     void findString(const String&, uint32_t findOptions, uint32_t maxMatchCount, Optional<CallbackID>);
1541     void findStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1542     void getImageForFindMatch(uint32_t matchIndex);
1543     void selectFindMatch(uint32_t matchIndex);
1544     void indicateFindMatch(uint32_t matchIndex);
1545     void hideFindUI();
1546     void countStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1547     void replaceMatches(const Vector<uint32_t>& matchIndices, const String& replacementText, bool selectionOnly, CallbackID);
1548
1549 #if USE(COORDINATED_GRAPHICS)
1550     void sendViewportAttributesChanged(const WebCore::ViewportArguments&);
1551 #endif
1552
1553     void didChangeSelectedIndexForActivePopupMenu(int32_t newIndex);
1554     void setTextForActivePopupMenu(int32_t index);
1555
1556 #if PLATFORM(GTK)
1557     void failedToShowPopupMenu();
1558 #endif
1559
1560     void didChooseFilesForOpenPanel(const Vector<String>&);
1561     void didCancelForOpenPanel();
1562
1563 #if PLATFORM(IOS_FAMILY)
1564     void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const IPC::DataReference& iconData);
1565     bool isTransparentOrFullyClipped(const WebCore::Element&) const;
1566 #endif
1567
1568 #if ENABLE(SANDBOX_EXTENSIONS)
1569     void extendSandboxForFilesFromOpenPanel(SandboxExtension::HandleArray&&);
1570 #endif
1571
1572     void didReceiveGeolocationPermissionDecision(uint64_t geolocationID, const String& authorizationToken);
1573
1574     void didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed);
1575
1576 #if ENABLE(MEDIA_STREAM)
1577     void userMediaAccessWasGranted(uint64_t userMediaID, WebCore::CaptureDevice&& audioDeviceUID, WebCore::CaptureDevice&& videoDeviceUID, String&& mediaDeviceIdentifierHashSalt, SandboxExtension::Handle&&, CompletionHandler<void()>&&);
1578     void userMediaAccessWasDenied(uint64_t userMediaID, uint64_t reason, String&& invalidConstraint);
1579
1580 #endif
1581
1582     void stopAllMediaPlayback();
1583     void suspendAllMediaPlayback();
1584     void resumeAllMediaPlayback();
1585
1586     void advanceToNextMisspelling(bool startBeforeSelection);
1587     void changeSpellingToWord(const String& word);
1588
1589 #if USE(APPKIT)
1590     void uppercaseWord();
1591     void lowercaseWord();
1592     void capitalizeWord();
1593 #endif
1594
1595     bool shouldDispatchSyntheticMouseEventsWhenModifyingSelection() const;
1596     void platformDidSelectAll();
1597     
1598     void setHasResourceLoadClient(bool);
1599
1600 #if ENABLE(CONTEXT_MENUS)
1601     void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&);
1602 #endif
1603
1604     void changeSelectedIndex(int32_t index);
1605     void setCanStartMediaTimerFired();
1606
1607     static bool platformCanHandleRequest(const WebCore::ResourceRequest&);
1608
1609     static PluginView* focusedPluginViewForFrame(WebCore::Frame&);
1610
1611     void reportUsedFeatures();
1612
1613     void updateWebsitePolicies(WebsitePoliciesData&&);
1614
1615     void changeFont(WebCore::FontChanges&&);
1616     void changeFontAttributes(WebCore::FontAttributeChanges&&);
1617
1618 #if PLATFORM(MAC)
1619     void performImmediateActionHitTestAtLocation(WebCore::FloatPoint);
1620     std::tuple<RefPtr<WebCore::Range>, NSDictionary *> lookupTextAtLocation(WebCore::FloatPoint);
1621     void immediateActionDidUpdate();
1622     void immediateActionDidCancel();
1623     void immediateActionDidComplete();
1624
1625     void dataDetectorsDidPresentUI(WebCore::PageOverlay::PageOverlayID);
1626     void dataDetectorsDidChangeUI(WebCore::PageOverlay::PageOverlayID);
1627     void dataDetectorsDidHideUI(WebCore::PageOverlay::PageOverlayID);
1628
1629     void handleAcceptedCandidate(WebCore::TextCheckingResult);
1630 #endif
1631
1632 #if PLATFORM(COCOA)
1633     void requestActiveNowPlayingSessionInfo(CallbackID);
1634     RetainPtr<NSData> accessibilityRemoteTokenData() const;
1635     void accessibilityTransferRemoteToken(RetainPtr<NSData>);
1636 #endif
1637
1638     void setShouldDispatchFakeMouseMoveEvents(bool dispatch) { m_shouldDispatchFakeMouseMoveEvents = dispatch; }
1639
1640 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
1641     void playbackTargetSelected(uint64_t, const WebCore::MediaPlaybackTargetContext& outputDevice) const;
1642     void playbackTargetAvailabilityDidChange(uint64_t, bool);
1643     void setShouldPlayToPlaybackTarget(uint64_t, bool);
1644     void playbackTargetPickerWasDismissed(uint64_t);
1645 #endif
1646
1647     void clearWheelEventTestMonitor();
1648
1649     void setShouldScaleViewToFitDocument(bool);
1650
1651     void pageStoppedScrolling();
1652
1653 #if ENABLE(VIDEO) && USE(GSTREAMER)
1654     void didEndRequestInstallMissingMediaPlugins(uint32_t result);
1655 #endif
1656
1657     void setUserInterfaceLayoutDirection(uint32_t);
1658
1659     bool canPluginHandleResponse(const WebCore::ResourceResponse&);
1660
1661     void simulateDeviceOrientationChange(double alpha, double beta, double gamma);
1662
1663 #if USE(SYSTEM_PREVIEW)
1664     void systemPreviewActionTriggered(WebCore::SystemPreviewInfo, const String& message);
1665 #endif
1666
1667 #if ENABLE(SPEECH_SYNTHESIS)
1668     void speakingErrorOccurred();
1669     void boundaryEventOccurred(bool wordBoundary, unsigned charIndex);
1670     void voicesDidChange();
1671 #endif
1672
1673     void frameBecameRemote(WebCore::FrameIdentifier, WebCore::GlobalFrameIdentifier&& remoteFrameIdentifier, WebCore::GlobalWindowIdentifier&& remoteWindowIdentifier);
1674
1675     void registerURLSchemeHandler(uint64_t identifier, const String& scheme);
1676
1677     void urlSchemeTaskDidPerformRedirection(uint64_t handlerIdentifier, uint64_t taskIdentifier, WebCore::ResourceResponse&&, WebCore::ResourceRequest&&);
1678     void urlSchemeTaskDidReceiveResponse(uint64_t handlerIdentifier, uint64_t taskIdentifier, const WebCore::ResourceResponse&);
1679     void urlSchemeTaskDidReceiveData(uint64_t handlerIdentifier, uint64_t taskIdentifier, const IPC::SharedBufferDataReference&);
1680     void urlSchemeTaskDidComplete(uint64_t handlerIdentifier, uint64_t taskIdentifier, const WebCore::ResourceError&);
1681
1682     void setShouldFireResizeEvents(bool);
1683
1684     void setIsSuspended(bool);
1685
1686     RefPtr<WebImage> snapshotAtSize(const WebCore::IntRect&, const WebCore::IntSize& bitmapSize, SnapshotOptions);
1687     RefPtr<WebImage> snapshotNode(WebCore::Node&, SnapshotOptions, unsigned maximumPixelCount = std::numeric_limits<unsigned>::max());
1688 #if PLATFORM(COCOA)
1689     RetainPtr<CFDataRef> pdfSnapshotAtSize(WebCore::IntRect, WebCore::IntSize bitmapSize, SnapshotOptions);
1690 #endif
1691
1692 #if ENABLE(ATTACHMENT_ELEMENT)
1693     RefPtr<WebCore::HTMLAttachmentElement> attachmentElementWithIdentifier(const String& identifier) const;
1694 #endif
1695
1696     bool canShowMIMEType(const String&, const Function<bool(const String&, WebCore::PluginData::AllowedPluginTypes)>& supportsPlugin) const;
1697
1698     void cancelGesturesBlockedOnSynchronousReplies();
1699
1700     bool shouldDispatchUpdateAfterFocusingElement(const WebCore::Element&) const;
1701
1702     void updateMockAccessibilityElementAfterCommittingLoad();
1703
1704     void paintSnapshotAtSize(const WebCore::IntRect&, const WebCore::IntSize&, SnapshotOptions, WebCore::Frame&, WebCore::FrameView&, WebCore::GraphicsContext&);
1705
1706 #if PLATFORM(GTK) || PLATFORM(WPE)
1707     void sendMessageToWebExtension(UserMessage&&);
1708     void sendMessageToWebExtensionWithReply(UserMessage&&, CompletionHandler<void(UserMessage&&)>&&);
1709 #endif
1710
1711     WebCore::PageIdentifier m_identifier;
1712
1713     std::unique_ptr<WebCore::Page> m_page;
1714     Ref<WebFrame> m_mainFrame;
1715
1716     RefPtr<WebPageGroupProxy> m_pageGroup;
1717
1718     String m_userAgent;
1719
1720     WebCore::IntSize m_viewSize;
1721     std::unique_ptr<DrawingArea> m_drawingArea;
1722
1723     HashSet<PluginView*> m_pluginViews;
1724     bool m_hasSeenPlugin { false };
1725
1726     HashMap<uint64_t, RefPtr<WebCore::TextCheckingRequest>> m_pendingTextCheckingRequestMap;
1727
1728     bool m_useFixedLayout { false };
1729
1730     WebCore::Color m_underlayColor;
1731
1732     bool m_isInRedo { false };
1733     bool m_isClosed { false };
1734     bool m_tabToLinks { false };
1735     
1736     bool m_asynchronousPluginInitializationEnabled { false };
1737     bool m_asynchronousPluginInitializationEnabledForAllPlugins { false };
1738     bool m_artificialPluginInitializationDelayEnabled { false };
1739     bool m_scrollingPerformanceLoggingEnabled { false };
1740     bool m_mainFrameIsScrollable { true };
1741
1742     bool m_alwaysShowsHorizontalScroller { false };
1743     bool m_alwaysShowsVerticalScroller { false };
1744
1745     bool m_shouldRenderCanvasInGPUProcess { false };
1746     bool m_needsInAppBrowserPrivacyQuirks { false };
1747
1748 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
1749     bool m_readyToFindPrimarySnapshottedPlugin { false };
1750     bool m_didFindPrimarySnapshottedPlugin { false };
1751     unsigned m_numberOfPrimarySnapshotDetectionAttempts { 0 };
1752     String m_primaryPlugInPageOrigin;
1753     String m_primaryPlugInOrigin;
1754     String m_primaryPlugInMimeType;
1755     RunLoop::Timer<WebPage> m_determinePrimarySnapshottedPlugInTimer;
1756 #endif
1757
1758     // The layer hosting mode.
1759     LayerHostingMode m_layerHostingMode;
1760
1761 #if PLATFORM(COCOA)
1762     bool m_pdfPluginEnabled { false };
1763     bool m_hasCachedWindowFrame { false };
1764
1765     // The frame of the containing window in screen coordinates.
1766     WebCore::FloatRect m_windowFrameInScreenCoordinates;
1767
1768     // The frame of the containing window in unflipped screen coordinates.
1769     WebCore::FloatRect m_windowFrameInUnflippedScreenCoordinates;
1770
1771     // The frame of the view in window coordinates.
1772     WebCore::FloatRect m_viewFrameInWindowCoordinates;
1773
1774     // The accessibility position of the view.
1775     WebCore::FloatPoint m_accessibilityPosition;
1776     
1777     RetainPtr<WKAccessibilityWebPageObject> m_mockAccessibilityElement;
1778 #endif
1779
1780 #if ENABLE(PLATFORM_DRIVEN_TEXT_CHECKING)
1781     UniqueRef<TextCheckingControllerProxy> m_textCheckingControllerProxy;
1782 #endif
1783
1784 #if PLATFORM(COCOA) || PLATFORM(GTK)
1785     std::unique_ptr<ViewGestureGeometryCollector> m_viewGestureGeometryCollector;
1786 #endif
1787
1788 #if PLATFORM(COCOA)
1789     RetainPtr<NSDictionary> m_dataDetectionContext;
1790 #endif
1791
1792 #if ENABLE(ACCESSIBILITY) && USE(ATK)
1793     GRefPtr<AtkObject> m_accessibilityObject;
1794 #endif
1795
1796 #if !PLATFORM(IOS_FAMILY)
1797     RefPtr<PageBanner> m_headerBanner;
1798     RefPtr<PageBanner> m_footerBanner;
1799 #endif
1800
1801     RunLoop::Timer<WebPage> m_setCanStartMediaTimer;
1802     bool m_mayStartMediaWhenInWindow { false };
1803
1804     HashMap<WebUndoStepID, RefPtr<WebUndoStep>> m_undoStepMap;
1805
1806 #if ENABLE(CONTEXT_MENUS)
1807     std::unique_ptr<API::InjectedBundle::PageContextMenuClient> m_contextMenuClient;
1808 #endif
1809     std::unique_ptr<API::InjectedBundle::EditorClient> m_editorClient;
1810     std::unique_ptr<API::InjectedBundle::FormClient> m_formClient;
1811     std::unique_ptr<API::InjectedBundle::PageLoaderClient> m_loaderClient;
1812     InjectedBundlePagePolicyClient m_policyClient;
1813     std::unique_ptr<API::InjectedBundle::ResourceLoadClient> m_resourceLoadClient;
1814     std::unique_ptr<API::InjectedBundle::PageUIClient> m_uiClient;
1815 #if ENABLE(FULLSCREEN_API)
1816     InjectedBundlePageFullScreenClient m_fullScreenClient;
1817 #endif
1818
1819     UniqueRef<FindController> m_findController;
1820
1821     RefPtr<WebInspector> m_inspector;
1822     RefPtr<WebInspectorUI> m_inspectorUI;
1823     RefPtr<RemoteWebInspectorUI> m_remoteInspectorUI;
1824     std::unique_ptr<WebPageInspectorTargetController> m_inspectorTargetController;
1825
1826 #if (PLATFORM(IOS_FAMILY) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
1827     RefPtr<PlaybackSessionManager> m_playbackSessionManager;
1828     RefPtr<VideoFullscreenManager> m_videoFullscreenManager;
1829 #endif
1830
1831 #if PLATFORM(IOS_FAMILY)
1832     bool m_allowsMediaDocumentInlinePlayback { false };
1833     RefPtr<WebCore::Range> m_startingGestureRange;
1834 #endif
1835
1836 #if ENABLE(FULLSCREEN_API)
1837     RefPtr<WebFullScreenManager> m_fullScreenManager;
1838 #endif
1839
1840     RefPtr<WebPopupMenu> m_activePopupMenu;
1841
1842 #if ENABLE(CONTEXT_MENUS)
1843     RefPtr<WebContextMenu> m_contextMenu;
1844 #endif
1845
1846 #if ENABLE(INPUT_TYPE_COLOR)
1847     WebColorChooser* m_activeColorChooser { nullptr };
1848 #endif
1849
1850 #if ENABLE(DATALIST_ELEMENT)
1851     WeakPtr<WebDataListSuggestionPicker> m_activeDataListSuggestionPicker;
1852 #endif
1853
1854     RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener;
1855     RefPtr<NotificationPermissionRequestManager> m_notificationPermissionRequestManager;
1856
1857     Ref<WebUserContentController> m_userContentController;
1858
1859 #if ENABLE(GEOLOCATION)
1860     UniqueRef<GeolocationPermissionRequestManager> m_geolocationPermissionRequestManager;
1861 #endif
1862
1863 #if ENABLE(MEDIA_STREAM)
1864     UniqueRef<UserMediaPermissionRequestManager> m_userMediaPermissionRequestManager;
1865 #endif
1866
1867     std::unique_ptr<WebCore::PrintContext> m_printContext;
1868 #if PLATFORM(GTK)
1869     RefPtr<WebPrintOperationGtk> m_printOperation;
1870 #endif
1871
1872     SandboxExtensionTracker m_sandboxExtensionTracker;
1873
1874     RefPtr<SandboxExtension> m_pendingDropSandboxExtension;
1875     Vector<RefPtr<SandboxExtension>> m_pendingDropExtensionsForFileUpload;
1876
1877     PAL::HysteresisActivity m_pageScrolledHysteresis;
1878
1879     bool m_canRunBeforeUnloadConfirmPanel { false };
1880
1881     bool m_canRunModal { false };
1882     bool m_isRunningModal { false };
1883
1884 #if ENABLE(DRAG_SUPPORT)
1885     bool m_isStartingDrag { false };
1886     WebCore::DragSourceAction m_allowedDragSourceActions { WebCore::DragSourceActionAny };
1887 #endif
1888
1889 #if ENABLE(DRAG_SUPPORT) && PLATFORM(IOS_FAMILY)
1890     HashSet<RefPtr<WebCore::HTMLImageElement>> m_pendingImageElementsForDropSnapshot;
1891     RefPtr<WebCore::Range> m_rangeForDropSnapshot;
1892 #endif
1893
1894     bool m_cachedMainFrameIsPinnedToLeftSide { true };
1895     bool m_cachedMainFrameIsPinnedToRightSide { true };
1896     bool m_cachedMainFrameIsPinnedToTopSide { true };
1897     bool m_cachedMainFrameIsPinnedToBottomSide { true };
1898     bool m_canShortCircuitHorizontalWheelEvents { false };
1899     bool m_hasWheelEventHandlers { false };
1900
1901     unsigned m_cachedPageCount { 0 };
1902
1903     HashSet<unsigned long> m_trackedNetworkResourceRequestIdentifiers;
1904
1905     WebCore::IntSize m_minimumSizeForAutoLayout;
1906     bool m_autoSizingShouldExpandToViewHeight { false };
1907     Optional<WebCore::IntSize> m_viewportSizeForCSSViewportUnits;
1908
1909     bool m_userIsInteracting { false };
1910     bool m_hasEverFocusedElementDueToUserInteractionSincePageTransition { false };
1911
1912 #if HAVE(TOUCH_BAR)
1913     bool m_isTouchBarUpdateSupressedForHiddenContentEditable { false };
1914     bool m_isNeverRichlyEditableForTouchBar { false };
1915 #endif
1916     OptionSet<WebCore::ActivityState::Flag> m_lastActivityStateChanges;
1917
1918 #if ENABLE(CONTEXT_MENUS)
1919     bool m_isShowingContextMenu { false };
1920 #endif
1921
1922     RefPtr<WebCore::Element> m_focusedElement;
1923     RefPtr<WebCore::Element> m_recentlyBlurredElement;
1924     bool m_hasPendingInputContextUpdateAfterBlurringAndRefocusingElement { false };
1925     bool m_hasPendingEditorStateUpdate { false };
1926
1927 #if ENABLE(IOS_TOUCH_EVENTS)
1928     CompletionHandler<void(bool)> m_pendingSynchronousTouchEventReply;
1929 #endif
1930
1931 #if ENABLE(META_VIEWPORT)
1932     WebCore::ViewportConfiguration m_viewportConfiguration;
1933     bool m_useTestingViewportConfiguration { false };
1934     bool m_forceAlwaysUserScalable { false };
1935     bool m_ignoreViewportScalingConstraints { false };
1936 #endif
1937
1938 #if PLATFORM(IOS_FAMILY)
1939     RefPtr<WebCore::Range> m_currentWordRange;
1940     RefPtr<WebCore::Node> m_interactionNode;
1941     WebCore::IntPoint m_lastInteractionLocation;
1942
1943     bool m_isShowingInputViewForFocusedElement { false };
1944     
1945     enum SelectionAnchor { Start, End };
1946     SelectionAnchor m_selectionAnchor { Start };
1947
1948     RefPtr<WebCore::Node> m_potentialTapNode;
1949     WebCore::FloatPoint m_potentialTapLocation;
1950     RefPtr<WebCore::SecurityOrigin> m_potentialTapSecurityOrigin;
1951
1952     bool m_hasReceivedVisibleContentRectsAfterDidCommitLoad { false };
1953     bool m_hasRestoredExposedContentRectAfterDidCommitLoad { false };
1954     bool m_scaleWasSetByUIProcess { false };
1955     bool m_userHasChangedPageScaleFactor { false };
1956     bool m_hasStablePageScaleFactor { true };
1957     bool m_isInStableState { true };
1958     bool m_shouldRevealCurrentSelectionAfterInsertion { true };
1959     MonotonicTime m_oldestNonStableUpdateVisibleContentRectsTimestamp;
1960     Seconds m_estimatedLatency { 0 };
1961     WebCore::FloatSize m_screenSize;
1962     WebCore::FloatSize m_availableScreenSize;
1963     WebCore::FloatSize m_overrideScreenSize;
1964
1965     RefPtr<WebCore::Range> m_initialSelection;
1966     WebCore::VisibleSelection m_storedSelectionForAccessibility { WebCore::VisibleSelection() };
1967     WebCore::FloatSize m_maximumUnobscuredSize;
1968     int32_t m_deviceOrientation { 0 };
1969     bool m_keyboardIsAttached { false };
1970     bool m_canShowWhileLocked { false };
1971     bool m_inDynamicSizeUpdate { false };
1972     HashMap<std::pair<WebCore::IntSize, double>, WebCore::IntPoint> m_dynamicSizeUpdateHistory;
1973     RefPtr<WebCore::Node> m_pendingSyntheticClickNode;
1974     WebCore::FloatPoint m_pendingSyntheticClickLocation;
1975     WebCore::FloatRect m_previousExposedContentRect;
1976     OptionSet<WebKit::WebEvent::Modifier> m_pendingSyntheticClickModifiers;
1977     WebCore::PointerID m_pendingSyntheticClickPointerId { 0 };
1978     FocusedElementIdentifier m_currentFocusedElementIdentifier { 0 };
1979     Optional<DynamicViewportSizeUpdateID> m_pendingDynamicViewportSizeUpdateID;
1980     double m_lastTransactionPageScaleFactor { 0 };
1981     TransactionID m_lastTransactionIDWithScaleChange;
1982
1983     CompletionHandler<void(InteractionInformationAtPosition&&)> m_pendingSynchronousPositionInformationReply;
1984 #endif
1985
1986     WebCore::Timer m_layerVolatilityTimer;
1987     Vector<Function<void(bool)>> m_markLayersAsVolatileCompletionHandlers;
1988     bool m_isSuspendedUnderLock { false };
1989
1990     HashSet<String, ASCIICaseInsensitiveHash> m_mimeTypesWithCustomContentProviders;
1991     Optional<WebCore::Color> m_backgroundColor { WebCore::Color::white };
1992
1993     HashSet<unsigned> m_activeRenderingSuppressionTokens;
1994     unsigned m_maximumRenderingSuppressionToken { 0 };
1995     
1996     WebCore::ScrollPinningBehavior m_scrollPinningBehavior { WebCore::DoNotPin };
1997     Optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle;
1998
1999     bool m_useAsyncScrolling { false };
2000
2001     OptionSet<WebCore::ActivityState::Flag> m_activityState;
2002
2003     bool m_isAppNapEnabled { true };
2004     UserActivity m_userActivity;
2005
2006     uint64_t m_pendingNavigationID { 0 };
2007     Optional<WebsitePoliciesData> m_pendingWebsitePolicies;
2008
2009     bool m_mainFrameProgressCompleted { false };
2010     bool m_shouldDispatchFakeMouseMoveEvents { true };
2011     bool m_isEditorStateMissingPostLayoutData { false };
2012     bool m_isSelectingTextWhileInsertingAsynchronously { false };
2013
2014     enum class EditorStateIsContentEditable { No, Yes, Unset };
2015     mutable EditorStateIsContentEditable m_lastEditorStateWasContentEditable { EditorStateIsContentEditable::Unset };
2016
2017 #if PLATFORM(GTK) || PLATFORM(WPE)
2018     Optional<InputMethodState> m_inputMethodState;
2019 #endif
2020
2021 #if ENABLE(VIDEO) && USE(GSTREAMER)
2022     RefPtr<WebCore::MediaPlayerRequestInstallMissingPluginsCallback> m_installMediaPluginsCallback;
2023 #endif
2024
2025 #if USE(OS_STATE)
2026     WallTime m_loadCommitTime;
2027 #endif
2028
2029     WebCore::UserInterfaceLayoutDirection m_userInterfaceLayoutDirection { WebCore::UserInterfaceLayoutDirection::LTR };
2030
2031     const String m_overrideContentSecurityPolicy;
2032     const Optional<double> m_cpuLimit;
2033
2034 #if USE(WPE_RENDERER)
2035     IPC::Attachment m_hostFileDescriptor;
2036 #endif
2037
2038     HashMap<String, RefPtr<WebURLSchemeHandlerProxy>> m_schemeToURLSchemeHandlerProxyMap;
2039     HashMap<uint64_t, WebURLSchemeHandlerProxy*> m_identifierToURLSchemeHandlerProxyMap;
2040
2041     HashMap<uint64_t, Function<void(bool granted)>> m_storageAccessResponseCallbackMap;
2042     HashMap<ShareSheetCallbackID, Function<void(bool completed)>> m_shareSheetResponseCallbackMap;
2043
2044 #if ENABLE(APPLICATION_MANIFEST)
2045     HashMap<uint64_t, uint64_t> m_applicationManifestFetchCallbackMap;
2046 #endif
2047
2048     OptionSet<LayerTreeFreezeReason> m_layerTreeFreezeReasons;
2049     bool m_isSuspended { false };
2050     bool m_needsFontAttributes { false };
2051     bool m_firstFlushAfterCommit { false };
2052 #if PLATFORM(COCOA)
2053     WeakPtr<WebRemoteObjectRegistry> m_remoteObjectRegistry;
2054 #endif
2055     WebPageProxyIdentifier m_webPageProxyIdentifier;
2056     WebCore::IntSize m_lastSentIntrinsicContentSize;
2057 #if ENABLE(VIEWPORT_RESIZING)
2058     WebCore::DeferrableOneShotTimer m_shrinkToFitContentTimer;
2059 #endif
2060 #if HAVE(VISIBILITY_PROPAGATION_VIEW)
2061     std::unique_ptr<LayerHostingContext> m_contextForVisibilityPropagation;
2062 #endif
2063 #if ENABLE(TEXT_AUTOSIZING)
2064     WebCore::Timer m_textAutoSizingAdjustmentTimer;
2065 #endif
2066
2067 #if ENABLE(RESOURCE_LOAD_STATISTICS)
2068     HashMap<WebCore::RegistrableDomain, WebCore::RegistrableDomain> m_domainsWithPageLevelStorageAccess;
2069     HashSet<WebCore::RegistrableDomain> m_loadedThirdPartyDomains;
2070 #endif
2071
2072     String m_overriddenMediaType;
2073     String m_processDisplayName;
2074     WebCore::AllowsContentJavaScript m_allowsContentJavaScriptFromMostRecentNavigation { WebCore::AllowsContentJavaScript::Yes };
2075
2076 #if PLATFORM(GTK)
2077     String m_themeName;
2078 #endif
2079     
2080     NavigatingToAppBoundDomain m_isNavigatingToAppBoundDomain { NavigatingToAppBoundDomain::No };
2081     NavigatedAwayFromAppBoundDomain m_hasNavigatedAwayFromAppBoundDomain { NavigatedAwayFromAppBoundDomain::No };
2082 };
2083
2084 #if !PLATFORM(IOS_FAMILY)
2085 inline void WebPage::platformWillPerformEditingCommand() { }
2086 #endif
2087
2088 } // namespace WebKit
2089