2 * Copyright (C) 2010-2018 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
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.
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.
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 "InjectedBundlePageContextMenuClient.h"
39 #include "InjectedBundlePageFullScreenClient.h"
40 #include "InjectedBundlePagePolicyClient.h"
41 #include "LayerTreeContext.h"
42 #include "MessageReceiver.h"
43 #include "MessageSender.h"
44 #include "OptionalCallbackID.h"
46 #include "SandboxExtension.h"
47 #include "ShareSheetCallbackID.h"
48 #include "SharedMemory.h"
50 #include "WebBackForwardListProxy.h"
51 #include "WebURLSchemeHandler.h"
52 #include "WebUserContentController.h"
53 #include <WebCore/ActivityState.h>
54 #include <WebCore/DictionaryPopupInfo.h>
55 #include <WebCore/DisabledAdaptations.h>
56 #include <WebCore/FrameLoaderTypes.h>
57 #include <WebCore/HTMLMenuElement.h>
58 #include <WebCore/HTMLMenuItemElement.h>
59 #include <WebCore/IntRect.h>
60 #include <WebCore/IntSizeHash.h>
61 #include <WebCore/Page.h>
62 #include <WebCore/PageOverlay.h>
63 #include <WebCore/PluginData.h>
64 #include <WebCore/SecurityPolicyViolationEvent.h>
65 #include <WebCore/ShareData.h>
66 #include <WebCore/UserActivity.h>
67 #include <WebCore/UserContentTypes.h>
68 #include <WebCore/UserInterfaceLayoutDirection.h>
69 #include <WebCore/UserScriptTypes.h>
70 #include <WebCore/VisibilityState.h>
71 #include <WebCore/WebCoreKeyboardUIMode.h>
73 #include <pal/HysteresisActivity.h>
74 #include <wtf/HashMap.h>
75 #include <wtf/MonotonicTime.h>
76 #include <wtf/RefPtr.h>
77 #include <wtf/RunLoop.h>
78 #include <wtf/Seconds.h>
79 #include <wtf/WallTime.h>
80 #include <wtf/text/WTFString.h>
82 #if HAVE(ACCESSIBILITY) && PLATFORM(GTK)
83 #include "WebPageAccessibilityObject.h"
84 #include <wtf/glib/GRefPtr.h>
88 #include "ArgumentCodersGtk.h"
89 #include "WebPrintOperationGtk.h"
92 #if PLATFORM(IOS_FAMILY)
93 #include "GestureTypes.h"
94 #include "WebPageMessages.h"
95 #include <WebCore/IntPointHash.h>
96 #include <WebCore/ViewportConfiguration.h>
99 #if ENABLE(APPLICATION_MANIFEST)
100 #include <WebCore/ApplicationManifest.h>
103 #if ENABLE(IOS_TOUCH_EVENTS)
104 #include <WebKitAdditions/PlatformTouchEventIOS.h>
105 #elif ENABLE(TOUCH_EVENTS)
106 #include <WebCore/PlatformTouchEvent.h>
109 #if ENABLE(MAC_GESTURE_EVENTS)
110 #include <WebKitAdditions/PlatformGestureEventMac.h>
114 #include "DynamicViewportSizeUpdate.h"
115 #include <WebCore/VisibleSelection.h>
116 #include <wtf/RetainPtr.h>
119 OBJC_CLASS NSDictionary;
121 OBJC_CLASS WKAccessibilityWebPageObject;
131 class FormDataReference;
137 class DocumentLoader;
139 class FontAttributeChanges;
142 class FrameSelection;
144 class GraphicsContext;
145 class HTMLMenuElement;
146 class HTMLMenuItemElement;
147 class HTMLPlugInElement;
148 class HTMLPlugInImageElement;
151 class MediaPlaybackTargetContext;
152 class MediaPlayerRequestInstallMissingPluginsCallback;
156 class ResourceRequest;
157 class ResourceResponse;
160 class SubstituteData;
161 class TextCheckingRequest;
163 class VisiblePosition;
165 enum SyntheticClickType : int8_t;
166 enum class ShouldTreatAsContinuingLoad : bool;
167 enum class TextIndicatorPresentationTransition : uint8_t;
169 struct BackForwardItemIdentifier;
170 struct CompositionUnderline;
171 struct DictationAlternative;
172 struct GlobalFrameIdentifier;
173 struct GlobalWindowIdentifier;
175 struct KeypressCommand;
176 struct PromisedAttachmentInfo;
177 struct TextCheckingResult;
178 struct ViewportArguments;
180 #if ENABLE(ATTACHMENT_ELEMENT)
181 class HTMLAttachmentElement;
190 class FindController;
192 class GeolocationPermissionRequestManager;
193 class MediaDeviceSandboxExtensions;
194 class NotificationPermissionRequestManager;
198 class RemoteWebInspectorUI;
199 class UserMediaPermissionRequestManager;
200 class ViewGestureGeometryCollector;
201 class VisibleContentRectUpdateInfo;
202 class WebColorChooser;
203 class WebContextMenu;
204 class WebContextMenuItemData;
205 class WebDataListSuggestionPicker;
206 class WebDocumentLoader;
209 class WebFullScreenManager;
212 class WebInspectorClient;
213 class WebInspectorUI;
214 class WebGestureEvent;
215 class WebKeyboardEvent;
216 class WebURLSchemeHandlerProxy;
218 class WebNotificationClient;
219 class WebOpenPanelResultListener;
220 class WebPageGroupProxy;
221 class WebPageOverlay;
222 class PlaybackSessionManager;
225 class WebUserContentController;
226 class VideoFullscreenManager;
229 class RemoteLayerTreeTransaction;
231 enum class DeviceAccessState : uint8_t;
232 enum FindOptions : uint16_t;
233 enum class DragControllerAction : uint8_t;
235 struct AssistedNodeInformation;
236 struct AttributedString;
237 struct BackForwardListItemState;
239 struct InteractionInformationAtPosition;
240 struct InteractionInformationRequest;
241 struct LoadParameters;
243 struct WebPageCreationParameters;
244 struct WebPreferencesStore;
245 struct WebSelectionData;
246 struct WebsitePoliciesData;
248 using SnapshotOptions = uint32_t;
249 using WKEventModifiers = uint32_t;
251 class WebPage : public API::ObjectImpl<API::Object::Type::BundlePage>, public IPC::MessageReceiver, public IPC::MessageSender, public CanMakeWeakPtr<WebPage> {
253 static Ref<WebPage> create(uint64_t pageID, WebPageCreationParameters&&);
256 void reinitializeWebPage(WebPageCreationParameters&&);
260 static WebPage* fromCorePage(WebCore::Page*);
262 WebCore::Page* corePage() const { return m_page.get(); }
263 uint64_t pageID() const { return m_pageID; }
264 PAL::SessionID sessionID() const { return m_page->sessionID(); }
265 bool usesEphemeralSession() const { return m_page->usesEphemeralSession(); }
267 void setSessionID(PAL::SessionID);
269 void setSize(const WebCore::IntSize&);
270 const WebCore::IntSize& size() const { return m_viewSize; }
271 WebCore::IntRect bounds() const { return WebCore::IntRect(WebCore::IntPoint(), size()); }
273 DrawingArea* drawingArea() const { return m_drawingArea.get(); }
275 #if ENABLE(ASYNC_SCROLLING)
276 WebCore::ScrollingCoordinator* scrollingCoordinator() const;
279 WebPageGroupProxy* pageGroup() const { return m_pageGroup.get(); }
281 void scrollMainFrameIfNotAtMaxScrollPosition(const WebCore::IntSize& scrollOffset);
283 bool scrollBy(uint32_t scrollDirection, uint32_t scrollGranularity);
285 void centerSelectionInVisibleArea();
288 void willCommitLayerTree(RemoteLayerTreeTransaction&);
289 void didFlushLayerTreeAtTime(MonotonicTime);
292 void willDisplayPage();
294 enum class LazyCreationPolicy { UseExistingOnly, CreateIfNeeded };
296 WebInspector* inspector(LazyCreationPolicy = LazyCreationPolicy::CreateIfNeeded);
297 WebInspectorUI* inspectorUI();
298 RemoteWebInspectorUI* remoteInspectorUI();
299 bool isInspectorPage() { return !!m_inspectorUI || !!m_remoteInspectorUI; }
301 void inspectorFrontendCountChanged(unsigned);
303 #if PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
304 PlaybackSessionManager& playbackSessionManager();
305 VideoFullscreenManager& videoFullscreenManager();
306 void videoControlsManagerDidChange();
309 #if PLATFORM(IOS_FAMILY)
310 void setAllowsMediaDocumentInlinePlayback(bool);
311 bool allowsMediaDocumentInlinePlayback() const { return m_allowsMediaDocumentInlinePlayback; }
314 #if ENABLE(FULLSCREEN_API)
315 WebFullScreenManager* fullScreenManager();
318 void addConsoleMessage(uint64_t frameID, MessageSource, MessageLevel, const String&, uint64_t requestID = 0);
319 void sendCSPViolationReport(uint64_t frameID, const WebCore::URL& reportURL, IPC::FormDataReference&&);
320 void enqueueSecurityPolicyViolationEvent(uint64_t frameID, WebCore::SecurityPolicyViolationEvent::Init&&);
322 // -- Called by the DrawingArea.
323 // FIXME: We could genericize these into a DrawingArea client interface. Would that be beneficial?
324 void drawRect(WebCore::GraphicsContext&, const WebCore::IntRect&);
325 void layoutIfNeeded();
327 // -- Called from WebCore clients.
328 bool handleEditingKeyboardEvent(WebCore::KeyboardEvent*);
330 void didStartPageTransition();
331 void didCompletePageTransition();
332 void didCommitLoad(WebFrame*);
333 void willReplaceMultipartContent(const WebFrame&);
334 void didReplaceMultipartContent(const WebFrame&);
335 void didFinishLoad(WebFrame*);
337 String userAgent(const WebCore::URL&) const;
338 String userAgent(WebFrame*, const WebCore::URL&) const;
339 String platformUserAgent(const WebCore::URL&) const;
340 WebCore::KeyboardUIMode keyboardUIMode();
342 void didInsertMenuElement(WebCore::HTMLMenuElement&);
343 void didRemoveMenuElement(WebCore::HTMLMenuElement&);
344 void didInsertMenuItemElement(WebCore::HTMLMenuItemElement&);
345 void didRemoveMenuItemElement(WebCore::HTMLMenuItemElement&);
347 const String& overrideContentSecurityPolicy() const { return m_overrideContentSecurityPolicy; }
349 WebUndoStep* webUndoStep(uint64_t);
350 void addWebUndoStep(uint64_t, WebUndoStep*);
351 void removeWebEditCommand(uint64_t);
352 bool isInRedo() const { return m_isInRedo; }
354 bool isAlwaysOnLoggingAllowed() const;
355 void setActivePopupMenu(WebPopupMenu*);
357 void setHiddenPageDOMTimerThrottlingIncreaseLimit(Seconds limit)
359 m_page->setDOMTimerAlignmentIntervalIncreaseLimit(limit);
362 #if ENABLE(INPUT_TYPE_COLOR)
363 WebColorChooser* activeColorChooser() const { return m_activeColorChooser; }
364 void setActiveColorChooser(WebColorChooser*);
365 void didChooseColor(const WebCore::Color&);
366 void didEndColorPicker();
369 #if ENABLE(DATALIST_ELEMENT)
370 void setActiveDataListSuggestionPicker(WebDataListSuggestionPicker*);
371 void didSelectDataListOption(const String&);
372 void didCloseSuggestions();
375 WebOpenPanelResultListener* activeOpenPanelResultListener() const { return m_activeOpenPanelResultListener.get(); }
376 void setActiveOpenPanelResultListener(Ref<WebOpenPanelResultListener>&&);
378 void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
379 void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override;
381 // -- InjectedBundle methods
382 #if ENABLE(CONTEXT_MENUS)
383 void setInjectedBundleContextMenuClient(std::unique_ptr<API::InjectedBundle::PageContextMenuClient>&&);
385 void setInjectedBundleEditorClient(std::unique_ptr<API::InjectedBundle::EditorClient>&&);
386 void setInjectedBundleFormClient(std::unique_ptr<API::InjectedBundle::FormClient>&&);
387 void setInjectedBundlePageLoaderClient(std::unique_ptr<API::InjectedBundle::PageLoaderClient>&&);
388 void initializeInjectedBundlePolicyClient(WKBundlePagePolicyClientBase*);
389 void setInjectedBundleResourceLoadClient(std::unique_ptr<API::InjectedBundle::ResourceLoadClient>&&);
390 void setInjectedBundleUIClient(std::unique_ptr<API::InjectedBundle::PageUIClient>&&);
391 #if ENABLE(FULLSCREEN_API)
392 void initializeInjectedBundleFullScreenClient(WKBundlePageFullScreenClientBase*);
395 #if ENABLE(CONTEXT_MENUS)
396 API::InjectedBundle::PageContextMenuClient& injectedBundleContextMenuClient() { return *m_contextMenuClient; }
398 API::InjectedBundle::EditorClient& injectedBundleEditorClient() { return *m_editorClient; }
399 API::InjectedBundle::FormClient& injectedBundleFormClient() { return *m_formClient; }
400 API::InjectedBundle::PageLoaderClient& injectedBundleLoaderClient() { return *m_loaderClient; }
401 InjectedBundlePagePolicyClient& injectedBundlePolicyClient() { return m_policyClient; }
402 API::InjectedBundle::ResourceLoadClient& injectedBundleResourceLoadClient() { return *m_resourceLoadClient; }
403 API::InjectedBundle::PageUIClient& injectedBundleUIClient() { return *m_uiClient; }
404 #if ENABLE(FULLSCREEN_API)
405 InjectedBundlePageFullScreenClient& injectedBundleFullScreenClient() { return m_fullScreenClient; }
408 bool findStringFromInjectedBundle(const String&, FindOptions);
410 WebFrame* mainWebFrame() const { return m_mainFrame.get(); }
412 WebCore::Frame* mainFrame() const; // May return nullptr.
413 WebCore::FrameView* mainFrameView() const; // May return nullptr.
415 RefPtr<WebCore::Range> currentSelectionAsRange();
417 #if ENABLE(NETSCAPE_PLUGIN_API)
418 RefPtr<Plugin> createPlugin(WebFrame*, WebCore::HTMLPlugInElement*, const Plugin::Parameters&, String& newMIMEType);
422 WebCore::WebGLLoadPolicy webGLPolicyForURL(WebFrame*, const WebCore::URL&);
423 WebCore::WebGLLoadPolicy resolveWebGLPolicyForURL(WebFrame*, const WebCore::URL&);
426 enum class IncludePostLayoutDataHint { No, Yes };
427 EditorState editorState(IncludePostLayoutDataHint = IncludePostLayoutDataHint::Yes) const;
428 void updateEditorStateAfterLayoutIfEditabilityChanged();
430 String renderTreeExternalRepresentation() const;
431 String renderTreeExternalRepresentationForPrinting() const;
432 uint64_t renderTreeSize() const;
434 void setTracksRepaints(bool);
435 bool isTrackingRepaints() const;
436 void resetTrackedRepaints();
437 Ref<API::Array> trackedRepaintRects();
439 void executeEditingCommand(const String& commandName, const String& argument);
440 bool isEditingCommandEnabled(const String& commandName);
441 void clearMainFrameName();
444 void sendSetWindowFrame(const WebCore::FloatRect&);
446 double textZoomFactor() const;
447 void setTextZoomFactor(double);
448 double pageZoomFactor() const;
449 void setPageZoomFactor(double);
450 void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
451 void windowScreenDidChange(uint32_t);
452 String dumpHistoryForTesting(const String& directory);
455 void accessibilitySettingsDidChange();
456 #if ENABLE(ACCESSIBILITY_EVENTS)
457 void updateAccessibilityEventsEnabled(bool);
460 void scalePage(double scale, const WebCore::IntPoint& origin);
461 void scalePageInViewCoordinates(double scale, WebCore::IntPoint centerInViewCoordinates);
462 double pageScaleFactor() const;
463 double totalScaleFactor() const;
464 double viewScaleFactor() const;
465 void scaleView(double scale);
467 void setUseFixedLayout(bool);
468 bool useFixedLayout() const { return m_useFixedLayout; }
469 bool setFixedLayoutSize(const WebCore::IntSize&);
470 WebCore::IntSize fixedLayoutSize() const;
472 void listenForLayoutMilestones(uint32_t /* LayoutMilestones */);
474 void setSuppressScrollbarAnimations(bool);
476 void setEnableVerticalRubberBanding(bool);
477 void setEnableHorizontalRubberBanding(bool);
479 void setBackgroundExtendsBeyondPage(bool);
481 void setPaginationMode(uint32_t /* WebCore::Pagination::Mode */);
482 void setPaginationBehavesLikeColumns(bool);
483 void setPageLength(double);
484 void setGapBetweenPages(double);
485 void setPaginationLineGridEnabled(bool);
487 void postInjectedBundleMessage(const String& messageName, const UserData&);
489 bool drawsBackground() const { return m_drawsBackground; }
491 void setUnderlayColor(const WebCore::Color& color) { m_underlayColor = color; }
492 WebCore::Color underlayColor() const { return m_underlayColor; }
495 void stopLoadingFrame(uint64_t frameID);
496 bool defersLoading() const;
497 void setDefersLoading(bool deferLoading);
499 void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*);
500 void exitAcceleratedCompositingMode();
502 void addPluginView(PluginView*);
503 void removePluginView(PluginView*);
505 bool isVisible() const { return m_activityState.contains(WebCore::ActivityState::IsVisible); }
506 bool isVisibleOrOccluded() const { return m_activityState.contains(WebCore::ActivityState::IsVisibleOrOccluded); }
508 LayerHostingMode layerHostingMode() const { return m_layerHostingMode; }
509 void setLayerHostingMode(LayerHostingMode);
512 void updatePluginsActiveAndFocusedState();
513 const WebCore::FloatRect& windowFrameInScreenCoordinates() const { return m_windowFrameInScreenCoordinates; }
514 const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates() const { return m_windowFrameInUnflippedScreenCoordinates; }
515 const WebCore::FloatRect& viewFrameInWindowCoordinates() const { return m_viewFrameInWindowCoordinates; }
517 bool hasCachedWindowFrame() const { return m_hasCachedWindowFrame; }
519 void updateHeaderAndFooterLayersForDeviceScaleChange(float scaleFactor);
523 void setTopOverhangImage(WebImage*);
524 void setBottomOverhangImage(WebImage*);
526 void setUseSystemAppearance(bool);
527 void setUseDarkAppearance(bool);
530 bool windowIsFocused() const;
531 bool windowAndWebPageAreFocused() const;
533 #if !PLATFORM(IOS_FAMILY)
534 void setHeaderPageBanner(PageBanner*);
535 PageBanner* headerPageBanner();
536 void setFooterPageBanner(PageBanner*);
537 PageBanner* footerPageBanner();
539 void hidePageBanners();
540 void showPageBanners();
542 void setHeaderBannerHeightForTesting(int);
543 void setFooterBannerHeightForTesting(int);
546 WebCore::IntPoint screenToRootView(const WebCore::IntPoint&);
547 WebCore::IntRect rootViewToScreen(const WebCore::IntRect&);
549 #if PLATFORM(IOS_FAMILY)
550 WebCore::IntPoint accessibilityScreenToRootView(const WebCore::IntPoint&);
551 WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&);
554 RefPtr<WebImage> scaledSnapshotWithOptions(const WebCore::IntRect&, double additionalScaleFactor, SnapshotOptions);
556 static const WebEvent* currentEvent();
558 FindController& findController() { return m_findController.get(); }
560 #if ENABLE(GEOLOCATION)
561 GeolocationPermissionRequestManager& geolocationPermissionRequestManager() { return m_geolocationPermissionRequestManager.get(); }
564 #if PLATFORM(IOS_FAMILY)
565 void savePageState(WebCore::HistoryItem&);
566 void restorePageState(const WebCore::HistoryItem&);
569 #if ENABLE(MEDIA_STREAM)
570 UserMediaPermissionRequestManager& userMediaPermissionRequestManager() { return *m_userMediaPermissionRequestManager; }
571 void prepareToSendUserMediaPermissionRequest();
572 void captureDevicesChanged(DeviceAccessState);
575 void elementDidFocus(WebCore::Node*);
576 void elementDidBlur(WebCore::Node*);
577 void resetAssistedNodeForFrame(WebFrame*);
579 void disabledAdaptationsDidChange(const OptionSet<WebCore::DisabledAdaptations>&);
580 void viewportPropertiesDidChange(const WebCore::ViewportArguments&);
581 void executeEditCommandWithCallback(const String&, const String& argument, CallbackID);
583 #if PLATFORM(IOS_FAMILY)
584 WebCore::FloatSize screenSize() const;
585 WebCore::FloatSize availableScreenSize() const;
586 WebCore::FloatSize overrideScreenSize() const;
587 int32_t deviceOrientation() const { return m_deviceOrientation; }
588 void didReceiveMobileDocType(bool);
590 void setUseTestingViewportConfiguration(bool useTestingViewport) { m_useTestingViewportConfiguration = useTestingViewport; }
591 bool isUsingTestingViewportConfiguration() const { return m_useTestingViewportConfiguration; }
593 double minimumPageScaleFactor() const;
594 double maximumPageScaleFactor() const;
595 double maximumPageScaleFactorIgnoringAlwaysScalable() const;
596 bool allowsUserScaling() const;
597 bool hasStablePageScaleFactor() const { return m_hasStablePageScaleFactor; }
599 void handleTap(const WebCore::IntPoint&, uint64_t lastLayerTreeTransactionId);
600 void potentialTapAtPosition(uint64_t requestID, const WebCore::FloatPoint&);
601 void commitPotentialTap(uint64_t lastLayerTreeTransactionId);
602 void commitPotentialTapFailed();
603 void cancelPotentialTap();
604 void cancelPotentialTapInFrame(WebFrame&);
605 void tapHighlightAtPosition(uint64_t requestID, const WebCore::FloatPoint&);
607 void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&);
608 void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&);
610 void blurAssistedNode();
611 void requestAssistedNodeInformation(CallbackID);
612 void selectWithGesture(const WebCore::IntPoint&, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithAssistedNode, CallbackID);
613 void updateSelectionWithTouches(const WebCore::IntPoint&, uint32_t touches, bool baseIsStart, CallbackID);
614 void selectWithTwoTouches(const WebCore::IntPoint& from, const WebCore::IntPoint& to, uint32_t gestureType, uint32_t gestureState, CallbackID);
615 void extendSelection(uint32_t granularity);
616 void selectWordBackward();
617 void moveSelectionByOffset(int32_t offset, CallbackID);
618 void selectTextWithGranularityAtPoint(const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithAssistedNode, CallbackID);
619 void selectPositionAtBoundaryWithDirection(const WebCore::IntPoint&, uint32_t granularity, uint32_t direction, bool isInteractingWithAssistedNode, CallbackID);
620 void moveSelectionAtBoundaryWithDirection(uint32_t granularity, uint32_t direction, CallbackID);
621 void selectPositionAtPoint(const WebCore::IntPoint&, bool isInteractingWithAssistedNode, CallbackID);
622 void beginSelectionInDirection(uint32_t direction, CallbackID);
623 void updateSelectionWithExtentPoint(const WebCore::IntPoint&, bool isInteractingWithAssistedNode, CallbackID);
624 void updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithAssistedNode, CallbackID);
626 void requestDictationContext(CallbackID);
627 void replaceDictatedText(const String& oldText, const String& newText);
628 void replaceSelectedText(const String& oldText, const String& newText);
629 void requestAutocorrectionData(const String& textForAutocorrection, CallbackID);
630 void applyAutocorrection(const String& correction, const String& originalText, CallbackID);
631 void syncApplyAutocorrection(const String& correction, const String& originalText, bool& correctionApplied);
632 void requestAutocorrectionContext(CallbackID);
633 void getAutocorrectionContext(String& beforeText, String& markedText, String& selectedText, String& afterText, uint64_t& location, uint64_t& length);
634 void getPositionInformation(const InteractionInformationRequest&, InteractionInformationAtPosition&);
635 void requestPositionInformation(const InteractionInformationRequest&);
636 void startInteractionWithElementAtPosition(const WebCore::IntPoint&);
637 void stopInteraction();
638 void performActionOnElement(uint32_t action);
639 void focusNextAssistedNode(bool isForward, CallbackID);
640 void autofillLoginCredentials(const String&, const String&);
641 void setAssistedNodeValue(const String&);
642 void setAssistedNodeValueAsNumber(double);
643 void setAssistedNodeSelectedIndex(uint32_t index, bool allowMultipleSelection);
644 WebCore::IntRect rectForElementAtInteractionLocation();
645 void updateSelectionAppearance();
646 void getSelectionContext(CallbackID);
647 void handleTwoFingerTapAtPoint(const WebCore::IntPoint&, uint64_t requestID);
648 void getRectsForGranularityWithSelectionOffset(uint32_t, int32_t, CallbackID);
649 void getRectsAtSelectionOffsetWithText(int32_t, const String&, CallbackID);
650 void storeSelectionForAccessibility(bool);
651 void startAutoscrollAtPosition(const WebCore::FloatPoint&);
652 void cancelAutoscroll();
654 void contentSizeCategoryDidChange(const String&);
656 Seconds eventThrottlingDelay() const;
658 void showInspectorHighlight(const WebCore::Highlight&);
659 void hideInspectorHighlight();
661 void showInspectorIndication();
662 void hideInspectorIndication();
664 void enableInspectorNodeSearch();
665 void disableInspectorNodeSearch();
667 bool forceAlwaysUserScalable() const { return m_forceAlwaysUserScalable; }
668 void setForceAlwaysUserScalable(bool);
671 #if PLATFORM(IOS_FAMILY) && ENABLE(IOS_TOUCH_EVENTS)
672 void dispatchAsynchronousTouchEvents(const Vector<WebTouchEvent, 1>& queue);
675 bool hasRichlyEditableSelection() const;
677 void setLayerTreeStateIsFrozen(bool);
678 void markLayersVolatile(WTF::Function<void (bool)>&& completionHandler = { });
679 void cancelMarkLayersVolatile();
681 NotificationPermissionRequestManager* notificationPermissionRequestManager();
683 void pageDidScroll();
685 #if ENABLE(CONTEXT_MENUS)
686 WebContextMenu* contextMenu();
687 WebContextMenu* contextMenuAtPointInWindow(const WebCore::IntPoint&);
690 bool hasLocalDataForURL(const WebCore::URL&);
692 static bool canHandleRequest(const WebCore::ResourceRequest&);
694 class SandboxExtensionTracker {
696 ~SandboxExtensionTracker();
700 void beginLoad(WebFrame*, SandboxExtension::Handle&&);
701 void beginReload(WebFrame*, SandboxExtension::Handle&&);
702 void willPerformLoadDragDestinationAction(RefPtr<SandboxExtension>&& pendingDropSandboxExtension);
703 void didStartProvisionalLoad(WebFrame*);
704 void didCommitProvisionalLoad(WebFrame*);
705 void didFailProvisionalLoad(WebFrame*);
708 void setPendingProvisionalSandboxExtension(RefPtr<SandboxExtension>&&);
710 RefPtr<SandboxExtension> m_pendingProvisionalSandboxExtension;
711 RefPtr<SandboxExtension> m_provisionalSandboxExtension;
712 RefPtr<SandboxExtension> m_committedSandboxExtension;
715 SandboxExtensionTracker& sandboxExtensionTracker() { return m_sandboxExtensionTracker; }
718 void setComposition(const String& text, const Vector<WebCore::CompositionUnderline>& underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeLength);
719 void confirmComposition(const String& text, int64_t selectionStart, int64_t selectionLength);
720 void cancelComposition();
722 void collapseSelectionInFrame(uint64_t frameID);
725 #if PLATFORM (GTK) && HAVE(GTK_GESTURES)
726 void getCenterForZoomGesture(const WebCore::IntPoint& centerInViewCoordinates, WebCore::IntPoint& result);
729 void didApplyStyle();
730 void didChangeSelection();
731 void didChangeContents();
732 void discardedComposition();
733 void canceledComposition();
734 void didUpdateComposition();
735 void didEndUserTriggeredSelectionChanges();
738 void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
739 WKAccessibilityWebPageObject* accessibilityRemoteObject();
740 NSObject *accessibilityObjectForMainFramePlugin();
741 const WebCore::FloatPoint& accessibilityPosition() const { return m_accessibilityPosition; }
743 void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
745 void setTextAsync(const String&);
746 void insertTextAsync(const String& text, const EditingRange& replacementRange, bool registerUndoGroup = false, uint32_t editingRangeIsRelativeTo = (uint32_t)EditingRangeIsRelativeTo::EditableRoot, bool suppressSelectionUpdate = false);
747 void getMarkedRangeAsync(CallbackID);
748 void getSelectedRangeAsync(CallbackID);
749 void characterIndexForPointAsync(const WebCore::IntPoint&, CallbackID);
750 void firstRectForCharacterRangeAsync(const EditingRange&, CallbackID);
751 void setCompositionAsync(const String& text, const Vector<WebCore::CompositionUnderline>& underlines, const EditingRange& selectionRange, const EditingRange& replacementRange);
752 void confirmCompositionAsync();
754 void readSelectionFromPasteboard(const WTF::String& pasteboardName, bool& result);
755 void getStringSelectionForPasteboard(WTF::String& stringValue);
756 void getDataSelectionForPasteboard(const WTF::String pasteboardType, SharedMemory::Handle& handle, uint64_t& size);
757 void shouldDelayWindowOrderingEvent(const WebKit::WebMouseEvent&, bool& result);
758 void acceptsFirstMouse(int eventNumber, const WebKit::WebMouseEvent&, bool& result);
759 bool performNonEditingBehaviorForSelector(const String&, WebCore::KeyboardEvent*);
763 void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::DictationAlternative>& dictationAlternativeLocations, bool registerUndoGroup = false);
764 void attributedSubstringForCharacterRangeAsync(const EditingRange&, CallbackID);
765 void fontAtSelection(CallbackID);
768 #if PLATFORM(COCOA) && ENABLE(SERVICE_CONTROLS)
769 void replaceSelectionWithPasteboardData(const Vector<String>& types, const IPC::DataReference&);
772 #if HAVE(ACCESSIBILITY) && PLATFORM(GTK)
773 void updateAccessibilityTree();
776 void setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length, bool suppressUnderline);
777 bool hasCompositionForTesting();
778 void confirmCompositionForTesting(const String& compositionString);
782 void speak(const String&);
785 void performDictionaryLookupForSelection(WebCore::Frame&, const WebCore::VisibleSelection&, WebCore::TextIndicatorPresentationTransition);
788 bool isSmartInsertDeleteEnabled();
789 void setSmartInsertDeleteEnabled(bool);
791 bool isSelectTrailingWhitespaceEnabled() const;
792 void setSelectTrailingWhitespaceEnabled(bool);
794 void replaceSelectionWithText(WebCore::Frame*, const String&);
795 void clearSelection();
796 void restoreSelectionInFocusedEditableElement();
798 #if ENABLE(DRAG_SUPPORT) && PLATFORM(GTK)
799 void performDragControllerAction(DragControllerAction, const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t draggingSourceOperationMask, WebSelectionData&&, uint32_t flags);
802 #if ENABLE(DRAG_SUPPORT) && !PLATFORM(GTK)
803 void performDragControllerAction(DragControllerAction, const WebCore::DragData&, SandboxExtension::Handle&&, SandboxExtension::HandleArray&&);
806 #if ENABLE(DRAG_SUPPORT)
807 void dragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation);
809 void willPerformLoadDragDestinationAction();
810 void mayPerformUploadDragDestinationAction();
812 void willStartDrag() { ASSERT(!m_isStartingDrag); m_isStartingDrag = true; }
814 void dragCancelled();
817 void beginPrinting(uint64_t frameID, const PrintInfo&);
819 void computePagesForPrinting(uint64_t frameID, const PrintInfo&, CallbackID);
820 void computePagesForPrintingImpl(uint64_t frameID, const PrintInfo&, Vector<WebCore::IntRect>& pageRects, double& totalScaleFactor);
823 void drawRectToImage(uint64_t frameID, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, CallbackID);
824 void drawPagesToPDF(uint64_t frameID, const PrintInfo&, uint32_t first, uint32_t count, CallbackID);
825 void drawPagesToPDFImpl(uint64_t frameID, const PrintInfo&, uint32_t first, uint32_t count, RetainPtr<CFMutableDataRef>& pdfPageData);
828 #if PLATFORM(IOS_FAMILY)
829 void computePagesForPrintingAndDrawToPDF(uint64_t frameID, const PrintInfo&, CallbackID, Messages::WebPage::ComputePagesForPrintingAndDrawToPDF::DelayedReply&&);
833 void drawPagesForPrinting(uint64_t frameID, const PrintInfo&, CallbackID);
834 void didFinishPrintOperation(const WebCore::ResourceError&, CallbackID);
837 void addResourceRequest(unsigned long, const WebCore::ResourceRequest&);
838 void removeResourceRequest(unsigned long);
840 void setMediaVolume(float);
841 void setMuted(WebCore::MediaProducer::MutedStateFlags);
842 void setMayStartMediaWhenInWindow(bool);
843 void stopMediaCapture();
845 #if ENABLE(MEDIA_SESSION)
846 void handleMediaEvent(uint32_t /* WebCore::MediaEventType */);
847 void setVolumeOfMediaElement(double, uint64_t);
850 void updateMainFrameScrollOffsetPinning();
852 bool mainFrameHasCustomContentProvider() const;
853 void addMIMETypeWithCustomContentProvider(const String&);
855 void mainFrameDidLayout();
857 bool canRunBeforeUnloadConfirmPanel() const { return m_canRunBeforeUnloadConfirmPanel; }
858 void setCanRunBeforeUnloadConfirmPanel(bool canRunBeforeUnloadConfirmPanel) { m_canRunBeforeUnloadConfirmPanel = canRunBeforeUnloadConfirmPanel; }
860 bool canRunModal() const { return m_canRunModal; }
861 void setCanRunModal(bool canRunModal) { m_canRunModal = canRunModal; }
865 void setDeviceScaleFactor(float);
866 float deviceScaleFactor() const;
868 void forceRepaintWithoutCallback();
870 void unmarkAllMisspellings();
871 void unmarkAllBadGrammar();
874 void handleAlternativeTextUIResult(const String&);
877 // For testing purpose.
878 void simulateMouseDown(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, WallTime);
879 void simulateMouseUp(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, WallTime);
880 void simulateMouseMotion(WebCore::IntPoint, WallTime);
882 #if ENABLE(CONTEXT_MENUS)
883 void contextMenuShowing() { m_isShowingContextMenu = true; }
886 void wheelEvent(const WebWheelEvent&);
888 void wheelEventHandlersChanged(bool);
889 void recomputeShortCircuitHorizontalWheelEventsState();
891 #if ENABLE(MAC_GESTURE_EVENTS)
892 void gestureEvent(const WebGestureEvent&);
895 void updateVisibilityState(bool isInitialState = false);
897 #if PLATFORM(IOS_FAMILY)
898 void setViewportConfigurationViewLayoutSize(const WebCore::FloatSize&, double scaleFactor);
899 void setMaximumUnobscuredSize(const WebCore::FloatSize&);
900 void setDeviceOrientation(int32_t);
901 void setOverrideViewportArguments(const std::optional<WebCore::ViewportArguments>&);
902 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);
903 std::optional<float> scaleFromUIProcess(const VisibleContentRectUpdateInfo&) const;
904 void updateVisibleContentRects(const VisibleContentRectUpdateInfo&, MonotonicTime oldestTimestamp);
905 bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; }
906 void willStartUserTriggeredZooming();
907 void applicationWillResignActive();
908 void applicationDidEnterBackground(bool isSuspendedUnderLock);
909 void applicationDidFinishSnapshottingAfterEnteringBackground();
910 void applicationWillEnterForeground(bool isSuspendedUnderLock);
911 void applicationDidBecomeActive();
912 void completePendingSyntheticClickForContentChangeObserver();
914 bool platformPrefersTextLegibilityBasedZoomScaling() const;
915 const WebCore::ViewportConfiguration& viewportConfiguration() const { return m_viewportConfiguration; }
918 #if ENABLE(IOS_TOUCH_EVENTS)
919 void dispatchTouchEvent(const WebTouchEvent&, bool& handled);
922 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
923 uint64_t nativeWindowHandle() { return m_nativeWindowHandle; }
926 bool shouldUseCustomContentProviderForResponse(const WebCore::ResourceResponse&);
928 bool asynchronousPluginInitializationEnabled() const { return m_asynchronousPluginInitializationEnabled; }
929 void setAsynchronousPluginInitializationEnabled(bool enabled) { m_asynchronousPluginInitializationEnabled = enabled; }
930 bool asynchronousPluginInitializationEnabledForAllPlugins() const { return m_asynchronousPluginInitializationEnabledForAllPlugins; }
931 void setAsynchronousPluginInitializationEnabledForAllPlugins(bool enabled) { m_asynchronousPluginInitializationEnabledForAllPlugins = enabled; }
932 bool artificialPluginInitializationDelayEnabled() const { return m_artificialPluginInitializationDelayEnabled; }
933 void setArtificialPluginInitializationDelayEnabled(bool enabled) { m_artificialPluginInitializationDelayEnabled = enabled; }
934 void setTabToLinksEnabled(bool enabled) { m_tabToLinks = enabled; }
935 bool tabToLinksEnabled() const { return m_tabToLinks; }
937 bool scrollingPerformanceLoggingEnabled() const { return m_scrollingPerformanceLoggingEnabled; }
938 void setScrollingPerformanceLoggingEnabled(bool);
941 bool shouldUsePDFPlugin() const;
942 bool pdfPluginEnabled() const { return m_pdfPluginEnabled; }
943 void setPDFPluginEnabled(bool enabled) { m_pdfPluginEnabled = enabled; }
945 NSDictionary *dataDetectionContext() const { return m_dataDetectionContext.get(); }
948 void savePDFToFileInDownloadsFolder(const String& suggestedFilename, const WebCore::URL& originatingURL, const uint8_t* data, unsigned long size);
951 void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
954 bool mainFrameIsScrollable() const { return m_mainFrameIsScrollable; }
956 void setAlwaysShowsHorizontalScroller(bool);
957 void setAlwaysShowsVerticalScroller(bool);
959 bool alwaysShowsHorizontalScroller() const { return m_alwaysShowsHorizontalScroller; };
960 bool alwaysShowsVerticalScroller() const { return m_alwaysShowsVerticalScroller; };
962 void setViewLayoutSize(const WebCore::IntSize&);
963 WebCore::IntSize viewLayoutSize() const { return m_viewLayoutSize; }
965 void setAutoSizingShouldExpandToViewHeight(bool shouldExpand);
966 bool autoSizingShouldExpandToViewHeight() { return m_autoSizingShouldExpandToViewHeight; }
968 void setViewportSizeForCSSViewportUnits(std::optional<WebCore::IntSize>);
969 std::optional<WebCore::IntSize> viewportSizeForCSSViewportUnits() const { return m_viewportSizeForCSSViewportUnits; }
971 bool canShowMIMEType(const String& MIMEType) const;
972 bool canShowResponse(const WebCore::ResourceResponse&) const;
974 void addTextCheckingRequest(uint64_t requestID, Ref<WebCore::TextCheckingRequest>&&);
975 void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
976 void didCancelCheckingText(uint64_t requestID);
978 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
979 void determinePrimarySnapshottedPlugIn();
980 void determinePrimarySnapshottedPlugInTimerFired();
981 void resetPrimarySnapshottedPlugIn();
982 bool matchesPrimaryPlugIn(const String& pageOrigin, const String& pluginOrigin, const String& mimeType) const;
983 bool plugInIntersectsSearchRect(WebCore::HTMLPlugInImageElement& pluginImageElement);
984 bool plugInIsPrimarySize(WebCore::HTMLPlugInImageElement& pluginImageElement, unsigned &pluginArea);
987 #if ENABLE(DATA_DETECTION)
988 void setDataDetectionResults(NSArray *);
991 unsigned extendIncrementalRenderingSuppression();
992 void stopExtendingIncrementalRenderingSuppression(unsigned token);
993 bool shouldExtendIncrementalRenderingSuppression() { return !m_activeRenderingSuppressionTokens.isEmpty(); }
995 WebCore::ScrollPinningBehavior scrollPinningBehavior() { return m_scrollPinningBehavior; }
996 void setScrollPinningBehavior(uint32_t /* WebCore::ScrollPinningBehavior */ pinning);
998 std::optional<WebCore::ScrollbarOverlayStyle> scrollbarOverlayStyle() { return m_scrollbarOverlayStyle; }
999 void setScrollbarOverlayStyle(std::optional<uint32_t /* WebCore::ScrollbarOverlayStyle */> scrollbarStyle);
1001 Ref<WebCore::DocumentLoader> createDocumentLoader(WebCore::Frame&, const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
1002 void updateCachedDocumentLoader(WebDocumentLoader&, WebCore::Frame&);
1004 void getBytecodeProfile(CallbackID);
1005 void getSamplingProfilerOutput(CallbackID);
1007 #if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION)
1008 void handleTelephoneNumberClick(const String& number, const WebCore::IntPoint&);
1009 void handleSelectionServiceClick(WebCore::FrameSelection&, const Vector<String>& telephoneNumbers, const WebCore::IntPoint&);
1012 void didChangeScrollOffsetForFrame(WebCore::Frame*);
1014 void setMainFrameProgressCompleted(bool completed) { m_mainFrameProgressCompleted = completed; }
1015 bool shouldDispatchFakeMouseMoveEvents() const { return m_shouldDispatchFakeMouseMoveEvents; }
1017 void postMessage(const String& messageName, API::Object* messageBody);
1018 void postSynchronousMessageForTesting(const String& messageName, API::Object* messageBody, RefPtr<API::Object>& returnData);
1019 void postMessageIgnoringFullySynchronousMode(const String& messageName, API::Object* messageBody);
1022 void setInputMethodState(bool);
1025 void imageOrMediaDocumentSizeChanged(const WebCore::IntSize&);
1027 #if ENABLE(VIDEO) && USE(GSTREAMER)
1028 void requestInstallMissingMediaPlugins(const String& details, const String& description, WebCore::MediaPlayerRequestInstallMissingPluginsCallback&);
1031 void addUserScript(String&& source, WebCore::UserContentInjectedFrames, WebCore::UserScriptInjectionTime);
1032 void addUserStyleSheet(const String& source, WebCore::UserContentInjectedFrames);
1033 void removeAllUserContent();
1035 void dispatchDidReachLayoutMilestone(WebCore::LayoutMilestones);
1037 void didRestoreScrollPosition();
1039 bool isControlledByAutomation() const;
1040 void setControlledByAutomation(bool);
1042 void insertNewlineInQuotedContent();
1045 WallTime loadCommitTime() const { return m_loadCommitTime; }
1049 void gamepadActivity(const Vector<GamepadData>&, bool shouldMakeGamepadsVisible);
1052 #if ENABLE(POINTER_LOCK)
1053 void didAcquirePointerLock();
1054 void didNotAcquirePointerLock();
1055 void didLosePointerLock();
1058 void didGetLoadDecisionForIcon(bool decision, CallbackID loadIdentifier, OptionalCallbackID);
1059 void setUseIconLoadingClient(bool);
1061 #if ENABLE(DATA_INTERACTION)
1062 void didConcludeEditDataInteraction();
1065 WebURLSchemeHandlerProxy* urlSchemeHandlerForScheme(const String&);
1066 void stopAllURLSchemeTasks();
1068 std::optional<double> cpuLimit() const { return m_cpuLimit; }
1070 static PluginView* pluginViewForFrame(WebCore::Frame*);
1072 void sendPartialEditorStateAndSchedulePostLayoutUpdate();
1073 void flushPendingEditorStateUpdate();
1075 #if ENABLE(RESOURCE_LOAD_STATISTICS)
1076 void hasStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, CompletionHandler<void(bool)>&& callback);
1077 void requestStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, CompletionHandler<void(bool)>&& callback);
1078 void storageAccessResponse(bool wasGranted, uint64_t contextId);
1081 void showShareSheet(WebCore::ShareDataWithParsedURL&, WTF::CompletionHandler<void(bool)>&& callback);
1082 void didCompleteShareSheet(bool wasCompleted, ShareSheetCallbackID contextId);
1084 #if ENABLE(ATTACHMENT_ELEMENT)
1085 void insertAttachment(const String& identifier, std::optional<uint64_t>&& fileSize, const String& fileName, const String& contentType, CallbackID);
1086 void updateAttachmentAttributes(const String& identifier, std::optional<uint64_t>&& fileSize, const String& contentType, const String& fileName, const IPC::DataReference& enclosingImageData, CallbackID);
1089 #if ENABLE(APPLICATION_MANIFEST)
1090 void getApplicationManifest(CallbackID);
1091 void didFinishLoadingApplicationManifest(uint64_t, const std::optional<WebCore::ApplicationManifest>&);
1094 UserContentControllerIdentifier userContentControllerIdentifier() const { return m_userContentController->identifier(); }
1096 WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() const { return m_userInterfaceLayoutDirection; }
1098 bool isSuspended() const { return m_isSuspended; }
1100 void didReceiveWebPageMessage(IPC::Connection&, IPC::Decoder&);
1103 WebPage(uint64_t pageID, WebPageCreationParameters&&);
1105 void updateThrottleState();
1106 void updateUserActivity();
1108 // IPC::MessageSender
1109 IPC::Connection* messageSenderConnection() override;
1110 uint64_t messageSenderDestinationID() override;
1112 void platformInitialize();
1113 void platformDetach();
1114 void platformEditorState(WebCore::Frame&, EditorState& result, IncludePostLayoutDataHint) const;
1115 void sendEditorStateUpdate();
1118 void sendTouchBarMenuDataAddedUpdate(WebCore::HTMLMenuElement&);
1119 void sendTouchBarMenuDataRemovedUpdate(WebCore::HTMLMenuElement&);
1120 void sendTouchBarMenuItemDataAddedUpdate(WebCore::HTMLMenuItemElement&);
1121 void sendTouchBarMenuItemDataRemovedUpdate(WebCore::HTMLMenuItemElement&);
1124 void didReceiveSyncWebPageMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&);
1126 #if PLATFORM(IOS_FAMILY)
1127 void resetViewportDefaultConfiguration(WebFrame* mainFrame, bool hasMobileDocType = false);
1128 enum class ZoomToInitialScale { No, Yes };
1129 void viewportConfigurationChanged(ZoomToInitialScale = ZoomToInitialScale::No);
1130 void updateViewportSizeForCSSViewportUnits();
1132 static void convertSelectionRectsToRootView(WebCore::FrameView*, Vector<WebCore::SelectionRect>&);
1133 RefPtr<WebCore::Range> rangeForWebSelectionAtPosition(const WebCore::IntPoint&, const WebCore::VisiblePosition&, SelectionFlags&);
1134 void getAssistedNodeInformation(AssistedNodeInformation&);
1135 void platformInitializeAccessibility();
1136 void handleSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location);
1137 void completeSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location, WebCore::SyntheticClickType);
1138 void sendTapHighlightForNodeIfNecessary(uint64_t requestID, WebCore::Node*);
1139 void resetTextAutosizing();
1140 WebCore::VisiblePosition visiblePositionInFocusedNodeForPoint(const WebCore::Frame&, const WebCore::IntPoint&, bool isInteractingWithAssistedNode);
1141 RefPtr<WebCore::Range> rangeForGranularityAtPoint(WebCore::Frame&, const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithAssistedNode);
1144 #if PLATFORM(IOS_FAMILY) && ENABLE(DATA_INTERACTION)
1145 void requestStartDataInteraction(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition);
1146 void requestAdditionalItemsForDragSession(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition);
1149 #if !PLATFORM(COCOA) && !PLATFORM(WPE)
1150 static const char* interpretKeyEvent(const WebCore::KeyboardEvent*);
1153 bool performDefaultBehaviorForKeyEvent(const WebKeyboardEvent&);
1156 bool executeKeypressCommandsInternal(const Vector<WebCore::KeypressCommand>&, WebCore::KeyboardEvent*);
1159 bool markLayersVolatileImmediatelyIfPossible();
1160 void layerVolatilityTimerFired();
1161 void callVolatilityCompletionHandlers(bool succeeded);
1163 String sourceForFrame(WebFrame*);
1165 void loadDataImpl(uint64_t navigationID, Ref<WebCore::SharedBuffer>&&, const String& MIMEType, const String& encodingName, const WebCore::URL& baseURL, const WebCore::URL& failingURL, const UserData&);
1169 void platformDidReceiveLoadParameters(const LoadParameters&);
1170 void loadRequest(LoadParameters&&);
1171 void loadData(LoadParameters&&);
1172 void loadAlternateHTML(const LoadParameters&);
1173 void navigateToPDFLinkWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint);
1174 void reload(uint64_t navigationID, uint32_t reloadOptions, SandboxExtension::Handle&&);
1175 void goToBackForwardItem(uint64_t navigationID, const WebCore::BackForwardItemIdentifier&, WebCore::FrameLoadType, WebCore::ShouldTreatAsContinuingLoad);
1176 void tryRestoreScrollPosition();
1177 void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, CallbackID);
1178 void updateIsInWindow(bool isInitialState = false);
1179 void visibilityDidChange();
1180 void setActivityState(OptionSet<WebCore::ActivityState::Flag>, ActivityStateChangeID, const Vector<CallbackID>& callbackIDs);
1181 void validateCommand(const String&, CallbackID);
1182 void executeEditCommand(const String&, const String&);
1183 void setEditable(bool);
1185 void setNeedsFontAttributes(bool);
1187 void mouseEvent(const WebMouseEvent&);
1188 void keyEvent(const WebKeyboardEvent&);
1190 #if ENABLE(IOS_TOUCH_EVENTS)
1191 void touchEventSync(const WebTouchEvent&, bool& handled);
1192 void updatePotentialTapSecurityOrigin(const WebTouchEvent&, bool wasHandled);
1193 #elif ENABLE(TOUCH_EVENTS)
1194 void touchEvent(const WebTouchEvent&);
1197 #if ENABLE(CONTEXT_MENUS)
1198 void contextMenuHidden() { m_isShowingContextMenu = false; }
1199 void contextMenuForKeyEvent();
1202 static bool scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity);
1203 static bool logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity);
1205 void loadURLInFrame(WebCore::URL&&, uint64_t frameID);
1207 enum class WasRestoredByAPIRequest { No, Yes };
1208 void restoreSessionInternal(const Vector<BackForwardListItemState>&, WasRestoredByAPIRequest, WebBackForwardListProxy::OverwriteExistingItem);
1209 void restoreSession(const Vector<BackForwardListItemState>&);
1210 void didRemoveBackForwardItem(const WebCore::BackForwardItemIdentifier&);
1211 void updateBackForwardListForReattach(const Vector<WebKit::BackForwardListItemState>&);
1212 void setCurrentHistoryItemForReattach(WebKit::BackForwardListItemState&&);
1214 void requestFontAttributesAtSelectionStart(CallbackID);
1216 #if ENABLE(REMOTE_INSPECTOR)
1217 void setAllowsRemoteInspection(bool);
1218 void setRemoteInspectionNameOverride(const String&);
1221 void setDrawsBackground(bool);
1224 void setTopContentInsetFenced(float, IPC::Attachment);
1226 void setTopContentInset(float);
1228 void viewWillStartLiveResize();
1229 void viewWillEndLiveResize();
1231 void getContentsAsString(CallbackID);
1233 void getContentsAsMHTMLData(CallbackID);
1235 void getMainResourceDataOfFrame(uint64_t frameID, CallbackID);
1236 void getResourceDataFromFrame(uint64_t frameID, const String& resourceURL, CallbackID);
1237 void getRenderTreeExternalRepresentation(CallbackID);
1238 void getSelectionOrContentsAsString(CallbackID);
1239 void getSelectionAsWebArchiveData(CallbackID);
1240 void getSourceForFrame(uint64_t frameID, CallbackID);
1241 void getWebArchiveOfFrame(uint64_t frameID, CallbackID);
1242 void runJavaScript(const String&, bool forceUserGesture, std::optional<String> worldName, CallbackID);
1243 void runJavaScriptInMainFrame(const String&, bool forceUserGesture, CallbackID);
1244 void runJavaScriptInMainFrameScriptWorld(const String&, bool forceUserGesture, const String& worldName, CallbackID);
1245 void forceRepaint(CallbackID);
1246 void takeSnapshot(WebCore::IntRect snapshotRect, WebCore::IntSize bitmapSize, uint32_t options, CallbackID);
1248 void preferencesDidChange(const WebPreferencesStore&);
1249 void updatePreferences(const WebPreferencesStore&);
1250 void updatePreferencesGenerated(const WebPreferencesStore&);
1252 #if PLATFORM(IOS_FAMILY)
1253 bool parentProcessHasServiceWorkerEntitlement() const;
1255 bool parentProcessHasServiceWorkerEntitlement() const { return true; }
1258 void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, WebCore::PolicyAction, uint64_t navigationID, const DownloadID&, std::optional<WebsitePoliciesData>&&);
1259 void continueWillSubmitForm(uint64_t frameID, uint64_t listenerID);
1260 void setUserAgent(const String&);
1261 void setCustomTextEncodingName(const String&);
1262 void suspendActiveDOMObjectsAndAnimations();
1263 void resumeActiveDOMObjectsAndAnimations();
1266 void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
1267 void performDictionaryLookupOfCurrentSelection();
1268 void performDictionaryLookupForRange(WebCore::Frame&, WebCore::Range&, NSDictionary *options, WebCore::TextIndicatorPresentationTransition);
1269 WebCore::DictionaryPopupInfo dictionaryPopupInfoForRange(WebCore::Frame&, WebCore::Range&, NSDictionary *options, WebCore::TextIndicatorPresentationTransition);
1270 #if ENABLE(PDFKIT_PLUGIN)
1271 WebCore::DictionaryPopupInfo dictionaryPopupInfoForSelectionInPDFPlugin(PDFSelection *, PDFPlugin&, NSDictionary *options, WebCore::TextIndicatorPresentationTransition);
1274 void windowAndViewFramesChanged(const WebCore::FloatRect& windowFrameInScreenCoordinates, const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates, const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
1276 RetainPtr<PDFDocument> pdfDocumentForPrintingFrame(WebCore::Frame*);
1277 void computePagesForPrintingPDFDocument(uint64_t frameID, const PrintInfo&, Vector<WebCore::IntRect>& resultPageRects);
1278 void drawPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, const WebCore::IntRect&);
1279 void drawPagesToPDFFromPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, uint32_t first, uint32_t count);
1282 void setMainFrameIsScrollable(bool);
1284 void unapplyEditCommand(uint64_t commandID);
1285 void reapplyEditCommand(uint64_t commandID);
1286 void didRemoveEditCommand(uint64_t commandID);
1288 void findString(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1289 void findStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1290 void getImageForFindMatch(uint32_t matchIndex);
1291 void selectFindMatch(uint32_t matchIndex);
1293 void countStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1295 #if USE(COORDINATED_GRAPHICS)
1296 void sendViewportAttributesChanged(const WebCore::ViewportArguments&);
1299 void didChangeSelectedIndexForActivePopupMenu(int32_t newIndex);
1300 void setTextForActivePopupMenu(int32_t index);
1303 void failedToShowPopupMenu();
1306 void didChooseFilesForOpenPanel(const Vector<String>&);
1307 void didCancelForOpenPanel();
1309 #if PLATFORM(IOS_FAMILY)
1310 void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const IPC::DataReference& iconData);
1313 #if ENABLE(SANDBOX_EXTENSIONS)
1314 void extendSandboxForFilesFromOpenPanel(SandboxExtension::HandleArray&&);
1317 void didReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed);
1319 void didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed);
1321 #if ENABLE(MEDIA_STREAM)
1322 void userMediaAccessWasGranted(uint64_t userMediaID, WebCore::CaptureDevice&& audioDeviceUID, WebCore::CaptureDevice&& videoDeviceUID, String&& mediaDeviceIdentifierHashSalt);
1323 void userMediaAccessWasDenied(uint64_t userMediaID, uint64_t reason, String&& invalidConstraint);
1325 void didCompleteMediaDeviceEnumeration(uint64_t userMediaID, const Vector<WebCore::CaptureDevice>& devices, String&& deviceIdentifierHashSalt, bool originHasPersistentAccess);
1328 #if ENABLE(MEDIA_STREAM) && ENABLE(SANDBOX_EXTENSIONS)
1329 void grantUserMediaDeviceSandboxExtensions(MediaDeviceSandboxExtensions&&);
1330 void revokeUserMediaDeviceSandboxExtensions(const Vector<String>&);
1334 void disableICECandidateFiltering();
1335 void enableICECandidateFiltering();
1338 #if ENABLE(WEB_RTC) && USE(LIBWEBRTC)
1339 void disableEnumeratingAllNetworkInterfaces();
1340 void enableEnumeratingAllNetworkInterfaces();
1343 void advanceToNextMisspelling(bool startBeforeSelection);
1344 void changeSpellingToWord(const String& word);
1347 void uppercaseWord();
1348 void lowercaseWord();
1349 void capitalizeWord();
1352 #if ENABLE(CONTEXT_MENUS)
1353 void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&);
1356 void changeSelectedIndex(int32_t index);
1357 void setCanStartMediaTimerFired();
1359 static bool platformCanHandleRequest(const WebCore::ResourceRequest&);
1361 static PluginView* focusedPluginViewForFrame(WebCore::Frame&);
1363 static RefPtr<WebCore::Range> rangeFromEditingRange(WebCore::Frame&, const EditingRange&, EditingRangeIsRelativeTo = EditingRangeIsRelativeTo::EditableRoot);
1365 void reportUsedFeatures();
1367 void updateWebsitePolicies(WebsitePoliciesData&&);
1369 void changeFont(WebCore::FontChanges&&);
1370 void changeFontAttributes(WebCore::FontAttributeChanges&&);
1373 void performImmediateActionHitTestAtLocation(WebCore::FloatPoint);
1374 std::tuple<RefPtr<WebCore::Range>, NSDictionary *> lookupTextAtLocation(WebCore::FloatPoint);
1375 void immediateActionDidUpdate();
1376 void immediateActionDidCancel();
1377 void immediateActionDidComplete();
1379 void dataDetectorsDidPresentUI(WebCore::PageOverlay::PageOverlayID);
1380 void dataDetectorsDidChangeUI(WebCore::PageOverlay::PageOverlayID);
1381 void dataDetectorsDidHideUI(WebCore::PageOverlay::PageOverlayID);
1383 void handleAcceptedCandidate(WebCore::TextCheckingResult);
1387 void requestActiveNowPlayingSessionInfo(CallbackID);
1390 void setShouldDispatchFakeMouseMoveEvents(bool dispatch) { m_shouldDispatchFakeMouseMoveEvents = dispatch; }
1392 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
1393 void playbackTargetSelected(uint64_t, const WebCore::MediaPlaybackTargetContext& outputDevice) const;
1394 void playbackTargetAvailabilityDidChange(uint64_t, bool);
1395 void setShouldPlayToPlaybackTarget(uint64_t, bool);
1398 void clearWheelEventTestTrigger();
1400 void setShouldScaleViewToFitDocument(bool);
1402 void pageStoppedScrolling();
1404 #if ENABLE(VIDEO) && USE(GSTREAMER)
1405 void didEndRequestInstallMissingMediaPlugins(uint32_t result);
1408 void setResourceCachingDisabled(bool);
1409 void setUserInterfaceLayoutDirection(uint32_t);
1411 bool canPluginHandleResponse(const WebCore::ResourceResponse&);
1414 void didReceivePasswordForQuickLookDocument(const String&);
1417 void frameBecameRemote(uint64_t frameID, WebCore::GlobalFrameIdentifier&& remoteFrameIdentifier, WebCore::GlobalWindowIdentifier&& remoteWindowIdentifier);
1419 void registerURLSchemeHandler(uint64_t identifier, const String& scheme);
1421 void urlSchemeTaskDidPerformRedirection(uint64_t handlerIdentifier, uint64_t taskIdentifier, WebCore::ResourceResponse&&, WebCore::ResourceRequest&&);
1422 void urlSchemeTaskDidReceiveResponse(uint64_t handlerIdentifier, uint64_t taskIdentifier, const WebCore::ResourceResponse&);
1423 void urlSchemeTaskDidReceiveData(uint64_t handlerIdentifier, uint64_t taskIdentifier, const IPC::DataReference&);
1424 void urlSchemeTaskDidComplete(uint64_t handlerIdentifier, uint64_t taskIdentifier, const WebCore::ResourceError&);
1426 void setIsSuspended(bool);
1427 void tearDownDrawingAreaForSuspend();
1429 RefPtr<WebImage> snapshotAtSize(const WebCore::IntRect&, const WebCore::IntSize& bitmapSize, SnapshotOptions);
1430 RefPtr<WebImage> snapshotNode(WebCore::Node&, SnapshotOptions, unsigned maximumPixelCount = std::numeric_limits<unsigned>::max());
1432 RetainPtr<CFDataRef> pdfSnapshotAtSize(const WebCore::IntRect&, const WebCore::IntSize& bitmapSize, SnapshotOptions);
1435 #if ENABLE(ATTACHMENT_ELEMENT)
1436 RefPtr<WebCore::HTMLAttachmentElement> attachmentElementWithIdentifier(const String& identifier) const;
1439 bool canShowMIMEType(const String&, const Function<bool(const String&, WebCore::PluginData::AllowedPluginTypes)>& supportsPlugin) const;
1443 std::unique_ptr<WebCore::Page> m_page;
1444 RefPtr<WebFrame> m_mainFrame;
1446 RefPtr<WebPageGroupProxy> m_pageGroup;
1450 WebCore::IntSize m_viewSize;
1451 std::unique_ptr<DrawingArea> m_drawingArea;
1453 HashSet<PluginView*> m_pluginViews;
1454 bool m_hasSeenPlugin { false };
1456 HashMap<uint64_t, RefPtr<WebCore::TextCheckingRequest>> m_pendingTextCheckingRequestMap;
1458 bool m_useFixedLayout { false };
1459 bool m_drawsBackground { true };
1461 WebCore::Color m_underlayColor;
1463 bool m_isInRedo { false };
1464 bool m_isClosed { false };
1465 bool m_tabToLinks { false };
1467 bool m_asynchronousPluginInitializationEnabled { false };
1468 bool m_asynchronousPluginInitializationEnabledForAllPlugins { false };
1469 bool m_artificialPluginInitializationDelayEnabled { false };
1470 bool m_scrollingPerformanceLoggingEnabled { false };
1471 bool m_mainFrameIsScrollable { true };
1473 bool m_alwaysShowsHorizontalScroller { false };
1474 bool m_alwaysShowsVerticalScroller { false };
1476 #if PLATFORM(IOS_FAMILY)
1477 bool m_ignoreViewportScalingConstraints { false };
1480 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
1481 bool m_readyToFindPrimarySnapshottedPlugin { false };
1482 bool m_didFindPrimarySnapshottedPlugin { false };
1483 unsigned m_numberOfPrimarySnapshotDetectionAttempts { 0 };
1484 String m_primaryPlugInPageOrigin;
1485 String m_primaryPlugInOrigin;
1486 String m_primaryPlugInMimeType;
1487 RunLoop::Timer<WebPage> m_determinePrimarySnapshottedPlugInTimer;
1490 // The layer hosting mode.
1491 LayerHostingMode m_layerHostingMode;
1494 bool m_pdfPluginEnabled { false };
1495 bool m_hasCachedWindowFrame { false };
1497 // The frame of the containing window in screen coordinates.
1498 WebCore::FloatRect m_windowFrameInScreenCoordinates;
1500 // The frame of the containing window in unflipped screen coordinates.
1501 WebCore::FloatRect m_windowFrameInUnflippedScreenCoordinates;
1503 // The frame of the view in window coordinates.
1504 WebCore::FloatRect m_viewFrameInWindowCoordinates;
1506 // The accessibility position of the view.
1507 WebCore::FloatPoint m_accessibilityPosition;
1509 RetainPtr<WKAccessibilityWebPageObject> m_mockAccessibilityElement;
1511 UniqueRef<ViewGestureGeometryCollector> m_viewGestureGeometryCollector;
1513 RetainPtr<NSDictionary> m_dataDetectionContext;
1516 #if HAVE(ACCESSIBILITY) && PLATFORM(GTK)
1517 GRefPtr<WebPageAccessibilityObject> m_accessibilityObject;
1520 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
1521 // Our view's window in the UI process.
1522 uint64_t m_nativeWindowHandle { 0 };
1525 #if !PLATFORM(IOS_FAMILY)
1526 RefPtr<PageBanner> m_headerBanner;
1527 RefPtr<PageBanner> m_footerBanner;
1530 RunLoop::Timer<WebPage> m_setCanStartMediaTimer;
1531 bool m_mayStartMediaWhenInWindow { false };
1533 HashMap<uint64_t, RefPtr<WebUndoStep>> m_undoStepMap;
1535 #if ENABLE(CONTEXT_MENUS)
1536 std::unique_ptr<API::InjectedBundle::PageContextMenuClient> m_contextMenuClient;
1538 std::unique_ptr<API::InjectedBundle::EditorClient> m_editorClient;
1539 std::unique_ptr<API::InjectedBundle::FormClient> m_formClient;
1540 std::unique_ptr<API::InjectedBundle::PageLoaderClient> m_loaderClient;
1541 InjectedBundlePagePolicyClient m_policyClient;
1542 std::unique_ptr<API::InjectedBundle::ResourceLoadClient> m_resourceLoadClient;
1543 std::unique_ptr<API::InjectedBundle::PageUIClient> m_uiClient;
1544 #if ENABLE(FULLSCREEN_API)
1545 InjectedBundlePageFullScreenClient m_fullScreenClient;
1548 UniqueRef<FindController> m_findController;
1550 RefPtr<WebInspector> m_inspector;
1551 RefPtr<WebInspectorUI> m_inspectorUI;
1552 RefPtr<RemoteWebInspectorUI> m_remoteInspectorUI;
1554 #if (PLATFORM(IOS_FAMILY) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
1555 RefPtr<PlaybackSessionManager> m_playbackSessionManager;
1556 RefPtr<VideoFullscreenManager> m_videoFullscreenManager;
1559 #if PLATFORM(IOS_FAMILY)
1560 bool m_allowsMediaDocumentInlinePlayback { false };
1561 RefPtr<WebCore::Range> m_startingGestureRange;
1564 #if ENABLE(FULLSCREEN_API)
1565 RefPtr<WebFullScreenManager> m_fullScreenManager;
1568 RefPtr<WebPopupMenu> m_activePopupMenu;
1570 #if ENABLE(CONTEXT_MENUS)
1571 RefPtr<WebContextMenu> m_contextMenu;
1574 #if ENABLE(INPUT_TYPE_COLOR)
1575 WebColorChooser* m_activeColorChooser { nullptr };
1578 #if ENABLE(DATALIST_ELEMENT)
1579 WebDataListSuggestionPicker* m_activeDataListSuggestionPicker { nullptr };
1582 RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener;
1583 RefPtr<NotificationPermissionRequestManager> m_notificationPermissionRequestManager;
1585 Ref<WebUserContentController> m_userContentController;
1587 #if ENABLE(GEOLOCATION)
1588 UniqueRef<GeolocationPermissionRequestManager> m_geolocationPermissionRequestManager;
1591 #if ENABLE(MEDIA_STREAM)
1592 std::unique_ptr<UserMediaPermissionRequestManager> m_userMediaPermissionRequestManager;
1595 std::unique_ptr<WebCore::PrintContext> m_printContext;
1597 RefPtr<WebPrintOperationGtk> m_printOperation;
1600 SandboxExtensionTracker m_sandboxExtensionTracker;
1602 RefPtr<SandboxExtension> m_pendingDropSandboxExtension;
1603 Vector<RefPtr<SandboxExtension>> m_pendingDropExtensionsForFileUpload;
1605 PAL::HysteresisActivity m_pageScrolledHysteresis;
1607 bool m_canRunBeforeUnloadConfirmPanel { false };
1609 bool m_canRunModal { false };
1610 bool m_isRunningModal { false };
1612 #if ENABLE(DRAG_SUPPORT)
1613 bool m_isStartingDrag { false };
1616 bool m_cachedMainFrameIsPinnedToLeftSide { true };
1617 bool m_cachedMainFrameIsPinnedToRightSide { true };
1618 bool m_cachedMainFrameIsPinnedToTopSide { true };
1619 bool m_cachedMainFrameIsPinnedToBottomSide { true };
1620 bool m_canShortCircuitHorizontalWheelEvents { false };
1621 bool m_hasWheelEventHandlers { false };
1623 unsigned m_cachedPageCount { 0 };
1625 HashSet<unsigned long> m_trackedNetworkResourceRequestIdentifiers;
1627 WebCore::IntSize m_viewLayoutSize;
1628 bool m_autoSizingShouldExpandToViewHeight { false };
1629 std::optional<WebCore::IntSize> m_viewportSizeForCSSViewportUnits;
1631 bool m_userIsInteracting { false };
1632 bool m_isAssistingNodeDueToUserInteraction { false };
1633 bool m_hasEverFocusedElementDueToUserInteractionSincePageTransition { false };
1634 bool m_needsHiddenContentEditableQuirk { false };
1635 bool m_needsPlainTextQuirk { false };
1636 bool m_changingActivityState { false };
1638 #if ENABLE(CONTEXT_MENUS)
1639 bool m_isShowingContextMenu { false };
1642 RefPtr<WebCore::Node> m_assistedNode;
1643 bool m_hasPendingBlurNotification { false };
1644 bool m_hasPendingEditorStateUpdate { false };
1646 #if PLATFORM(IOS_FAMILY)
1647 RefPtr<WebCore::Range> m_currentWordRange;
1648 RefPtr<WebCore::Node> m_interactionNode;
1649 WebCore::IntPoint m_lastInteractionLocation;
1651 enum SelectionAnchor { Start, End };
1652 SelectionAnchor m_selectionAnchor { Start };
1654 RefPtr<WebCore::Node> m_potentialTapNode;
1655 WebCore::FloatPoint m_potentialTapLocation;
1656 RefPtr<WebCore::SecurityOrigin> m_potentialTapSecurityOrigin;
1658 WebCore::ViewportConfiguration m_viewportConfiguration;
1659 bool m_hasReceivedVisibleContentRectsAfterDidCommitLoad { false };
1660 bool m_scaleWasSetByUIProcess { false };
1661 bool m_userHasChangedPageScaleFactor { false };
1662 bool m_hasStablePageScaleFactor { true };
1663 bool m_useTestingViewportConfiguration { false };
1664 bool m_isInStableState { true };
1665 bool m_forceAlwaysUserScalable { false };
1666 MonotonicTime m_oldestNonStableUpdateVisibleContentRectsTimestamp;
1667 Seconds m_estimatedLatency { 0 };
1668 WebCore::FloatSize m_screenSize;
1669 WebCore::FloatSize m_availableScreenSize;
1670 WebCore::FloatSize m_overrideScreenSize;
1671 RefPtr<WebCore::Range> m_currentBlockSelection;
1672 WebCore::IntRect m_blockRectForTextSelection;
1674 RefPtr<WebCore::Range> m_initialSelection;
1675 WebCore::VisibleSelection m_storedSelectionForAccessibility { WebCore::VisibleSelection() };
1676 WebCore::IntSize m_blockSelectionDesiredSize;
1677 WebCore::FloatSize m_maximumUnobscuredSize;
1678 int32_t m_deviceOrientation { 0 };
1679 bool m_inDynamicSizeUpdate { false };
1680 HashMap<std::pair<WebCore::IntSize, double>, WebCore::IntPoint> m_dynamicSizeUpdateHistory;
1681 RefPtr<WebCore::Node> m_pendingSyntheticClickNode;
1682 WebCore::FloatPoint m_pendingSyntheticClickLocation;
1683 WebCore::FloatRect m_previousExposedContentRect;
1684 uint64_t m_currentAssistedNodeIdentifier { 0 };
1685 std::optional<DynamicViewportSizeUpdateID> m_pendingDynamicViewportSizeUpdateID;
1686 double m_lastTransactionPageScaleFactor { 0 };
1687 uint64_t m_lastTransactionIDWithScaleChange { 0 };
1690 WebCore::Timer m_layerVolatilityTimer;
1691 Vector<WTF::Function<void (bool)>> m_markLayersAsVolatileCompletionHandlers;
1692 bool m_isSuspendedUnderLock { false };
1694 HashSet<String, ASCIICaseInsensitiveHash> m_mimeTypesWithCustomContentProviders;
1695 WebCore::Color m_backgroundColor { WebCore::Color::white };
1697 HashSet<unsigned> m_activeRenderingSuppressionTokens;
1698 unsigned m_maximumRenderingSuppressionToken { 0 };
1700 WebCore::ScrollPinningBehavior m_scrollPinningBehavior { WebCore::DoNotPin };
1701 std::optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle;
1703 bool m_useAsyncScrolling { false };
1705 OptionSet<WebCore::ActivityState::Flag> m_activityState;
1707 bool m_processSuppressionEnabled;
1708 UserActivity m_userActivity;
1709 PAL::HysteresisActivity m_userActivityHysteresis;
1711 uint64_t m_pendingNavigationID { 0 };
1713 bool m_mainFrameProgressCompleted { false };
1714 bool m_shouldDispatchFakeMouseMoveEvents { true };
1715 bool m_isEditorStateMissingPostLayoutData { false };
1716 bool m_isSelectingTextWhileInsertingAsynchronously { false };
1718 enum class EditorStateIsContentEditable { No, Yes, Unset };
1719 mutable EditorStateIsContentEditable m_lastEditorStateWasContentEditable { EditorStateIsContentEditable::Unset };
1722 bool m_inputMethodEnabled { false };
1725 #if ENABLE(VIDEO) && USE(GSTREAMER)
1726 RefPtr<WebCore::MediaPlayerRequestInstallMissingPluginsCallback> m_installMediaPluginsCallback;
1730 WallTime m_loadCommitTime;
1733 WebCore::UserInterfaceLayoutDirection m_userInterfaceLayoutDirection { WebCore::UserInterfaceLayoutDirection::LTR };
1735 const String m_overrideContentSecurityPolicy;
1736 const std::optional<double> m_cpuLimit;
1738 HashMap<String, RefPtr<WebURLSchemeHandlerProxy>> m_schemeToURLSchemeHandlerProxyMap;
1739 HashMap<uint64_t, WebURLSchemeHandlerProxy*> m_identifierToURLSchemeHandlerProxyMap;
1741 HashMap<uint64_t, WTF::Function<void(bool granted)>> m_storageAccessResponseCallbackMap;
1742 HashMap<ShareSheetCallbackID, WTF::Function<void(bool completed)>> m_shareSheetResponseCallbackMap;
1744 #if ENABLE(APPLICATION_MANIFEST)
1745 HashMap<uint64_t, uint64_t> m_applicationManifestFetchCallbackMap;
1748 bool m_isSuspended { false };
1749 bool m_needsFontAttributes { false };
1752 } // namespace WebKit