Inserting a space after inserting an accepted candidate scrolls the document and...
[WebKit-https.git] / Source / WebKit2 / UIProcess / WebPageProxy.h
1 /*
2  * Copyright (C) 2010-2016 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #pragma once
27
28 #include "APIObject.h"
29 #include "APISession.h"
30 #include "AssistedNodeInformation.h"
31 #include "AutoCorrectionCallback.h"
32 #include "Connection.h"
33 #include "ContextMenuContextData.h"
34 #include "DownloadID.h"
35 #include "DragControllerAction.h"
36 #include "DrawingAreaProxy.h"
37 #include "EditingRange.h"
38 #include "EditorState.h"
39 #include "GeolocationPermissionRequestManagerProxy.h"
40 #include "LayerTreeContext.h"
41 #include "MessageSender.h"
42 #include "NotificationPermissionRequestManagerProxy.h"
43 #include "PageLoadState.h"
44 #include "ProcessThrottler.h"
45 #include "SandboxExtension.h"
46 #include "ShareableBitmap.h"
47 #include "UserMediaPermissionRequestManagerProxy.h"
48 #include "VisibleContentRectUpdateInfo.h"
49 #include "WKBase.h"
50 #include "WKPagePrivate.h"
51 #include "WebColorPicker.h"
52 #include "WebContextMenuItemData.h"
53 #include "WebCoreArgumentCoders.h"
54 #include "WebFrameProxy.h"
55 #include "WebPageCreationParameters.h"
56 #include "WebPageDiagnosticLoggingClient.h"
57 #include "WebPageInjectedBundleClient.h"
58 #include "WebPaymentCoordinatorProxy.h"
59 #include "WebPreferences.h"
60 #include <WebCore/AlternativeTextClient.h> // FIXME: Needed by WebPageProxyMessages.h for DICTATION_ALTERNATIVES.
61 #include "WebPageProxyMessages.h"
62 #include "WebPopupMenuProxy.h"
63 #include "WebProcessLifetimeTracker.h"
64 #include <WebCore/Color.h>
65 #include <WebCore/DragActions.h>
66 #include <WebCore/EventTrackingRegions.h>
67 #include <WebCore/FrameLoaderTypes.h>
68 #include <WebCore/HitTestResult.h>
69 #include <WebCore/MediaProducer.h>
70 #include <WebCore/Page.h>
71 #include <WebCore/PlatformScreen.h>
72 #include <WebCore/ScrollTypes.h>
73 #include <WebCore/SearchPopupMenu.h>
74 #include <WebCore/TextChecking.h>
75 #include <WebCore/TextGranularity.h>
76 #include <WebCore/UserInterfaceLayoutDirection.h>
77 #include <WebCore/ViewState.h>
78 #include <WebCore/VisibleSelection.h>
79 #include <memory>
80 #include <wtf/HashMap.h>
81 #include <wtf/HashSet.h>
82 #include <wtf/PassRefPtr.h>
83 #include <wtf/Ref.h>
84 #include <wtf/RefPtr.h>
85 #include <wtf/Vector.h>
86 #include <wtf/text/WTFString.h>
87
88 OBJC_CLASS NSView;
89 OBJC_CLASS _WKRemoteObjectRegistry;
90
91 #if ENABLE(DRAG_SUPPORT)
92 #include <WebCore/DragActions.h>
93 #endif
94
95 #if ENABLE(TOUCH_EVENTS)
96 #include "NativeWebTouchEvent.h"
97 #endif
98
99 #if PLATFORM(COCOA)
100 #include "LayerRepresentation.h"
101 #endif
102
103 #if PLATFORM(MAC)
104 #include "AttributedString.h"
105 #endif
106
107 #if PLATFORM(IOS)
108 #include "ProcessThrottler.h"
109 #endif
110
111 #if PLATFORM(GTK)
112 #include "ArgumentCodersGtk.h"
113 #endif
114
115 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
116 #include <WebCore/MediaPlaybackTargetPicker.h>
117 #include <WebCore/WebMediaSessionManagerClient.h>
118 #endif
119
120 #if ENABLE(MEDIA_SESSION)
121 namespace WebCore {
122 class MediaSessionMetadata;
123 }
124 #endif
125
126 namespace API {
127 class ContextMenuClient;
128 class FindClient;
129 class FindMatchesClient;
130 class FormClient;
131 class HistoryClient;
132 class LoaderClient;
133 class Navigation;
134 class NavigationClient;
135 class PolicyClient;
136 class UIClient;
137 class URLRequest;
138 }
139
140 namespace IPC {
141 class Decoder;
142 class Connection;
143 }
144
145 namespace WebCore {
146 class AuthenticationChallenge;
147 class Cursor;
148 class DragData;
149 class FloatRect;
150 class GraphicsLayer;
151 class IntSize;
152 class ProtectionSpace;
153 class RunLoopObserver;
154 class SharedBuffer;
155 class TextIndicator;
156 enum class HasInsecureContent;
157 struct DictionaryPopupInfo;
158 struct ExceptionDetails;
159 struct FileChooserSettings;
160 struct SecurityOriginData;
161 struct TextAlternativeWithRange;
162 struct TextCheckingResult;
163 struct ViewportAttributes;
164 struct WindowFeatures;
165 }
166
167 #if PLATFORM(GTK)
168 typedef GtkWidget* PlatformWidget;
169 #endif
170
171 namespace WebKit {
172
173 enum HiddenPageThrottlingAutoIncreasesCounterType { };
174 typedef RefCounter<HiddenPageThrottlingAutoIncreasesCounterType> HiddenPageThrottlingAutoIncreasesCounter;
175
176 class CertificateInfo;
177 class NativeWebGestureEvent;
178 class NativeWebKeyboardEvent;
179 class NativeWebMouseEvent;
180 class NativeWebWheelEvent;
181 class PageClient;
182 class RemoteLayerTreeScrollingPerformanceData;
183 class RemoteLayerTreeTransaction;
184 class RemoteScrollingCoordinatorProxy;
185 class StringPairVector;
186 class UserData;
187 class ViewSnapshot;
188 class VisitedLinkStore;
189 class WebBackForwardList;
190 class WebBackForwardListItem;
191 class WebContextMenuProxy;
192 class WebEditCommandProxy;
193 class WebFullScreenManagerProxy;
194 class WebPlaybackSessionManagerProxy;
195 class WebNavigationState;
196 class WebVideoFullscreenManagerProxy;
197 class WebKeyboardEvent;
198 class WebMouseEvent;
199 class WebOpenPanelResultListenerProxy;
200 class WebPageGroup;
201 class WebProcessProxy;
202 class WebUserContentControllerProxy;
203 class WebWheelEvent;
204 class WebsiteDataStore;
205 struct AttributedString;
206 struct ColorSpaceData;
207 struct EditingRange;
208 struct EditorState;
209 class GamepadData;
210 struct LoadParameters;
211 struct PlatformPopupMenuData;
212 struct PrintInfo;
213 struct WebPopupItem;
214
215 #if ENABLE(VIBRATION)
216 class WebVibrationProxy;
217 #endif
218
219 #if USE(QUICK_LOOK)
220 class QuickLookDocumentData;
221 #endif
222
223 typedef GenericCallback<uint64_t> UnsignedCallback;
224 typedef GenericCallback<EditingRange> EditingRangeCallback;
225 typedef GenericCallback<const String&> StringCallback;
226 typedef GenericCallback<API::SerializedScriptValue*, bool, const WebCore::ExceptionDetails&> ScriptValueCallback;
227
228 #if PLATFORM(GTK)
229 typedef GenericCallback<API::Error*> PrintFinishedCallback;
230 #endif
231
232 #if ENABLE(TOUCH_EVENTS)
233 struct QueuedTouchEvents {
234     QueuedTouchEvents(const NativeWebTouchEvent& event)
235         : forwardedEvent(event)
236     {
237     }
238     NativeWebTouchEvent forwardedEvent;
239     Vector<NativeWebTouchEvent> deferredTouchEvents;
240 };
241 #endif
242
243 typedef GenericCallback<const String&, bool, int32_t> ValidateCommandCallback;
244 typedef GenericCallback<const WebCore::IntRect&, const EditingRange&> RectForCharacterRangeCallback;
245
246 #if PLATFORM(MAC)
247 typedef GenericCallback<const AttributedString&, const EditingRange&> AttributedStringForCharacterRangeCallback;
248 typedef GenericCallback<const String&, double, bool> FontAtSelectionCallback;
249 #endif
250
251 #if PLATFORM(IOS)
252 typedef GenericCallback<const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t> GestureCallback;
253 typedef GenericCallback<const WebCore::IntPoint&, uint32_t, uint32_t> TouchesCallback;
254 struct NodeAssistanceArguments {
255     AssistedNodeInformation m_nodeInformation;
256     bool m_userIsInteracting;
257     bool m_blurPreviousNode;
258     RefPtr<API::Object> m_userData;
259 };
260
261 using DrawToPDFCallback = GenericCallback<const IPC::DataReference&>;
262 #endif
263
264 #if PLATFORM(COCOA)
265 typedef GenericCallback<const WebCore::MachSendRight&> MachSendRightCallback;
266 #endif
267
268 class WebPageProxy : public API::ObjectImpl<API::Object::Type::Page>
269 #if ENABLE(INPUT_TYPE_COLOR)
270     , public WebColorPicker::Client
271 #endif
272 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
273     , public WebCore::WebMediaSessionManagerClient
274 #endif
275     , public WebPopupMenuProxy::Client
276     , public IPC::MessageReceiver
277     , public IPC::MessageSender {
278 public:
279     static Ref<WebPageProxy> create(PageClient&, WebProcessProxy&, uint64_t pageID, Ref<API::PageConfiguration>&&);
280     virtual ~WebPageProxy();
281
282     const API::PageConfiguration& configuration() const;
283
284     uint64_t pageID() const { return m_pageID; }
285     WebCore::SessionID sessionID() const { return m_sessionID; }
286     void setSessionID(WebCore::SessionID);
287
288     WebFrameProxy* mainFrame() const { return m_mainFrame.get(); }
289     WebFrameProxy* focusedFrame() const { return m_focusedFrame.get(); }
290     WebFrameProxy* frameSetLargestFrame() const { return m_frameSetLargestFrame.get(); }
291
292     DrawingAreaProxy* drawingArea() const { return m_drawingArea.get(); }
293
294     WebNavigationState& navigationState() { return *m_navigationState.get(); }
295
296     WebsiteDataStore& websiteDataStore() { return m_websiteDataStore; }
297
298 #if ENABLE(DATA_DETECTION)
299     NSArray *dataDetectionResults() { return m_dataDetectionResults.get(); }
300 #endif
301         
302 #if ENABLE(ASYNC_SCROLLING)
303     RemoteScrollingCoordinatorProxy* scrollingCoordinatorProxy() const { return m_scrollingCoordinatorProxy.get(); }
304 #endif
305
306     WebBackForwardList& backForwardList() { return m_backForwardList; }
307
308     bool addsVisitedLinks() const { return m_addsVisitedLinks; }
309     void setAddsVisitedLinks(bool addsVisitedLinks) { m_addsVisitedLinks = addsVisitedLinks; }
310
311     void fullscreenMayReturnToInline();
312     void didEnterFullscreen();
313     void didExitFullscreen();
314
315     WebInspectorProxy* inspector() const;
316
317     bool isControlledByAutomation() const { return m_controlledByAutomation; }
318     void setControlledByAutomation(bool);
319
320 #if ENABLE(REMOTE_INSPECTOR)
321     bool allowsRemoteInspection() const { return m_allowsRemoteInspection; }
322     void setAllowsRemoteInspection(bool);
323     String remoteInspectionNameOverride() const { return m_remoteInspectionNameOverride; }
324     void setRemoteInspectionNameOverride(const String&);
325 #endif
326
327 #if ENABLE(VIBRATION)
328     WebVibrationProxy* vibration() { return m_vibration.get(); }
329 #endif
330
331 #if ENABLE(FULLSCREEN_API)
332     WebFullScreenManagerProxy* fullScreenManager();
333 #endif
334 #if (PLATFORM(IOS) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
335     WebPlaybackSessionManagerProxy* playbackSessionManager();
336     WebVideoFullscreenManagerProxy* videoFullscreenManager();
337 #endif
338
339 #if PLATFORM(IOS)
340     bool allowsMediaDocumentInlinePlayback() const;
341     void setAllowsMediaDocumentInlinePlayback(bool);
342 #endif
343
344 #if ENABLE(CONTEXT_MENUS)
345     API::ContextMenuClient& contextMenuClient() { return *m_contextMenuClient; }
346     void setContextMenuClient(std::unique_ptr<API::ContextMenuClient>);
347 #endif
348     API::FindClient& findClient() { return *m_findClient; }
349     void setFindClient(std::unique_ptr<API::FindClient>);
350     API::FindMatchesClient& findMatchesClient() { return *m_findMatchesClient; }
351     void setFindMatchesClient(std::unique_ptr<API::FindMatchesClient>);
352     API::DiagnosticLoggingClient& diagnosticLoggingClient() { return *m_diagnosticLoggingClient; }
353     void setDiagnosticLoggingClient(std::unique_ptr<API::DiagnosticLoggingClient>);
354     void setFormClient(std::unique_ptr<API::FormClient>);
355     void setNavigationClient(std::unique_ptr<API::NavigationClient>);
356     void setHistoryClient(std::unique_ptr<API::HistoryClient>);
357     void setLoaderClient(std::unique_ptr<API::LoaderClient>);
358     void setPolicyClient(std::unique_ptr<API::PolicyClient>);
359     void setInjectedBundleClient(const WKPageInjectedBundleClientBase*);
360     WebPageInjectedBundleClient* injectedBundleClient() { return m_injectedBundleClient.get(); }
361
362     API::UIClient& uiClient() { return *m_uiClient; }
363     void setUIClient(std::unique_ptr<API::UIClient>);
364
365     void initializeWebPage();
366
367     void close();
368     bool tryClose();
369     bool isClosed() const { return m_isClosed; }
370
371     void closePage(bool stopResponsivenessTimer);
372
373     void addPlatformLoadParameters(LoadParameters&);
374     RefPtr<API::Navigation> loadRequest(const WebCore::ResourceRequest&, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes, API::Object* userData = nullptr);
375     RefPtr<API::Navigation> loadFile(const String& fileURL, const String& resourceDirectoryURL, API::Object* userData = nullptr);
376     RefPtr<API::Navigation> loadData(API::Data*, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr);
377     RefPtr<API::Navigation> loadHTMLString(const String& htmlString, const String& baseURL, API::Object* userData = nullptr);
378     void loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL, API::Object* userData = nullptr);
379     void loadPlainTextString(const String&, API::Object* userData = nullptr);
380     void loadWebArchiveData(API::Data*, API::Object* userData = nullptr);
381     void navigateToPDFLinkWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint);
382
383     void stopLoading();
384     RefPtr<API::Navigation> reload(bool reloadFromOrigin, bool contentBlockersEnabled);
385
386     RefPtr<API::Navigation> goForward();
387     RefPtr<API::Navigation> goBack();
388
389     RefPtr<API::Navigation> goToBackForwardItem(WebBackForwardListItem*);
390     void tryRestoreScrollPosition();
391     void didChangeBackForwardList(WebBackForwardListItem* addedItem, Vector<RefPtr<WebBackForwardListItem>> removed);
392     void willGoToBackForwardListItem(uint64_t itemID, const UserData&);
393
394     bool shouldKeepCurrentBackForwardListItemInList(WebBackForwardListItem*);
395
396     bool willHandleHorizontalScrollEvents() const;
397
398     bool canShowMIMEType(const String& mimeType);
399
400     bool drawsBackground() const { return m_drawsBackground; }
401     void setDrawsBackground(bool);
402
403     float topContentInset() const { return m_topContentInset; }
404     void setTopContentInset(float);
405
406     WebCore::Color underlayColor() const { return m_underlayColor; }
407     void setUnderlayColor(const WebCore::Color&);
408
409     // At this time, m_pageExtendedBackgroundColor can be set via pageExtendedBackgroundColorDidChange() which is a message
410     // from the UIProcess, or by didCommitLayerTree(). When PLATFORM(MAC) adopts UI side compositing, we should get rid of
411     // the message entirely.
412     WebCore::Color pageExtendedBackgroundColor() const { return m_pageExtendedBackgroundColor; }
413
414     void viewWillStartLiveResize();
415     void viewWillEndLiveResize();
416
417     void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, std::function<void (CallbackBase::Error)>);
418     
419     void clearSelection();
420     void restoreSelectionInFocusedEditableElement();
421
422     void setViewNeedsDisplay(const WebCore::Region&);
423     void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin, bool isProgrammaticScroll);
424     
425     void setDelegatesScrolling(bool delegatesScrolling) { m_delegatesScrolling = delegatesScrolling; }
426     bool delegatesScrolling() const { return m_delegatesScrolling; }
427
428     enum class ViewStateChangeDispatchMode { Deferrable, Immediate };
429     void viewStateDidChange(WebCore::ViewState::Flags mayHaveChanged, bool wantsSynchronousReply = false, ViewStateChangeDispatchMode = ViewStateChangeDispatchMode::Deferrable);
430     bool isInWindow() const { return m_viewState & WebCore::ViewState::IsInWindow; }
431     void waitForDidUpdateViewState();
432     void didUpdateViewState() { m_waitingForDidUpdateViewState = false; }
433
434     void layerHostingModeDidChange();
435
436     WebCore::IntSize viewSize() const;
437     bool isViewVisible() const { return m_viewState & WebCore::ViewState::IsVisible; }
438     bool isViewWindowActive() const;
439
440     void addMIMETypeWithCustomContentProvider(const String& mimeType);
441
442     void executeEditCommand(const String& commandName, const String& argument = String());
443     void validateCommand(const String& commandName, std::function<void (const String&, bool, int32_t, CallbackBase::Error)>);
444
445     const EditorState& editorState() const { return m_editorState; }
446     bool canDelete() const { return hasSelectedRange() && isContentEditable(); }
447     bool hasSelectedRange() const { return m_editorState.selectionIsRange; }
448     bool isContentEditable() const { return m_editorState.isContentEditable; }
449     
450     bool maintainsInactiveSelection() const { return m_maintainsInactiveSelection; }
451     void setMaintainsInactiveSelection(bool);
452     void setEditable(bool);
453     bool isEditable() const { return m_isEditable; }
454
455 #if PLATFORM(IOS)
456     void executeEditCommand(const String& commandName, std::function<void (CallbackBase::Error)>);
457     double displayedContentScale() const { return m_lastVisibleContentRectUpdate.scale(); }
458     const WebCore::FloatRect& exposedContentRect() const { return m_lastVisibleContentRectUpdate.exposedContentRect(); }
459     const WebCore::FloatRect& unobscuredContentRect() const { return m_lastVisibleContentRectUpdate.unobscuredContentRect(); }
460
461     void updateVisibleContentRects(const VisibleContentRectUpdateInfo&);
462     void resendLastVisibleContentRects();
463
464     enum class UnobscuredRectConstraint { ConstrainedToDocumentRect, Unconstrained };
465     WebCore::FloatRect computeCustomFixedPositionRect(const WebCore::FloatRect& unobscuredContentRect, double displayedContentScale, UnobscuredRectConstraint = UnobscuredRectConstraint::Unconstrained) const;
466     void overflowScrollViewWillStartPanGesture();
467     void overflowScrollViewDidScroll();
468     void overflowScrollWillStartScroll();
469     void overflowScrollDidEndScroll();
470
471     void dynamicViewportSizeUpdate(const WebCore::FloatSize& minimumLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, double targetScale, int32_t deviceOrientation);
472     void synchronizeDynamicViewportUpdate();
473
474     void setViewportConfigurationMinimumLayoutSize(const WebCore::FloatSize&);
475     void setMaximumUnobscuredSize(const WebCore::FloatSize&);
476     void setDeviceOrientation(int32_t);
477     int32_t deviceOrientation() const { return m_deviceOrientation; }
478     void willCommitLayerTree(uint64_t transactionID);
479
480     void selectWithGesture(const WebCore::IntPoint, WebCore::TextGranularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithAssistedNode, std::function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>);
481     void updateSelectionWithTouches(const WebCore::IntPoint, uint32_t touches, bool baseIsStart, std::function<void (const WebCore::IntPoint&, uint32_t, uint32_t, CallbackBase::Error)>);
482     void selectWithTwoTouches(const WebCore::IntPoint from, const WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, std::function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>);
483     void updateBlockSelectionWithTouch(const WebCore::IntPoint, uint32_t touch, uint32_t handlePosition);
484     void extendSelection(WebCore::TextGranularity);
485     void selectWordBackward();
486     void moveSelectionByOffset(int32_t offset, std::function<void (CallbackBase::Error)>);
487     void selectTextWithGranularityAtPoint(const WebCore::IntPoint, WebCore::TextGranularity, bool isInteractingWithAssistedNode, std::function<void (CallbackBase::Error)>);
488     void selectPositionAtPoint(const WebCore::IntPoint, bool isInteractingWithAssistedNode, std::function<void (CallbackBase::Error)>);
489     void selectPositionAtBoundaryWithDirection(const WebCore::IntPoint, WebCore::TextGranularity, WebCore::SelectionDirection, bool isInteractingWithAssistedNode, std::function<void (CallbackBase::Error)>);
490     void moveSelectionAtBoundaryWithDirection(WebCore::TextGranularity, WebCore::SelectionDirection, std::function<void(CallbackBase::Error)>);
491     void beginSelectionInDirection(WebCore::SelectionDirection, std::function<void (uint64_t, CallbackBase::Error)>);
492     void updateSelectionWithExtentPoint(const WebCore::IntPoint, bool isInteractingWithAssistedNode, std::function<void (uint64_t, CallbackBase::Error)>);
493     void updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint, WebCore::TextGranularity, bool isInteractingWithAssistedNode, std::function<void(uint64_t, CallbackBase::Error)>);
494     void requestAutocorrectionData(const String& textForAutocorrection, std::function<void (const Vector<WebCore::FloatRect>&, const String&, double, uint64_t, CallbackBase::Error)>);
495     void applyAutocorrection(const String& correction, const String& originalText, std::function<void (const String&, CallbackBase::Error)>);
496     bool applyAutocorrection(const String& correction, const String& originalText);
497     void requestAutocorrectionContext(std::function<void (const String&, const String&, const String&, const String&, uint64_t, uint64_t, CallbackBase::Error)>);
498     void getAutocorrectionContext(String& contextBefore, String& markedText, String& selectedText, String& contextAfter, uint64_t& location, uint64_t& length);
499     void requestDictationContext(std::function<void (const String&, const String&, const String&, CallbackBase::Error)>);
500     void replaceDictatedText(const String& oldText, const String& newText);
501     void replaceSelectedText(const String& oldText, const String& newText);
502     void didReceivePositionInformation(const InteractionInformationAtPosition&);
503     void getPositionInformation(const WebCore::IntPoint&, InteractionInformationAtPosition&);
504     void requestPositionInformation(const WebCore::IntPoint&);
505     void startInteractionWithElementAtPosition(const WebCore::IntPoint&);
506     void stopInteraction();
507     void performActionOnElement(uint32_t action);
508     void saveImageToLibrary(const SharedMemory::Handle& imageHandle, uint64_t imageSize);
509     void didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold);
510     void focusNextAssistedNode(bool isForward, std::function<void (CallbackBase::Error)>);
511     void setAssistedNodeValue(const String&);
512     void setAssistedNodeValueAsNumber(double);
513     void setAssistedNodeSelectedIndex(uint32_t index, bool allowMultipleSelection = false);
514     void applicationDidEnterBackground();
515     void applicationDidFinishSnapshottingAfterEnteringBackground();
516     void applicationWillEnterForeground();
517     void applicationWillResignActive();
518     void applicationDidBecomeActive();
519     void zoomToRect(WebCore::FloatRect, double minimumScale, double maximumScale);
520     void commitPotentialTapFailed();
521     void didNotHandleTapAsClick(const WebCore::IntPoint&);
522     void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID);
523     void contentSizeCategoryDidChange(const String& contentSizeCategory);
524     void getSelectionContext(std::function<void(const String&, const String&, const String&, CallbackBase::Error)>);
525     void handleTwoFingerTapAtPoint(const WebCore::IntPoint&, uint64_t requestID);
526     void setForceAlwaysUserScalable(bool);
527 #endif
528 #if ENABLE(DATA_DETECTION)
529     void setDataDetectionResult(const DataDetectionResult&);
530 #endif
531     void didCommitLayerTree(const WebKit::RemoteLayerTreeTransaction&);
532     void layerTreeCommitComplete();
533
534 #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
535     void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect);
536     void commitPageTransitionViewport();
537 #endif
538 #if PLATFORM(EFL)
539     void setThemePath(const String&);
540 #endif
541
542 #if PLATFORM(GTK)
543     void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd);
544     void confirmComposition(const String& compositionString, int64_t selectionStart, int64_t selectionLength);
545     void cancelComposition();
546 #endif
547
548 #if PLATFORM(GTK)
549     void setInputMethodState(bool enabled);
550 #endif
551
552 #if PLATFORM (GTK) && HAVE(GTK_GESTURES)
553     void getCenterForZoomGesture(const WebCore::IntPoint& centerInViewCoordinates, WebCore::IntPoint& center);
554 #endif
555
556 #if PLATFORM(COCOA)
557     void windowAndViewFramesChanged(const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
558     void setMainFrameIsScrollable(bool);
559
560     void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
561     bool shouldDelayWindowOrderingForEvent(const WebMouseEvent&);
562     bool acceptsFirstMouse(int eventNumber, const WebMouseEvent&);
563
564     void setAcceleratedCompositingRootLayer(LayerOrView*);
565     LayerOrView* acceleratedCompositingRootLayer() const;
566
567     void insertTextAsync(const String& text, const EditingRange& replacementRange, bool registerUndoGroup = false, EditingRangeIsRelativeTo = EditingRangeIsRelativeTo::EditableRoot, bool suppressSelectionUpdate = false);
568     void getMarkedRangeAsync(std::function<void (EditingRange, CallbackBase::Error)>);
569     void getSelectedRangeAsync(std::function<void (EditingRange, CallbackBase::Error)>);
570     void characterIndexForPointAsync(const WebCore::IntPoint&, std::function<void (uint64_t, CallbackBase::Error)>);
571     void firstRectForCharacterRangeAsync(const EditingRange&, std::function<void (const WebCore::IntRect&, const EditingRange&, CallbackBase::Error)>);
572     void setCompositionAsync(const String& text, Vector<WebCore::CompositionUnderline> underlines, const EditingRange& selectionRange, const EditingRange& replacementRange);
573     void confirmCompositionAsync();
574
575     void setScrollPerformanceDataCollectionEnabled(bool);
576     bool scrollPerformanceDataCollectionEnabled() const { return m_scrollPerformanceDataCollectionEnabled; }
577     RemoteLayerTreeScrollingPerformanceData* scrollingPerformanceData() { return m_scrollingPerformanceData.get(); }
578 #endif // PLATFORM(COCOA)
579
580 #if PLATFORM(MAC)
581     void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::TextAlternativeWithRange>& dictationAlternatives, bool registerUndoGroup);
582     void attributedSubstringForCharacterRangeAsync(const EditingRange&, std::function<void (const AttributedString&, const EditingRange&, CallbackBase::Error)>);
583     void setFont(const String& fontFamily, double fontSize, uint64_t fontTraits);
584     void fontAtSelection(std::function<void (const String&, double, bool, CallbackBase::Error)>);
585
586     void startWindowDrag();
587     NSWindow *platformWindow();
588     void rootViewToWindow(const WebCore::IntRect& viewRect, WebCore::IntRect& windowRect);
589
590 #if WK_API_ENABLED
591     NSView *inspectorAttachmentView();
592     _WKRemoteObjectRegistry *remoteObjectRegistry();
593 #endif
594
595     void intrinsicContentSizeDidChange(const WebCore::IntSize& intrinsicContentSize);
596     CGRect boundsOfLayerInLayerBackedWindowCoordinates(CALayer *) const;
597 #endif // PLATFORM(MAC)
598
599 #if PLATFORM(EFL)
600     void handleInputMethodKeydown(bool& handled);
601     void confirmComposition(const String&);
602     void setComposition(const String&, Vector<WebCore::CompositionUnderline>&, int);
603     void cancelComposition();
604 #endif
605
606 #if PLATFORM(GTK)
607     PlatformWidget viewWidget();
608     const WebCore::Color& backgroundColor() const { return m_backgroundColor; }
609     void setBackgroundColor(const WebCore::Color& color) { m_backgroundColor = color; }
610 #endif
611
612     void handleMouseEvent(const NativeWebMouseEvent&);
613     void handleWheelEvent(const NativeWebWheelEvent&);
614     void handleKeyboardEvent(const NativeWebKeyboardEvent&);
615
616 #if ENABLE(MAC_GESTURE_EVENTS)
617     void handleGestureEvent(const NativeWebGestureEvent&);
618 #endif
619
620 #if ENABLE(IOS_TOUCH_EVENTS)
621     void handleTouchEventSynchronously(NativeWebTouchEvent&);
622     void handleTouchEventAsynchronously(const NativeWebTouchEvent&);
623
624 #elif ENABLE(TOUCH_EVENTS)
625     void handleTouchEvent(const NativeWebTouchEvent&);
626 #endif
627
628     void scrollBy(WebCore::ScrollDirection, WebCore::ScrollGranularity);
629     void centerSelectionInVisibleArea();
630
631     const String& toolTip() const { return m_toolTip; }
632
633     const String& userAgent() const { return m_userAgent; }
634     void setApplicationNameForUserAgent(const String&);
635     const String& applicationNameForUserAgent() const { return m_applicationNameForUserAgent; }
636     void setCustomUserAgent(const String&);
637     const String& customUserAgent() const { return m_customUserAgent; }
638     static String standardUserAgent(const String& applicationName = String());
639
640     bool supportsTextEncoding() const;
641     void setCustomTextEncodingName(const String&);
642     String customTextEncodingName() const { return m_customTextEncodingName; }
643
644     bool areActiveDOMObjectsAndAnimationsSuspended() const { return m_isPageSuspended; }
645     void resumeActiveDOMObjectsAndAnimations();
646     void suspendActiveDOMObjectsAndAnimations();
647
648     double estimatedProgress() const;
649
650     void terminateProcess();
651
652     SessionState sessionState(const std::function<bool (WebBackForwardListItem&)>& = nullptr) const;
653     RefPtr<API::Navigation> restoreFromSessionState(SessionState, bool navigate);
654
655     bool supportsTextZoom() const;
656     double textZoomFactor() const { return m_textZoomFactor; }
657     void setTextZoomFactor(double);
658     double pageZoomFactor() const;
659     void setPageZoomFactor(double);
660     void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
661
662     void scalePage(double scale, const WebCore::IntPoint& origin);
663     void scalePageInViewCoordinates(double scale, const WebCore::IntPoint& centerInViewCoordinates);
664     double pageScaleFactor() const;
665     double viewScaleFactor() const { return m_viewScaleFactor; }
666     void scaleView(double scale);
667     void setShouldScaleViewToFitDocument(bool);
668     
669     float deviceScaleFactor() const;
670     void setIntrinsicDeviceScaleFactor(float);
671     void setCustomDeviceScaleFactor(float);
672     void windowScreenDidChange(WebCore::PlatformDisplayID);
673
674     void setUseFixedLayout(bool);
675     void setFixedLayoutSize(const WebCore::IntSize&);
676     bool useFixedLayout() const { return m_useFixedLayout; };
677     const WebCore::IntSize& fixedLayoutSize() const { return m_fixedLayoutSize; };
678
679     void listenForLayoutMilestones(WebCore::LayoutMilestones);
680
681     bool hasHorizontalScrollbar() const { return m_mainFrameHasHorizontalScrollbar; }
682     bool hasVerticalScrollbar() const { return m_mainFrameHasVerticalScrollbar; }
683
684     void setSuppressScrollbarAnimations(bool);
685     bool areScrollbarAnimationsSuppressed() const { return m_suppressScrollbarAnimations; }
686
687     bool isPinnedToLeftSide() const { return m_mainFrameIsPinnedToLeftSide; }
688     bool isPinnedToRightSide() const { return m_mainFrameIsPinnedToRightSide; }
689     bool isPinnedToTopSide() const { return m_mainFrameIsPinnedToTopSide; }
690     bool isPinnedToBottomSide() const { return m_mainFrameIsPinnedToBottomSide; }
691
692     bool rubberBandsAtLeft() const;
693     void setRubberBandsAtLeft(bool);
694     bool rubberBandsAtRight() const;
695     void setRubberBandsAtRight(bool);
696     bool rubberBandsAtTop() const;
697     void setRubberBandsAtTop(bool);
698     bool rubberBandsAtBottom() const;
699     void setRubberBandsAtBottom(bool);
700
701     void setShouldUseImplicitRubberBandControl(bool shouldUseImplicitRubberBandControl) { m_shouldUseImplicitRubberBandControl = shouldUseImplicitRubberBandControl; }
702     bool shouldUseImplicitRubberBandControl() const { return m_shouldUseImplicitRubberBandControl; }
703         
704     void setEnableVerticalRubberBanding(bool);
705     bool verticalRubberBandingIsEnabled() const;
706     void setEnableHorizontalRubberBanding(bool);
707     bool horizontalRubberBandingIsEnabled() const;
708         
709     void setBackgroundExtendsBeyondPage(bool);
710     bool backgroundExtendsBeyondPage() const;
711
712     void setPaginationMode(WebCore::Pagination::Mode);
713     WebCore::Pagination::Mode paginationMode() const { return m_paginationMode; }
714     void setPaginationBehavesLikeColumns(bool);
715     bool paginationBehavesLikeColumns() const { return m_paginationBehavesLikeColumns; }
716     void setPageLength(double);
717     double pageLength() const { return m_pageLength; }
718     void setGapBetweenPages(double);
719     double gapBetweenPages() const { return m_gapBetweenPages; }
720     void setPaginationLineGridEnabled(bool);
721     bool paginationLineGridEnabled() const { return m_paginationLineGridEnabled; }
722     unsigned pageCount() const { return m_pageCount; }
723
724 #if PLATFORM(COCOA)
725     // Called by the web process through a message.
726     void registerWebProcessAccessibilityToken(const IPC::DataReference&);
727     // Called by the UI process when it is ready to send its tokens to the web process.
728     void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
729     bool readSelectionFromPasteboard(const String& pasteboardName);
730     String stringSelectionForPasteboard();
731     RefPtr<WebCore::SharedBuffer> dataSelectionForPasteboard(const String& pasteboardType);
732     void makeFirstResponder();
733
734     ColorSpaceData colorSpace();
735 #endif
736
737 #if ENABLE(SERVICE_CONTROLS)
738     void replaceSelectionWithPasteboardData(const Vector<String>& types, const IPC::DataReference&);
739 #endif
740
741     void pageScaleFactorDidChange(double);
742     void pluginScaleFactorDidChange(double);
743     void pluginZoomFactorDidChange(double);
744
745     // Find.
746     void findString(const String&, FindOptions, unsigned maxMatchCount);
747     void findStringMatches(const String&, FindOptions, unsigned maxMatchCount);
748     void getImageForFindMatch(int32_t matchIndex);
749     void selectFindMatch(int32_t matchIndex);
750     void didGetImageForFindMatch(const ShareableBitmap::Handle& contentImageHandle, uint32_t matchIndex);
751     void hideFindUI();
752     void countStringMatches(const String&, FindOptions, unsigned maxMatchCount);
753     void didCountStringMatches(const String&, uint32_t matchCount);
754     void setTextIndicator(const WebCore::TextIndicatorData&, uint64_t /* WebCore::TextIndicatorWindowLifetime */ lifetime = 0 /* Permanent */);
755     void setTextIndicatorAnimationProgress(float);
756     void clearTextIndicator();
757     void didFindString(const String&, const Vector<WebCore::IntRect>&, uint32_t matchCount, int32_t matchIndex);
758     void didFailToFindString(const String&);
759     void didFindStringMatches(const String&, const Vector<Vector<WebCore::IntRect>>& matchRects, int32_t firstIndexAfterSelection);
760
761     void getContentsAsString(std::function<void (const String&, CallbackBase::Error)>);
762     void getBytecodeProfile(std::function<void (const String&, CallbackBase::Error)>);
763     void getSamplingProfilerOutput(std::function<void (const String&, CallbackBase::Error)>);
764     void isWebProcessResponsive(std::function<void (bool isWebProcessResponsive)>);
765
766 #if ENABLE(MHTML)
767     void getContentsAsMHTMLData(std::function<void (API::Data*, CallbackBase::Error)>);
768 #endif
769     void getMainResourceDataOfFrame(WebFrameProxy*, std::function<void (API::Data*, CallbackBase::Error)>);
770     void getResourceDataFromFrame(WebFrameProxy*, API::URL*, std::function<void (API::Data*, CallbackBase::Error)>);
771     void getRenderTreeExternalRepresentation(std::function<void (const String&, CallbackBase::Error)>);
772     void getSelectionOrContentsAsString(std::function<void (const String&, CallbackBase::Error)>);
773     void getSelectionAsWebArchiveData(std::function<void (API::Data*, CallbackBase::Error)>);
774     void getSourceForFrame(WebFrameProxy*, std::function<void (const String&, CallbackBase::Error)>);
775     void getWebArchiveOfFrame(WebFrameProxy*, std::function<void (API::Data*, CallbackBase::Error)>);
776     void runJavaScriptInMainFrame(const String&, std::function<void (API::SerializedScriptValue*, bool hadException, const WebCore::ExceptionDetails&, CallbackBase::Error)> callbackFunction);
777     void forceRepaint(PassRefPtr<VoidCallback>);
778
779     float headerHeight(WebFrameProxy*);
780     float footerHeight(WebFrameProxy*);
781     void drawHeader(WebFrameProxy*, const WebCore::FloatRect&);
782     void drawFooter(WebFrameProxy*, const WebCore::FloatRect&);
783
784 #if PLATFORM(COCOA)
785     // Dictionary.
786     void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
787     void performDictionaryLookupOfCurrentSelection();
788 #endif
789
790     void receivedPolicyDecision(WebCore::PolicyAction, WebFrameProxy*, uint64_t listenerID, API::Navigation* navigationID);
791
792     void backForwardRemovedItem(uint64_t itemID);
793
794 #if ENABLE(DRAG_SUPPORT)    
795     // Drag and drop support.
796     void dragEntered(WebCore::DragData&, const String& dragStorageName = String());
797     void dragUpdated(WebCore::DragData&, const String& dragStorageName = String());
798     void dragExited(WebCore::DragData&, const String& dragStorageName = String());
799     void performDragOperation(WebCore::DragData&, const String& dragStorageName, const SandboxExtension::Handle&, const SandboxExtension::HandleArray&);
800
801     void didPerformDragControllerAction(uint64_t dragOperation, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted);
802     void dragEnded(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t operation);
803 #if PLATFORM(COCOA)
804     void setDragImage(const WebCore::IntPoint& clientPosition, const ShareableBitmap::Handle& dragImageHandle, bool isLinkDrag);
805     void setPromisedDataForImage(const String& pasteboardName, const SharedMemory::Handle& imageHandle, uint64_t imageSize, const String& filename, const String& extension,
806                          const String& title, const String& url, const String& visibleURL, const SharedMemory::Handle& archiveHandle, uint64_t archiveSize);
807 #if ENABLE(ATTACHMENT_ELEMENT)
808     void setPromisedDataForAttachment(const String& pasteboardName, const String& filename, const String& extension, const String& title, const String& url, const String& visibleURL);
809 #endif
810 #endif
811 #if PLATFORM(GTK)
812     void startDrag(const WebCore::DragData&, const ShareableBitmap::Handle& dragImage);
813 #endif
814 #endif
815
816     void processDidBecomeUnresponsive();
817     void processDidBecomeResponsive();
818     void processDidCrash();
819     void willChangeProcessIsResponsive();
820     void didChangeProcessIsResponsive();
821
822 #if PLATFORM(IOS)
823     void processWillBecomeSuspended();
824     void processWillBecomeForeground();
825 #endif
826
827     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
828     virtual void exitAcceleratedCompositingMode();
829     virtual void updateAcceleratedCompositingMode(const LayerTreeContext&);
830
831     enum UndoOrRedo { Undo, Redo };
832     void addEditCommand(WebEditCommandProxy*);
833     void removeEditCommand(WebEditCommandProxy*);
834     bool isValidEditCommand(WebEditCommandProxy*);
835     void registerEditCommand(PassRefPtr<WebEditCommandProxy>, UndoOrRedo);
836
837 #if PLATFORM(COCOA)
838     void registerKeypressCommandName(const String& name) { m_knownKeypressCommandNames.add(name); }
839     bool isValidKeypressCommandName(const String& name) const { return m_knownKeypressCommandNames.contains(name); }
840 #endif
841
842     WebProcessProxy& process() { return m_process; }
843     pid_t processIdentifier() const;
844
845     WebPreferences& preferences() { return m_preferences; }
846     void setPreferences(WebPreferences&);
847
848     WebPageGroup& pageGroup() { return m_pageGroup; }
849
850     bool isValid() const;
851
852 #if ENABLE(DRAG_SUPPORT)
853     WebCore::DragOperation currentDragOperation() const { return m_currentDragOperation; }
854     bool currentDragIsOverFileInput() const { return m_currentDragIsOverFileInput; }
855     unsigned currentDragNumberOfFilesToBeAccepted() const { return m_currentDragNumberOfFilesToBeAccepted; }
856     void resetCurrentDragInformation()
857     {
858         m_currentDragOperation = WebCore::DragOperationNone;
859         m_currentDragIsOverFileInput = false;
860         m_currentDragNumberOfFilesToBeAccepted = 0;
861     }
862 #endif
863
864     void preferencesDidChange();
865
866 #if ENABLE(CONTEXT_MENUS)
867     // Called by the WebContextMenuProxy.
868     void contextMenuItemSelected(const WebContextMenuItemData&);
869 #endif
870
871     // Called by the WebOpenPanelResultListenerProxy.
872 #if PLATFORM(IOS)
873     void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const API::Data* iconData);
874 #endif
875     void didChooseFilesForOpenPanel(const Vector<String>&);
876     void didCancelForOpenPanel();
877
878     WebPageCreationParameters creationParameters();
879
880 #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
881     void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize&);
882 #endif
883
884     void handleDownloadRequest(DownloadProxy*);
885
886     void advanceToNextMisspelling(bool startBeforeSelection);
887     void changeSpellingToWord(const String& word);
888 #if USE(APPKIT)
889     void uppercaseWord();
890     void lowercaseWord();
891     void capitalizeWord();
892 #endif
893
894 #if PLATFORM(COCOA)
895     bool isSmartInsertDeleteEnabled() const { return m_isSmartInsertDeleteEnabled; }
896     void setSmartInsertDeleteEnabled(bool);
897 #endif
898
899 #if PLATFORM(GTK)
900     String accessibilityPlugID() const { return m_accessibilityPlugID; }
901 #endif
902
903     void setCanRunModal(bool);
904     bool canRunModal();
905
906     void beginPrinting(WebFrameProxy*, const PrintInfo&);
907     void endPrinting();
908     void computePagesForPrinting(WebFrameProxy*, const PrintInfo&, PassRefPtr<ComputedPagesCallback>);
909 #if PLATFORM(COCOA)
910     void drawRectToImage(WebFrameProxy*, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, PassRefPtr<ImageCallback>);
911     void drawPagesToPDF(WebFrameProxy*, const PrintInfo&, uint32_t first, uint32_t count, PassRefPtr<DataCallback>);
912 #if PLATFORM(IOS)
913     uint32_t computePagesForPrintingAndDrawToPDF(uint64_t frameID, const PrintInfo&, DrawToPDFCallback::CallbackFunction&&);
914     void drawToPDFCallback(const IPC::DataReference& pdfData, uint64_t callbackID);
915 #endif
916 #elif PLATFORM(GTK)
917     void drawPagesForPrinting(WebFrameProxy*, const PrintInfo&, PassRefPtr<PrintFinishedCallback>);
918 #endif
919
920     PageLoadState& pageLoadState() { return m_pageLoadState; }
921
922 #if PLATFORM(COCOA)
923     void handleAlternativeTextUIResult(const String& result);
924 #endif
925
926     void saveDataToFileInDownloadsFolder(const String& suggestedFilename, const String& mimeType, const String& originatingURLString, API::Data*);
927     void savePDFToFileInDownloadsFolder(const String& suggestedFilename, const String& originatingURLString, const IPC::DataReference&);
928 #if PLATFORM(COCOA)
929     void savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
930     void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const IPC::DataReference&, const String& pdfUUID);
931     void openPDFFromTemporaryFolderWithNativeApplication(const String& pdfUUID);
932 #endif
933
934     WebCore::IntRect visibleScrollerThumbRect() const { return m_visibleScrollerThumbRect; }
935
936     uint64_t renderTreeSize() const { return m_renderTreeSize; }
937
938     void printMainFrame();
939     
940     void setMediaVolume(float);
941     void setMuted(bool);
942     void setMayStartMediaWhenInWindow(bool);
943     bool mayStartMediaWhenInWindow() const { return m_mayStartMediaWhenInWindow; }
944         
945 #if ENABLE(MEDIA_SESSION)
946     bool hasMediaSessionWithActiveMediaElements() const { return m_hasMediaSessionWithActiveMediaElements; }
947     void handleMediaEvent(WebCore::MediaEventType);
948     void setVolumeOfMediaElement(double, uint64_t);
949 #endif
950
951     // WebPopupMenuProxy::Client
952     NativeWebMouseEvent* currentlyProcessedMouseDownEvent() override;
953
954     void setSuppressVisibilityUpdates(bool flag);
955     bool suppressVisibilityUpdates() { return m_suppressVisibilityUpdates; }
956
957 #if PLATFORM(IOS)
958     void willStartUserTriggeredZooming();
959
960     void potentialTapAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
961     void commitPotentialTap();
962     void cancelPotentialTap();
963     void tapHighlightAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
964     void handleTap(const WebCore::FloatPoint&);
965
966     void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&);
967     void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&);
968
969     void blurAssistedNode();
970 #endif
971
972     void postMessageToInjectedBundle(const String& messageName, API::Object* messageBody);
973
974 #if ENABLE(INPUT_TYPE_COLOR)
975     void setColorPickerColor(const WebCore::Color&);
976     void endColorPicker();
977 #endif
978
979     WebCore::IntSize minimumLayoutSize() const { return m_minimumLayoutSize; }
980     void setMinimumLayoutSize(const WebCore::IntSize&);
981
982     bool autoSizingShouldExpandToViewHeight() const { return m_autoSizingShouldExpandToViewHeight; }
983     void setAutoSizingShouldExpandToViewHeight(bool);
984
985     void didReceiveAuthenticationChallengeProxy(uint64_t frameID, PassRefPtr<AuthenticationChallengeProxy>);
986
987     int64_t spellDocumentTag();
988     void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
989     void didCancelCheckingText(uint64_t requestID);
990
991     void connectionWillOpen(IPC::Connection&);
992     void webProcessWillShutDown();
993
994     void processDidFinishLaunching();
995
996     void didSaveToPageCache();
997         
998     void setScrollPinningBehavior(WebCore::ScrollPinningBehavior);
999     WebCore::ScrollPinningBehavior scrollPinningBehavior() const { return m_scrollPinningBehavior; }
1000
1001     void setOverlayScrollbarStyle(WTF::Optional<WebCore::ScrollbarOverlayStyle>);
1002     WTF::Optional<WebCore::ScrollbarOverlayStyle> overlayScrollbarStyle() const { return m_scrollbarOverlayStyle; }
1003
1004     bool shouldRecordNavigationSnapshots() const { return m_shouldRecordNavigationSnapshots; }
1005     void setShouldRecordNavigationSnapshots(bool shouldRecordSnapshots) { m_shouldRecordNavigationSnapshots = shouldRecordSnapshots; }
1006     void recordNavigationSnapshot();
1007     void recordNavigationSnapshot(WebBackForwardListItem&);
1008
1009 #if PLATFORM(COCOA)
1010     PassRefPtr<ViewSnapshot> takeViewSnapshot();
1011 #endif
1012
1013 #if ENABLE(SUBTLE_CRYPTO)
1014     void wrapCryptoKey(const Vector<uint8_t>&, bool& succeeded, Vector<uint8_t>&);
1015     void unwrapCryptoKey(const Vector<uint8_t>&, bool& succeeded, Vector<uint8_t>&);
1016 #endif
1017
1018     void takeSnapshot(WebCore::IntRect, WebCore::IntSize bitmapSize, SnapshotOptions, std::function<void (const ShareableBitmap::Handle&, CallbackBase::Error)>);
1019
1020     void navigationGestureDidBegin();
1021     void navigationGestureWillEnd(bool willNavigate, WebBackForwardListItem&);
1022     void navigationGestureDidEnd(bool willNavigate, WebBackForwardListItem&);
1023     void navigationGestureDidEnd();
1024     void navigationGestureSnapshotWasRemoved();
1025     void willRecordNavigationSnapshot(WebBackForwardListItem&);
1026
1027     bool isShowingNavigationGestureSnapshot() const { return m_isShowingNavigationGestureSnapshot; }
1028
1029     bool isPlayingAudio() const { return !!(m_mediaState & WebCore::MediaProducer::IsPlayingAudio); }
1030     void isPlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags, uint64_t);
1031     WebCore::MediaProducer::MediaStateFlags mediaStateFlags() const { return m_mediaState; }
1032
1033 #if PLATFORM(MAC)
1034     void videoControlsManagerDidChange();
1035     bool hasActiveVideoForControlsManager() const;
1036     void requestControlledElementID() const;
1037     void handleControlledElementIDResponse(const String&) const;
1038     bool isPlayingVideoInEnhancedFullscreen() const;
1039 #endif
1040
1041 #if ENABLE(MEDIA_SESSION)
1042     void hasMediaSessionWithActiveMediaElementsDidChange(bool);
1043     void mediaSessionMetadataDidChange(const WebCore::MediaSessionMetadata&);
1044     void focusedContentMediaElementDidChange(uint64_t);
1045 #endif
1046
1047 #if PLATFORM(MAC)
1048     void removeNavigationGestureSnapshot();
1049
1050     API::HitTestResult* lastMouseMoveHitTestResult() const { return m_lastMouseMoveHitTestResult.get(); }
1051     void performImmediateActionHitTestAtLocation(WebCore::FloatPoint);
1052
1053     void immediateActionDidUpdate();
1054     void immediateActionDidCancel();
1055     void immediateActionDidComplete();
1056
1057     void* immediateActionAnimationControllerForHitTestResult(RefPtr<API::HitTestResult>, uint64_t, RefPtr<API::Object>);
1058
1059     void installViewStateChangeCompletionHandler(void(^completionHandler)());
1060
1061     void handleAcceptedCandidate(WebCore::TextCheckingResult);
1062     void didHandleAcceptedCandidate();
1063 #endif
1064
1065 #if PLATFORM(EFL) && HAVE(ACCESSIBILITY) && defined(HAVE_ECORE_X)
1066     bool accessibilityObjectReadByPoint(const WebCore::IntPoint&);
1067     bool accessibilityObjectReadPrevious();
1068     bool accessibilityObjectReadNext();
1069 #endif
1070
1071 #if USE(UNIFIED_TEXT_CHECKING)
1072     void checkTextOfParagraph(const String& text, uint64_t checkingTypes, int32_t insertionPoint, Vector<WebCore::TextCheckingResult>& results);
1073 #endif
1074     void getGuessesForWord(const String& word, const String& context, int32_t insertionPoint, Vector<String>& guesses);
1075
1076     void setShouldDispatchFakeMouseMoveEvents(bool);
1077
1078     // Diagnostic messages logging.
1079     void logDiagnosticMessage(const String& message, const String& description, bool shouldSample);
1080     void logDiagnosticMessageWithResult(const String& message, const String& description, uint32_t result, bool shouldSample);
1081     void logDiagnosticMessageWithValue(const String& message, const String& description, const String& value, bool shouldSample);
1082     void logSampledDiagnosticMessage(const String& message, const String& description);
1083     void logSampledDiagnosticMessageWithResult(const String& message, const String& description, uint32_t result);
1084     void logSampledDiagnosticMessageWithValue(const String& message, const String& description, const String& value);
1085
1086 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
1087     void addPlaybackTargetPickerClient(uint64_t);
1088     void removePlaybackTargetPickerClient(uint64_t);
1089     void showPlaybackTargetPicker(uint64_t, const WebCore::FloatRect&, bool hasVideo);
1090     void playbackTargetPickerClientStateDidChange(uint64_t, WebCore::MediaProducer::MediaStateFlags);
1091     void setMockMediaPlaybackTargetPickerEnabled(bool);
1092     void setMockMediaPlaybackTargetPickerState(const String&, WebCore::MediaPlaybackTargetContext::State);
1093
1094     // WebMediaSessionManagerClient
1095     void setPlaybackTarget(uint64_t, Ref<WebCore::MediaPlaybackTarget>&&) override;
1096     void externalOutputDeviceAvailableDidChange(uint64_t, bool) override;
1097     void setShouldPlayToPlaybackTarget(uint64_t, bool) override;
1098 #endif
1099
1100     void didChangeBackgroundColor();
1101     void didLayoutForCustomContentProvider();
1102
1103     // For testing
1104     void clearWheelEventTestTrigger();
1105     void callAfterNextPresentationUpdate(std::function<void (CallbackBase::Error)>);
1106
1107     void didReachLayoutMilestone(uint32_t layoutMilestones);
1108
1109     void didRestoreScrollPosition();
1110
1111     void setFocus(bool focused);
1112     void setWindowFrame(const WebCore::FloatRect&);
1113     void getWindowFrame(WebCore::FloatRect&);
1114
1115     bool isResourceCachingDisabled() const { return m_isResourceCachingDisabled; }
1116     void setResourceCachingDisabled(bool);
1117
1118     WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection();
1119     void setUserInterfaceLayoutDirection(WebCore::UserInterfaceLayoutDirection);
1120
1121     bool hasHadSelectionChangesFromUserInteraction() const { return m_hasHadSelectionChangesFromUserInteraction; }
1122     bool needsHiddenContentEditableQuirk() const { return m_needsHiddenContentEditableQuirk; }
1123     bool needsPlainTextQuirk() const { return m_needsPlainTextQuirk; }
1124
1125     bool isAlwaysOnLoggingAllowed() const;
1126
1127     void canAuthenticateAgainstProtectionSpace(uint64_t loaderID, uint64_t frameID, const WebCore::ProtectionSpace&);
1128
1129 #if ENABLE(GAMEPAD)
1130     void gamepadActivity(const Vector<GamepadData>&);
1131 #endif
1132
1133 private:
1134     WebPageProxy(PageClient&, WebProcessProxy&, uint64_t pageID, Ref<API::PageConfiguration>&&);
1135     void platformInitialize();
1136
1137     void updateViewState(WebCore::ViewState::Flags flagsToUpdate = WebCore::ViewState::AllFlags);
1138     void updateActivityToken();
1139     void updateProccessSuppressionState();
1140     void updateHiddenPageThrottlingAutoIncreases();
1141
1142     enum class ResetStateReason {
1143         PageInvalidated,
1144         WebProcessExited,
1145     };
1146     void resetState(ResetStateReason);
1147     void resetStateAfterProcessExited();
1148
1149     void setUserAgent(const String&);
1150
1151     // IPC::MessageReceiver
1152     // Implemented in generated WebPageProxyMessageReceiver.cpp
1153     void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
1154     void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override;
1155
1156
1157     // IPC::MessageSender
1158     bool sendMessage(std::unique_ptr<IPC::Encoder>, OptionSet<IPC::SendOption>) override;
1159     IPC::Connection* messageSenderConnection() override;
1160     uint64_t messageSenderDestinationID() override;
1161
1162     // WebPopupMenuProxy::Client
1163     void valueChangedForPopupMenu(WebPopupMenuProxy*, int32_t newSelectedIndex) override;
1164     void setTextFromItemForPopupMenu(WebPopupMenuProxy*, int32_t index) override;
1165 #if PLATFORM(GTK)
1166     void failedToShowPopupMenu() override;
1167 #endif
1168
1169     void didCreateMainFrame(uint64_t frameID);
1170     void didCreateSubframe(uint64_t frameID);
1171
1172     void didStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& url, const String& unreachableURL, const UserData&);
1173     void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, const String&, const UserData&);
1174     void didChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, const String& url);
1175     void didFailProvisionalLoadForFrame(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, const UserData&);
1176     void didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t frameLoadType, const WebCore::CertificateInfo&, bool containsPluginDocument, Optional<WebCore::HasInsecureContent> forcedHasInsecureContent, const UserData&);
1177     void didFinishDocumentLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
1178     void didFinishLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
1179     void didFailLoadForFrame(uint64_t frameID, uint64_t navigationID, const WebCore::ResourceError&, const UserData&);
1180     void didSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t sameDocumentNavigationType, const String&, const UserData&);
1181     void didReceiveTitleForFrame(uint64_t frameID, const String&, const UserData&);
1182     void didFirstLayoutForFrame(uint64_t frameID, const UserData&);
1183     void didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, const UserData&);
1184     void didDisplayInsecureContentForFrame(uint64_t frameID, const UserData&);
1185     void didRunInsecureContentForFrame(uint64_t frameID, const UserData&);
1186     void didDetectXSSForFrame(uint64_t frameID, const UserData&);
1187     void mainFramePluginHandlesPageScaleGestureDidChange(bool);
1188     void frameDidBecomeFrameSet(uint64_t frameID, bool);
1189     void didStartProgress();
1190     void didChangeProgress(double);
1191     void didFinishProgress();
1192     void setNetworkRequestsInProgress(bool);
1193
1194     void hasInsecureContent(WebCore::HasInsecureContent&);
1195
1196     void didDestroyNavigation(uint64_t navigationID);
1197
1198     void decidePolicyForNavigationAction(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const NavigationActionData&, uint64_t originatingFrameID, const WebCore::SecurityOriginData& originatingFrameSecurityOrigin, const WebCore::ResourceRequest& originalRequest, const WebCore::ResourceRequest&, uint64_t listenerID, const UserData&, bool& receivedPolicyAction, uint64_t& newNavigationID, uint64_t& policyAction, DownloadID&);
1199     void decidePolicyForNewWindowAction(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, const NavigationActionData&, const WebCore::ResourceRequest&, const String& frameName, uint64_t listenerID, const UserData&);
1200     void decidePolicyForResponse(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, uint64_t listenerID, const UserData&);
1201     void decidePolicyForResponseSync(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, uint64_t listenerID, const UserData&, bool& receivedPolicyAction, uint64_t& policyAction, DownloadID&);
1202     void unableToImplementPolicy(uint64_t frameID, const WebCore::ResourceError&, const UserData&);
1203
1204     void willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const Vector<std::pair<String, String>>& textFieldValues, uint64_t listenerID, const UserData&);
1205
1206     // History client
1207     void didNavigateWithNavigationData(const WebNavigationDataStore&, uint64_t frameID);
1208     void didPerformClientRedirect(const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
1209     void didPerformServerRedirect(const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
1210     void didUpdateHistoryTitle(const String& title, const String& url, uint64_t frameID);
1211
1212     // UI client
1213     void createNewPage(uint64_t frameID, const WebCore::SecurityOriginData&, const WebCore::ResourceRequest&, const WebCore::WindowFeatures&, const NavigationActionData&, uint64_t& newPageID, WebPageCreationParameters&);
1214     void showPage();
1215     void runJavaScriptAlert(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, RefPtr<Messages::WebPageProxy::RunJavaScriptAlert::DelayedReply>);
1216     void runJavaScriptConfirm(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, RefPtr<Messages::WebPageProxy::RunJavaScriptConfirm::DelayedReply>);
1217     void runJavaScriptPrompt(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, const String&, RefPtr<Messages::WebPageProxy::RunJavaScriptPrompt::DelayedReply>);
1218     void setStatusText(const String&);
1219     void mouseDidMoveOverElement(const WebHitTestResultData&, uint32_t modifiers, const UserData&);
1220
1221 #if ENABLE(NETSCAPE_PLUGIN_API)
1222     void unavailablePluginButtonClicked(uint32_t opaquePluginUnavailabilityReason, const String& mimeType, const String& pluginURLString, const String& pluginsPageURLString, const String& frameURLString, const String& pageURLString);
1223 #endif // ENABLE(NETSCAPE_PLUGIN_API)
1224 #if ENABLE(WEBGL)
1225     void webGLPolicyForURL(const String& url, uint32_t& loadPolicy);
1226     void resolveWebGLPolicyForURL(const String& url, uint32_t& loadPolicy);
1227 #endif // ENABLE(WEBGL)
1228     void setToolbarsAreVisible(bool toolbarsAreVisible);
1229     void getToolbarsAreVisible(bool& toolbarsAreVisible);
1230     void setMenuBarIsVisible(bool menuBarIsVisible);
1231     void getMenuBarIsVisible(bool& menuBarIsVisible);
1232     void setStatusBarIsVisible(bool statusBarIsVisible);
1233     void getStatusBarIsVisible(bool& statusBarIsVisible);
1234     void setIsResizable(bool isResizable);
1235     void getIsResizable(bool& isResizable);
1236     void screenToRootView(const WebCore::IntPoint& screenPoint, WebCore::IntPoint& windowPoint);
1237     void rootViewToScreen(const WebCore::IntRect& viewRect, WebCore::IntRect& result);
1238 #if PLATFORM(IOS)
1239     void accessibilityScreenToRootView(const WebCore::IntPoint& screenPoint, WebCore::IntPoint& windowPoint);
1240     void rootViewToAccessibilityScreen(const WebCore::IntRect& viewRect, WebCore::IntRect& result);
1241 #endif
1242     void runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, RefPtr<Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::DelayedReply>);
1243     void didChangeViewportProperties(const WebCore::ViewportAttributes&);
1244     void pageDidScroll();
1245     void runOpenPanel(uint64_t frameID, const WebCore::SecurityOriginData&, const WebCore::FileChooserSettings&);
1246     void printFrame(uint64_t frameID);
1247     void exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, PassRefPtr<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply>);
1248     void reachedApplicationCacheOriginQuota(const String& originIdentifier, uint64_t currentQuota, uint64_t totalBytesNeeded, PassRefPtr<Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::DelayedReply>);
1249     void requestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, String originIdentifier);
1250
1251     void requestUserMediaPermissionForFrame(uint64_t userMediaID, uint64_t frameID, String userMediaDocumentOriginIdentifier, String topLevelDocumentOriginIdentifier, const Vector<String>& audioDeviceUIDs, const Vector<String>& videoDeviceUIDs);
1252     void checkUserMediaPermissionForFrame(uint64_t userMediaID, uint64_t frameID, String userMediaDocumentOriginIdentifier, String topLevelDocumentOriginIdentifier);
1253
1254     void runModal();
1255     void notifyScrollerThumbIsVisibleInRect(const WebCore::IntRect&);
1256     void recommendedScrollbarStyleDidChange(int32_t newStyle);
1257     void didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar);
1258     void didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide, bool pinnedToTopSide, bool pinnedToBottomSide);
1259     void didChangePageCount(unsigned);
1260     void pageExtendedBackgroundColorDidChange(const WebCore::Color&);
1261 #if ENABLE(NETSCAPE_PLUGIN_API)
1262     void didFailToInitializePlugin(const String& mimeType, const String& frameURLString, const String& pageURLString);
1263     void didBlockInsecurePluginVersion(const String& mimeType, const String& pluginURLString, const String& frameURLString, const String& pageURLString, bool replacementObscured);
1264 #endif // ENABLE(NETSCAPE_PLUGIN_API)
1265     void setCanShortCircuitHorizontalWheelEvents(bool canShortCircuitHorizontalWheelEvents) { m_canShortCircuitHorizontalWheelEvents = canShortCircuitHorizontalWheelEvents; }
1266
1267     void reattachToWebProcess();
1268     RefPtr<API::Navigation> reattachToWebProcessForReload();
1269     RefPtr<API::Navigation> reattachToWebProcessWithItem(WebBackForwardListItem*);
1270
1271     void requestNotificationPermission(uint64_t notificationID, const String& originString);
1272     void showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, const String& dir, const String& originString, uint64_t notificationID);
1273     void cancelNotification(uint64_t notificationID);
1274     void clearNotifications(const Vector<uint64_t>& notificationIDs);
1275     void didDestroyNotification(uint64_t notificationID);
1276
1277 #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
1278     void pageDidRequestScroll(const WebCore::IntPoint&);
1279     void pageTransitionViewportReady();
1280     void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&);
1281 #endif
1282
1283     void didChangeContentSize(const WebCore::IntSize&);
1284
1285 #if ENABLE(INPUT_TYPE_COLOR)
1286     void showColorPicker(const WebCore::Color& initialColor, const WebCore::IntRect&);
1287     void didChooseColor(const WebCore::Color&) override;
1288     void didEndColorPicker() override;
1289 #endif
1290
1291     void editorStateChanged(const EditorState&);
1292     void compositionWasCanceled(const EditorState&);
1293     void setHasHadSelectionChangesFromUserInteraction(bool);
1294     void setNeedsHiddenContentEditableQuirk(bool);
1295     void setNeedsPlainTextQuirk(bool);
1296
1297     // Back/Forward list management
1298     void backForwardAddItem(uint64_t itemID);
1299     void backForwardGoToItem(uint64_t itemID, SandboxExtension::Handle&);
1300     void backForwardItemAtIndex(int32_t index, uint64_t& itemID);
1301     void backForwardBackListCount(int32_t& count);
1302     void backForwardForwardListCount(int32_t& count);
1303     void backForwardClear();
1304
1305     // Undo management
1306     void registerEditCommandForUndo(uint64_t commandID, uint32_t editAction);
1307     void registerInsertionUndoGrouping();
1308     void clearAllEditCommands();
1309     void canUndoRedo(uint32_t action, bool& result);
1310     void executeUndoRedo(uint32_t action, bool& result);
1311
1312     // Keyboard handling
1313 #if PLATFORM(COCOA)
1314     void executeSavedCommandBySelector(const String& selector, bool& handled);
1315 #endif
1316
1317 #if PLATFORM(GTK)
1318     void getEditorCommandsForKeyEvent(const AtomicString&, Vector<String>&);
1319     void bindAccessibilityTree(const String&);
1320 #endif
1321 #if PLATFORM(EFL)
1322     void getEditorCommandsForKeyEvent(Vector<String>&);
1323 #endif
1324
1325     // Popup Menu.
1326     void showPopupMenu(const WebCore::IntRect& rect, uint64_t textDirection, const Vector<WebPopupItem>& items, int32_t selectedIndex, const PlatformPopupMenuData&);
1327     void hidePopupMenu();
1328
1329 #if ENABLE(CONTEXT_MENUS)
1330     void showContextMenu(const ContextMenuContextData&, const UserData&);
1331     void internalShowContextMenu(const ContextMenuContextData&, const UserData&);
1332 #endif
1333
1334 #if ENABLE(TELEPHONE_NUMBER_DETECTION)
1335 #if PLATFORM(MAC)
1336     void showTelephoneNumberMenu(const String& telephoneNumber, const WebCore::IntPoint&);
1337 #endif
1338 #endif
1339
1340     // Search popup results
1341     void saveRecentSearches(const String&, const Vector<WebCore::RecentSearch>&);
1342     void loadRecentSearches(const String&, Vector<WebCore::RecentSearch>&);
1343
1344 #if PLATFORM(COCOA)
1345     // Speech.
1346     void getIsSpeaking(bool&);
1347     void speak(const String&);
1348     void stopSpeaking();
1349
1350     // Spotlight.
1351     void searchWithSpotlight(const String&);
1352         
1353     void searchTheWeb(const String&);
1354
1355     // Dictionary.
1356     void didPerformDictionaryLookup(const WebCore::DictionaryPopupInfo&);
1357 #endif
1358
1359 #if PLATFORM(MAC)
1360     bool appleMailPaginationQuirkEnabled();
1361 #endif
1362
1363     // Spelling and grammar.
1364     void checkSpellingOfString(const String& text, int32_t& misspellingLocation, int32_t& misspellingLength);
1365     void checkGrammarOfString(const String& text, Vector<WebCore::GrammarDetail>&, int32_t& badGrammarLocation, int32_t& badGrammarLength);
1366     void spellingUIIsShowing(bool&);
1367     void updateSpellingUIWithMisspelledWord(const String& misspelledWord);
1368     void updateSpellingUIWithGrammarString(const String& badGrammarPhrase, const WebCore::GrammarDetail&);
1369     void learnWord(const String& word);
1370     void ignoreWord(const String& word);
1371     void requestCheckingOfString(uint64_t requestID, const WebCore::TextCheckingRequestData&, int32_t insertionPoint);
1372
1373     void takeFocus(uint32_t direction);
1374     void setToolTip(const String&);
1375     void setCursor(const WebCore::Cursor&);
1376     void setCursorHiddenUntilMouseMoves(bool);
1377
1378     void didReceiveEvent(uint32_t opaqueType, bool handled);
1379     void stopResponsivenessTimer();
1380
1381     void voidCallback(uint64_t);
1382     void dataCallback(const IPC::DataReference&, uint64_t);
1383     void imageCallback(const ShareableBitmap::Handle&, uint64_t);
1384     void stringCallback(const String&, uint64_t);
1385     void invalidateStringCallback(uint64_t);
1386     void scriptValueCallback(const IPC::DataReference&, bool hadException, const WebCore::ExceptionDetails&, uint64_t);
1387     void computedPagesCallback(const Vector<WebCore::IntRect>&, double totalScaleFactorForPrinting, uint64_t);
1388     void validateCommandCallback(const String&, bool, int, uint64_t);
1389     void unsignedCallback(uint64_t, uint64_t);
1390     void editingRangeCallback(const EditingRange&, uint64_t);
1391 #if PLATFORM(COCOA)
1392     void machSendRightCallback(const WebCore::MachSendRight&, uint64_t);
1393 #endif
1394     void rectForCharacterRangeCallback(const WebCore::IntRect&, const EditingRange&, uint64_t);
1395 #if PLATFORM(MAC)
1396     void attributedStringForCharacterRangeCallback(const AttributedString&, const EditingRange&, uint64_t);
1397     void fontAtSelectionCallback(const String&, double, bool, uint64_t);
1398 #endif
1399 #if PLATFORM(IOS)
1400     void gestureCallback(const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, uint64_t);
1401     void touchesCallback(const WebCore::IntPoint&, uint32_t, uint32_t, uint64_t);
1402     void autocorrectionDataCallback(const Vector<WebCore::FloatRect>&, const String&, float, uint64_t, uint64_t);
1403     void autocorrectionContextCallback(const String&, const String&, const String&, const String&, uint64_t, uint64_t, uint64_t);
1404     void selectionContextCallback(const String&, const String&, const String&, uint64_t);
1405     void interpretKeyEvent(const EditorState&, bool isCharEvent, bool& handled);
1406     void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect);
1407 #endif
1408 #if PLATFORM(GTK)
1409     void printFinishedCallback(const WebCore::ResourceError&, uint64_t);
1410 #endif
1411
1412     void focusedFrameChanged(uint64_t frameID);
1413     void frameSetLargestFrameChanged(uint64_t frameID);
1414
1415     void didReceiveAuthenticationChallenge(uint64_t frameID, const WebCore::AuthenticationChallenge&, uint64_t challengeID);
1416
1417     void didFinishLoadingDataForCustomContentProvider(const String& suggestedFilename, const IPC::DataReference&);
1418
1419 #if PLATFORM(COCOA)
1420     void pluginFocusOrWindowFocusChanged(uint64_t pluginComplexTextInputIdentifier, bool pluginHasFocusAndWindowHasFocus);
1421     void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, uint64_t complexTextInputState);
1422 #endif
1423
1424     bool maybeInitializeSandboxExtensionHandle(const WebCore::URL&, SandboxExtension::Handle&);
1425
1426 #if PLATFORM(MAC)
1427     void substitutionsPanelIsShowing(bool&);
1428     void showCorrectionPanel(int32_t panelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings);
1429     void dismissCorrectionPanel(int32_t reason);
1430     void dismissCorrectionPanelSoon(int32_t reason, String& result);
1431     void recordAutocorrectionResponse(int32_t responseType, const String& replacedString, const String& replacementString);
1432
1433 #if USE(DICTATION_ALTERNATIVES)
1434     void showDictationAlternativeUI(const WebCore::FloatRect& boundingBoxOfDictatedText, uint64_t dictationContext);
1435     void removeDictationAlternatives(uint64_t dictationContext);
1436     void dictationAlternatives(uint64_t dictationContext, Vector<String>& result);
1437 #endif
1438
1439     void setEditableElementIsFocused(bool);
1440 #endif // PLATFORM(MAC)
1441
1442 #if PLATFORM(IOS)
1443     WebCore::FloatSize screenSize();
1444     WebCore::FloatSize availableScreenSize();
1445     float textAutosizingWidth();
1446
1447     void dynamicViewportUpdateChangedTarget(double newTargetScale, const WebCore::FloatPoint& newScrollPosition, uint64_t dynamicViewportSizeUpdateID);
1448     void couldNotRestorePageState();
1449     void restorePageState(const WebCore::FloatPoint& scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatSize& obscuredInsetOnSave, double scale);
1450     void restorePageCenterAndScale(const WebCore::FloatPoint&, double scale);
1451
1452     void didGetTapHighlightGeometries(uint64_t requestID, const WebCore::Color& color, const Vector<WebCore::FloatQuad>& geometries, const WebCore::IntSize& topLeftRadius, const WebCore::IntSize& topRightRadius, const WebCore::IntSize& bottomLeftRadius, const WebCore::IntSize& bottomRightRadius);
1453
1454     void startAssistingNode(const AssistedNodeInformation&, bool userIsInteracting, bool blurPreviousNode, const UserData&);
1455     void stopAssistingNode();
1456
1457     void showInspectorHighlight(const WebCore::Highlight&);
1458     void hideInspectorHighlight();
1459
1460     void showInspectorIndication();
1461     void hideInspectorIndication();
1462
1463     void enableInspectorNodeSearch();
1464     void disableInspectorNodeSearch();
1465 #endif // PLATFORM(IOS)
1466
1467 #if ENABLE(DATA_DETECTION)
1468     RetainPtr<NSArray> m_dataDetectionResults;
1469 #endif
1470
1471     void clearLoadDependentCallbacks();
1472
1473     void performDragControllerAction(DragControllerAction, WebCore::DragData&, const String& dragStorageName, const SandboxExtension::Handle&, const SandboxExtension::HandleArray&);
1474
1475     void updateBackingStoreDiscardableState();
1476
1477     void setRenderTreeSize(uint64_t treeSize) { m_renderTreeSize = treeSize; }
1478
1479 #if PLUGIN_ARCHITECTURE(X11)
1480     void createPluginContainer(uint64_t& windowID);
1481     void windowedPluginGeometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect, uint64_t windowID);
1482     void windowedPluginVisibilityDidChange(bool isVisible, uint64_t windowID);
1483 #endif
1484
1485     void processNextQueuedWheelEvent();
1486     void sendWheelEvent(const WebWheelEvent&);
1487
1488 #if ENABLE(TOUCH_EVENTS)
1489     void updateTouchEventTracking(const WebTouchEvent&);
1490     WebCore::TrackingType touchEventTrackingType(const WebTouchEvent&) const;
1491 #endif
1492
1493 #if ENABLE(NETSCAPE_PLUGIN_API)
1494     void findPlugin(const String& mimeType, uint32_t processType, const String& urlString, const String& frameURLString, const String& pageURLString, bool allowOnlyApplicationPlugins, uint64_t& pluginProcessToken, String& newMIMEType, uint32_t& pluginLoadPolicy, String& unavailabilityDescription);
1495 #endif
1496
1497 #if USE(QUICK_LOOK)
1498     void didStartLoadForQuickLookDocumentInMainFrame(const String& fileName, const String& uti);
1499     void didFinishLoadForQuickLookDocumentInMainFrame(const QuickLookDocumentData&);
1500 #endif
1501
1502 #if ENABLE(CONTENT_FILTERING)
1503     void contentFilterDidBlockLoadForFrame(const WebCore::ContentFilterUnblockHandler&, uint64_t frameID);
1504 #endif
1505
1506     uint64_t generateNavigationID();
1507
1508     WebPreferencesStore preferencesStore() const;
1509
1510     void dispatchViewStateChange();
1511     void viewDidLeaveWindow();
1512     void viewDidEnterWindow();
1513
1514 #if PLATFORM(MAC)
1515     void didPerformImmediateActionHitTest(const WebHitTestResultData&, bool contentPreventsDefault, const UserData&);
1516 #endif
1517
1518     void useFixedLayoutDidChange(bool useFixedLayout) { m_useFixedLayout = useFixedLayout; }
1519     void fixedLayoutSizeDidChange(WebCore::IntSize fixedLayoutSize) { m_fixedLayoutSize = fixedLayoutSize; }
1520
1521     void imageOrMediaDocumentSizeChanged(const WebCore::IntSize&);
1522 #if ENABLE(VIDEO)
1523 #if USE(GSTREAMER)
1524     void requestInstallMissingMediaPlugins(const String& details, const String& description);
1525 #endif
1526 #endif
1527
1528     void handleAutoFillButtonClick(const UserData&);
1529
1530     void finishInitializingWebPageAfterProcessLaunch();
1531
1532     void handleMessage(IPC::Connection&, const String& messageName, const UserData& messageBody);
1533     void handleSynchronousMessage(IPC::Connection&, const String& messageName, const UserData& messageBody, UserData& returnUserData);
1534
1535     PageClient& m_pageClient;
1536     Ref<API::PageConfiguration> m_configuration;
1537
1538     std::unique_ptr<API::LoaderClient> m_loaderClient;
1539     std::unique_ptr<API::PolicyClient> m_policyClient;
1540     std::unique_ptr<API::NavigationClient> m_navigationClient;
1541     std::unique_ptr<API::HistoryClient> m_historyClient;
1542     std::unique_ptr<API::FormClient> m_formClient;
1543     std::unique_ptr<API::UIClient> m_uiClient;
1544     std::unique_ptr<API::FindClient> m_findClient;
1545     std::unique_ptr<API::FindMatchesClient> m_findMatchesClient;
1546     std::unique_ptr<API::DiagnosticLoggingClient> m_diagnosticLoggingClient;
1547 #if ENABLE(CONTEXT_MENUS)
1548     std::unique_ptr<API::ContextMenuClient> m_contextMenuClient;
1549 #endif
1550     std::unique_ptr<WebPageInjectedBundleClient> m_injectedBundleClient;
1551
1552     std::unique_ptr<WebNavigationState> m_navigationState;
1553     String m_failingProvisionalLoadURL;
1554     bool m_isLoadingAlternateHTMLStringForFailingProvisionalLoad { false };
1555
1556     std::unique_ptr<DrawingAreaProxy> m_drawingArea;
1557 #if ENABLE(ASYNC_SCROLLING)
1558     std::unique_ptr<RemoteScrollingCoordinatorProxy> m_scrollingCoordinatorProxy;
1559 #endif
1560
1561     Ref<WebProcessProxy> m_process;
1562     Ref<WebPageGroup> m_pageGroup;
1563     Ref<WebPreferences> m_preferences;
1564
1565     WebProcessLifetimeTracker m_webProcessLifetimeTracker { *this };
1566
1567     Ref<WebUserContentControllerProxy> m_userContentController;
1568     Ref<VisitedLinkStore> m_visitedLinkStore;
1569     Ref<WebsiteDataStore> m_websiteDataStore;
1570
1571     RefPtr<WebFrameProxy> m_mainFrame;
1572     RefPtr<WebFrameProxy> m_focusedFrame;
1573     RefPtr<WebFrameProxy> m_frameSetLargestFrame;
1574
1575     String m_userAgent;
1576     String m_applicationNameForUserAgent;
1577     String m_customUserAgent;
1578     String m_customTextEncodingName;
1579
1580     bool m_treatsSHA1CertificatesAsInsecure;
1581
1582     RefPtr<WebInspectorProxy> m_inspector;
1583
1584 #if ENABLE(FULLSCREEN_API)
1585     RefPtr<WebFullScreenManagerProxy> m_fullScreenManager;
1586 #endif
1587 #if (PLATFORM(IOS) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
1588     RefPtr<WebPlaybackSessionManagerProxy> m_playbackSessionManager;
1589     RefPtr<WebVideoFullscreenManagerProxy> m_videoFullscreenManager;
1590 #endif
1591 #if PLATFORM(IOS)
1592     VisibleContentRectUpdateInfo m_lastVisibleContentRectUpdate;
1593     bool m_hasReceivedLayerTreeTransactionAfterDidCommitLoad;
1594     uint64_t m_firstLayerTreeTransactionIdAfterDidCommitLoad;
1595     int32_t m_deviceOrientation;
1596     bool m_dynamicViewportSizeUpdateWaitingForTarget;
1597     bool m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit;
1598     uint64_t m_dynamicViewportSizeUpdateLayerTreeTransactionID;
1599     uint64_t m_layerTreeTransactionIdAtLastTouchStart;
1600     uint64_t m_currentDynamicViewportSizeUpdateID { 0 };
1601     bool m_hasNetworkRequestsOnSuspended;
1602 #endif
1603
1604 #if ENABLE(VIBRATION)
1605     RefPtr<WebVibrationProxy> m_vibration;
1606 #endif
1607
1608 #if ENABLE(APPLE_PAY)
1609     std::unique_ptr<WebPaymentCoordinatorProxy> m_paymentCoordinator;
1610 #endif
1611
1612     CallbackMap m_callbacks;
1613     HashSet<uint64_t> m_loadDependentStringCallbackIDs;
1614
1615     HashSet<WebEditCommandProxy*> m_editCommandSet;
1616
1617 #if PLATFORM(COCOA)
1618     HashSet<String> m_knownKeypressCommandNames;
1619 #endif
1620
1621     RefPtr<WebPopupMenuProxy> m_activePopupMenu;
1622 #if ENABLE(CONTEXT_MENUS)
1623     std::unique_ptr<WebContextMenuProxy> m_activeContextMenu;
1624     ContextMenuContextData m_activeContextMenuContextData;
1625 #endif
1626     RefPtr<API::HitTestResult> m_lastMouseMoveHitTestResult;
1627
1628     RefPtr<WebOpenPanelResultListenerProxy> m_openPanelResultListener;
1629     GeolocationPermissionRequestManagerProxy m_geolocationPermissionRequestManager;
1630     NotificationPermissionRequestManagerProxy m_notificationPermissionRequestManager;
1631
1632     UserMediaPermissionRequestManagerProxy m_userMediaPermissionRequestManager;
1633
1634     WebCore::ViewState::Flags m_viewState;
1635     bool m_viewWasEverInWindow;
1636 #if PLATFORM(IOS)
1637     bool m_allowsMediaDocumentInlinePlayback { false };
1638     bool m_alwaysRunsAtForegroundPriority;
1639     ProcessThrottler::ForegroundActivityToken m_activityToken;
1640 #endif
1641     bool m_initialCapitalizationEnabled;
1642     Ref<WebBackForwardList> m_backForwardList;
1643         
1644     bool m_maintainsInactiveSelection;
1645
1646     String m_toolTip;
1647
1648     EditorState m_editorState;
1649     bool m_isEditable;
1650
1651     double m_textZoomFactor;
1652     double m_pageZoomFactor;
1653     double m_pageScaleFactor;
1654     double m_pluginZoomFactor;
1655     double m_pluginScaleFactor;
1656     double m_viewScaleFactor { 1 };
1657     float m_intrinsicDeviceScaleFactor;
1658     float m_customDeviceScaleFactor;
1659     float m_topContentInset;
1660
1661     LayerHostingMode m_layerHostingMode;
1662
1663     bool m_drawsBackground;
1664
1665     WebCore::Color m_underlayColor;
1666     WebCore::Color m_pageExtendedBackgroundColor;
1667
1668     bool m_useFixedLayout;
1669     WebCore::IntSize m_fixedLayoutSize;
1670
1671     bool m_suppressScrollbarAnimations;
1672
1673     WebCore::Pagination::Mode m_paginationMode;
1674     bool m_paginationBehavesLikeColumns;
1675     double m_pageLength;
1676     double m_gapBetweenPages;
1677     bool m_paginationLineGridEnabled;
1678         
1679     // If the process backing the web page is alive and kicking.
1680     bool m_isValid;
1681
1682     // Whether WebPageProxy::close() has been called on this page.
1683     bool m_isClosed;
1684
1685     // Whether it can run modal child web pages.
1686     bool m_canRunModal;
1687
1688     bool m_needsToFinishInitializingWebPageAfterProcessLaunch { false };
1689
1690     bool m_isInPrintingMode;
1691     bool m_isPerformingDOMPrintOperation;
1692
1693     bool m_inDecidePolicyForResponseSync;
1694     const WebCore::ResourceRequest* m_decidePolicyForResponseRequest;
1695     bool m_syncMimeTypePolicyActionIsValid;
1696     WebCore::PolicyAction m_syncMimeTypePolicyAction;
1697     DownloadID m_syncMimeTypePolicyDownloadID;
1698
1699     bool m_inDecidePolicyForNavigationAction;
1700     bool m_syncNavigationActionPolicyActionIsValid;
1701     WebCore::PolicyAction m_syncNavigationActionPolicyAction;
1702     DownloadID m_syncNavigationActionPolicyDownloadID;
1703     bool m_shouldSuppressAppLinksInNextNavigationPolicyDecision { false };
1704
1705     Deque<NativeWebKeyboardEvent> m_keyEventQueue;
1706     Deque<NativeWebWheelEvent> m_wheelEventQueue;
1707     Deque<std::unique_ptr<Vector<NativeWebWheelEvent>>> m_currentlyProcessedWheelEvents;
1708 #if ENABLE(MAC_GESTURE_EVENTS)
1709     Deque<NativeWebGestureEvent> m_gestureEventQueue;
1710 #endif
1711
1712     bool m_processingMouseMoveEvent;
1713     std::unique_ptr<NativeWebMouseEvent> m_nextMouseMoveEvent;
1714     std::unique_ptr<NativeWebMouseEvent> m_currentlyProcessedMouseDownEvent;
1715
1716 #if ENABLE(TOUCH_EVENTS)
1717     struct TouchEventTracking {
1718         WebCore::TrackingType touchForceChangedTracking { WebCore::TrackingType::NotTracking };
1719         WebCore::TrackingType touchStartTracking { WebCore::TrackingType::NotTracking };
1720         WebCore::TrackingType touchMoveTracking { WebCore::TrackingType::NotTracking };
1721         WebCore::TrackingType touchEndTracking { WebCore::TrackingType::NotTracking };
1722
1723         bool isTrackingAnything() const
1724         {
1725             return touchForceChangedTracking != WebCore::TrackingType::NotTracking
1726                 || touchStartTracking != WebCore::TrackingType::NotTracking
1727                 || touchMoveTracking != WebCore::TrackingType::NotTracking
1728                 || touchEndTracking != WebCore::TrackingType::NotTracking;
1729         }
1730
1731         void reset()
1732         {
1733             touchForceChangedTracking = WebCore::TrackingType::NotTracking;
1734             touchStartTracking = WebCore::TrackingType::NotTracking;
1735             touchMoveTracking = WebCore::TrackingType::NotTracking;
1736             touchEndTracking = WebCore::TrackingType::NotTracking;
1737         }
1738     };
1739     TouchEventTracking m_touchEventTracking;
1740 #endif
1741 #if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS)
1742     Deque<QueuedTouchEvents> m_touchEventQueue;
1743 #endif
1744
1745 #if ENABLE(INPUT_TYPE_COLOR)
1746     RefPtr<WebColorPicker> m_colorPicker;
1747 #endif
1748
1749     const uint64_t m_pageID;
1750     WebCore::SessionID m_sessionID;
1751
1752     bool m_isPageSuspended;
1753     bool m_addsVisitedLinks;
1754
1755     bool m_controlledByAutomation { false };
1756
1757 #if ENABLE(REMOTE_INSPECTOR)
1758     bool m_allowsRemoteInspection;
1759     String m_remoteInspectionNameOverride;
1760 #endif
1761
1762 #if PLATFORM(COCOA)
1763     bool m_isSmartInsertDeleteEnabled;
1764 #endif
1765
1766 #if PLATFORM(GTK)
1767     String m_accessibilityPlugID;
1768     WebCore::Color m_backgroundColor;
1769 #endif
1770
1771     int64_t m_spellDocumentTag;
1772     bool m_hasSpellDocumentTag;
1773     unsigned m_pendingLearnOrIgnoreWordMessageCount;
1774
1775     bool m_mainFrameHasCustomContentProvider;
1776
1777 #if ENABLE(DRAG_SUPPORT)
1778     // Current drag destination details are delivered as an asynchronous response,
1779     // so we preserve them to be used when the next dragging delegate call is made.
1780     WebCore::DragOperation m_currentDragOperation;
1781     bool m_currentDragIsOverFileInput;
1782     unsigned m_currentDragNumberOfFilesToBeAccepted;
1783 #endif
1784
1785     PageLoadState m_pageLoadState;
1786     
1787     bool m_delegatesScrolling;
1788
1789     bool m_mainFrameHasHorizontalScrollbar;
1790     bool m_mainFrameHasVerticalScrollbar;
1791
1792     // Whether horizontal wheel events can be handled directly for swiping purposes.
1793     bool m_canShortCircuitHorizontalWheelEvents;
1794
1795     bool m_mainFrameIsPinnedToLeftSide;
1796     bool m_mainFrameIsPinnedToRightSide;
1797     bool m_mainFrameIsPinnedToTopSide;
1798     bool m_mainFrameIsPinnedToBottomSide;
1799
1800     bool m_shouldUseImplicitRubberBandControl;
1801     bool m_rubberBandsAtLeft;
1802     bool m_rubberBandsAtRight;
1803     bool m_rubberBandsAtTop;
1804     bool m_rubberBandsAtBottom;
1805         
1806     bool m_enableVerticalRubberBanding;
1807     bool m_enableHorizontalRubberBanding;
1808
1809     bool m_backgroundExtendsBeyondPage;
1810
1811     bool m_shouldRecordNavigationSnapshots;
1812     bool m_isShowingNavigationGestureSnapshot;
1813
1814     bool m_mainFramePluginHandlesPageScaleGesture { false };
1815
1816     unsigned m_pageCount;
1817
1818     WebCore::IntRect m_visibleScrollerThumbRect;
1819
1820     uint64_t m_renderTreeSize;
1821     uint64_t m_sessionRestorationRenderTreeSize;
1822     bool m_wantsSessionRestorationRenderTreeSizeThresholdEvent;
1823     bool m_hitRenderTreeSizeThreshold;
1824
1825     bool m_suppressVisibilityUpdates;
1826     bool m_autoSizingShouldExpandToViewHeight;
1827     WebCore::IntSize m_minimumLayoutSize;
1828
1829     float m_mediaVolume;
1830     bool m_muted;
1831     bool m_mayStartMediaWhenInWindow;
1832
1833     bool m_waitingForDidUpdateViewState;
1834
1835     bool m_shouldScaleViewToFitDocument { false };
1836     bool m_suppressNavigationSnapshotting { false };
1837
1838 #if PLATFORM(COCOA)
1839     HashMap<String, String> m_temporaryPDFFiles;
1840     std::unique_ptr<WebCore::RunLoopObserver> m_viewStateChangeDispatcher;
1841
1842     std::unique_ptr<RemoteLayerTreeScrollingPerformanceData> m_scrollingPerformanceData;
1843     bool m_scrollPerformanceDataCollectionEnabled;
1844 #endif
1845     UserObservablePageCounter::Token m_pageIsUserObservableCount;
1846     ProcessSuppressionDisabledToken m_preventProcessSuppressionCount;
1847     HiddenPageThrottlingAutoIncreasesCounter::Token m_hiddenPageDOMTimerThrottlingAutoIncreasesCount;
1848         
1849     WebCore::ScrollPinningBehavior m_scrollPinningBehavior;
1850     WTF::Optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle;
1851
1852     uint64_t m_navigationID;
1853
1854     WebPreferencesStore::ValueMap m_configurationPreferenceValues;
1855     WebCore::ViewState::Flags m_potentiallyChangedViewStateFlags;
1856     bool m_viewStateChangeWantsSynchronousReply;
1857     Vector<uint64_t> m_nextViewStateChangeCallbacks;
1858
1859     WebCore::MediaProducer::MediaStateFlags m_mediaState { WebCore::MediaProducer::IsNotPlaying };
1860
1861     bool m_isResourceCachingDisabled { false };
1862
1863     bool m_hasHadSelectionChangesFromUserInteraction { false };
1864     bool m_needsHiddenContentEditableQuirk { false };
1865     bool m_needsPlainTextQuirk { false };
1866
1867 #if ENABLE(MEDIA_SESSION)
1868     bool m_hasMediaSessionWithActiveMediaElements { false };
1869 #endif
1870
1871 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
1872     bool m_requiresTargetMonitoring { false };
1873 #endif
1874
1875 #if PLATFORM(IOS)
1876     bool m_hasDeferredStartAssistingNode { false };
1877     std::unique_ptr<NodeAssistanceArguments> m_deferredNodeAssistanceArguments;
1878     bool m_forceAlwaysUserScalable { false };
1879 #endif
1880
1881 #if ENABLE(DOWNLOAD_ATTRIBUTE)
1882     bool m_syncNavigationActionHasDownloadAttribute { false };
1883 #endif
1884 };
1885
1886 } // namespace WebKit