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 "APIObject.h"
29 #include "AssistedNodeInformation.h"
30 #include "AutoCorrectionCallback.h"
31 #include "Connection.h"
32 #include "ContextMenuContextData.h"
33 #include "DownloadID.h"
34 #include "DragControllerAction.h"
35 #include "EditingRange.h"
36 #include "EditorState.h"
37 #include "GeolocationPermissionRequestManagerProxy.h"
38 #include "HiddenPageThrottlingAutoIncreasesCounter.h"
39 #include "LayerTreeContext.h"
40 #include "MessageSender.h"
41 #include "NotificationPermissionRequestManagerProxy.h"
42 #include "PageLoadState.h"
43 #include "ProcessTerminationReason.h"
44 #include "ProcessThrottler.h"
45 #include "SandboxExtension.h"
46 #include "ShareSheetCallbackID.h"
47 #include "ShareableBitmap.h"
48 #include "SuspendedPageProxy.h"
49 #include "SystemPreviewController.h"
50 #include "UserMediaPermissionRequestManagerProxy.h"
51 #include "VisibleContentRectUpdateInfo.h"
52 #include "VisibleWebPageCounter.h"
54 #include "WKPagePrivate.h"
55 #include "WebColorPicker.h"
56 #include "WebContextMenuItemData.h"
57 #include "WebCoreArgumentCoders.h"
58 #include "WebDataListSuggestionsDropdown.h"
59 #include "WebFrameProxy.h"
60 #include "WebPageCreationParameters.h"
61 #include "WebPageDiagnosticLoggingClient.h"
62 #include "WebPageInjectedBundleClient.h"
63 #include "WebPaymentCoordinatorProxy.h"
64 #include "WebPreferences.h"
65 #include "WebPageProxyMessages.h"
66 #include "WebPopupMenuProxy.h"
67 #include "WebProcessLifetimeTracker.h"
68 #include "WebsitePoliciesData.h"
69 #include <WebCore/ActivityState.h>
70 #include <WebCore/AutoplayEvent.h>
71 #include <WebCore/Color.h>
72 #include <WebCore/DragActions.h>
73 #include <WebCore/EventTrackingRegions.h>
74 #include <WebCore/FontAttributes.h>
75 #include <WebCore/FrameLoaderTypes.h>
76 #include <WebCore/FrameView.h> // FIXME: Move LayoutViewportConstraint to its own file and stop including this.
77 #include <WebCore/LayoutPoint.h>
78 #include <WebCore/LayoutSize.h>
79 #include <WebCore/MediaPlaybackTargetContext.h>
80 #include <WebCore/MediaProducer.h>
81 #include <WebCore/PlatformScreen.h>
82 #include <WebCore/ScrollTypes.h>
83 #include <WebCore/SearchPopupMenu.h>
84 #include <WebCore/TextChecking.h>
85 #include <WebCore/TextGranularity.h>
86 #include <WebCore/URL.h>
87 #include <WebCore/UserInterfaceLayoutDirection.h>
89 #include <wtf/CompletionHandler.h>
90 #include <wtf/HashMap.h>
91 #include <wtf/HashSet.h>
92 #include <wtf/MonotonicTime.h>
93 #include <wtf/Optional.h>
94 #include <wtf/ProcessID.h>
96 #include <wtf/RefPtr.h>
97 #include <wtf/RunLoop.h>
98 #include <wtf/UniqueRef.h>
99 #include <wtf/Vector.h>
100 #include <wtf/text/WTFString.h>
103 OBJC_CLASS _WKRemoteObjectRegistry;
105 #if ENABLE(DRAG_SUPPORT)
106 #include <WebCore/DragActions.h>
109 #if ENABLE(TOUCH_EVENTS)
110 #include "NativeWebTouchEvent.h"
114 #include "DynamicViewportSizeUpdate.h"
115 #include "LayerRepresentation.h"
116 #include "TouchBarMenuData.h"
117 #include "TouchBarMenuItemData.h"
121 #include "ArgumentCodersGtk.h"
124 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
125 #include <WebCore/MediaPlaybackTargetPicker.h>
126 #include <WebCore/WebMediaSessionManagerClient.h>
129 #if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
130 #include "DisplayLink.h"
133 #if ENABLE(MEDIA_SESSION)
135 class MediaSessionMetadata;
141 class ContextMenuClient;
143 class FindMatchesClient;
145 class FullscreenClient;
147 class IconLoadingClient;
150 class NavigationClient;
162 class AuthenticationChallenge;
163 class CertificateInfo;
167 class FontAttributeChanges;
171 class ProtectionSpace;
172 class RunLoopObserver;
175 class ValidationBubble;
177 enum SelectionDirection : uint8_t;
179 enum class AutoplayEvent : uint8_t;
180 enum class LockBackForwardList : bool;
181 enum class HasInsecureContent : bool;
182 enum class NotificationDirection : uint8_t;
183 enum class ShouldSample : bool;
184 enum class ShouldTreatAsContinuingLoad : bool;
186 struct ApplicationManifest;
187 struct BackForwardItemIdentifier;
188 struct DataListSuggestionInformation;
189 struct DictionaryPopupInfo;
190 struct ExceptionDetails;
191 struct FileChooserSettings;
192 struct GlobalWindowIdentifier;
193 struct MediaStreamRequest;
194 struct PrewarmInformation;
195 struct SecurityOriginData;
197 struct TextAlternativeWithRange;
198 struct TextCheckingResult;
199 struct ViewportAttributes;
200 struct WindowFeatures;
202 template <typename> class RectEdges;
203 using FloatBoxExtent = RectEdges<float>;
207 typedef GtkWidget* PlatformWidget;
211 struct wpe_view_backend;
214 #if PLATFORM(GTK) || PLATFORM(WPE)
215 typedef struct OpaqueJSContext* JSGlobalContextRef;
219 typedef HWND PlatformWidget;
223 class DrawingAreaProxy;
224 class NativeWebGestureEvent;
225 class NativeWebKeyboardEvent;
226 class NativeWebMouseEvent;
227 class NativeWebWheelEvent;
229 class RemoteLayerTreeHost;
230 class RemoteLayerTreeScrollingPerformanceData;
231 class RemoteLayerTreeTransaction;
232 class RemoteScrollingCoordinatorProxy;
233 class SecKeyProxyStore;
236 class VisitedLinkStore;
237 class WebBackForwardList;
238 class WebBackForwardListItem;
239 class WebContextMenuProxy;
240 class WebEditCommandProxy;
241 class WebFullScreenManagerProxy;
242 class PlaybackSessionManagerProxy;
243 class WebNavigationState;
244 class VideoFullscreenManagerProxy;
245 class WebAuthenticatorCoordinatorProxy;
246 class WebKeyboardEvent;
247 class WebURLSchemeHandler;
249 class WebOpenPanelResultListenerProxy;
251 class WebProcessProxy;
252 class WebUserContentControllerProxy;
254 class WebsiteDataStore;
257 struct AttributedString;
258 struct ColorSpaceData;
261 struct FrameInfoData;
262 struct InteractionInformationRequest;
263 struct LoadParameters;
264 struct PlatformPopupMenuData;
267 struct URLSchemeTaskParameters;
269 enum class ProcessSwapRequestedByClient;
270 enum class UndoOrRedo : bool;
273 class QuickLookDocumentData;
276 typedef GenericCallback<uint64_t> UnsignedCallback;
277 typedef GenericCallback<EditingRange> EditingRangeCallback;
278 typedef GenericCallback<const String&> StringCallback;
279 typedef GenericCallback<API::SerializedScriptValue*, bool, const WebCore::ExceptionDetails&> ScriptValueCallback;
280 typedef GenericCallback<const WebCore::FontAttributes&> FontAttributesCallback;
283 typedef GenericCallback<API::Error*> PrintFinishedCallback;
286 #if ENABLE(TOUCH_EVENTS)
287 struct QueuedTouchEvents {
288 QueuedTouchEvents(const NativeWebTouchEvent& event)
289 : forwardedEvent(event)
292 NativeWebTouchEvent forwardedEvent;
293 Vector<NativeWebTouchEvent> deferredTouchEvents;
297 typedef GenericCallback<const String&, bool, int32_t> ValidateCommandCallback;
298 typedef GenericCallback<const WebCore::IntRect&, const EditingRange&> RectForCharacterRangeCallback;
300 #if ENABLE(APPLICATION_MANIFEST)
301 typedef GenericCallback<const std::optional<WebCore::ApplicationManifest>&> ApplicationManifestCallback;
305 typedef GenericCallback<const AttributedString&, const EditingRange&> AttributedStringForCharacterRangeCallback;
306 typedef GenericCallback<const String&, double, bool> FontAtSelectionCallback;
309 #if PLATFORM(IOS_FAMILY)
310 typedef GenericCallback<const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t> GestureCallback;
311 typedef GenericCallback<const WebCore::IntPoint&, uint32_t, uint32_t> TouchesCallback;
312 typedef GenericCallback<const Vector<WebCore::SelectionRect>&> SelectionRectsCallback;
313 typedef GenericCallback<const AssistedNodeInformation&> AssistedNodeInformationCallback;
314 struct NodeAssistanceArguments {
315 AssistedNodeInformation m_nodeInformation;
316 bool m_userIsInteracting;
317 bool m_blurPreviousNode;
318 bool m_changingActivityState;
319 RefPtr<API::Object> m_userData;
322 using DrawToPDFCallback = GenericCallback<const IPC::DataReference&>;
326 typedef GenericCallback<const WTF::MachSendRight&> MachSendRightCallback;
327 typedef GenericCallback<bool, bool, String, double, double, uint64_t> NowPlayingInfoCallback;
330 using SpellDocumentTag = int64_t;
332 class WebPageProxy : public API::ObjectImpl<API::Object::Type::Page>
333 #if ENABLE(INPUT_TYPE_COLOR)
334 , public WebColorPicker::Client
336 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
337 , public WebCore::WebMediaSessionManagerClient
339 , public WebPopupMenuProxy::Client
340 , public IPC::MessageReceiver
341 , public IPC::MessageSender
342 , public CanMakeWeakPtr<WebPageProxy> {
344 static Ref<WebPageProxy> create(PageClient&, WebProcessProxy&, uint64_t pageID, Ref<API::PageConfiguration>&&);
345 virtual ~WebPageProxy();
347 const API::PageConfiguration& configuration() const;
349 uint64_t pageID() const { return m_pageID; }
351 PAL::SessionID sessionID() const;
353 WebFrameProxy* mainFrame() const { return m_mainFrame.get(); }
354 WebFrameProxy* focusedFrame() const { return m_focusedFrame.get(); }
355 WebFrameProxy* frameSetLargestFrame() const { return m_frameSetLargestFrame.get(); }
357 DrawingAreaProxy* drawingArea() const { return m_drawingArea.get(); }
359 WebNavigationState& navigationState() { return *m_navigationState.get(); }
361 WebsiteDataStore& websiteDataStore() { return m_websiteDataStore; }
362 void changeWebsiteDataStore(WebsiteDataStore&);
364 #if ENABLE(DATA_DETECTION)
365 NSArray *dataDetectionResults() { return m_dataDetectionResults.get(); }
368 #if ENABLE(ASYNC_SCROLLING) && PLATFORM(COCOA)
369 RemoteScrollingCoordinatorProxy* scrollingCoordinatorProxy() const { return m_scrollingCoordinatorProxy.get(); }
372 WebBackForwardList& backForwardList() { return m_backForwardList; }
374 bool addsVisitedLinks() const { return m_addsVisitedLinks; }
375 void setAddsVisitedLinks(bool addsVisitedLinks) { m_addsVisitedLinks = addsVisitedLinks; }
377 void exitFullscreenImmediately();
378 void fullscreenMayReturnToInline();
379 void didEnterFullscreen();
380 void didExitFullscreen();
382 WebInspectorProxy* inspector() const;
384 void didChangeInspectorFrontendCount(unsigned count) { m_inspectorFrontendCount = count; }
385 unsigned inspectorFrontendCount() const { return m_inspectorFrontendCount; }
387 bool isControlledByAutomation() const { return m_controlledByAutomation; }
388 void setControlledByAutomation(bool);
390 #if ENABLE(REMOTE_INSPECTOR)
391 bool allowsRemoteInspection() const { return m_allowsRemoteInspection; }
392 void setAllowsRemoteInspection(bool);
393 String remoteInspectionNameOverride() const { return m_remoteInspectionNameOverride; }
394 void setRemoteInspectionNameOverride(const String&);
397 #if ENABLE(FULLSCREEN_API)
398 WebFullScreenManagerProxy* fullScreenManager();
400 API::FullscreenClient& fullscreenClient() const { return *m_fullscreenClient; }
401 void setFullscreenClient(std::unique_ptr<API::FullscreenClient>&&);
403 #if (PLATFORM(IOS_FAMILY) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
404 PlaybackSessionManagerProxy* playbackSessionManager();
405 VideoFullscreenManagerProxy* videoFullscreenManager();
408 #if PLATFORM(IOS_FAMILY)
409 bool allowsMediaDocumentInlinePlayback() const;
410 void setAllowsMediaDocumentInlinePlayback(bool);
413 #if USE(SYSTEM_PREVIEW)
414 SystemPreviewController* systemPreviewController() { return m_systemPreviewController.get(); }
417 #if ENABLE(CONTEXT_MENUS)
418 API::ContextMenuClient& contextMenuClient() { return *m_contextMenuClient; }
419 void setContextMenuClient(std::unique_ptr<API::ContextMenuClient>&&);
421 API::FindClient& findClient() { return *m_findClient; }
422 void setFindClient(std::unique_ptr<API::FindClient>&&);
423 API::FindMatchesClient& findMatchesClient() { return *m_findMatchesClient; }
424 void setFindMatchesClient(std::unique_ptr<API::FindMatchesClient>&&);
425 API::DiagnosticLoggingClient* diagnosticLoggingClient() { return m_diagnosticLoggingClient.get(); }
426 void setDiagnosticLoggingClient(std::unique_ptr<API::DiagnosticLoggingClient>&&);
427 void setFormClient(std::unique_ptr<API::FormClient>&&);
428 void setNavigationClient(UniqueRef<API::NavigationClient>&&);
429 void setHistoryClient(UniqueRef<API::HistoryClient>&&);
430 void setLoaderClient(std::unique_ptr<API::LoaderClient>&&);
431 void setPolicyClient(std::unique_ptr<API::PolicyClient>&&);
432 void setInjectedBundleClient(const WKPageInjectedBundleClientBase*);
433 WebPageInjectedBundleClient* injectedBundleClient() { return m_injectedBundleClient.get(); }
435 API::UIClient& uiClient() { return *m_uiClient; }
436 void setUIClient(std::unique_ptr<API::UIClient>&&);
438 API::IconLoadingClient& iconLoadingClient() { return *m_iconLoadingClient; }
439 void setIconLoadingClient(std::unique_ptr<API::IconLoadingClient>&&);
441 void initializeWebPage();
443 WeakPtr<SecKeyProxyStore> secKeyProxyStore(const WebCore::AuthenticationChallenge&);
447 bool isClosed() const { return m_isClosed; }
449 void setOpenedByDOM() { m_openedByDOM = true; }
450 bool openedByDOM() const { return m_openedByDOM; }
452 bool hasCommittedAnyProvisionalLoads() const { return m_hasCommittedAnyProvisionalLoads; }
454 void setIsUsingHighPerformanceWebGL(bool value) { m_isUsingHighPerformanceWebGL = value; }
455 bool isUsingHighPerformanceWebGL() const { return m_isUsingHighPerformanceWebGL; }
457 void didExceedInactiveMemoryLimitWhileActive();
458 void didExceedBackgroundCPULimitWhileInForeground();
460 void closePage(bool stopResponsivenessTimer);
462 void addPlatformLoadParameters(LoadParameters&);
463 RefPtr<API::Navigation> loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes, API::Object* userData = nullptr);
464 RefPtr<API::Navigation> loadFile(const String& fileURL, const String& resourceDirectoryURL, API::Object* userData = nullptr);
465 RefPtr<API::Navigation> loadData(const IPC::DataReference&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr);
466 void loadAlternateHTML(const IPC::DataReference&, const String& encoding, const WebCore::URL& baseURL, const WebCore::URL& unreachableURL, API::Object* userData = nullptr, bool forSafeBrowsing = false);
467 void loadWebArchiveData(API::Data*, API::Object* userData = nullptr);
468 void navigateToPDFLinkWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint);
471 RefPtr<API::Navigation> reload(OptionSet<WebCore::ReloadOption>);
473 RefPtr<API::Navigation> goForward();
474 RefPtr<API::Navigation> goBack();
476 RefPtr<API::Navigation> goToBackForwardItem(WebBackForwardListItem&);
477 void tryRestoreScrollPosition();
478 void didChangeBackForwardList(WebBackForwardListItem* addedItem, Vector<Ref<WebBackForwardListItem>>&& removed);
479 void willGoToBackForwardListItem(const WebCore::BackForwardItemIdentifier&, bool inPageCache);
481 bool shouldKeepCurrentBackForwardListItemInList(WebBackForwardListItem&);
483 bool willHandleHorizontalScrollEvents() const;
485 void updateWebsitePolicies(WebsitePoliciesData&&);
487 bool canShowMIMEType(const String& mimeType);
489 bool drawsBackground() const { return m_drawsBackground; }
490 void setDrawsBackground(bool);
492 String currentURL() const;
494 float topContentInset() const { return m_topContentInset; }
495 void setTopContentInset(float);
497 WebCore::Color underlayColor() const { return m_underlayColor; }
498 void setUnderlayColor(const WebCore::Color&);
500 // At this time, m_pageExtendedBackgroundColor can be set via pageExtendedBackgroundColorDidChange() which is a message
501 // from the UIProcess, or by didCommitLayerTree(). When PLATFORM(MAC) adopts UI side compositing, we should get rid of
502 // the message entirely.
503 WebCore::Color pageExtendedBackgroundColor() const { return m_pageExtendedBackgroundColor; }
505 void viewWillStartLiveResize();
506 void viewWillEndLiveResize();
508 void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, WTF::Function<void (CallbackBase::Error)>&&);
510 void clearSelection();
511 void restoreSelectionInFocusedEditableElement();
513 PageClient& pageClient() const;
515 void setViewNeedsDisplay(const WebCore::Region&);
516 void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin, bool isProgrammaticScroll);
518 WebCore::FloatPoint viewScrollPosition() const;
520 void setDelegatesScrolling(bool delegatesScrolling) { m_delegatesScrolling = delegatesScrolling; }
521 bool delegatesScrolling() const { return m_delegatesScrolling; }
523 enum class ActivityStateChangeDispatchMode { Deferrable, Immediate };
524 void activityStateDidChange(OptionSet<WebCore::ActivityState::Flag> mayHaveChanged, bool wantsSynchronousReply = false, ActivityStateChangeDispatchMode = ActivityStateChangeDispatchMode::Deferrable);
525 bool isInWindow() const { return m_activityState.contains(WebCore::ActivityState::IsInWindow); }
526 void waitForDidUpdateActivityState(ActivityStateChangeID);
527 void didUpdateActivityState() { m_waitingForDidUpdateActivityState = false; }
529 void layerHostingModeDidChange();
531 WebCore::IntSize viewSize() const;
532 bool isViewVisible() const { return m_activityState.contains(WebCore::ActivityState::IsVisible); }
533 bool isViewFocused() const { return m_activityState.contains(WebCore::ActivityState::IsFocused); }
534 bool isViewWindowActive() const { return m_activityState.contains(WebCore::ActivityState::WindowIsActive); }
536 void addMIMETypeWithCustomContentProvider(const String& mimeType);
538 void executeEditCommand(const String& commandName, const String& argument = String());
539 void validateCommand(const String& commandName, WTF::Function<void (const String&, bool, int32_t, CallbackBase::Error)>&&);
541 const EditorState& editorState() const { return m_editorState; }
542 bool canDelete() const { return hasSelectedRange() && isContentEditable(); }
543 bool hasSelectedRange() const { return m_editorState.selectionIsRange; }
544 bool isContentEditable() const { return m_editorState.isContentEditable; }
546 std::optional<WebCore::FontAttributes> cachedFontAttributesAtSelectionStart() const { return m_cachedFontAttributesAtSelectionStart; }
549 const TouchBarMenuData& touchBarMenuData() const { return m_touchBarMenuData; }
552 bool maintainsInactiveSelection() const;
553 void setMaintainsInactiveSelection(bool);
554 void setEditable(bool);
555 bool isEditable() const { return m_isEditable; }
557 void activateMediaStreamCaptureInPage();
558 bool isMediaStreamCaptureMuted() const { return m_mutedState & WebCore::MediaProducer::CaptureDevicesAreMuted; }
559 void setMediaStreamCaptureMuted(bool);
560 void executeEditCommand(const String& commandName, const String& argument, WTF::Function<void(CallbackBase::Error)>&&);
562 void requestFontAttributesAtSelectionStart(Function<void(const WebCore::FontAttributes&, CallbackBase::Error)>&&);
563 void fontAttributesCallback(const WebCore::FontAttributes&, CallbackID);
565 #if PLATFORM(IOS_FAMILY)
566 double displayedContentScale() const { return m_lastVisibleContentRectUpdate.scale(); }
567 const WebCore::FloatRect& exposedContentRect() const { return m_lastVisibleContentRectUpdate.exposedContentRect(); }
568 const WebCore::FloatRect& unobscuredContentRect() const { return m_lastVisibleContentRectUpdate.unobscuredContentRect(); }
569 bool inStableState() const { return m_lastVisibleContentRectUpdate.inStableState(); }
570 const WebCore::FloatRect& unobscuredContentRectRespectingInputViewBounds() const { return m_lastVisibleContentRectUpdate.unobscuredContentRectRespectingInputViewBounds(); }
571 // When visual viewports are enabled, this is the layout viewport rect.
572 const WebCore::FloatRect& customFixedPositionRect() const { return m_lastVisibleContentRectUpdate.customFixedPositionRect(); }
574 void updateVisibleContentRects(const VisibleContentRectUpdateInfo&);
575 void resendLastVisibleContentRects();
577 WebCore::FloatRect computeCustomFixedPositionRect(const WebCore::FloatRect& unobscuredContentRect, const WebCore::FloatRect& unobscuredContentRectRespectingInputViewBounds, const WebCore::FloatRect& currentCustomFixedPositionRect, double displayedContentScale, WebCore::FrameView::LayoutViewportConstraint = WebCore::FrameView::LayoutViewportConstraint::Unconstrained, bool visualViewportEnabled = false) const;
579 void scrollingNodeScrollViewWillStartPanGesture();
580 void scrollingNodeScrollViewDidScroll();
581 void scrollingNodeScrollWillStartScroll();
582 void scrollingNodeScrollDidEndScroll();
584 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& unobscuredSafeAreaInsets, double targetScale, int32_t deviceOrientation, DynamicViewportSizeUpdateID);
586 void setViewportConfigurationViewLayoutSize(const WebCore::FloatSize&, double scaleFactor);
587 void setMaximumUnobscuredSize(const WebCore::FloatSize&);
588 void setDeviceOrientation(int32_t);
589 int32_t deviceOrientation() const { return m_deviceOrientation; }
590 void setOverrideViewportArguments(const std::optional<WebCore::ViewportArguments>&);
591 void willCommitLayerTree(uint64_t transactionID);
593 void selectWithGesture(const WebCore::IntPoint, WebCore::TextGranularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithAssistedNode, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>&&);
594 void updateSelectionWithTouches(const WebCore::IntPoint, uint32_t touches, bool baseIsStart, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, CallbackBase::Error)>&&);
595 void selectWithTwoTouches(const WebCore::IntPoint from, const WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>&&);
596 void extendSelection(WebCore::TextGranularity);
597 void selectWordBackward();
598 void moveSelectionByOffset(int32_t offset, WTF::Function<void (CallbackBase::Error)>&&);
599 void selectTextWithGranularityAtPoint(const WebCore::IntPoint, WebCore::TextGranularity, bool isInteractingWithAssistedNode, WTF::Function<void (CallbackBase::Error)>&&);
600 void selectPositionAtPoint(const WebCore::IntPoint, bool isInteractingWithAssistedNode, WTF::Function<void (CallbackBase::Error)>&&);
601 void selectPositionAtBoundaryWithDirection(const WebCore::IntPoint, WebCore::TextGranularity, WebCore::SelectionDirection, bool isInteractingWithAssistedNode, WTF::Function<void (CallbackBase::Error)>&&);
602 void moveSelectionAtBoundaryWithDirection(WebCore::TextGranularity, WebCore::SelectionDirection, WTF::Function<void(CallbackBase::Error)>&&);
603 void beginSelectionInDirection(WebCore::SelectionDirection, WTF::Function<void (uint64_t, CallbackBase::Error)>&&);
604 void updateSelectionWithExtentPoint(const WebCore::IntPoint, bool isInteractingWithAssistedNode, WTF::Function<void (uint64_t, CallbackBase::Error)>&&);
605 void updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint, WebCore::TextGranularity, bool isInteractingWithAssistedNode, WTF::Function<void(uint64_t, CallbackBase::Error)>&&);
606 void requestAutocorrectionData(const String& textForAutocorrection, WTF::Function<void (const Vector<WebCore::FloatRect>&, const String&, double, uint64_t, CallbackBase::Error)>&&);
607 void applyAutocorrection(const String& correction, const String& originalText, WTF::Function<void (const String&, CallbackBase::Error)>&&);
608 bool applyAutocorrection(const String& correction, const String& originalText);
609 void requestAutocorrectionContext(WTF::Function<void (const String&, const String&, const String&, const String&, uint64_t, uint64_t, CallbackBase::Error)>&&);
610 void getAutocorrectionContext(String& contextBefore, String& markedText, String& selectedText, String& contextAfter, uint64_t& location, uint64_t& length);
611 void requestDictationContext(WTF::Function<void (const String&, const String&, const String&, CallbackBase::Error)>&&);
612 void replaceDictatedText(const String& oldText, const String& newText);
613 void replaceSelectedText(const String& oldText, const String& newText);
614 void didReceivePositionInformation(const InteractionInformationAtPosition&);
615 void requestPositionInformation(const InteractionInformationRequest&);
616 void startInteractionWithElementAtPosition(const WebCore::IntPoint&);
617 void stopInteraction();
618 void performActionOnElement(uint32_t action);
619 void saveImageToLibrary(const SharedMemory::Handle& imageHandle, uint64_t imageSize);
620 void focusNextAssistedNode(bool isForward, WTF::Function<void (CallbackBase::Error)>&& = [] (auto) { });
621 void setAssistedNodeValue(const String&);
622 void setAssistedNodeValueAsNumber(double);
623 void setAssistedNodeSelectedIndex(uint32_t index, bool allowMultipleSelection = false);
624 void applicationDidEnterBackground();
625 void applicationDidFinishSnapshottingAfterEnteringBackground();
626 void applicationWillEnterForeground();
627 void applicationWillResignActive();
628 void applicationDidBecomeActive();
629 void commitPotentialTapFailed();
630 void didNotHandleTapAsClick(const WebCore::IntPoint&);
631 void didCompleteSyntheticClick();
632 void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID);
633 void contentSizeCategoryDidChange(const String& contentSizeCategory);
634 void getSelectionContext(WTF::Function<void(const String&, const String&, const String&, CallbackBase::Error)>&&);
635 void handleTwoFingerTapAtPoint(const WebCore::IntPoint&, uint64_t requestID);
636 void setForceAlwaysUserScalable(bool);
637 bool forceAlwaysUserScalable() const { return m_forceAlwaysUserScalable; }
638 double layoutSizeScaleFactor() const { return m_viewportConfigurationLayoutSizeScaleFactor; }
639 void setIsScrollingOrZooming(bool);
640 void requestRectsForGranularityWithSelectionOffset(WebCore::TextGranularity, uint32_t offset, WTF::Function<void(const Vector<WebCore::SelectionRect>&, CallbackBase::Error)>&&);
641 void requestRectsAtSelectionOffsetWithText(int32_t offset, const String&, WTF::Function<void(const Vector<WebCore::SelectionRect>&, CallbackBase::Error)>&&);
642 void autofillLoginCredentials(const String& username, const String& password);
643 void storeSelectionForAccessibility(bool);
644 void startAutoscrollAtPosition(const WebCore::FloatPoint& positionInWindow);
645 void cancelAutoscroll();
646 #if ENABLE(DATA_INTERACTION)
647 void didHandleStartDataInteractionRequest(bool started);
648 void didHandleAdditionalDragItemsRequest(bool added);
649 void requestStartDataInteraction(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition);
650 void requestAdditionalItemsForDragSession(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition);
651 void didConcludeEditDataInteraction(std::optional<WebCore::TextIndicatorData>);
654 #if ENABLE(DATA_DETECTION)
655 void setDataDetectionResult(const DataDetectionResult&);
657 void didCommitLayerTree(const WebKit::RemoteLayerTreeTransaction&);
658 void layerTreeCommitComplete();
660 bool updateLayoutViewportParameters(const WebKit::RemoteLayerTreeTransaction&);
663 void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd);
664 void confirmComposition(const String& compositionString, int64_t selectionStart, int64_t selectionLength);
665 void cancelComposition();
669 void setInputMethodState(bool enabled);
672 #if PLATFORM (GTK) && HAVE(GTK_GESTURES)
673 void getCenterForZoomGesture(const WebCore::IntPoint& centerInViewCoordinates, WebCore::IntPoint& center);
677 void windowAndViewFramesChanged(const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
678 void setMainFrameIsScrollable(bool);
680 void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
681 bool shouldDelayWindowOrderingForEvent(const WebMouseEvent&);
682 bool acceptsFirstMouse(int eventNumber, const WebMouseEvent&);
684 void setAcceleratedCompositingRootLayer(LayerOrView*);
685 LayerOrView* acceleratedCompositingRootLayer() const;
687 void setTextAsync(const String&);
688 void insertTextAsync(const String& text, const EditingRange& replacementRange, bool registerUndoGroup = false, EditingRangeIsRelativeTo = EditingRangeIsRelativeTo::EditableRoot, bool suppressSelectionUpdate = false);
689 void getMarkedRangeAsync(WTF::Function<void (EditingRange, CallbackBase::Error)>&&);
690 void getSelectedRangeAsync(WTF::Function<void (EditingRange, CallbackBase::Error)>&&);
691 void characterIndexForPointAsync(const WebCore::IntPoint&, WTF::Function<void (uint64_t, CallbackBase::Error)>&&);
692 void firstRectForCharacterRangeAsync(const EditingRange&, WTF::Function<void (const WebCore::IntRect&, const EditingRange&, CallbackBase::Error)>&&);
693 void setCompositionAsync(const String& text, const Vector<WebCore::CompositionUnderline>& underlines, const EditingRange& selectionRange, const EditingRange& replacementRange);
694 void confirmCompositionAsync();
696 void setScrollPerformanceDataCollectionEnabled(bool);
697 bool scrollPerformanceDataCollectionEnabled() const { return m_scrollPerformanceDataCollectionEnabled; }
698 RemoteLayerTreeScrollingPerformanceData* scrollingPerformanceData() { return m_scrollingPerformanceData.get(); }
699 #endif // PLATFORM(COCOA)
701 void changeFontAttributes(WebCore::FontAttributeChanges&&);
702 void changeFont(WebCore::FontChanges&&);
705 void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::TextAlternativeWithRange>& dictationAlternatives, bool registerUndoGroup);
706 void attributedSubstringForCharacterRangeAsync(const EditingRange&, WTF::Function<void (const AttributedString&, const EditingRange&, CallbackBase::Error)>&&);
707 void fontAtSelection(WTF::Function<void (const String&, double, bool, CallbackBase::Error)>&&);
709 void startWindowDrag();
710 NSWindow *platformWindow();
711 void rootViewToWindow(const WebCore::IntRect& viewRect, WebCore::IntRect& windowRect);
714 NSView *inspectorAttachmentView();
715 _WKRemoteObjectRegistry *remoteObjectRegistry();
718 void intrinsicContentSizeDidChange(const WebCore::IntSize& intrinsicContentSize);
719 CGRect boundsOfLayerInLayerBackedWindowCoordinates(CALayer *) const;
720 #endif // PLATFORM(MAC)
723 PlatformWidget viewWidget();
724 const WebCore::Color& backgroundColor() const { return m_backgroundColor; }
725 void setBackgroundColor(const WebCore::Color& color) { m_backgroundColor = color; }
729 PlatformWidget viewWidget();
732 struct wpe_view_backend* viewBackend();
735 bool isProcessingMouseEvents() const;
736 void processNextQueuedMouseEvent();
737 void handleMouseEvent(const NativeWebMouseEvent&);
739 void handleWheelEvent(const NativeWebWheelEvent&);
741 bool isProcessingKeyboardEvents() const;
742 void handleKeyboardEvent(const NativeWebKeyboardEvent&);
744 #if ENABLE(MAC_GESTURE_EVENTS)
745 void handleGestureEvent(const NativeWebGestureEvent&);
748 #if ENABLE(IOS_TOUCH_EVENTS)
749 void handleTouchEventSynchronously(NativeWebTouchEvent&);
750 void handleTouchEventAsynchronously(const NativeWebTouchEvent&);
752 #elif ENABLE(TOUCH_EVENTS)
753 void handleTouchEvent(const NativeWebTouchEvent&);
756 void scrollBy(WebCore::ScrollDirection, WebCore::ScrollGranularity);
757 void centerSelectionInVisibleArea();
759 const String& toolTip() const { return m_toolTip; }
761 const String& userAgent() const { return m_userAgent; }
762 void setApplicationNameForUserAgent(const String&);
763 const String& applicationNameForUserAgent() const { return m_applicationNameForUserAgent; }
764 void setCustomUserAgent(const String&);
765 const String& customUserAgent() const { return m_customUserAgent; }
766 static String standardUserAgent(const String& applicationName = String());
768 bool supportsTextEncoding() const;
769 void setCustomTextEncodingName(const String&);
770 String customTextEncodingName() const { return m_customTextEncodingName; }
772 bool areActiveDOMObjectsAndAnimationsSuspended() const { return m_isPageSuspended; }
773 void resumeActiveDOMObjectsAndAnimations();
774 void suspendActiveDOMObjectsAndAnimations();
776 double estimatedProgress() const;
778 SessionState sessionState(WTF::Function<bool (WebBackForwardListItem&)>&& = nullptr) const;
779 RefPtr<API::Navigation> restoreFromSessionState(SessionState, bool navigate);
781 bool supportsTextZoom() const;
782 double textZoomFactor() const { return m_textZoomFactor; }
783 void setTextZoomFactor(double);
784 double pageZoomFactor() const;
785 void setPageZoomFactor(double);
786 void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
788 void scalePage(double scale, const WebCore::IntPoint& origin);
789 void scalePageInViewCoordinates(double scale, const WebCore::IntPoint& centerInViewCoordinates);
790 double pageScaleFactor() const;
791 double viewScaleFactor() const { return m_viewScaleFactor; }
792 void scaleView(double scale);
793 void setShouldScaleViewToFitDocument(bool);
795 float deviceScaleFactor() const;
796 void setIntrinsicDeviceScaleFactor(float);
797 void setCustomDeviceScaleFactor(float);
798 void windowScreenDidChange(WebCore::PlatformDisplayID);
799 void accessibilitySettingsDidChange();
800 #if ENABLE(ACCESSIBILITY_EVENTS)
801 void updateAccessibilityEventsEnabled(bool);
804 void setUseFixedLayout(bool);
805 void setFixedLayoutSize(const WebCore::IntSize&);
806 bool useFixedLayout() const { return m_useFixedLayout; };
807 const WebCore::IntSize& fixedLayoutSize() const { return m_fixedLayoutSize; };
809 void setAlwaysShowsHorizontalScroller(bool);
810 void setAlwaysShowsVerticalScroller(bool);
811 bool alwaysShowsHorizontalScroller() const { return m_alwaysShowsHorizontalScroller; }
812 bool alwaysShowsVerticalScroller() const { return m_alwaysShowsVerticalScroller; }
814 void listenForLayoutMilestones(WebCore::LayoutMilestones);
816 bool hasHorizontalScrollbar() const { return m_mainFrameHasHorizontalScrollbar; }
817 bool hasVerticalScrollbar() const { return m_mainFrameHasVerticalScrollbar; }
819 void setSuppressScrollbarAnimations(bool);
820 bool areScrollbarAnimationsSuppressed() const { return m_suppressScrollbarAnimations; }
822 bool isPinnedToLeftSide() const { return m_mainFrameIsPinnedToLeftSide; }
823 bool isPinnedToRightSide() const { return m_mainFrameIsPinnedToRightSide; }
824 bool isPinnedToTopSide() const { return m_mainFrameIsPinnedToTopSide; }
825 bool isPinnedToBottomSide() const { return m_mainFrameIsPinnedToBottomSide; }
827 bool rubberBandsAtLeft() const;
828 void setRubberBandsAtLeft(bool);
829 bool rubberBandsAtRight() const;
830 void setRubberBandsAtRight(bool);
831 bool rubberBandsAtTop() const;
832 void setRubberBandsAtTop(bool);
833 bool rubberBandsAtBottom() const;
834 void setRubberBandsAtBottom(bool);
836 void setShouldUseImplicitRubberBandControl(bool shouldUseImplicitRubberBandControl) { m_shouldUseImplicitRubberBandControl = shouldUseImplicitRubberBandControl; }
837 bool shouldUseImplicitRubberBandControl() const { return m_shouldUseImplicitRubberBandControl; }
839 void setEnableVerticalRubberBanding(bool);
840 bool verticalRubberBandingIsEnabled() const;
841 void setEnableHorizontalRubberBanding(bool);
842 bool horizontalRubberBandingIsEnabled() const;
844 void setBackgroundExtendsBeyondPage(bool);
845 bool backgroundExtendsBeyondPage() const;
847 void setPaginationMode(WebCore::Pagination::Mode);
848 WebCore::Pagination::Mode paginationMode() const { return m_paginationMode; }
849 void setPaginationBehavesLikeColumns(bool);
850 bool paginationBehavesLikeColumns() const { return m_paginationBehavesLikeColumns; }
851 void setPageLength(double);
852 double pageLength() const { return m_pageLength; }
853 void setGapBetweenPages(double);
854 double gapBetweenPages() const { return m_gapBetweenPages; }
855 void setPaginationLineGridEnabled(bool);
856 bool paginationLineGridEnabled() const { return m_paginationLineGridEnabled; }
857 unsigned pageCount() const { return m_pageCount; }
860 void setUseSystemAppearance(bool);
861 bool useSystemAppearance() const { return m_useSystemAppearance; }
862 void effectiveAppearanceDidChange();
863 bool useDarkAppearance() const;
867 // Called by the web process through a message.
868 void registerWebProcessAccessibilityToken(const IPC::DataReference&);
869 // Called by the UI process when it is ready to send its tokens to the web process.
870 void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
871 bool readSelectionFromPasteboard(const String& pasteboardName);
872 String stringSelectionForPasteboard();
873 RefPtr<WebCore::SharedBuffer> dataSelectionForPasteboard(const String& pasteboardType);
874 void makeFirstResponder();
875 void assistiveTechnologyMakeFirstResponder();
877 ColorSpaceData colorSpace();
880 #if ENABLE(SERVICE_CONTROLS)
881 void replaceSelectionWithPasteboardData(const Vector<String>& types, const IPC::DataReference&);
884 void pageScaleFactorDidChange(double);
885 void pluginScaleFactorDidChange(double);
886 void pluginZoomFactorDidChange(double);
889 void findString(const String&, FindOptions, unsigned maxMatchCount);
890 void findStringMatches(const String&, FindOptions, unsigned maxMatchCount);
891 void getImageForFindMatch(int32_t matchIndex);
892 void selectFindMatch(int32_t matchIndex);
893 void didGetImageForFindMatch(const ShareableBitmap::Handle& contentImageHandle, uint32_t matchIndex);
895 void countStringMatches(const String&, FindOptions, unsigned maxMatchCount);
896 void didCountStringMatches(const String&, uint32_t matchCount);
897 void setTextIndicator(const WebCore::TextIndicatorData&, uint64_t /* WebCore::TextIndicatorWindowLifetime */ lifetime = 0 /* Permanent */);
898 void setTextIndicatorAnimationProgress(float);
899 void clearTextIndicator();
900 void didFindString(const String&, const Vector<WebCore::IntRect>&, uint32_t matchCount, int32_t matchIndex, bool didWrapAround);
901 void didFailToFindString(const String&);
902 void didFindStringMatches(const String&, const Vector<Vector<WebCore::IntRect>>& matchRects, int32_t firstIndexAfterSelection);
904 void getContentsAsString(WTF::Function<void (const String&, CallbackBase::Error)>&&);
905 void getBytecodeProfile(WTF::Function<void (const String&, CallbackBase::Error)>&&);
906 void getSamplingProfilerOutput(WTF::Function<void (const String&, CallbackBase::Error)>&&);
907 void isWebProcessResponsive(WTF::Function<void (bool isWebProcessResponsive)>&&);
910 void getContentsAsMHTMLData(Function<void (API::Data*, CallbackBase::Error)>&&);
912 void getMainResourceDataOfFrame(WebFrameProxy*, Function<void (API::Data*, CallbackBase::Error)>&&);
913 void getResourceDataFromFrame(WebFrameProxy*, API::URL*, Function<void (API::Data*, CallbackBase::Error)>&&);
914 void getRenderTreeExternalRepresentation(WTF::Function<void (const String&, CallbackBase::Error)>&&);
915 void getSelectionOrContentsAsString(WTF::Function<void (const String&, CallbackBase::Error)>&&);
916 void getSelectionAsWebArchiveData(Function<void (API::Data*, CallbackBase::Error)>&&);
917 void getSourceForFrame(WebFrameProxy*, WTF::Function<void (const String&, CallbackBase::Error)>&&);
918 void getWebArchiveOfFrame(WebFrameProxy*, Function<void (API::Data*, CallbackBase::Error)>&&);
919 void runJavaScriptInMainFrame(const String&, bool, WTF::Function<void (API::SerializedScriptValue*, bool hadException, const WebCore::ExceptionDetails&, CallbackBase::Error)>&& callbackFunction);
920 void runJavaScriptInMainFrameScriptWorld(const String&, bool, const String& worldName, WTF::Function<void(API::SerializedScriptValue*, bool hadException, const WebCore::ExceptionDetails&, CallbackBase::Error)>&& callbackFunction);
921 void forceRepaint(RefPtr<VoidCallback>&&);
923 float headerHeight(WebFrameProxy&);
924 float footerHeight(WebFrameProxy&);
925 void drawHeader(WebFrameProxy&, WebCore::FloatRect&&);
926 void drawFooter(WebFrameProxy&, WebCore::FloatRect&&);
930 void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
931 void performDictionaryLookupOfCurrentSelection();
934 class PolicyDecisionSender;
935 void receivedPolicyDecision(WebCore::PolicyAction, API::Navigation*, std::optional<WebsitePoliciesData>&&, Ref<PolicyDecisionSender>&&);
936 void receivedNavigationPolicyDecision(WebCore::PolicyAction, API::Navigation*, ProcessSwapRequestedByClient, WebFrameProxy&, API::WebsitePolicies*, Ref<PolicyDecisionSender>&&);
938 void backForwardRemovedItem(const WebCore::BackForwardItemIdentifier&);
940 #if ENABLE(DRAG_SUPPORT)
941 // Drag and drop support.
942 void dragEntered(WebCore::DragData&, const String& dragStorageName = String());
943 void dragUpdated(WebCore::DragData&, const String& dragStorageName = String());
944 void dragExited(WebCore::DragData&, const String& dragStorageName = String());
945 void performDragOperation(WebCore::DragData&, const String& dragStorageName, SandboxExtension::Handle&&, SandboxExtension::HandleArray&&);
946 void didPerformDragOperation(bool handled);
948 void didPerformDragControllerAction(uint64_t dragOperation, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, const WebCore::IntRect& insertionRect);
949 void dragEnded(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t operation);
951 void dragCancelled();
952 void setDragCaretRect(const WebCore::IntRect&);
954 void startDrag(const WebCore::DragItem&, const ShareableBitmap::Handle& dragImageHandle);
955 void setPromisedDataForImage(const String& pasteboardName, const SharedMemory::Handle& imageHandle, uint64_t imageSize, const String& filename, const String& extension,
956 const String& title, const String& url, const String& visibleURL, const SharedMemory::Handle& archiveHandle, uint64_t archiveSize);
959 void startDrag(WebSelectionData&&, uint64_t dragOperation, const ShareableBitmap::Handle& dragImage);
963 void processDidBecomeUnresponsive();
964 void processDidBecomeResponsive();
965 void processDidTerminate(ProcessTerminationReason);
966 void dispatchProcessDidTerminate(ProcessTerminationReason);
967 void willChangeProcessIsResponsive();
968 void didChangeProcessIsResponsive();
970 #if PLATFORM(IOS_FAMILY)
971 void processWillBecomeSuspended();
972 void processWillBecomeForeground();
975 virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
976 virtual void exitAcceleratedCompositingMode();
977 virtual void updateAcceleratedCompositingMode(const LayerTreeContext&);
979 void addEditCommand(WebEditCommandProxy*);
980 void removeEditCommand(WebEditCommandProxy*);
981 bool isValidEditCommand(WebEditCommandProxy*);
982 void registerEditCommand(Ref<WebEditCommandProxy>&&, UndoOrRedo);
988 void registerKeypressCommandName(const String& name) { m_knownKeypressCommandNames.add(name); }
989 bool isValidKeypressCommandName(const String& name) const { return m_knownKeypressCommandNames.contains(name); }
992 WebProcessProxy& process() { return m_process; }
993 ProcessID processIdentifier() const;
995 WebPreferences& preferences() { return m_preferences; }
996 void setPreferences(WebPreferences&);
998 WebPageGroup& pageGroup() { return m_pageGroup; }
1000 bool isValid() const;
1002 #if ENABLE(DRAG_SUPPORT)
1003 WebCore::DragOperation currentDragOperation() const { return m_currentDragOperation; }
1004 bool currentDragIsOverFileInput() const { return m_currentDragIsOverFileInput; }
1005 unsigned currentDragNumberOfFilesToBeAccepted() const { return m_currentDragNumberOfFilesToBeAccepted; }
1006 WebCore::IntRect currentDragCaretRect() const { return m_currentDragCaretRect; }
1007 void resetCurrentDragInformation();
1008 void didEndDragging();
1011 void preferencesDidChange();
1013 #if ENABLE(CONTEXT_MENUS)
1014 // Called by the WebContextMenuProxy.
1015 void contextMenuItemSelected(const WebContextMenuItemData&);
1016 void handleContextMenuKeyEvent();
1019 // Called by the WebOpenPanelResultListenerProxy.
1020 #if PLATFORM(IOS_FAMILY)
1021 void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const API::Data* iconData);
1023 void didChooseFilesForOpenPanel(const Vector<String>&);
1024 void didCancelForOpenPanel();
1026 WebPageCreationParameters creationParameters();
1028 void handleDownloadRequest(DownloadProxy*);
1030 void advanceToNextMisspelling(bool startBeforeSelection);
1031 void changeSpellingToWord(const String& word);
1033 void uppercaseWord();
1034 void lowercaseWord();
1035 void capitalizeWord();
1039 bool isSmartInsertDeleteEnabled() const { return m_isSmartInsertDeleteEnabled; }
1040 void setSmartInsertDeleteEnabled(bool);
1044 String accessibilityPlugID() const { return m_accessibilityPlugID; }
1047 void setCanRunModal(bool);
1050 void beginPrinting(WebFrameProxy*, const PrintInfo&);
1052 void computePagesForPrinting(WebFrameProxy*, const PrintInfo&, Ref<ComputedPagesCallback>&&);
1054 void drawRectToImage(WebFrameProxy*, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, Ref<ImageCallback>&&);
1055 void drawPagesToPDF(WebFrameProxy*, const PrintInfo&, uint32_t first, uint32_t count, Ref<DataCallback>&&);
1056 #if PLATFORM(IOS_FAMILY)
1057 uint32_t computePagesForPrintingAndDrawToPDF(uint64_t frameID, const PrintInfo&, DrawToPDFCallback::CallbackFunction&&);
1058 void drawToPDFCallback(const IPC::DataReference& pdfData, WebKit::CallbackID);
1061 void drawPagesForPrinting(WebFrameProxy*, const PrintInfo&, Ref<PrintFinishedCallback>&&);
1064 PageLoadState& pageLoadState() { return m_pageLoadState; }
1067 void handleAlternativeTextUIResult(const String& result);
1070 void saveDataToFileInDownloadsFolder(String&& suggestedFilename, String&& mimeType, WebCore::URL&& originatingURL, API::Data&);
1071 void savePDFToFileInDownloadsFolder(String&& suggestedFilename, WebCore::URL&& originatingURL, const IPC::DataReference&);
1073 void savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
1074 void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const IPC::DataReference&, const String& pdfUUID);
1075 void openPDFFromTemporaryFolderWithNativeApplication(const String& pdfUUID);
1078 #if ENABLE(PDFKIT_PLUGIN)
1079 void showPDFContextMenu(const WebKit::PDFContextMenu&, std::optional<int32_t>& selectedIndex);
1081 WebCore::IntRect visibleScrollerThumbRect() const { return m_visibleScrollerThumbRect; }
1083 uint64_t renderTreeSize() const { return m_renderTreeSize; }
1085 void printMainFrame();
1087 void setMediaVolume(float);
1088 void setMuted(WebCore::MediaProducer::MutedStateFlags);
1089 void setMayStartMediaWhenInWindow(bool);
1090 bool mayStartMediaWhenInWindow() const { return m_mayStartMediaWhenInWindow; }
1091 void setMediaCaptureEnabled(bool);
1092 bool mediaCaptureEnabled() const { return m_mediaCaptureEnabled; }
1093 void stopMediaCapture();
1095 #if ENABLE(MEDIA_SESSION)
1096 bool hasMediaSessionWithActiveMediaElements() const { return m_hasMediaSessionWithActiveMediaElements; }
1097 void handleMediaEvent(WebCore::MediaEventType);
1098 void setVolumeOfMediaElement(double, uint64_t);
1101 #if ENABLE(POINTER_LOCK)
1102 void didAllowPointerLock();
1103 void didDenyPointerLock();
1106 // WebPopupMenuProxy::Client
1107 NativeWebMouseEvent* currentlyProcessedMouseDownEvent() override;
1109 void setSuppressVisibilityUpdates(bool flag);
1110 bool suppressVisibilityUpdates() { return m_suppressVisibilityUpdates; }
1112 #if PLATFORM(IOS_FAMILY)
1113 void willStartUserTriggeredZooming();
1115 void potentialTapAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
1116 void commitPotentialTap(uint64_t layerTreeTransactionIdAtLastTouchStart);
1117 void cancelPotentialTap();
1118 void tapHighlightAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
1119 void handleTap(const WebCore::FloatPoint&, uint64_t layerTreeTransactionIdAtLastTouchStart);
1121 void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&);
1122 void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&);
1124 void blurAssistedNode();
1127 void postMessageToInjectedBundle(const String& messageName, API::Object* messageBody);
1129 #if ENABLE(INPUT_TYPE_COLOR)
1130 void setColorPickerColor(const WebCore::Color&);
1131 void endColorPicker();
1134 WebCore::IntSize viewLayoutSize() const { return m_viewLayoutSize; }
1135 void setViewLayoutSize(const WebCore::IntSize&);
1137 bool autoSizingShouldExpandToViewHeight() const { return m_autoSizingShouldExpandToViewHeight; }
1138 void setAutoSizingShouldExpandToViewHeight(bool);
1140 void setViewportSizeForCSSViewportUnits(const WebCore::IntSize&);
1141 WebCore::IntSize viewportSizeForCSSViewportUnits() const { return m_viewportSizeForCSSViewportUnits.value_or(WebCore::IntSize()); }
1143 void didReceiveAuthenticationChallengeProxy(uint64_t frameID, Ref<AuthenticationChallengeProxy>&&);
1145 SpellDocumentTag spellDocumentTag();
1147 void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
1148 void didCancelCheckingText(uint64_t requestID);
1150 void connectionWillOpen(IPC::Connection&);
1151 void webProcessWillShutDown();
1153 void processDidFinishLaunching();
1155 void didSaveToPageCache();
1157 void setScrollPinningBehavior(WebCore::ScrollPinningBehavior);
1158 WebCore::ScrollPinningBehavior scrollPinningBehavior() const { return m_scrollPinningBehavior; }
1160 void setOverlayScrollbarStyle(std::optional<WebCore::ScrollbarOverlayStyle>);
1161 std::optional<WebCore::ScrollbarOverlayStyle> overlayScrollbarStyle() const { return m_scrollbarOverlayStyle; }
1163 // When the state of the window changes such that the WebPage needs immediate update, the UIProcess sends a new
1164 // ActivityStateChangeID to the WebProcess through the SetActivityState message. The UIProcess will wait till it
1165 // receives a CommitLayerTree which has an ActivityStateChangeID equal to or greater than the one it sent.
1166 ActivityStateChangeID takeNextActivityStateChangeID() { return ++m_currentActivityStateChangeID; }
1168 bool shouldRecordNavigationSnapshots() const { return m_shouldRecordNavigationSnapshots; }
1169 void setShouldRecordNavigationSnapshots(bool shouldRecordSnapshots) { m_shouldRecordNavigationSnapshots = shouldRecordSnapshots; }
1170 void recordAutomaticNavigationSnapshot();
1171 void suppressNextAutomaticNavigationSnapshot() { m_shouldSuppressNextAutomaticNavigationSnapshot = true; }
1172 void recordNavigationSnapshot(WebBackForwardListItem&);
1173 void requestAssistedNodeInformation(Function<void(const AssistedNodeInformation&, CallbackBase::Error)>&&);
1176 RefPtr<ViewSnapshot> takeViewSnapshot();
1179 #if ENABLE(SUBTLE_CRYPTO)
1180 void wrapCryptoKey(const Vector<uint8_t>&, bool& succeeded, Vector<uint8_t>&);
1181 void unwrapCryptoKey(const Vector<uint8_t>&, bool& succeeded, Vector<uint8_t>&);
1184 void signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const WebCore::URL&, String& result);
1186 void takeSnapshot(WebCore::IntRect, WebCore::IntSize bitmapSize, SnapshotOptions, WTF::Function<void (const ShareableBitmap::Handle&, CallbackBase::Error)>&&);
1188 void navigationGestureDidBegin();
1189 void navigationGestureWillEnd(bool willNavigate, WebBackForwardListItem&);
1190 void navigationGestureDidEnd(bool willNavigate, WebBackForwardListItem&);
1191 void navigationGestureDidEnd();
1192 void navigationGestureSnapshotWasRemoved();
1193 void willRecordNavigationSnapshot(WebBackForwardListItem&);
1195 bool isShowingNavigationGestureSnapshot() const { return m_isShowingNavigationGestureSnapshot; }
1197 bool isPlayingAudio() const { return !!(m_mediaState & WebCore::MediaProducer::IsPlayingAudio); }
1198 void isPlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags, uint64_t);
1199 bool hasActiveAudioStream() const { return m_mediaState & WebCore::MediaProducer::HasActiveAudioCaptureDevice; }
1200 bool hasActiveVideoStream() const { return m_mediaState & WebCore::MediaProducer::HasActiveVideoCaptureDevice; }
1201 WebCore::MediaProducer::MediaStateFlags mediaStateFlags() const { return m_mediaState; }
1202 void handleAutoplayEvent(WebCore::AutoplayEvent, OptionSet<WebCore::AutoplayEventFlags>);
1204 void videoControlsManagerDidChange();
1205 bool hasActiveVideoForControlsManager() const;
1206 void requestControlledElementID() const;
1207 void handleControlledElementIDResponse(const String&) const;
1208 bool isPlayingVideoInEnhancedFullscreen() const;
1211 void requestActiveNowPlayingSessionInfo(Ref<NowPlayingInfoCallback>&&);
1212 void nowPlayingInfoCallback(bool, bool, const String&, double, double, uint64_t, CallbackID);
1215 #if ENABLE(MEDIA_SESSION)
1216 void hasMediaSessionWithActiveMediaElementsDidChange(bool);
1217 void mediaSessionMetadataDidChange(const WebCore::MediaSessionMetadata&);
1218 void focusedContentMediaElementDidChange(uint64_t);
1222 API::HitTestResult* lastMouseMoveHitTestResult() const { return m_lastMouseMoveHitTestResult.get(); }
1223 void performImmediateActionHitTestAtLocation(WebCore::FloatPoint);
1225 void immediateActionDidUpdate();
1226 void immediateActionDidCancel();
1227 void immediateActionDidComplete();
1229 NSObject *immediateActionAnimationControllerForHitTestResult(RefPtr<API::HitTestResult>, uint64_t, RefPtr<API::Object>);
1231 void installActivityStateChangeCompletionHandler(WTF::Function<void ()>&&);
1233 void handleAcceptedCandidate(WebCore::TextCheckingResult);
1234 void didHandleAcceptedCandidate();
1236 void setHeaderBannerHeightForTesting(int);
1237 void setFooterBannerHeightForTesting(int);
1240 #if USE(UNIFIED_TEXT_CHECKING)
1241 void checkTextOfParagraph(const String& text, OptionSet<WebCore::TextCheckingType> checkingTypes, int32_t insertionPoint, Vector<WebCore::TextCheckingResult>& results);
1243 void getGuessesForWord(const String& word, const String& context, int32_t insertionPoint, Vector<String>& guesses);
1245 void setShouldDispatchFakeMouseMoveEvents(bool);
1247 // Diagnostic messages logging.
1248 void logDiagnosticMessage(const String& message, const String& description, WebCore::ShouldSample);
1249 void logDiagnosticMessageWithResult(const String& message, const String& description, uint32_t result, WebCore::ShouldSample);
1250 void logDiagnosticMessageWithValue(const String& message, const String& description, double value, unsigned significantFigures, WebCore::ShouldSample);
1251 void logDiagnosticMessageWithEnhancedPrivacy(const String& message, const String& description, WebCore::ShouldSample);
1253 // Performance logging.
1254 void logScrollingEvent(uint32_t eventType, MonotonicTime, uint64_t);
1256 // Form validation messages.
1257 void showValidationMessage(const WebCore::IntRect& anchorClientRect, const String& message);
1258 void hideValidationMessage();
1260 WebCore::ValidationBubble* validationBubble() const { return m_validationBubble.get(); } // For testing.
1263 #if PLATFORM(IOS_FAMILY)
1264 void setIsKeyboardAnimatingIn(bool isKeyboardAnimatingIn) { m_isKeyboardAnimatingIn = isKeyboardAnimatingIn; }
1267 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
1268 void addPlaybackTargetPickerClient(uint64_t);
1269 void removePlaybackTargetPickerClient(uint64_t);
1270 void showPlaybackTargetPicker(uint64_t, const WebCore::FloatRect&, bool hasVideo);
1271 void playbackTargetPickerClientStateDidChange(uint64_t, WebCore::MediaProducer::MediaStateFlags);
1272 void setMockMediaPlaybackTargetPickerEnabled(bool);
1273 void setMockMediaPlaybackTargetPickerState(const String&, WebCore::MediaPlaybackTargetContext::State);
1275 // WebMediaSessionManagerClient
1276 void setPlaybackTarget(uint64_t, Ref<WebCore::MediaPlaybackTarget>&&) override;
1277 void externalOutputDeviceAvailableDidChange(uint64_t, bool) override;
1278 void setShouldPlayToPlaybackTarget(uint64_t, bool) override;
1281 void didChangeBackgroundColor();
1282 void didLayoutForCustomContentProvider();
1285 void clearWheelEventTestTrigger();
1286 void callAfterNextPresentationUpdate(WTF::Function<void (CallbackBase::Error)>&&);
1288 void didReachLayoutMilestone(uint32_t layoutMilestones);
1290 void didRestoreScrollPosition();
1292 void getLoadDecisionForIcon(const WebCore::LinkIcon&, WebKit::CallbackID);
1293 void finishedLoadingIcon(WebKit::CallbackID, const IPC::DataReference&);
1295 void setFocus(bool focused);
1296 void setWindowFrame(const WebCore::FloatRect&);
1297 void getWindowFrame(Messages::WebPageProxy::GetWindowFrame::DelayedReply&&);
1298 void getWindowFrameWithCallback(Function<void(WebCore::FloatRect)>&&);
1300 bool isResourceCachingDisabled() const { return m_isResourceCachingDisabled; }
1301 void setResourceCachingDisabled(bool);
1303 WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection();
1304 void setUserInterfaceLayoutDirection(WebCore::UserInterfaceLayoutDirection);
1306 bool hasHadSelectionChangesFromUserInteraction() const { return m_hasHadSelectionChangesFromUserInteraction; }
1307 bool needsHiddenContentEditableQuirk() const { return m_needsHiddenContentEditableQuirk; }
1308 bool needsPlainTextQuirk() const { return m_needsPlainTextQuirk; }
1310 bool isAlwaysOnLoggingAllowed() const;
1313 void gamepadActivity(const Vector<GamepadData>&, bool shouldMakeGamepadsVisible);
1316 void isLoadingChanged() { activityStateDidChange(WebCore::ActivityState::IsLoading); }
1318 void clearUserMediaState();
1320 void setShouldSkipWaitingForPaintAfterNextViewDidMoveToWindow(bool shouldSkip) { m_shouldSkipWaitingForPaintAfterNextViewDidMoveToWindow = shouldSkip; }
1322 void setURLSchemeHandlerForScheme(Ref<WebURLSchemeHandler>&&, const String& scheme);
1323 WebURLSchemeHandler* urlSchemeHandlerForScheme(const String& scheme);
1326 void createSandboxExtensionsIfNeeded(const Vector<String>& files, SandboxExtension::Handle& fileReadHandle, SandboxExtension::HandleArray& fileUploadHandles);
1328 void editorStateChanged(const EditorState&);
1331 void touchBarMenuDataRemoved();
1332 void touchBarMenuDataChanged(const TouchBarMenuData&);
1333 void touchBarMenuItemDataAdded(const TouchBarMenuItemData&);
1334 void touchBarMenuItemDataRemoved(const TouchBarMenuItemData&);
1337 #if ENABLE(RESOURCE_LOAD_STATISTICS)
1338 void hasStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, uint64_t webProcessContextId);
1339 void requestStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, uint64_t webProcessContextId, bool prompt);
1342 #if ENABLE(ATTACHMENT_ELEMENT)
1343 RefPtr<API::Attachment> attachmentForIdentifier(const String& identifier) const;
1344 void insertAttachment(Ref<API::Attachment>&&, Function<void(CallbackBase::Error)>&&);
1345 void updateAttachmentAttributes(const API::Attachment&, Function<void(CallbackBase::Error)>&&);
1348 #if ENABLE(APPLICATION_MANIFEST)
1349 void getApplicationManifest(Function<void(const std::optional<WebCore::ApplicationManifest>&, CallbackBase::Error)>&&);
1352 void writeBlobToFilePath(const WebCore::URL& blobURL, const String& path, Function<void(bool success)>&&);
1354 WebPreferencesStore preferencesStore() const;
1356 void setDefersLoadingForTesting(bool);
1358 WebCore::IntRect syncRootViewToScreen(const WebCore::IntRect& viewRect);
1361 Vector<String> mediaMIMETypes();
1364 #if ENABLE(DATALIST_ELEMENT)
1365 void didSelectOption(const String&);
1366 void didCloseSuggestions();
1370 WebPageProxy(PageClient&, WebProcessProxy&, uint64_t pageID, Ref<API::PageConfiguration>&&);
1371 void platformInitialize();
1373 void notifyProcessPoolToPrewarm();
1375 RefPtr<API::Navigation> goToBackForwardItem(WebBackForwardListItem&, WebCore::FrameLoadType);
1377 void updateActivityState(OptionSet<WebCore::ActivityState::Flag> flagsToUpdate = WebCore::ActivityState::allFlags());
1378 void updateThrottleState();
1379 void updateHiddenPageThrottlingAutoIncreases();
1381 void suspendCurrentPageIfPossible(API::Navigation&, std::optional<uint64_t> mainFrameID);
1383 enum class ResetStateReason {
1388 void resetState(ResetStateReason);
1389 void resetStateAfterProcessExited(ProcessTerminationReason);
1391 void setUserAgent(String&&);
1393 // IPC::MessageReceiver
1394 // Implemented in generated WebPageProxyMessageReceiver.cpp
1395 void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
1396 void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override;
1399 // IPC::MessageSender
1400 bool sendMessage(std::unique_ptr<IPC::Encoder>, OptionSet<IPC::SendOption>) override;
1401 IPC::Connection* messageSenderConnection() override;
1402 uint64_t messageSenderDestinationID() override;
1404 // WebPopupMenuProxy::Client
1405 void valueChangedForPopupMenu(WebPopupMenuProxy*, int32_t newSelectedIndex) override;
1406 void setTextFromItemForPopupMenu(WebPopupMenuProxy*, int32_t index) override;
1408 void failedToShowPopupMenu() override;
1411 #if ENABLE(POINTER_LOCK)
1412 void requestPointerLock();
1413 void requestPointerUnlock();
1416 void didCreateMainFrame(uint64_t frameID);
1417 void didCreateSubframe(uint64_t frameID);
1418 void didCreateWindow(uint64_t frameID, WebCore::GlobalWindowIdentifier&&);
1420 void didStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL&&, WebCore::URL&& unreachableURL, const UserData&);
1421 void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::ResourceRequest&&, const UserData&);
1422 void willPerformClientRedirectForFrame(uint64_t frameID, const String& url, double delay, WebCore::LockBackForwardList);
1423 void didCancelClientRedirectForFrame(uint64_t frameID);
1424 void didChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL&&);
1425 void didFailProvisionalLoadForFrame(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, const UserData&);
1426 void didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t frameLoadType, const WebCore::CertificateInfo&, bool containsPluginDocument, std::optional<WebCore::HasInsecureContent> forcedHasInsecureContent, const UserData&);
1427 void didFinishDocumentLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
1428 void didFinishLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
1429 void didFailLoadForFrame(uint64_t frameID, uint64_t navigationID, const WebCore::ResourceError&, const UserData&);
1430 void didSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t sameDocumentNavigationType, WebCore::URL&&, const UserData&);
1431 void didChangeMainDocument(uint64_t frameID);
1433 void didReceiveTitleForFrame(uint64_t frameID, const String&, const UserData&);
1434 void didFirstLayoutForFrame(uint64_t frameID, const UserData&);
1435 void didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, const UserData&);
1436 void didDisplayInsecureContentForFrame(uint64_t frameID, const UserData&);
1437 void didRunInsecureContentForFrame(uint64_t frameID, const UserData&);
1438 void didDetectXSSForFrame(uint64_t frameID, const UserData&);
1439 void mainFramePluginHandlesPageScaleGestureDidChange(bool);
1440 void frameDidBecomeFrameSet(uint64_t frameID, bool);
1441 void didStartProgress();
1442 void didChangeProgress(double);
1443 void didFinishProgress();
1444 void didCompletePageTransition(bool isInitialEmptyDocument);
1445 void setNetworkRequestsInProgress(bool);
1447 void hasInsecureContent(WebCore::HasInsecureContent&);
1449 void didDestroyNavigation(uint64_t navigationID);
1451 void decidePolicyForNavigationAction(WebFrameProxy&, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, NavigationActionData&&, const FrameInfoData&, uint64_t originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, WebCore::ResourceResponse&& redirectResponse, const UserData&, WebCore::ShouldSkipSafeBrowsingCheck, Ref<PolicyDecisionSender>&&);
1452 void decidePolicyForNavigationActionAsync(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, NavigationActionData&&, const FrameInfoData&, uint64_t originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, WebCore::ResourceResponse&& redirectResponse, const UserData&, WebCore::ShouldSkipSafeBrowsingCheck, uint64_t listenerID);
1453 void decidePolicyForNavigationActionSync(uint64_t frameID, bool isMainFrame, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, NavigationActionData&&, const FrameInfoData&, uint64_t originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, WebCore::ResourceResponse&& redirectResponse, const UserData&, WebCore::ShouldSkipSafeBrowsingCheck, Messages::WebPageProxy::DecidePolicyForNavigationActionSync::DelayedReply&&);
1454 void decidePolicyForNewWindowAction(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, NavigationActionData&&, WebCore::ResourceRequest&&, const String& frameName, uint64_t listenerID, const UserData&);
1455 void decidePolicyForResponse(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, uint64_t listenerID, const UserData&);
1456 void unableToImplementPolicy(uint64_t frameID, const WebCore::ResourceError&, const UserData&);
1457 void beginSafeBrowsingCheck(const WebCore::URL&, WebFramePolicyListenerProxy&);
1459 void willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const Vector<std::pair<String, String>>& textFieldValues, uint64_t listenerID, const UserData&);
1461 void contentRuleListNotification(WebCore::URL&&, Vector<String>&& identifiers, Vector<String>&& notifications);
1464 void didNavigateWithNavigationData(const WebNavigationDataStore&, uint64_t frameID);
1465 void didPerformClientRedirect(const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
1466 void didPerformServerRedirect(const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
1467 void didUpdateHistoryTitle(const String& title, const String& url, uint64_t frameID);
1470 void createNewPage(const FrameInfoData&, uint64_t originatingPageID, WebCore::ResourceRequest&&, WebCore::WindowFeatures&&, NavigationActionData&&, Messages::WebPageProxy::CreateNewPage::DelayedReply&&);
1472 void runJavaScriptAlert(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, Messages::WebPageProxy::RunJavaScriptAlert::DelayedReply&&);
1473 void runJavaScriptConfirm(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, Messages::WebPageProxy::RunJavaScriptConfirm::DelayedReply&&);
1474 void runJavaScriptPrompt(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, const String&, Messages::WebPageProxy::RunJavaScriptPrompt::DelayedReply&&);
1475 void setStatusText(const String&);
1476 void mouseDidMoveOverElement(WebHitTestResultData&&, uint32_t modifiers, UserData&&);
1478 #if ENABLE(NETSCAPE_PLUGIN_API)
1479 void unavailablePluginButtonClicked(uint32_t opaquePluginUnavailabilityReason, const String& mimeType, const String& pluginURLString, const String& pluginsPageURLString, const String& frameURLString, const String& pageURLString);
1480 #endif // ENABLE(NETSCAPE_PLUGIN_API)
1482 void webGLPolicyForURL(WebCore::URL&&, Messages::WebPageProxy::WebGLPolicyForURL::DelayedReply&&);
1483 void resolveWebGLPolicyForURL(WebCore::URL&&, Messages::WebPageProxy::ResolveWebGLPolicyForURL::DelayedReply&&);
1484 #endif // ENABLE(WEBGL)
1485 void setToolbarsAreVisible(bool toolbarsAreVisible);
1486 void getToolbarsAreVisible(Messages::WebPageProxy::GetToolbarsAreVisible::DelayedReply&&);
1487 void setMenuBarIsVisible(bool menuBarIsVisible);
1488 void getMenuBarIsVisible(Messages::WebPageProxy::GetMenuBarIsVisible::DelayedReply&&);
1489 void setStatusBarIsVisible(bool statusBarIsVisible);
1490 void getStatusBarIsVisible(Messages::WebPageProxy::GetStatusBarIsVisible::DelayedReply&&);
1491 void getIsViewVisible(bool&);
1492 void setIsResizable(bool isResizable);
1493 void screenToRootView(const WebCore::IntPoint& screenPoint, Messages::WebPageProxy::ScreenToRootView::DelayedReply&&);
1494 void rootViewToScreen(const WebCore::IntRect& viewRect, Messages::WebPageProxy::RootViewToScreen::DelayedReply&&);
1495 #if PLATFORM(IOS_FAMILY)
1496 void accessibilityScreenToRootView(const WebCore::IntPoint& screenPoint, WebCore::IntPoint& windowPoint);
1497 void rootViewToAccessibilityScreen(const WebCore::IntRect& viewRect, WebCore::IntRect& result);
1499 void runBeforeUnloadConfirmPanel(uint64_t frameID, const WebCore::SecurityOriginData&, const String& message, Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::DelayedReply&&);
1500 void didChangeViewportProperties(const WebCore::ViewportAttributes&);
1501 void pageDidScroll();
1502 void runOpenPanel(uint64_t frameID, const WebCore::SecurityOriginData&, const WebCore::FileChooserSettings&);
1503 void showShareSheet(const WebCore::ShareDataWithParsedURL&, ShareSheetCallbackID);
1504 void printFrame(uint64_t frameID);
1505 void exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply&&);
1506 void reachedApplicationCacheOriginQuota(const String& originIdentifier, uint64_t currentQuota, uint64_t totalBytesNeeded, Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::DelayedReply&&);
1507 void requestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, String originIdentifier);
1509 #if ENABLE(MEDIA_STREAM)
1510 UserMediaPermissionRequestManagerProxy& userMediaPermissionRequestManager();
1512 void requestUserMediaPermissionForFrame(uint64_t userMediaID, uint64_t frameID, const WebCore::SecurityOriginData& userMediaDocumentOriginIdentifier, const WebCore::SecurityOriginData& topLevelDocumentOriginIdentifier, const WebCore::MediaStreamRequest&);
1513 void enumerateMediaDevicesForFrame(uint64_t userMediaID, uint64_t frameID, const WebCore::SecurityOriginData& userMediaDocumentOriginData, const WebCore::SecurityOriginData& topLevelDocumentOriginData);
1514 void beginMonitoringCaptureDevices();
1517 void notifyScrollerThumbIsVisibleInRect(const WebCore::IntRect&);
1518 void recommendedScrollbarStyleDidChange(int32_t newStyle);
1519 void didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar);
1520 void didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide, bool pinnedToTopSide, bool pinnedToBottomSide);
1521 void didChangePageCount(unsigned);
1522 void pageExtendedBackgroundColorDidChange(const WebCore::Color&);
1523 #if ENABLE(NETSCAPE_PLUGIN_API)
1524 void didFailToInitializePlugin(const String& mimeType, const String& frameURLString, const String& pageURLString);
1525 void didBlockInsecurePluginVersion(const String& mimeType, const String& pluginURLString, const String& frameURLString, const String& pageURLString, bool replacementObscured);
1526 #endif // ENABLE(NETSCAPE_PLUGIN_API)
1527 void setCanShortCircuitHorizontalWheelEvents(bool canShortCircuitHorizontalWheelEvents) { m_canShortCircuitHorizontalWheelEvents = canShortCircuitHorizontalWheelEvents; }
1529 void reattachToWebProcess();
1530 void swapToWebProcess(Ref<WebProcessProxy>&&, API::Navigation&, std::optional<uint64_t> mainFrameIDInPreviousProcess);
1531 void finishAttachingToWebProcess();
1533 RefPtr<API::Navigation> reattachToWebProcessForReload();
1534 RefPtr<API::Navigation> reattachToWebProcessWithItem(WebBackForwardListItem&);
1536 void loadRequestWithNavigation(API::Navigation&, WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, API::Object* userData, WebCore::ShouldTreatAsContinuingLoad);
1538 void requestNotificationPermission(uint64_t notificationID, const String& originString);
1539 void showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, WebCore::NotificationDirection, const String& originString, uint64_t notificationID);
1540 void cancelNotification(uint64_t notificationID);
1541 void clearNotifications(const Vector<uint64_t>& notificationIDs);
1542 void didDestroyNotification(uint64_t notificationID);
1544 void didChangeContentSize(const WebCore::IntSize&);
1546 #if ENABLE(INPUT_TYPE_COLOR)
1547 void showColorPicker(const WebCore::Color& initialColor, const WebCore::IntRect&, Vector<WebCore::Color>&&);
1548 void didChooseColor(const WebCore::Color&) override;
1549 void didEndColorPicker() override;
1552 #if ENABLE(DATALIST_ELEMENT)
1553 void showDataListSuggestions(WebCore::DataListSuggestionInformation&&);
1554 void handleKeydownInDataList(const String&);
1555 void endDataListSuggestions();
1558 void closeOverlayedViews();
1560 void compositionWasCanceled();
1561 void setHasHadSelectionChangesFromUserInteraction(bool);
1562 void setNeedsHiddenContentEditableQuirk(bool);
1563 void setNeedsPlainTextQuirk(bool);
1565 // Back/Forward list management
1566 void backForwardAddItem(BackForwardListItemState&&);
1567 void backForwardGoToItem(const WebCore::BackForwardItemIdentifier&, SandboxExtension::Handle&);
1568 void backForwardItemAtIndex(int32_t index, std::optional<WebCore::BackForwardItemIdentifier>&);
1569 void backForwardBackListCount(uint32_t& count);
1570 void backForwardForwardListCount(uint32_t& count);
1571 void backForwardClear();
1574 void registerEditCommandForUndo(uint64_t commandID, uint32_t editAction);
1575 void registerInsertionUndoGrouping();
1576 void clearAllEditCommands();
1577 void canUndoRedo(UndoOrRedo, bool& result);
1578 void executeUndoRedo(UndoOrRedo);
1580 // Keyboard handling
1582 void executeSavedCommandBySelector(const String& selector, bool& handled);
1586 void getEditorCommandsForKeyEvent(const AtomicString&, Vector<String>&);
1587 void bindAccessibilityTree(const String&);
1591 void showPopupMenu(const WebCore::IntRect& rect, uint64_t textDirection, const Vector<WebPopupItem>& items, int32_t selectedIndex, const PlatformPopupMenuData&);
1592 void hidePopupMenu();
1594 #if ENABLE(CONTEXT_MENUS)
1595 void showContextMenu(ContextMenuContextData&&, const UserData&);
1598 #if ENABLE(TELEPHONE_NUMBER_DETECTION)
1600 void showTelephoneNumberMenu(const String& telephoneNumber, const WebCore::IntPoint&);
1604 // Search popup results
1605 void saveRecentSearches(const String&, const Vector<WebCore::RecentSearch>&);
1606 void loadRecentSearches(const String&, Vector<WebCore::RecentSearch>&);
1610 void getIsSpeaking(bool&);
1611 void speak(const String&);
1612 void stopSpeaking();
1615 void searchWithSpotlight(const String&);
1617 void searchTheWeb(const String&);
1620 void didPerformDictionaryLookup(const WebCore::DictionaryPopupInfo&);
1624 bool appleMailPaginationQuirkEnabled();
1628 // FIXME: Need to support iOS too, but there is no isAppleMail for iOS.
1629 bool appleMailLinesClampEnabled();
1632 // Spelling and grammar.
1633 void checkSpellingOfString(const String& text, int32_t& misspellingLocation, int32_t& misspellingLength);
1634 void checkGrammarOfString(const String& text, Vector<WebCore::GrammarDetail>&, int32_t& badGrammarLocation, int32_t& badGrammarLength);
1635 void spellingUIIsShowing(bool&);
1636 void updateSpellingUIWithMisspelledWord(const String& misspelledWord);
1637 void updateSpellingUIWithGrammarString(const String& badGrammarPhrase, const WebCore::GrammarDetail&);
1638 void learnWord(const String& word);
1639 void ignoreWord(const String& word);
1640 void requestCheckingOfString(uint64_t requestID, const WebCore::TextCheckingRequestData&, int32_t insertionPoint);
1642 void takeFocus(uint32_t direction);
1643 void setToolTip(const String&);
1644 void setCursor(const WebCore::Cursor&);
1645 void setCursorHiddenUntilMouseMoves(bool);
1647 void didReceiveEvent(uint32_t opaqueType, bool handled);
1649 void voidCallback(CallbackID);
1650 void dataCallback(const IPC::DataReference&, CallbackID);
1651 void imageCallback(const ShareableBitmap::Handle&, CallbackID);
1652 void stringCallback(const String&, CallbackID);
1653 void invalidateStringCallback(CallbackID);
1654 void scriptValueCallback(const IPC::DataReference&, bool hadException, const WebCore::ExceptionDetails&, CallbackID);
1655 void computedPagesCallback(const Vector<WebCore::IntRect>&, double totalScaleFactorForPrinting, CallbackID);
1656 void validateCommandCallback(const String&, bool, int, CallbackID);
1657 void unsignedCallback(uint64_t, CallbackID);
1658 void editingRangeCallback(const EditingRange&, CallbackID);
1659 #if ENABLE(APPLICATION_MANIFEST)
1660 void applicationManifestCallback(const std::optional<WebCore::ApplicationManifest>&, CallbackID);
1663 void machSendRightCallback(const WTF::MachSendRight&, CallbackID);
1665 void rectForCharacterRangeCallback(const WebCore::IntRect&, const EditingRange&, CallbackID);
1667 void attributedStringForCharacterRangeCallback(const AttributedString&, const EditingRange&, CallbackID);
1668 void fontAtSelectionCallback(const String&, double, bool, CallbackID);
1670 #if PLATFORM(IOS_FAMILY)
1671 void gestureCallback(const WebCore::IntPoint&, uint32_t gestureType, uint32_t gestureState, uint32_t flags, CallbackID);
1672 void touchesCallback(const WebCore::IntPoint&, uint32_t touches, uint32_t flags, CallbackID);
1673 void autocorrectionDataCallback(const Vector<WebCore::FloatRect>&, const String& fontName, float fontSize, uint64_t fontTraits, CallbackID);
1674 void autocorrectionContextCallback(const String& beforeText, const String& markedText, const String& selectedText, const String& afterText, uint64_t location, uint64_t length, CallbackID);
1675 void selectionContextCallback(const String& selectedText, const String& beforeText, const String& afterText, CallbackID);
1676 void interpretKeyEvent(const EditorState&, bool isCharEvent, bool& handled);
1677 void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect, WebCore::RouteSharingPolicy, const String&);
1678 void selectionRectsCallback(const Vector<WebCore::SelectionRect>&, CallbackID);
1681 void printFinishedCallback(const WebCore::ResourceError&, CallbackID);
1684 void focusedFrameChanged(uint64_t frameID);
1685 void frameSetLargestFrameChanged(uint64_t frameID);
1687 void didFinishLoadingDataForCustomContentProvider(const String& suggestedFilename, const IPC::DataReference&);
1690 void pluginFocusOrWindowFocusChanged(uint64_t pluginComplexTextInputIdentifier, bool pluginHasFocusAndWindowHasFocus);
1691 void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, uint64_t complexTextInputState);
1694 bool maybeInitializeSandboxExtensionHandle(const WebCore::URL&, SandboxExtension::Handle&);
1696 #if USE(AUTOMATIC_TEXT_REPLACEMENT)
1697 void toggleSmartInsertDelete();
1698 void toggleAutomaticQuoteSubstitution();
1699 void toggleAutomaticLinkDetection();
1700 void toggleAutomaticDashSubstitution();
1701 void toggleAutomaticTextReplacement();
1705 void substitutionsPanelIsShowing(bool&);
1706 void showCorrectionPanel(int32_t panelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings);
1707 void dismissCorrectionPanel(int32_t reason);
1708 void dismissCorrectionPanelSoon(int32_t reason, String& result);
1709 void recordAutocorrectionResponse(int32_t responseType, const String& replacedString, const String& replacementString);
1711 #if USE(DICTATION_ALTERNATIVES)
1712 void showDictationAlternativeUI(const WebCore::FloatRect& boundingBoxOfDictatedText, uint64_t dictationContext);
1713 void removeDictationAlternatives(uint64_t dictationContext);
1714 void dictationAlternatives(uint64_t dictationContext, Vector<String>& result);
1717 void setEditableElementIsFocused(bool);
1718 #endif // PLATFORM(MAC)
1720 #if PLATFORM(IOS_FAMILY)
1721 WebCore::FloatSize screenSize();
1722 WebCore::FloatSize availableScreenSize();
1723 WebCore::FloatSize overrideScreenSize();
1724 float textAutosizingWidth();
1726 void couldNotRestorePageState();
1727 void restorePageState(std::optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatBoxExtent& obscuredInsetsOnSave, double scale);
1728 void restorePageCenterAndScale(std::optional<WebCore::FloatPoint>, double scale);
1730 void didGetTapHighlightGeometries(uint64_t requestID, const WebCore::Color& color, const Vector<WebCore::FloatQuad>& geometries, const WebCore::IntSize& topLeftRadius, const WebCore::IntSize& topRightRadius, const WebCore::IntSize& bottomLeftRadius, const WebCore::IntSize& bottomRightRadius);
1732 void startAssistingNode(const AssistedNodeInformation&, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, const UserData&);
1733 void stopAssistingNode();
1735 void showInspectorHighlight(const WebCore::Highlight&);
1736 void hideInspectorHighlight();
1738 void showInspectorIndication();
1739 void hideInspectorIndication();
1741 void enableInspectorNodeSearch();
1742 void disableInspectorNodeSearch();
1743 void assistedNodeInformationCallback(const AssistedNodeInformation&, CallbackID);
1744 #endif // PLATFORM(IOS_FAMILY)
1746 #if ENABLE(DATA_DETECTION)
1747 RetainPtr<NSArray> m_dataDetectionResults;
1750 void clearLoadDependentCallbacks();
1752 void performDragControllerAction(DragControllerAction, WebCore::DragData&, const String& dragStorageName, SandboxExtension::Handle&&, SandboxExtension::HandleArray&&);
1754 void updateBackingStoreDiscardableState();
1756 void setRenderTreeSize(uint64_t treeSize) { m_renderTreeSize = treeSize; }
1759 void createPluginContainer(uint64_t& windowID);
1760 void windowedPluginGeometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect, uint64_t windowID);
1761 void windowedPluginVisibilityDidChange(bool isVisible, uint64_t windowID);
1764 void processNextQueuedWheelEvent();
1765 void sendWheelEvent(const WebWheelEvent&);
1766 bool shouldProcessWheelEventNow(const WebWheelEvent&) const;
1768 #if ENABLE(TOUCH_EVENTS)
1769 void updateTouchEventTracking(const WebTouchEvent&);
1770 WebCore::TrackingType touchEventTrackingType(const WebTouchEvent&) const;
1773 #if ENABLE(NETSCAPE_PLUGIN_API)
1774 void findPlugin(const String& mimeType, uint32_t processType, const String& urlString, const String& frameURLString, const String& pageURLString, bool allowOnlyApplicationPlugins, Messages::WebPageProxy::FindPlugin::DelayedReply&&);
1778 void didStartLoadForQuickLookDocumentInMainFrame(const String& fileName, const String& uti);
1779 void didFinishLoadForQuickLookDocumentInMainFrame(const QuickLookDocumentData&);
1780 void didRequestPasswordForQuickLookDocumentInMainFrame(const String& fileName);
1783 #if ENABLE(CONTENT_FILTERING)
1784 void contentFilterDidBlockLoadForFrame(const WebCore::ContentFilterUnblockHandler&, uint64_t frameID);
1787 void tryReloadAfterProcessTermination();
1788 void resetRecentCrashCountSoon();
1789 void resetRecentCrashCount();
1791 API::DiagnosticLoggingClient* effectiveDiagnosticLoggingClient(WebCore::ShouldSample);
1793 void dispatchActivityStateChange();
1794 void viewDidLeaveWindow();
1795 void viewDidEnterWindow();
1798 void didPerformImmediateActionHitTest(const WebHitTestResultData&, bool contentPreventsDefault, const UserData&);
1801 void useFixedLayoutDidChange(bool useFixedLayout) { m_useFixedLayout = useFixedLayout; }
1802 void fixedLayoutSizeDidChange(WebCore::IntSize fixedLayoutSize) { m_fixedLayoutSize = fixedLayoutSize; }
1804 void imageOrMediaDocumentSizeChanged(const WebCore::IntSize&);
1807 void requestInstallMissingMediaPlugins(const String& details, const String& description);
1811 void startURLSchemeTask(URLSchemeTaskParameters&&);
1812 void stopURLSchemeTask(uint64_t handlerIdentifier, uint64_t taskIdentifier);
1813 void loadSynchronousURLSchemeTask(URLSchemeTaskParameters&&, Messages::WebPageProxy::LoadSynchronousURLSchemeTask::DelayedReply&&);
1815 void handleAutoFillButtonClick(const UserData&);
1817 void didResignInputElementStrongPasswordAppearance(const UserData&);
1819 void finishInitializingWebPageAfterProcessLaunch();
1821 void handleMessage(IPC::Connection&, const String& messageName, const UserData& messageBody);
1822 void handleSynchronousMessage(IPC::Connection&, const String& messageName, const UserData& messageBody, UserData& returnUserData);
1824 void viewIsBecomingVisible();
1826 void stopAllURLSchemeTasks();
1828 #if ENABLE(ATTACHMENT_ELEMENT)
1829 void registerAttachmentIdentifierFromData(const String&, const String& contentType, const String& preferredFileName, const IPC::DataReference&);
1830 void registerAttachmentIdentifierFromFilePath(const String&, const String& contentType, const String& filePath);
1831 void registerAttachmentIdentifier(const String&);
1832 void cloneAttachmentData(const String& fromIdentifier, const String& toIdentifier);
1834 void platformRegisterAttachment(Ref<API::Attachment>&&, const String& preferredFileName, const IPC::DataReference&);
1835 void platformRegisterAttachment(Ref<API::Attachment>&&, const String& filePath);
1836 void platformCloneAttachment(Ref<API::Attachment>&& fromAttachment, Ref<API::Attachment>&& toAttachment);
1838 void didInsertAttachmentWithIdentifier(const String& identifier, const String& source, bool hasEnclosingImage);
1839 void didRemoveAttachmentWithIdentifier(const String& identifier);
1840 void didRemoveAttachment(API::Attachment&);
1841 Ref<API::Attachment> ensureAttachment(const String& identifier);
1842 void invalidateAllAttachments();
1845 #if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
1846 void startDisplayLink(unsigned observerID);
1847 void stopDisplayLink(unsigned observerID);
1850 void reportPageLoadResult(const WebCore::ResourceError& = { });
1852 void continueNavigationInNewProcess(API::Navigation&, Ref<WebProcessProxy>&&);
1854 void setNeedsFontAttributes(bool);
1855 void updateFontAttributesAfterEditorStateChange();
1857 WeakPtr<PageClient> m_pageClient;
1858 Ref<API::PageConfiguration> m_configuration;
1860 std::unique_ptr<API::LoaderClient> m_loaderClient;
1861 std::unique_ptr<API::PolicyClient> m_policyClient;
1862 UniqueRef<API::NavigationClient> m_navigationClient;
1863 UniqueRef<API::HistoryClient> m_historyClient;
1864 std::unique_ptr<API::IconLoadingClient> m_iconLoadingClient;
1865 std::unique_ptr<API::FormClient> m_formClient;
1866 std::unique_ptr<API::UIClient> m_uiClient;
1867 std::unique_ptr<API::FindClient> m_findClient;
1868 std::unique_ptr<API::FindMatchesClient> m_findMatchesClient;
1869 std::unique_ptr<API::DiagnosticLoggingClient> m_diagnosticLoggingClient;
1870 #if ENABLE(CONTEXT_MENUS)
1871 std::unique_ptr<API::ContextMenuClient> m_contextMenuClient;
1873 std::unique_ptr<WebPageInjectedBundleClient> m_injectedBundleClient;
1875 std::unique_ptr<WebNavigationState> m_navigationState;
1876 String m_failingProvisionalLoadURL;
1877 bool m_isLoadingAlternateHTMLStringForFailingProvisionalLoad { false };
1879 std::unique_ptr<DrawingAreaProxy> m_drawingArea;
1881 std::unique_ptr<RemoteLayerTreeHost> m_frozenRemoteLayerTreeHost;
1882 #if ENABLE(ASYNC_SCROLLING)
1883 std::unique_ptr<RemoteScrollingCoordinatorProxy> m_scrollingCoordinatorProxy;
1886 Ref<WebProcessProxy> m_process;
1887 Ref<WebPageGroup> m_pageGroup;
1888 Ref<WebPreferences> m_preferences;
1890 WebProcessLifetimeTracker m_webProcessLifetimeTracker { *this };
1892 Ref<WebUserContentControllerProxy> m_userContentController;
1893 Ref<VisitedLinkStore> m_visitedLinkStore;
1894 Ref<WebsiteDataStore> m_websiteDataStore;
1896 RefPtr<WebFrameProxy> m_mainFrame;
1897 Function<void()> m_mainFrameCreationHandler;
1898 Function<void(const WebCore::GlobalWindowIdentifier&)> m_mainFrameWindowCreationHandler;
1900 RefPtr<WebFrameProxy> m_focusedFrame;
1901 RefPtr<WebFrameProxy> m_frameSetLargestFrame;
1904 String m_applicationNameForUserAgent;
1905 String m_customUserAgent;
1906 String m_customTextEncodingName;
1907 String m_overrideContentSecurityPolicy;
1909 bool m_treatsSHA1CertificatesAsInsecure { true };
1911 RefPtr<WebInspectorProxy> m_inspector;
1913 #if ENABLE(FULLSCREEN_API)
1914 std::unique_ptr<WebFullScreenManagerProxy> m_fullScreenManager;
1915 std::unique_ptr<API::FullscreenClient> m_fullscreenClient;
1918 #if (PLATFORM(IOS_FAMILY) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
1919 RefPtr<PlaybackSessionManagerProxy> m_playbackSessionManager;
1920 RefPtr<VideoFullscreenManagerProxy> m_videoFullscreenManager;
1923 #if PLATFORM(IOS_FAMILY)
1924 VisibleContentRectUpdateInfo m_lastVisibleContentRectUpdate;
1925 uint64_t m_firstLayerTreeTransactionIdAfterDidCommitLoad { 0 };
1926 int32_t m_deviceOrientation { 0 };
1927 bool m_hasReceivedLayerTreeTransactionAfterDidCommitLoad { true };
1928 bool m_hasNetworkRequestsOnSuspended { false };
1929 bool m_isKeyboardAnimatingIn { false };
1930 bool m_isScrollingOrZooming { false };
1934 bool m_useSystemAppearance { false };
1937 #if ENABLE(APPLE_PAY)
1938 std::unique_ptr<WebPaymentCoordinatorProxy> m_paymentCoordinator;
1941 #if USE(SYSTEM_PREVIEW)
1942 std::unique_ptr<SystemPreviewController> m_systemPreviewController;
1945 #if ENABLE(WEB_AUTHN)
1946 std::unique_ptr<WebAuthenticatorCoordinatorProxy> m_credentialsMessenger;
1949 CallbackMap m_callbacks;
1950 HashSet<CallbackID> m_loadDependentStringCallbackIDs;
1952 HashSet<WebEditCommandProxy*> m_editCommandSet;
1955 HashSet<String> m_knownKeypressCommandNames;
1958 RefPtr<WebPopupMenuProxy> m_activePopupMenu;
1959 #if ENABLE(CONTEXT_MENUS)
1960 RefPtr<WebContextMenuProxy> m_activeContextMenu;
1961 ContextMenuContextData m_activeContextMenuContextData;
1963 RefPtr<API::HitTestResult> m_lastMouseMoveHitTestResult;
1965 RefPtr<WebOpenPanelResultListenerProxy> m_openPanelResultListener;
1966 GeolocationPermissionRequestManagerProxy m_geolocationPermissionRequestManager;
1967 NotificationPermissionRequestManagerProxy m_notificationPermissionRequestManager;
1969 #if ENABLE(MEDIA_STREAM)
1970 std::unique_ptr<UserMediaPermissionRequestManagerProxy> m_userMediaPermissionRequestManager;
1973 OptionSet<WebCore::ActivityState::Flag> m_activityState;
1974 bool m_viewWasEverInWindow { false };
1975 #if PLATFORM(IOS_FAMILY)
1976 bool m_allowsMediaDocumentInlinePlayback { false };
1977 bool m_alwaysRunsAtForegroundPriority { false };
1978 ProcessThrottler::ForegroundActivityToken m_activityToken;
1980 bool m_initialCapitalizationEnabled { false };
1981 std::optional<double> m_cpuLimit;
1982 Ref<WebBackForwardList> m_backForwardList;
1984 bool m_maintainsInactiveSelection { false };
1986 bool m_waitsForPaintAfterViewDidMoveToWindow { false };
1987 bool m_shouldSkipWaitingForPaintAfterNextViewDidMoveToWindow { false };
1991 EditorState m_editorState;
1992 bool m_isEditable { false };
1995 TouchBarMenuData m_touchBarMenuData;
1998 double m_textZoomFactor { 1 };
1999 double m_pageZoomFactor { 1 };
2000 double m_pageScaleFactor { 1 };
2001 double m_pluginZoomFactor { 1 };
2002 double m_pluginScaleFactor { 1 };
2003 double m_viewScaleFactor { 1 };
2004 float m_intrinsicDeviceScaleFactor { 1 };
2005 std::optional<float> m_customDeviceScaleFactor;
2006 float m_topContentInset { 0 };
2008 LayerHostingMode m_layerHostingMode { LayerHostingMode::InProcess };
2010 bool m_drawsBackground { true };
2012 WebCore::Color m_underlayColor;
2013 WebCore::Color m_pageExtendedBackgroundColor;
2015 bool m_useFixedLayout { false };
2016 WebCore::IntSize m_fixedLayoutSize;
2018 bool m_alwaysShowsHorizontalScroller { false };
2019 bool m_alwaysShowsVerticalScroller { false };
2021 WebCore::LayoutMilestones m_observedLayoutMilestones { 0 };
2023 bool m_suppressScrollbarAnimations { false };
2025 WebCore::Pagination::Mode m_paginationMode { WebCore::Pagination::Unpaginated };
2026 bool m_paginationBehavesLikeColumns { false };
2027 double m_pageLength { 0 };
2028 double m_gapBetweenPages { 0 };
2029 bool m_paginationLineGridEnabled { false };
2031 // If the process backing the web page is alive and kicking.
2032 bool m_isValid { true };
2034 // Whether WebPageProxy::close() has been called on this page.
2035 bool m_isClosed { false };
2037 // Whether it can run modal child web pages.
2038 bool m_canRunModal { false };
2040 bool m_needsToFinishInitializingWebPageAfterProcessLaunch { false };
2042 bool m_isInPrintingMode { false };
2043 bool m_isPerformingDOMPrintOperation { false };
2045 WebCore::ResourceRequest m_decidePolicyForResponseRequest;
2046 bool m_shouldSuppressAppLinksInNextNavigationPolicyDecision { false };
2048 Deque<NativeWebMouseEvent> m_mouseEventQueue;
2049 Deque<NativeWebKeyboardEvent> m_keyEventQueue;
2050 Deque<NativeWebWheelEvent> m_wheelEventQueue;
2051 Deque<std::unique_ptr<Vector<NativeWebWheelEvent>>> m_currentlyProcessedWheelEvents;
2052 #if ENABLE(MAC_GESTURE_EVENTS)
2053 Deque<NativeWebGestureEvent> m_gestureEventQueue;
2056 #if ENABLE(TOUCH_EVENTS)
2057 struct TouchEventTracking {
2058 WebCore::TrackingType touchForceChangedTracking { WebCore::TrackingType::NotTracking };
2059 WebCore::TrackingType touchStartTracking { WebCore::TrackingType::NotTracking };
2060 WebCore::TrackingType touchMoveTracking { WebCore::TrackingType::NotTracking };
2061 WebCore::TrackingType touchEndTracking { WebCore::TrackingType::NotTracking };
2063 bool isTrackingAnything() const
2065 return touchForceChangedTracking != WebCore::TrackingType::NotTracking
2066 || touchStartTracking != WebCore::TrackingType::NotTracking
2067 || touchMoveTracking != WebCore::TrackingType::NotTracking
2068 || touchEndTracking != WebCore::TrackingType::NotTracking;
2073 touchForceChangedTracking = WebCore::TrackingType::NotTracking;
2074 touchStartTracking = WebCore::TrackingType::NotTracking;
2075 touchMoveTracking = WebCore::TrackingType::NotTracking;
2076 touchEndTracking = WebCore::TrackingType::NotTracking;
2079 TouchEventTracking m_touchEventTracking;
2081 #if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS)
2082 Deque<QueuedTouchEvents> m_touchEventQueue;
2085 #if ENABLE(INPUT_TYPE_COLOR)
2086 RefPtr<WebColorPicker> m_colorPicker;
2088 #if ENABLE(DATALIST_ELEMENT)
2089 RefPtr<WebDataListSuggestionsDropdown> m_dataListSuggestionsDropdown;
2092 RefPtr<WebCore::ValidationBubble> m_validationBubble;
2095 const uint64_t m_pageID;
2097 bool m_isPageSuspended { false };
2098 bool m_addsVisitedLinks { true };
2100 bool m_controlledByAutomation { false };
2102 #if ENABLE(REMOTE_INSPECTOR)
2103 bool m_allowsRemoteInspection { true };
2104 String m_remoteInspectionNameOverride;
2106 unsigned m_inspectorFrontendCount { 0 };
2109 bool m_isSmartInsertDeleteEnabled { false };
2113 String m_accessibilityPlugID;
2114 WebCore::Color m_backgroundColor { WebCore::Color::white };
2117 unsigned m_pendingLearnOrIgnoreWordMessageCount { 0 };
2119 bool m_mainFrameHasCustomContentProvider { false };
2121 #if ENABLE(DRAG_SUPPORT)
2122 // Current drag destination details are delivered as an asynchronous response,
2123 // so we preserve them to be used when the next dragging delegate call is made.
2124 WebCore::DragOperation m_currentDragOperation { WebCore::DragOperationNone };
2125 bool m_currentDragIsOverFileInput { false };
2126 unsigned m_currentDragNumberOfFilesToBeAccepted { 0 };
2127 WebCore::IntRect m_currentDragCaretRect;
2130 PageLoadState m_pageLoadState;
2132 bool m_delegatesScrolling { false };
2134 bool m_mainFrameHasHorizontalScrollbar { false };
2135 bool m_mainFrameHasVerticalScrollbar { false };
2137 // Whether horizontal wheel events can be handled directly for swiping purposes.
2138 bool m_canShortCircuitHorizontalWheelEvents { true };
2140 bool m_mainFrameIsPinnedToLeftSide { true };
2141 bool m_mainFrameIsPinnedToRightSide { true };
2142 bool m_mainFrameIsPinnedToTopSide { true };
2143 bool m_mainFrameIsPinnedToBottomSide { true };
2145 bool m_shouldUseImplicitRubberBandControl { false };
2146 bool m_rubberBandsAtLeft { true };
2147 bool m_rubberBandsAtRight { true };
2148 bool m_rubberBandsAtTop { true };
2149 bool m_rubberBandsAtBottom { true };
2151 bool m_enableVerticalRubberBanding { true };
2152 bool m_enableHorizontalRubberBanding { true };
2154 bool m_backgroundExtendsBeyondPage { true };
2156 bool m_shouldRecordNavigationSnapshots { false };
2157 bool m_isShowingNavigationGestureSnapshot { false };
2159 bool m_mainFramePluginHandlesPageScaleGesture { false };
2161 unsigned m_pageCount { 0 };
2163 WebCore::IntRect m_visibleScrollerThumbRect;
2165 uint64_t m_renderTreeSize { 0 };
2166 uint64_t m_sessionRestorationRenderTreeSize { 0 };
2167 bool m_hitRenderTreeSizeThreshold { false };
2169 bool m_suppressVisibilityUpdates { false };
2170 bool m_autoSizingShouldExpandToViewHeight { false };
2171 WebCore::IntSize m_viewLayoutSize;
2172 std::optional<WebCore::IntSize> m_viewportSizeForCSSViewportUnits;
2175 WebCore::LayoutSize m_baseLayoutViewportSize;
2176 WebCore::LayoutPoint m_minStableLayoutViewportOrigin;
2177 WebCore::LayoutPoint m_maxStableLayoutViewportOrigin;
2179 float m_mediaVolume { 1 };
2180 WebCore::MediaProducer::MutedStateFlags m_mutedState { WebCore::MediaProducer::NoneMuted };
2181 bool m_mayStartMediaWhenInWindow { true };
2182 bool m_mediaCaptureEnabled { true };
2184 bool m_waitingForDidUpdateActivityState { false };
2186 bool m_shouldScaleViewToFitDocument { false };
2187 bool m_shouldSuppressNextAutomaticNavigationSnapshot { false };
2190 HashMap<String, String> m_temporaryPDFFiles;
2191 std::unique_ptr<WebCore::RunLoopObserver> m_activityStateChangeDispatcher;
2193 std::unique_ptr<RemoteLayerTreeScrollingPerformanceData> m_scrollingPerformanceData;
2194 bool m_scrollPerformanceDataCollectionEnabled { false };
2196 UserObservablePageCounter::Token m_pageIsUserObservableCount;
2197 ProcessSuppressionDisabledToken m_preventProcessSuppressionCount;
2198 HiddenPageThrottlingAutoIncreasesCounter::Token m_hiddenPageDOMTimerThrottlingAutoIncreasesCount;
2199 VisibleWebPageToken m_visiblePageToken;
2201 WebCore::ScrollPinningBehavior m_scrollPinningBehavior { WebCore::DoNotPin };
2202 std::optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle;
2204 uint64_t m_navigationID { 0 };
2205 ActivityStateChangeID m_currentActivityStateChangeID { ActivityStateChangeAsynchronous };
2207 WebPreferencesStore::ValueMap m_configurationPreferenceValues;
2208 OptionSet<WebCore::ActivityState::Flag> m_potentiallyChangedActivityStateFlags;
2209 bool m_activityStateChangeWantsSynchronousReply { false };
2210 Vector<CallbackID> m_nextActivityStateChangeCallbacks;
2212 WebCore::MediaProducer::MediaStateFlags m_mediaState { WebCore::MediaProducer::IsNotPlaying };
2214 bool m_isResourceCachingDisabled { false };
2216 bool m_hasHadSelectionChangesFromUserInteraction { false };
2217 bool m_needsHiddenContentEditableQuirk { false };
2218 bool m_needsPlainTextQuirk { false };
2220 #if ENABLE(MEDIA_SESSION)
2221 bool m_hasMediaSessionWithActiveMediaElements { false };
2224 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
2225 bool m_requiresTargetMonitoring { false };
2228 #if PLATFORM(IOS_FAMILY)
2229 std::unique_ptr<NodeAssistanceArguments> m_deferredNodeAssistanceArguments;
2230 bool m_forceAlwaysUserScalable { false };
2231 WebCore::FloatSize m_viewportConfigurationViewLayoutSize;
2232 double m_viewportConfigurationLayoutSizeScaleFactor { 1 };
2233 WebCore::FloatSize m_maximumUnobscuredSize;
2236 std::optional<WebCore::FontAttributes> m_cachedFontAttributesAtSelectionStart;
2238 #if ENABLE(POINTER_LOCK)
2239 bool m_isPointerLockPending { false };
2240 bool m_isPointerLocked { false };
2243 bool m_isUsingHighPerformanceWebGL { false };
2244 bool m_openedByDOM { false };
2245 bool m_hasCommittedAnyProvisionalLoads { false };
2247 HashMap<String, Ref<WebURLSchemeHandler>> m_urlSchemeHandlersByScheme;
2248 HashMap<uint64_t, Ref<WebURLSchemeHandler>> m_urlSchemeHandlersByIdentifier;
2250 #if ENABLE(ATTACHMENT_ELEMENT)
2251 HashMap<String, Ref<API::Attachment>> m_attachmentIdentifierToAttachmentMap;
2254 #if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
2255 std::unique_ptr<DisplayLink> m_displayLink;
2258 std::optional<SpellDocumentTag> m_spellDocumentTag;
2260 std::optional<MonotonicTime> m_pageLoadStart;
2263 // FIXME: We should try and get rid of this data member.
2264 WeakPtr<SuspendedPageProxy> m_pageSuspendedDueToCurrentNavigation;
2267 RunLoop::Timer<WebPageProxy> m_resetRecentCrashCountTimer;
2268 unsigned m_recentCrashCount { 0 };
2270 bool m_needsFontAttributes { false };
2273 } // namespace WebKit