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