2 * Copyright (C) 2010-2019 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE.
28 #include "APIInjectedBundleEditorClient.h"
29 #include "APIInjectedBundleFormClient.h"
30 #include "APIInjectedBundlePageContextMenuClient.h"
31 #include "APIInjectedBundlePageLoaderClient.h"
32 #include "APIInjectedBundlePageResourceLoadClient.h"
33 #include "APIInjectedBundlePageUIClient.h"
34 #include "APIObject.h"
35 #include "CallbackID.h"
36 #include "DrawingAreaInfo.h"
37 #include "EditingRange.h"
38 #include "FocusedElementInformation.h"
39 #include "InjectedBundlePageContextMenuClient.h"
40 #include "InjectedBundlePageFullScreenClient.h"
41 #include "InjectedBundlePagePolicyClient.h"
42 #include "LayerTreeContext.h"
43 #include "MessageReceiver.h"
44 #include "MessageSender.h"
45 #include "OptionalCallbackID.h"
47 #include "SandboxExtension.h"
48 #include "ShareSheetCallbackID.h"
49 #include "SharedMemory.h"
50 #include "StorageNamespaceIdentifier.h"
51 #include "TransactionID.h"
53 #include "WebBackForwardListProxy.h"
54 #include "WebPageMessagesReplies.h"
55 #include "WebURLSchemeHandler.h"
56 #include "WebUndoStepID.h"
57 #include "WebUserContentController.h"
58 #include "WebsitePoliciesData.h"
59 #include <JavaScriptCore/InspectorFrontendChannel.h>
60 #include <WebCore/ActivityState.h>
61 #include <WebCore/DictionaryPopupInfo.h>
62 #include <WebCore/DisabledAdaptations.h>
63 #include <WebCore/DragActions.h>
64 #include <WebCore/FrameLoaderTypes.h>
65 #include <WebCore/HTMLMenuElement.h>
66 #include <WebCore/HTMLMenuItemElement.h>
67 #include <WebCore/IntRect.h>
68 #include <WebCore/IntSizeHash.h>
69 #include <WebCore/Page.h>
70 #include <WebCore/PageIdentifier.h>
71 #include <WebCore/PageOverlay.h>
72 #include <WebCore/PluginData.h>
73 #include <WebCore/PointerID.h>
74 #include <WebCore/SecurityPolicyViolationEvent.h>
75 #include <WebCore/ShareData.h>
76 #include <WebCore/TextManipulationController.h>
77 #include <WebCore/UserActivity.h>
78 #include <WebCore/UserContentTypes.h>
79 #include <WebCore/UserInterfaceLayoutDirection.h>
80 #include <WebCore/UserScriptTypes.h>
81 #include <WebCore/VisibilityState.h>
82 #include <WebCore/WebCoreKeyboardUIMode.h>
84 #include <pal/HysteresisActivity.h>
85 #include <wtf/HashMap.h>
86 #include <wtf/MonotonicTime.h>
87 #include <wtf/RefPtr.h>
88 #include <wtf/RunLoop.h>
89 #include <wtf/Seconds.h>
90 #include <wtf/WallTime.h>
91 #include <wtf/text/WTFString.h>
93 #if ENABLE(ACCESSIBILITY) && USE(ATK)
94 typedef struct _AtkObject AtkObject;
95 #include <wtf/glib/GRefPtr.h>
99 #include "ArgumentCodersGtk.h"
100 #include "WebPrintOperationGtk.h"
103 #if PLATFORM(IOS_FAMILY)
104 #include "GestureTypes.h"
105 #include <WebCore/IntPointHash.h>
106 #include <WebCore/ViewportConfiguration.h>
107 #include <WebCore/WKContentObservation.h>
110 #if ENABLE(APPLICATION_MANIFEST)
111 #include <WebCore/ApplicationManifest.h>
114 #if ENABLE(IOS_TOUCH_EVENTS)
115 #include <WebKitAdditions/PlatformTouchEventIOS.h>
116 #elif ENABLE(TOUCH_EVENTS)
117 #include <WebCore/PlatformTouchEvent.h>
120 #if ENABLE(DATA_DETECTION)
121 #include <WebCore/DataDetection.h>
124 #if ENABLE(MAC_GESTURE_EVENTS)
125 #include <WebKitAdditions/PlatformGestureEventMac.h>
129 #include "DynamicViewportSizeUpdate.h"
130 #include <WebCore/VisibleSelection.h>
131 #include <wtf/RetainPtr.h>
134 OBJC_CLASS NSDictionary;
136 OBJC_CLASS WKAccessibilityWebPageObject;
139 #define ENABLE_VIEWPORT_RESIZING PLATFORM(IOS_FAMILY)
148 class FormDataReference;
154 class DocumentLoader;
156 class FontAttributeChanges;
159 class FrameSelection;
161 class GraphicsContext;
162 class HTMLImageElement;
163 class HTMLMenuElement;
164 class HTMLMenuItemElement;
165 class HTMLPlugInElement;
166 class HTMLPlugInImageElement;
169 class MediaPlaybackTargetContext;
170 class MediaPlayerRequestInstallMissingPluginsCallback;
174 class ResourceRequest;
175 class ResourceResponse;
178 class SubstituteData;
179 class TextCheckingRequest;
180 class VisiblePosition;
182 enum SyntheticClickType : int8_t;
183 enum class DOMPasteAccessResponse : uint8_t;
184 enum class DragHandlingMethod : uint8_t;
185 enum class ShouldTreatAsContinuingLoad : bool;
186 enum class StorageAccessPromptWasShown : bool;
187 enum class StorageAccessWasGranted : bool;
188 enum class TextIndicatorPresentationTransition : uint8_t;
189 enum class WritingDirection : uint8_t;
191 struct BackForwardItemIdentifier;
192 struct CompositionUnderline;
193 struct DictationAlternative;
194 struct ElementContext;
195 struct GlobalFrameIdentifier;
196 struct GlobalWindowIdentifier;
198 struct KeypressCommand;
199 struct PromisedAttachmentInfo;
200 struct TextCheckingResult;
201 struct ViewportArguments;
203 #if ENABLE(ATTACHMENT_ELEMENT)
204 class HTMLAttachmentElement;
213 class FindController;
215 class GeolocationPermissionRequestManager;
216 class LayerHostingContext;
217 class MediaDeviceSandboxExtensions;
218 class NotificationPermissionRequestManager;
222 class RemoteWebInspectorUI;
223 class TextCheckingControllerProxy;
224 class UserMediaPermissionRequestManager;
225 class ViewGestureGeometryCollector;
226 class VisibleContentRectUpdateInfo;
227 class WebColorChooser;
228 class WebContextMenu;
229 class WebContextMenuItemData;
230 class WebDataListSuggestionPicker;
231 class WebDocumentLoader;
233 class PlaybackSessionManager;
234 class VideoFullscreenManager;
236 class WebFullScreenManager;
237 class WebGestureEvent;
240 class WebInspectorClient;
241 class WebInspectorUI;
242 class WebKeyboardEvent;
244 class WebNotificationClient;
245 class WebOpenPanelResultListener;
246 class WebPageGroupProxy;
247 class WebPageInspectorTargetController;
248 class WebPageOverlay;
249 class WebPaymentCoordinator;
251 class WebRemoteObjectRegistry;
253 class WebURLSchemeHandlerProxy;
255 class WebUserContentController;
257 class RemoteLayerTreeTransaction;
259 enum FindOptions : uint16_t;
260 enum class DragControllerAction : uint8_t;
261 enum class SyntheticEditingCommandType : uint8_t;
263 struct AttributedString;
264 struct BackForwardListItemState;
265 struct DataDetectionResult;
266 struct DocumentEditingContext;
267 struct DocumentEditingContextRequest;
270 struct InsertTextOptions;
271 struct InteractionInformationAtPosition;
272 struct InteractionInformationRequest;
273 struct LoadParameters;
275 struct TextInputContext;
277 struct WebAutocorrectionData;
278 struct WebAutocorrectionContext;
279 struct WebPageCreationParameters;
280 struct WebPreferencesStore;
281 struct WebSelectionData;
282 struct WebsitePoliciesData;
284 using SnapshotOptions = uint32_t;
285 using WKEventModifiers = uint32_t;
287 class WebPage : public API::ObjectImpl<API::Object::Type::BundlePage>, public IPC::MessageReceiver, public IPC::MessageSender, public CanMakeWeakPtr<WebPage> {
289 static Ref<WebPage> create(WebCore::PageIdentifier, WebPageCreationParameters&&);
293 void reinitializeWebPage(WebPageCreationParameters&&);
297 static WebPage& fromCorePage(WebCore::Page&);
299 WebCore::Page* corePage() const { return m_page.get(); }
300 WebCore::PageIdentifier identifier() const { return m_identifier; }
301 StorageNamespaceIdentifier sessionStorageNamespaceIdentifier() const { return makeObjectIdentifier<StorageNamespaceIdentifierType>(m_webPageProxyIdentifier.toUInt64()); }
302 PAL::SessionID sessionID() const;
303 bool usesEphemeralSession() const;
305 void setSize(const WebCore::IntSize&);
306 const WebCore::IntSize& size() const { return m_viewSize; }
307 WebCore::IntRect bounds() const { return WebCore::IntRect(WebCore::IntPoint(), size()); }
309 DrawingArea* drawingArea() const { return m_drawingArea.get(); }
311 #if ENABLE(ASYNC_SCROLLING)
312 WebCore::ScrollingCoordinator* scrollingCoordinator() const;
315 WebPageGroupProxy* pageGroup() const { return m_pageGroup.get(); }
317 void scrollMainFrameIfNotAtMaxScrollPosition(const WebCore::IntSize& scrollOffset);
319 bool scrollBy(uint32_t scrollDirection, uint32_t scrollGranularity);
321 void centerSelectionInVisibleArea();
324 void willCommitLayerTree(RemoteLayerTreeTransaction&);
325 void didFlushLayerTreeAtTime(MonotonicTime);
328 void layoutIfNeeded();
329 void updateRendering();
331 enum class LazyCreationPolicy { UseExistingOnly, CreateIfNeeded };
333 WebInspector* inspector(LazyCreationPolicy = LazyCreationPolicy::CreateIfNeeded);
334 WebInspectorUI* inspectorUI();
335 RemoteWebInspectorUI* remoteInspectorUI();
336 bool isInspectorPage() { return !!m_inspectorUI || !!m_remoteInspectorUI; }
338 void inspectorFrontendCountChanged(unsigned);
340 #if PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
341 PlaybackSessionManager& playbackSessionManager();
342 VideoFullscreenManager& videoFullscreenManager();
343 void videoControlsManagerDidChange();
346 #if PLATFORM(IOS_FAMILY)
347 void setAllowsMediaDocumentInlinePlayback(bool);
348 bool allowsMediaDocumentInlinePlayback() const { return m_allowsMediaDocumentInlinePlayback; }
351 #if ENABLE(FULLSCREEN_API)
352 WebFullScreenManager* fullScreenManager();
355 void addConsoleMessage(WebCore::FrameIdentifier, MessageSource, MessageLevel, const String&, uint64_t requestID = 0);
356 void sendCSPViolationReport(WebCore::FrameIdentifier, const URL& reportURL, IPC::FormDataReference&&);
357 void enqueueSecurityPolicyViolationEvent(WebCore::FrameIdentifier, WebCore::SecurityPolicyViolationEvent::Init&&);
359 // -- Called by the DrawingArea.
360 // FIXME: We could genericize these into a DrawingArea client interface. Would that be beneficial?
361 void drawRect(WebCore::GraphicsContext&, const WebCore::IntRect&);
363 // -- Called from WebCore clients.
364 bool handleEditingKeyboardEvent(WebCore::KeyboardEvent&);
366 void didStartPageTransition();
367 void didCompletePageTransition();
368 void didCommitLoad(WebFrame*);
369 void willReplaceMultipartContent(const WebFrame&);
370 void didReplaceMultipartContent(const WebFrame&);
371 void didFinishDocumentLoad(WebFrame&);
372 void didFinishLoad(WebFrame&);
374 String userAgent(const URL&) const;
375 String platformUserAgent(const URL&) const;
376 WebCore::KeyboardUIMode keyboardUIMode();
378 void didInsertMenuElement(WebCore::HTMLMenuElement&);
379 void didRemoveMenuElement(WebCore::HTMLMenuElement&);
380 void didInsertMenuItemElement(WebCore::HTMLMenuItemElement&);
381 void didRemoveMenuItemElement(WebCore::HTMLMenuItemElement&);
383 const String& overrideContentSecurityPolicy() const { return m_overrideContentSecurityPolicy; }
385 WebUndoStep* webUndoStep(WebUndoStepID);
386 void addWebUndoStep(WebUndoStepID, Ref<WebUndoStep>&&);
387 void removeWebEditCommand(WebUndoStepID);
388 bool isInRedo() const { return m_isInRedo; }
390 bool isAlwaysOnLoggingAllowed() const;
391 void setActivePopupMenu(WebPopupMenu*);
393 void setHiddenPageDOMTimerThrottlingIncreaseLimit(Seconds limit)
395 m_page->setDOMTimerAlignmentIntervalIncreaseLimit(limit);
398 #if ENABLE(INPUT_TYPE_COLOR)
399 WebColorChooser* activeColorChooser() const { return m_activeColorChooser; }
400 void setActiveColorChooser(WebColorChooser*);
401 void didChooseColor(const WebCore::Color&);
402 void didEndColorPicker();
405 #if ENABLE(DATALIST_ELEMENT)
406 void setActiveDataListSuggestionPicker(WebDataListSuggestionPicker*);
407 void didSelectDataListOption(const String&);
408 void didCloseSuggestions();
411 WebOpenPanelResultListener* activeOpenPanelResultListener() const { return m_activeOpenPanelResultListener.get(); }
412 void setActiveOpenPanelResultListener(Ref<WebOpenPanelResultListener>&&);
414 void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
415 void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override;
417 // -- InjectedBundle methods
418 #if ENABLE(CONTEXT_MENUS)
419 void setInjectedBundleContextMenuClient(std::unique_ptr<API::InjectedBundle::PageContextMenuClient>&&);
421 void setInjectedBundleEditorClient(std::unique_ptr<API::InjectedBundle::EditorClient>&&);
422 void setInjectedBundleFormClient(std::unique_ptr<API::InjectedBundle::FormClient>&&);
423 void setInjectedBundlePageLoaderClient(std::unique_ptr<API::InjectedBundle::PageLoaderClient>&&);
424 void initializeInjectedBundlePolicyClient(WKBundlePagePolicyClientBase*);
425 void setInjectedBundleResourceLoadClient(std::unique_ptr<API::InjectedBundle::ResourceLoadClient>&&);
426 void setInjectedBundleUIClient(std::unique_ptr<API::InjectedBundle::PageUIClient>&&);
427 #if ENABLE(FULLSCREEN_API)
428 void initializeInjectedBundleFullScreenClient(WKBundlePageFullScreenClientBase*);
431 #if ENABLE(CONTEXT_MENUS)
432 API::InjectedBundle::PageContextMenuClient& injectedBundleContextMenuClient() { return *m_contextMenuClient; }
434 API::InjectedBundle::EditorClient& injectedBundleEditorClient() { return *m_editorClient; }
435 API::InjectedBundle::FormClient& injectedBundleFormClient() { return *m_formClient; }
436 API::InjectedBundle::PageLoaderClient& injectedBundleLoaderClient() { return *m_loaderClient; }
437 InjectedBundlePagePolicyClient& injectedBundlePolicyClient() { return m_policyClient; }
438 API::InjectedBundle::ResourceLoadClient& injectedBundleResourceLoadClient() { return *m_resourceLoadClient; }
439 API::InjectedBundle::PageUIClient& injectedBundleUIClient() { return *m_uiClient; }
440 #if ENABLE(FULLSCREEN_API)
441 InjectedBundlePageFullScreenClient& injectedBundleFullScreenClient() { return m_fullScreenClient; }
444 bool findStringFromInjectedBundle(const String&, FindOptions);
445 void findStringMatchesFromInjectedBundle(const String&, FindOptions);
446 void replaceStringMatchesFromInjectedBundle(const Vector<uint32_t>& matchIndices, const String& replacementText, bool selectionOnly);
448 WebFrame* mainWebFrame() const { return m_mainFrame.get(); }
450 WebCore::Frame* mainFrame() const; // May return nullptr.
451 WebCore::FrameView* mainFrameView() const; // May return nullptr.
453 RefPtr<WebCore::Range> currentSelectionAsRange();
455 #if ENABLE(NETSCAPE_PLUGIN_API)
456 RefPtr<Plugin> createPlugin(WebFrame*, WebCore::HTMLPlugInElement*, const Plugin::Parameters&, String& newMIMEType);
460 WebCore::WebGLLoadPolicy webGLPolicyForURL(WebFrame*, const URL&);
461 WebCore::WebGLLoadPolicy resolveWebGLPolicyForURL(WebFrame*, const URL&);
464 enum class IncludePostLayoutDataHint { No, Yes };
465 EditorState editorState(IncludePostLayoutDataHint = IncludePostLayoutDataHint::Yes) const;
466 void updateEditorStateAfterLayoutIfEditabilityChanged();
468 // options are RenderTreeExternalRepresentationBehavior values.
469 String renderTreeExternalRepresentation(unsigned options = 0) const;
470 String renderTreeExternalRepresentationForPrinting() const;
471 uint64_t renderTreeSize() const;
473 void setTracksRepaints(bool);
474 bool isTrackingRepaints() const;
475 void resetTrackedRepaints();
476 Ref<API::Array> trackedRepaintRects();
478 void executeEditingCommand(const String& commandName, const String& argument);
479 bool isEditingCommandEnabled(const String& commandName);
480 void clearMainFrameName();
483 void suspendForProcessSwap();
485 void sendSetWindowFrame(const WebCore::FloatRect&);
487 double textZoomFactor() const;
488 void setTextZoomFactor(double);
489 double pageZoomFactor() const;
490 void setPageZoomFactor(double);
491 void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
492 void windowScreenDidChange(uint32_t);
493 String dumpHistoryForTesting(const String& directory);
496 void accessibilitySettingsDidChange();
498 void scalePage(double scale, const WebCore::IntPoint& origin);
499 void scalePageInViewCoordinates(double scale, WebCore::IntPoint centerInViewCoordinates);
500 double pageScaleFactor() const;
501 double totalScaleFactor() const;
502 double viewScaleFactor() const;
503 void scaleView(double scale);
505 void setUseFixedLayout(bool);
506 bool useFixedLayout() const { return m_useFixedLayout; }
507 bool setFixedLayoutSize(const WebCore::IntSize&);
508 WebCore::IntSize fixedLayoutSize() const;
510 void listenForLayoutMilestones(OptionSet<WebCore::LayoutMilestone>);
512 void setSuppressScrollbarAnimations(bool);
514 void setEnableVerticalRubberBanding(bool);
515 void setEnableHorizontalRubberBanding(bool);
517 void setBackgroundExtendsBeyondPage(bool);
519 void setPaginationMode(uint32_t /* WebCore::Pagination::Mode */);
520 void setPaginationBehavesLikeColumns(bool);
521 void setPageLength(double);
522 void setGapBetweenPages(double);
523 void setPaginationLineGridEnabled(bool);
525 void postInjectedBundleMessage(const String& messageName, const UserData&);
527 void setUnderlayColor(const WebCore::Color& color) { m_underlayColor = color; }
528 WebCore::Color underlayColor() const { return m_underlayColor; }
531 void stopLoadingFrame(WebCore::FrameIdentifier);
532 bool defersLoading() const;
533 void setDefersLoading(bool deferLoading);
535 void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*);
536 void exitAcceleratedCompositingMode();
538 void addPluginView(PluginView*);
539 void removePluginView(PluginView*);
541 bool isVisible() const { return m_activityState.contains(WebCore::ActivityState::IsVisible); }
542 bool isVisibleOrOccluded() const { return m_activityState.contains(WebCore::ActivityState::IsVisibleOrOccluded); }
544 LayerHostingMode layerHostingMode() const { return m_layerHostingMode; }
545 void setLayerHostingMode(LayerHostingMode);
548 void updatePluginsActiveAndFocusedState();
549 const WebCore::FloatRect& windowFrameInScreenCoordinates() const { return m_windowFrameInScreenCoordinates; }
550 const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates() const { return m_windowFrameInUnflippedScreenCoordinates; }
551 const WebCore::FloatRect& viewFrameInWindowCoordinates() const { return m_viewFrameInWindowCoordinates; }
553 bool hasCachedWindowFrame() const { return m_hasCachedWindowFrame; }
555 void updateHeaderAndFooterLayersForDeviceScaleChange(float scaleFactor);
559 void setTopOverhangImage(WebImage*);
560 void setBottomOverhangImage(WebImage*);
562 void setUseSystemAppearance(bool);
565 void effectiveAppearanceDidChange(bool useDarkAppearance, bool useElevatedUserInterfaceLevel);
567 bool windowIsFocused() const;
568 bool windowAndWebPageAreFocused() const;
570 #if !PLATFORM(IOS_FAMILY)
571 void setHeaderPageBanner(PageBanner*);
572 PageBanner* headerPageBanner();
573 void setFooterPageBanner(PageBanner*);
574 PageBanner* footerPageBanner();
576 void hidePageBanners();
577 void showPageBanners();
579 void setHeaderBannerHeightForTesting(int);
580 void setFooterBannerHeightForTesting(int);
583 WebCore::IntPoint screenToRootView(const WebCore::IntPoint&);
584 WebCore::IntRect rootViewToScreen(const WebCore::IntRect&);
585 WebCore::IntPoint accessibilityScreenToRootView(const WebCore::IntPoint&);
586 WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&);
588 RefPtr<WebImage> scaledSnapshotWithOptions(const WebCore::IntRect&, double additionalScaleFactor, SnapshotOptions);
590 static const WebEvent* currentEvent();
592 FindController& findController() { return m_findController.get(); }
594 #if ENABLE(GEOLOCATION)
595 GeolocationPermissionRequestManager& geolocationPermissionRequestManager() { return m_geolocationPermissionRequestManager.get(); }
598 #if PLATFORM(IOS_FAMILY)
599 void savePageState(WebCore::HistoryItem&);
600 void restorePageState(const WebCore::HistoryItem&);
603 #if ENABLE(MEDIA_STREAM)
604 UserMediaPermissionRequestManager& userMediaPermissionRequestManager() { return m_userMediaPermissionRequestManager; }
605 void captureDevicesChanged();
608 void elementDidFocus(WebCore::Element&);
609 void elementDidRefocus(WebCore::Element&);
610 void elementDidBlur(WebCore::Element&);
611 void focusedElementDidChangeInputMode(WebCore::Element&, WebCore::InputMode);
612 void resetFocusedElementForFrame(WebFrame*);
613 void updateInputContextAfterBlurringAndRefocusingElementIfNeeded(WebCore::Element&);
615 void disabledAdaptationsDidChange(const OptionSet<WebCore::DisabledAdaptations>&);
616 void viewportPropertiesDidChange(const WebCore::ViewportArguments&);
617 void executeEditCommandWithCallback(const String&, const String& argument, CallbackID);
620 void textInputContextsInRect(WebCore::FloatRect, CompletionHandler<void(const Vector<WebCore::ElementContext>&)>&&);
621 void focusTextInputContext(const WebCore::ElementContext&, CompletionHandler<void(bool)>&&);
623 #if PLATFORM(IOS_FAMILY)
624 WebCore::FloatSize screenSize() const;
625 WebCore::FloatSize availableScreenSize() const;
626 WebCore::FloatSize overrideScreenSize() const;
627 int32_t deviceOrientation() const { return m_deviceOrientation; }
628 void didReceiveMobileDocType(bool);
630 void setUseTestingViewportConfiguration(bool useTestingViewport) { m_useTestingViewportConfiguration = useTestingViewport; }
631 bool isUsingTestingViewportConfiguration() const { return m_useTestingViewportConfiguration; }
633 double minimumPageScaleFactor() const;
634 double maximumPageScaleFactor() const;
635 double maximumPageScaleFactorIgnoringAlwaysScalable() const;
636 bool allowsUserScaling() const;
637 bool hasStablePageScaleFactor() const { return m_hasStablePageScaleFactor; }
639 void handleTap(const WebCore::IntPoint&, OptionSet<WebKit::WebEvent::Modifier>, TransactionID lastLayerTreeTransactionId);
640 void potentialTapAtPosition(uint64_t requestID, const WebCore::FloatPoint&, bool shouldRequestMagnificationInformation);
641 void commitPotentialTap(OptionSet<WebKit::WebEvent::Modifier>, TransactionID lastLayerTreeTransactionId, WebCore::PointerID);
642 void commitPotentialTapFailed();
643 void cancelPotentialTap();
644 void cancelPotentialTapInFrame(WebFrame&);
645 void tapHighlightAtPosition(uint64_t requestID, const WebCore::FloatPoint&);
646 void didRecognizeLongPress();
647 void handleDoubleTapForDoubleClickAtPoint(const WebCore::IntPoint&, OptionSet<WebKit::WebEvent::Modifier>, TransactionID lastLayerTreeTransactionId);
649 void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&);
650 void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&);
652 void blurFocusedElement();
653 void requestFocusedElementInformation(CallbackID);
654 void selectWithGesture(const WebCore::IntPoint&, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithFocusedElement, CallbackID);
655 void updateSelectionWithTouches(const WebCore::IntPoint&, uint32_t touches, bool baseIsStart, CallbackID);
656 void selectWithTwoTouches(const WebCore::IntPoint& from, const WebCore::IntPoint& to, uint32_t gestureType, uint32_t gestureState, CallbackID);
657 void extendSelection(uint32_t granularity);
658 void selectWordBackward();
659 void moveSelectionByOffset(int32_t offset, CallbackID);
660 void selectTextWithGranularityAtPoint(const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithFocusedElement, CallbackID);
661 void selectPositionAtBoundaryWithDirection(const WebCore::IntPoint&, uint32_t granularity, uint32_t direction, bool isInteractingWithFocusedElement, CallbackID);
662 void moveSelectionAtBoundaryWithDirection(uint32_t granularity, uint32_t direction, CallbackID);
663 void selectPositionAtPoint(const WebCore::IntPoint&, bool isInteractingWithFocusedElement, CallbackID);
664 void beginSelectionInDirection(uint32_t direction, CallbackID);
665 void updateSelectionWithExtentPoint(const WebCore::IntPoint&, bool isInteractingWithFocusedElement, CallbackID);
666 void updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithFocusedElement, CallbackID);
668 void requestDictationContext(CallbackID);
669 void replaceDictatedText(const String& oldText, const String& newText);
670 void replaceSelectedText(const String& oldText, const String& newText);
671 void requestAutocorrectionData(const String& textForAutocorrection, CompletionHandler<void(WebAutocorrectionData)>&& reply);
672 void applyAutocorrection(const String& correction, const String& originalText, CallbackID);
673 void syncApplyAutocorrection(const String& correction, const String& originalText, CompletionHandler<void(bool)>&&);
674 void requestAutocorrectionContext();
675 void getPositionInformation(const InteractionInformationRequest&, CompletionHandler<void(InteractionInformationAtPosition&&)>&&);
676 void requestPositionInformation(const InteractionInformationRequest&);
677 void startInteractionWithElementContextOrPosition(Optional<WebCore::ElementContext>&&, WebCore::IntPoint&&);
678 void stopInteraction();
679 void performActionOnElement(uint32_t action);
680 void focusNextFocusedElement(bool isForward, CallbackID);
681 void autofillLoginCredentials(const String&, const String&);
682 void setFocusedElementValue(const String&);
683 void setFocusedElementValueAsNumber(double);
684 void setFocusedElementSelectedIndex(uint32_t index, bool allowMultipleSelection);
685 void setIsShowingInputViewForFocusedElement(bool);
686 bool isShowingInputViewForFocusedElement() const { return m_isShowingInputViewForFocusedElement; }
687 void updateSelectionAppearance();
688 void getSelectionContext(CallbackID);
689 void handleTwoFingerTapAtPoint(const WebCore::IntPoint&, OptionSet<WebKit::WebEvent::Modifier>, uint64_t requestID);
690 void handleStylusSingleTapAtPoint(const WebCore::IntPoint&, uint64_t requestID);
691 void getRectsForGranularityWithSelectionOffset(uint32_t, int32_t, CallbackID);
692 void getRectsAtSelectionOffsetWithText(int32_t, const String&, CallbackID);
693 void storeSelectionForAccessibility(bool);
694 void startAutoscrollAtPosition(const WebCore::FloatPoint&);
695 void cancelAutoscroll();
696 void requestEvasionRectsAboveSelection(CompletionHandler<void(const Vector<WebCore::FloatRect>&)>&&);
698 void contentSizeCategoryDidChange(const String&);
700 Seconds eventThrottlingDelay() const;
702 void showInspectorHighlight(const WebCore::Highlight&);
703 void hideInspectorHighlight();
705 void showInspectorIndication();
706 void hideInspectorIndication();
708 void enableInspectorNodeSearch();
709 void disableInspectorNodeSearch();
711 bool forceAlwaysUserScalable() const { return m_forceAlwaysUserScalable; }
712 void setForceAlwaysUserScalable(bool);
714 void updateSelectionWithDelta(int64_t locationDelta, int64_t lengthDelta, CompletionHandler<void()>&&);
715 void requestDocumentEditingContext(WebKit::DocumentEditingContextRequest, CompletionHandler<void(WebKit::DocumentEditingContext)>&&);
718 #if PLATFORM(IOS_FAMILY) && ENABLE(IOS_TOUCH_EVENTS)
719 void dispatchAsynchronousTouchEvents(const Vector<WebTouchEvent, 1>& queue);
722 bool hasRichlyEditableSelection() const;
724 enum class LayerTreeFreezeReason {
725 PageTransition = 1 << 0,
726 BackgroundApplication = 1 << 1,
727 ProcessSuspended = 1 << 2,
728 PageSuspended = 1 << 3,
730 ProcessSwap = 1 << 5,
732 void freezeLayerTree(LayerTreeFreezeReason);
733 void unfreezeLayerTree(LayerTreeFreezeReason);
735 void markLayersVolatile(Function<void(bool)>&& completionHandler = { });
736 void cancelMarkLayersVolatile();
738 NotificationPermissionRequestManager* notificationPermissionRequestManager();
740 void pageDidScroll();
742 #if ENABLE(CONTEXT_MENUS)
743 WebContextMenu* contextMenu();
744 WebContextMenu* contextMenuAtPointInWindow(const WebCore::IntPoint&);
747 bool hasLocalDataForURL(const URL&);
749 static bool canHandleRequest(const WebCore::ResourceRequest&);
751 class SandboxExtensionTracker {
753 ~SandboxExtensionTracker();
757 void beginLoad(WebFrame*, SandboxExtension::Handle&&);
758 void beginReload(WebFrame*, SandboxExtension::Handle&&);
759 void willPerformLoadDragDestinationAction(RefPtr<SandboxExtension>&& pendingDropSandboxExtension);
760 void didStartProvisionalLoad(WebFrame*);
761 void didCommitProvisionalLoad(WebFrame*);
762 void didFailProvisionalLoad(WebFrame*);
765 void setPendingProvisionalSandboxExtension(RefPtr<SandboxExtension>&&);
766 bool shouldReuseCommittedSandboxExtension(WebFrame*);
768 RefPtr<SandboxExtension> m_pendingProvisionalSandboxExtension;
769 RefPtr<SandboxExtension> m_provisionalSandboxExtension;
770 RefPtr<SandboxExtension> m_committedSandboxExtension;
773 SandboxExtensionTracker& sandboxExtensionTracker() { return m_sandboxExtensionTracker; }
776 void setComposition(const String&, const Vector<WebCore::CompositionUnderline>&, const EditingRange& selectionRange);
777 void confirmComposition(const String& text);
779 void collapseSelectionInFrame(WebCore::FrameIdentifier);
780 void showEmojiPicker(WebCore::Frame&);
782 void getCenterForZoomGesture(const WebCore::IntPoint& centerInViewCoordinates, CompletionHandler<void(WebCore::IntPoint&&)>&&);
785 void didApplyStyle();
786 void didChangeSelection();
787 void didChangeOverflowScrollPosition();
788 void didChangeContents();
789 void discardedComposition();
790 void canceledComposition();
791 void didUpdateComposition();
792 void didEndUserTriggeredSelectionChanges();
795 void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
796 WKAccessibilityWebPageObject* accessibilityRemoteObject();
797 NSObject *accessibilityObjectForMainFramePlugin();
798 const WebCore::FloatPoint& accessibilityPosition() const { return m_accessibilityPosition; }
800 void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
802 void setTextAsync(const String&);
803 void insertTextAsync(const String& text, const EditingRange& replacementRange, InsertTextOptions&&);
804 void hasMarkedText(CompletionHandler<void(bool)>&&);
805 void getMarkedRangeAsync(CallbackID);
806 void getSelectedRangeAsync(CallbackID);
807 void characterIndexForPointAsync(const WebCore::IntPoint&, CallbackID);
808 void firstRectForCharacterRangeAsync(const EditingRange&, CallbackID);
809 void setCompositionAsync(const String& text, const Vector<WebCore::CompositionUnderline>& underlines, const EditingRange& selectionRange, const EditingRange& replacementRange);
810 void confirmCompositionAsync();
812 void readSelectionFromPasteboard(const String& pasteboardName, CompletionHandler<void(bool&&)>&&);
813 void getStringSelectionForPasteboard(CompletionHandler<void(String&&)>&&);
814 void getDataSelectionForPasteboard(const String pasteboardType, CompletionHandler<void(SharedMemory::Handle&&, uint64_t)>&&);
815 void shouldDelayWindowOrderingEvent(const WebKit::WebMouseEvent&, CompletionHandler<void(bool)>&&);
816 void acceptsFirstMouse(int eventNumber, const WebKit::WebMouseEvent&, CompletionHandler<void(bool)>&&);
817 bool performNonEditingBehaviorForSelector(const String&, WebCore::KeyboardEvent*);
821 void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::DictationAlternative>& dictationAlternativeLocations, bool registerUndoGroup = false);
822 void attributedSubstringForCharacterRangeAsync(const EditingRange&, CallbackID);
823 void fontAtSelection(CallbackID);
826 #if PLATFORM(COCOA) && ENABLE(SERVICE_CONTROLS)
827 void replaceSelectionWithPasteboardData(const Vector<String>& types, const IPC::DataReference&);
830 void setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length, bool suppressUnderline);
831 bool hasCompositionForTesting();
832 void confirmCompositionForTesting(const String& compositionString);
836 void speak(const String&);
839 void performDictionaryLookupForSelection(WebCore::Frame&, const WebCore::VisibleSelection&, WebCore::TextIndicatorPresentationTransition);
842 bool isSmartInsertDeleteEnabled();
843 void setSmartInsertDeleteEnabled(bool);
845 bool isSelectTrailingWhitespaceEnabled() const;
846 void setSelectTrailingWhitespaceEnabled(bool);
848 void replaceSelectionWithText(WebCore::Frame*, const String&);
849 void clearSelection();
850 void restoreSelectionInFocusedEditableElement();
852 #if ENABLE(DRAG_SUPPORT) && PLATFORM(GTK)
853 void performDragControllerAction(DragControllerAction, const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t draggingSourceOperationMask, WebSelectionData&&, uint32_t flags);
856 #if ENABLE(DRAG_SUPPORT) && !PLATFORM(GTK)
857 void performDragControllerAction(DragControllerAction, const WebCore::DragData&, SandboxExtension::Handle&&, SandboxExtension::HandleArray&&);
860 #if ENABLE(DRAG_SUPPORT)
861 void dragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation);
863 void willPerformLoadDragDestinationAction();
864 void mayPerformUploadDragDestinationAction();
866 void willStartDrag() { ASSERT(!m_isStartingDrag); m_isStartingDrag = true; }
868 void dragCancelled();
869 WebCore::DragSourceAction allowedDragSourceActions() const { return m_allowedDragSourceActions; }
872 void beginPrinting(WebCore::FrameIdentifier, const PrintInfo&);
874 void computePagesForPrinting(WebCore::FrameIdentifier, const PrintInfo&, CallbackID);
875 void computePagesForPrintingImpl(WebCore::FrameIdentifier, const PrintInfo&, Vector<WebCore::IntRect>& pageRects, double& totalScaleFactor, WebCore::FloatBoxExtent& computedMargin);
878 void drawRectToImage(WebCore::FrameIdentifier, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, CallbackID);
879 void drawPagesToPDF(WebCore::FrameIdentifier, const PrintInfo&, uint32_t first, uint32_t count, CallbackID);
880 void drawPagesToPDFImpl(WebCore::FrameIdentifier, const PrintInfo&, uint32_t first, uint32_t count, RetainPtr<CFMutableDataRef>& pdfPageData);
883 #if PLATFORM(IOS_FAMILY)
884 void computePagesForPrintingAndDrawToPDF(WebCore::FrameIdentifier, const PrintInfo&, CallbackID, Messages::WebPage::ComputePagesForPrintingAndDrawToPDFDelayedReply&&);
887 void drawToPDF(WebCore::FrameIdentifier, const Optional<WebCore::FloatRect>&, CallbackID);
890 void drawPagesForPrinting(WebCore::FrameIdentifier, const PrintInfo&, CallbackID);
891 void didFinishPrintOperation(const WebCore::ResourceError&, CallbackID);
894 void addResourceRequest(unsigned long, const WebCore::ResourceRequest&);
895 void removeResourceRequest(unsigned long);
897 void setMediaVolume(float);
898 void setMuted(WebCore::MediaProducer::MutedStateFlags);
899 void setMayStartMediaWhenInWindow(bool);
900 void stopMediaCapture();
902 #if ENABLE(MEDIA_SESSION)
903 void handleMediaEvent(uint32_t /* WebCore::MediaEventType */);
904 void setVolumeOfMediaElement(double, uint64_t);
907 void updateMainFrameScrollOffsetPinning();
909 bool mainFrameHasCustomContentProvider() const;
910 void addMIMETypeWithCustomContentProvider(const String&);
912 void mainFrameDidLayout();
914 bool canRunBeforeUnloadConfirmPanel() const { return m_canRunBeforeUnloadConfirmPanel; }
915 void setCanRunBeforeUnloadConfirmPanel(bool canRunBeforeUnloadConfirmPanel) { m_canRunBeforeUnloadConfirmPanel = canRunBeforeUnloadConfirmPanel; }
917 bool canRunModal() const { return m_canRunModal; }
918 void setCanRunModal(bool canRunModal) { m_canRunModal = canRunModal; }
922 void setDeviceScaleFactor(float);
923 float deviceScaleFactor() const;
925 void forceRepaintWithoutCallback();
927 void unmarkAllMisspellings();
928 void unmarkAllBadGrammar();
931 void handleAlternativeTextUIResult(const String&);
934 // For testing purpose.
935 void simulateMouseDown(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, WallTime);
936 void simulateMouseUp(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, WallTime);
937 void simulateMouseMotion(WebCore::IntPoint, WallTime);
939 #if ENABLE(CONTEXT_MENUS)
940 void contextMenuShowing() { m_isShowingContextMenu = true; }
943 void wheelEvent(const WebWheelEvent&);
945 void wheelEventHandlersChanged(bool);
946 void recomputeShortCircuitHorizontalWheelEventsState();
948 #if ENABLE(MAC_GESTURE_EVENTS)
949 void gestureEvent(const WebGestureEvent&);
952 void updateVisibilityState(bool isInitialState = false);
954 #if PLATFORM(IOS_FAMILY)
955 void setViewportConfigurationViewLayoutSize(const WebCore::FloatSize&, double scaleFactor, double minimumEffectiveDeviceWidth);
956 void setMaximumUnobscuredSize(const WebCore::FloatSize&);
957 void setDeviceOrientation(int32_t);
958 void setOverrideViewportArguments(const Optional<WebCore::ViewportArguments>&);
959 void dynamicViewportSizeUpdate(const WebCore::FloatSize& viewLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& targetUnobscuredSafeAreaInsets, double scale, int32_t deviceOrientation, DynamicViewportSizeUpdateID);
960 Optional<float> scaleFromUIProcess(const VisibleContentRectUpdateInfo&) const;
961 void updateVisibleContentRects(const VisibleContentRectUpdateInfo&, MonotonicTime oldestTimestamp);
962 bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; }
963 void willStartUserTriggeredZooming();
964 void applicationWillResignActive();
965 void applicationDidEnterBackground(bool isSuspendedUnderLock);
966 void applicationDidFinishSnapshottingAfterEnteringBackground();
967 void applicationWillEnterForeground(bool isSuspendedUnderLock);
968 void applicationDidBecomeActive();
969 void didFinishContentChangeObserving(WKContentChange);
971 bool platformPrefersTextLegibilityBasedZoomScaling() const;
972 const WebCore::ViewportConfiguration& viewportConfiguration() const { return m_viewportConfiguration; }
974 void hardwareKeyboardAvailabilityChanged(bool keyboardIsAttached);
976 void updateStringForFind(const String&);
978 bool canShowWhileLocked() const { return m_canShowWhileLocked; }
981 #if ENABLE(IOS_TOUCH_EVENTS)
982 void dispatchTouchEvent(const WebTouchEvent&, bool& handled);
985 bool shouldUseCustomContentProviderForResponse(const WebCore::ResourceResponse&);
987 bool asynchronousPluginInitializationEnabled() const { return m_asynchronousPluginInitializationEnabled; }
988 void setAsynchronousPluginInitializationEnabled(bool enabled) { m_asynchronousPluginInitializationEnabled = enabled; }
989 bool asynchronousPluginInitializationEnabledForAllPlugins() const { return m_asynchronousPluginInitializationEnabledForAllPlugins; }
990 void setAsynchronousPluginInitializationEnabledForAllPlugins(bool enabled) { m_asynchronousPluginInitializationEnabledForAllPlugins = enabled; }
991 bool artificialPluginInitializationDelayEnabled() const { return m_artificialPluginInitializationDelayEnabled; }
992 void setArtificialPluginInitializationDelayEnabled(bool enabled) { m_artificialPluginInitializationDelayEnabled = enabled; }
993 void setTabToLinksEnabled(bool enabled) { m_tabToLinks = enabled; }
994 bool tabToLinksEnabled() const { return m_tabToLinks; }
996 bool scrollingPerformanceLoggingEnabled() const { return m_scrollingPerformanceLoggingEnabled; }
997 void setScrollingPerformanceLoggingEnabled(bool);
1000 bool shouldUsePDFPlugin() const;
1001 bool pdfPluginEnabled() const { return m_pdfPluginEnabled; }
1002 void setPDFPluginEnabled(bool enabled) { m_pdfPluginEnabled = enabled; }
1004 NSDictionary *dataDetectionContext() const { return m_dataDetectionContext.get(); }
1007 void savePDFToFileInDownloadsFolder(const String& suggestedFilename, const URL& originatingURL, const uint8_t* data, unsigned long size);
1010 void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
1013 bool mainFrameIsScrollable() const { return m_mainFrameIsScrollable; }
1015 void setAlwaysShowsHorizontalScroller(bool);
1016 void setAlwaysShowsVerticalScroller(bool);
1018 bool alwaysShowsHorizontalScroller() const { return m_alwaysShowsHorizontalScroller; };
1019 bool alwaysShowsVerticalScroller() const { return m_alwaysShowsVerticalScroller; };
1021 void setMinimumSizeForAutoLayout(const WebCore::IntSize&);
1022 WebCore::IntSize minimumSizeForAutoLayout() const { return m_minimumSizeForAutoLayout; }
1024 void setAutoSizingShouldExpandToViewHeight(bool shouldExpand);
1025 bool autoSizingShouldExpandToViewHeight() { return m_autoSizingShouldExpandToViewHeight; }
1027 void setViewportSizeForCSSViewportUnits(Optional<WebCore::IntSize>);
1028 Optional<WebCore::IntSize> viewportSizeForCSSViewportUnits() const { return m_viewportSizeForCSSViewportUnits; }
1030 bool canShowMIMEType(const String& MIMEType) const;
1031 bool canShowResponse(const WebCore::ResourceResponse&) const;
1033 void addTextCheckingRequest(uint64_t requestID, Ref<WebCore::TextCheckingRequest>&&);
1034 void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
1035 void didCancelCheckingText(uint64_t requestID);
1037 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
1038 void determinePrimarySnapshottedPlugIn();
1039 void determinePrimarySnapshottedPlugInTimerFired();
1040 void resetPrimarySnapshottedPlugIn();
1041 bool matchesPrimaryPlugIn(const String& pageOrigin, const String& pluginOrigin, const String& mimeType) const;
1042 bool plugInIntersectsSearchRect(WebCore::HTMLPlugInImageElement& pluginImageElement);
1043 bool plugInIsPrimarySize(WebCore::HTMLPlugInImageElement& pluginImageElement, unsigned &pluginArea);
1046 #if ENABLE(DATA_DETECTION)
1047 void setDataDetectionResults(NSArray *);
1048 void detectDataInAllFrames(uint64_t, CompletionHandler<void(const DataDetectionResult&)>&&);
1049 void removeDataDetectedLinks(CompletionHandler<void(const DataDetectionResult&)>&&);
1052 unsigned extendIncrementalRenderingSuppression();
1053 void stopExtendingIncrementalRenderingSuppression(unsigned token);
1054 bool shouldExtendIncrementalRenderingSuppression() { return !m_activeRenderingSuppressionTokens.isEmpty(); }
1056 WebCore::ScrollPinningBehavior scrollPinningBehavior() { return m_scrollPinningBehavior; }
1057 void setScrollPinningBehavior(uint32_t /* WebCore::ScrollPinningBehavior */ pinning);
1059 Optional<WebCore::ScrollbarOverlayStyle> scrollbarOverlayStyle() { return m_scrollbarOverlayStyle; }
1060 void setScrollbarOverlayStyle(Optional<uint32_t /* WebCore::ScrollbarOverlayStyle */> scrollbarStyle);
1062 Ref<WebCore::DocumentLoader> createDocumentLoader(WebCore::Frame&, const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
1063 void updateCachedDocumentLoader(WebDocumentLoader&, WebCore::Frame&);
1065 void getBytecodeProfile(CallbackID);
1066 void getSamplingProfilerOutput(CallbackID);
1068 #if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION)
1069 void handleTelephoneNumberClick(const String& number, const WebCore::IntPoint&);
1070 void handleSelectionServiceClick(WebCore::FrameSelection&, const Vector<String>& telephoneNumbers, const WebCore::IntPoint&);
1073 void didChangeScrollOffsetForFrame(WebCore::Frame*);
1075 void setMainFrameProgressCompleted(bool completed) { m_mainFrameProgressCompleted = completed; }
1076 bool shouldDispatchFakeMouseMoveEvents() const { return m_shouldDispatchFakeMouseMoveEvents; }
1078 void postMessage(const String& messageName, API::Object* messageBody);
1079 void postSynchronousMessageForTesting(const String& messageName, API::Object* messageBody, RefPtr<API::Object>& returnData);
1080 void postMessageIgnoringFullySynchronousMode(const String& messageName, API::Object* messageBody);
1083 void setInputMethodState(bool);
1086 void imageOrMediaDocumentSizeChanged(const WebCore::IntSize&);
1088 #if ENABLE(VIDEO) && USE(GSTREAMER)
1089 void requestInstallMissingMediaPlugins(const String& details, const String& description, WebCore::MediaPlayerRequestInstallMissingPluginsCallback&);
1092 void addUserScript(String&& source, WebCore::UserContentInjectedFrames, WebCore::UserScriptInjectionTime);
1093 void addUserStyleSheet(const String& source, WebCore::UserContentInjectedFrames);
1094 void removeAllUserContent();
1096 void dispatchDidReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone>);
1098 void didRestoreScrollPosition();
1100 bool isControlledByAutomation() const;
1101 void setControlledByAutomation(bool);
1103 void connectInspector(const String& targetId, Inspector::FrontendChannel::ConnectionType);
1104 void disconnectInspector(const String& targetId);
1105 void sendMessageToTargetBackend(const String& targetId, const String& message);
1107 void insertNewlineInQuotedContent();
1110 WallTime loadCommitTime() const { return m_loadCommitTime; }
1114 void gamepadActivity(const Vector<GamepadData>&, bool shouldMakeGamepadsVisible);
1117 #if ENABLE(POINTER_LOCK)
1118 void didAcquirePointerLock();
1119 void didNotAcquirePointerLock();
1120 void didLosePointerLock();
1123 void didGetLoadDecisionForIcon(bool decision, CallbackID loadIdentifier, OptionalCallbackID);
1124 void setUseIconLoadingClient(bool);
1126 #if PLATFORM(IOS_FAMILY) && ENABLE(DRAG_SUPPORT)
1127 void didConcludeEditDrag();
1128 void didConcludeDrop();
1131 void didFinishLoadingImageForElement(WebCore::HTMLImageElement&);
1133 WebURLSchemeHandlerProxy* urlSchemeHandlerForScheme(const String&);
1134 void stopAllURLSchemeTasks();
1136 Optional<double> cpuLimit() const { return m_cpuLimit; }
1138 static PluginView* pluginViewForFrame(WebCore::Frame*);
1140 void flushPendingEditorStateUpdate();
1142 #if ENABLE(RESOURCE_LOAD_STATISTICS)
1143 void hasStorageAccess(WebCore::RegistrableDomain&& subFrameDomain, WebCore::RegistrableDomain&& topFrameDomain, WebFrame&, CompletionHandler<void(bool)>&&);
1144 void requestStorageAccess(WebCore::RegistrableDomain&& subFrameDomain, WebCore::RegistrableDomain&& topFrameDomain, WebFrame&, CompletionHandler<void(WebCore::StorageAccessWasGranted, WebCore::StorageAccessPromptWasShown)>&&);
1145 void wasLoadedWithDataTransferFromPrevalentResource();
1148 #if ENABLE(DEVICE_ORIENTATION)
1149 void shouldAllowDeviceOrientationAndMotionAccess(WebCore::FrameIdentifier, WebCore::SecurityOriginData&&, bool mayPrompt, CompletionHandler<void(WebCore::DeviceOrientationOrMotionPermissionState)>&&);
1152 void showShareSheet(WebCore::ShareDataWithParsedURL&, CompletionHandler<void(bool)>&& callback);
1153 void didCompleteShareSheet(bool wasCompleted, ShareSheetCallbackID contextId);
1155 #if ENABLE(ATTACHMENT_ELEMENT)
1156 void insertAttachment(const String& identifier, Optional<uint64_t>&& fileSize, const String& fileName, const String& contentType, CallbackID);
1157 void updateAttachmentAttributes(const String& identifier, Optional<uint64_t>&& fileSize, const String& contentType, const String& fileName, const IPC::DataReference& enclosingImageData, CallbackID);
1160 #if ENABLE(APPLICATION_MANIFEST)
1161 void getApplicationManifest(CallbackID);
1162 void didFinishLoadingApplicationManifest(uint64_t, const Optional<WebCore::ApplicationManifest>&);
1165 #if USE(WPE_RENDERER)
1166 int hostFileDescriptor() const { return m_hostFileDescriptor.fileDescriptor(); }
1169 void updateCurrentModifierState(OptionSet<WebCore::PlatformEvent::Modifier> modifiers);
1171 UserContentControllerIdentifier userContentControllerIdentifier() const { return m_userContentController->identifier(); }
1173 WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() const { return m_userInterfaceLayoutDirection; }
1175 bool isSuspended() const { return m_isSuspended; }
1177 void didReceiveWebPageMessage(IPC::Connection&, IPC::Decoder&);
1179 template<typename T>
1180 bool sendSyncWithDelayedReply(T&& message, typename T::Reply&& reply)
1182 cancelGesturesBlockedOnSynchronousReplies();
1183 return sendSync(WTFMove(message), WTFMove(reply), Seconds::infinity(), IPC::SendSyncOption::InformPlatformProcessWillSuspend);
1186 WebCore::DOMPasteAccessResponse requestDOMPasteAccess(const String& originIdentifier);
1187 WebCore::IntRect rectForElementAtInteractionLocation() const;
1189 const Optional<WebCore::Color>& backgroundColor() const { return m_backgroundColor; }
1191 void suspendAllMediaBuffering();
1192 void resumeAllMediaBuffering();
1194 void configureLoggingChannel(const String&, WTFLogChannelState, WTFLogLevel);
1196 WebCore::Element* elementForContext(const WebCore::ElementContext&) const;
1197 Optional<WebCore::ElementContext> contextForElement(WebCore::Element&) const;
1199 void startTextManipulations(Vector<WebCore::TextManipulationController::ExclusionRule>&&, CompletionHandler<void()>&&);
1200 void completeTextManipulation(WebCore::TextManipulationController::ItemIdentifier,
1201 const Vector<WebCore::TextManipulationController::ManipulationToken>&,
1202 CompletionHandler<void(WebCore::TextManipulationController::ManipulationResult)>&&);
1204 #if ENABLE(APPLE_PAY)
1205 WebPaymentCoordinator* paymentCoordinator();
1208 #if ENABLE(PLATFORM_DRIVEN_TEXT_CHECKING)
1209 TextCheckingControllerProxy& textCheckingController() { return m_textCheckingControllerProxy.get(); }
1213 void setRemoteObjectRegistry(WebRemoteObjectRegistry*);
1214 WebRemoteObjectRegistry* remoteObjectRegistry();
1217 WebPageProxyIdentifier webPageProxyIdentifier() const { return m_webPageProxyIdentifier; }
1219 void updateIntrinsicContentSizeIfNeeded(const WebCore::IntSize&);
1220 void scheduleFullEditorStateUpdate();
1221 bool isThrottleable() const;
1223 bool userIsInteracting() const { return m_userIsInteracting; }
1224 void setUserIsInteracting(bool userIsInteracting) { m_userIsInteracting = userIsInteracting; }
1226 bool firstFlushAfterCommit() const { return m_firstFlushAfterCommit; }
1227 void setFirstFlushAfterCommit(bool f) { m_firstFlushAfterCommit = f; }
1229 #if PLATFORM(IOS_FAMILY)
1230 // This excludes layout overflow, includes borders.
1231 static WebCore::IntRect rootViewBoundsForElement(const WebCore::Element&);
1232 // These include layout overflow for overflow:visible elements, but exclude borders.
1233 static WebCore::IntRect absoluteInteractionBoundsForElement(const WebCore::Element&);
1234 static WebCore::IntRect rootViewInteractionBoundsForElement(const WebCore::Element&);
1235 #endif // PLATFORM(IOS_FAMILY)
1238 void didStartLoadForQuickLookDocumentInMainFrame(const String& fileName, const String& uti);
1239 void didFinishLoadForQuickLookDocumentInMainFrame(const WebCore::SharedBuffer&);
1240 void requestPasswordForQuickLookDocumentInMainFrame(const String& fileName, CompletionHandler<void(const String&)>&&);
1244 WebPage(WebCore::PageIdentifier, WebPageCreationParameters&&);
1246 void updateThrottleState();
1248 // IPC::MessageSender
1249 IPC::Connection* messageSenderConnection() const override;
1250 uint64_t messageSenderDestinationID() const override;
1252 void platformInitialize();
1253 void platformReinitialize();
1254 void platformDetach();
1255 void platformEditorState(WebCore::Frame&, EditorState& result, IncludePostLayoutDataHint) const;
1256 void platformWillPerformEditingCommand();
1257 void sendEditorStateUpdate();
1260 void sendTouchBarMenuDataAddedUpdate(WebCore::HTMLMenuElement&);
1261 void sendTouchBarMenuDataRemovedUpdate(WebCore::HTMLMenuElement&);
1262 void sendTouchBarMenuItemDataAddedUpdate(WebCore::HTMLMenuItemElement&);
1263 void sendTouchBarMenuItemDataRemovedUpdate(WebCore::HTMLMenuItemElement&);
1266 void didReceiveSyncWebPageMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&);
1268 #if PLATFORM(IOS_FAMILY)
1269 void resetViewportDefaultConfiguration(WebFrame* mainFrame, bool hasMobileDocType = false);
1270 enum class ZoomToInitialScale { No, Yes };
1271 void viewportConfigurationChanged(ZoomToInitialScale = ZoomToInitialScale::No);
1272 void updateViewportSizeForCSSViewportUnits();
1274 static void convertSelectionRectsToRootView(WebCore::FrameView*, Vector<WebCore::SelectionRect>&);
1276 void getFocusedElementInformation(FocusedElementInformation&);
1277 void platformInitializeAccessibility();
1278 void generateSyntheticEditingCommand(SyntheticEditingCommandType);
1279 void handleSyntheticClick(WebCore::Node& nodeRespondingToClick, const WebCore::FloatPoint& location, OptionSet<WebKit::WebEvent::Modifier>, WebCore::PointerID = WebCore::mousePointerID);
1280 void completeSyntheticClick(WebCore::Node& nodeRespondingToClick, const WebCore::FloatPoint& location, OptionSet<WebKit::WebEvent::Modifier>, WebCore::SyntheticClickType, WebCore::PointerID = WebCore::mousePointerID);
1281 void sendTapHighlightForNodeIfNecessary(uint64_t requestID, WebCore::Node*);
1282 WebCore::VisiblePosition visiblePositionInFocusedNodeForPoint(const WebCore::Frame&, const WebCore::IntPoint&, bool isInteractingWithFocusedElement);
1283 RefPtr<WebCore::Range> rangeForGranularityAtPoint(WebCore::Frame&, const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithFocusedElement);
1284 void setFocusedFrameBeforeSelectingTextAtLocation(const WebCore::IntPoint&);
1285 void dispatchSyntheticMouseEventsForSelectionGesture(SelectionTouch, const WebCore::IntPoint&);
1287 void sendPositionInformation(InteractionInformationAtPosition&&);
1288 InteractionInformationAtPosition positionInformation(const InteractionInformationRequest&);
1289 RefPtr<ShareableBitmap> shareableBitmapSnapshotForNode(WebCore::Element&);
1290 WebAutocorrectionContext autocorrectionContext();
1291 bool applyAutocorrectionInternal(const String& correction, const String& originalText);
1292 bool shouldIgnoreMetaViewport() const;
1294 #if ENABLE(TEXT_AUTOSIZING)
1295 void textAutoSizingAdjustmentTimerFired();
1296 void resetTextAutosizing();
1297 void resetIdempotentTextAutosizingIfNeeded(double previousInitialScale);
1300 #if ENABLE(VIEWPORT_RESIZING)
1301 void scheduleShrinkToFitContent();
1302 void shrinkToFitContentTimerFired();
1303 bool immediatelyShrinkToFitContent();
1306 #if PLATFORM(IOS_FAMILY) && ENABLE(DATA_INTERACTION)
1307 void requestDragStart(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t allowedActions);
1308 void requestAdditionalItemsForDragSession(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t allowedActions);
1309 void insertDroppedImagePlaceholders(const Vector<WebCore::IntSize>&, CompletionHandler<void(const Vector<WebCore::IntRect>&, Optional<WebCore::TextIndicatorData>)>&& reply);
1310 void computeAndSendEditDragSnapshot();
1313 #if !PLATFORM(COCOA) && !PLATFORM(WPE)
1314 static const char* interpretKeyEvent(const WebCore::KeyboardEvent*);
1317 bool performDefaultBehaviorForKeyEvent(const WebKeyboardEvent&);
1320 bool executeKeypressCommandsInternal(const Vector<WebCore::KeypressCommand>&, WebCore::KeyboardEvent*);
1323 void testProcessIncomingSyncMessagesWhenWaitingForSyncReply(Messages::WebPage::TestProcessIncomingSyncMessagesWhenWaitingForSyncReplyDelayedReply&&);
1325 void updateDrawingAreaLayerTreeFreezeState();
1326 bool markLayersVolatileImmediatelyIfPossible();
1327 void layerVolatilityTimerFired();
1328 void callVolatilityCompletionHandlers(bool succeeded);
1330 String sourceForFrame(WebFrame*);
1332 void loadDataImpl(uint64_t navigationID, bool shouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&&, Ref<WebCore::SharedBuffer>&&, const String& MIMEType, const String& encodingName, const URL& baseURL, const URL& failingURL, const UserData&, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow);
1336 void platformDidReceiveLoadParameters(const LoadParameters&);
1337 void loadRequest(LoadParameters&&);
1338 NO_RETURN void loadRequestWaitingForPID(LoadParameters&&, URL&&, WebPageProxyIdentifier);
1339 void loadData(LoadParameters&&);
1340 void loadAlternateHTML(LoadParameters&&);
1341 void navigateToPDFLinkWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint);
1342 void reload(uint64_t navigationID, uint32_t reloadOptions, SandboxExtension::Handle&&);
1343 void goToBackForwardItem(uint64_t navigationID, const WebCore::BackForwardItemIdentifier&, WebCore::FrameLoadType, WebCore::ShouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&&);
1344 void tryRestoreScrollPosition();
1345 void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, CallbackID);
1346 void updateIsInWindow(bool isInitialState = false);
1347 void visibilityDidChange();
1348 void setActivityState(OptionSet<WebCore::ActivityState::Flag>, ActivityStateChangeID, const Vector<CallbackID>& callbackIDs);
1349 void validateCommand(const String&, CallbackID);
1350 void executeEditCommand(const String&, const String&);
1351 void setEditable(bool);
1353 void didChangeSelectionOrOverflowScrollPosition();
1355 void increaseListLevel();
1356 void decreaseListLevel();
1357 void changeListType();
1359 void setBaseWritingDirection(WebCore::WritingDirection);
1361 void setNeedsFontAttributes(bool);
1363 void mouseEvent(const WebMouseEvent&);
1364 void keyEvent(const WebKeyboardEvent&);
1366 #if ENABLE(IOS_TOUCH_EVENTS)
1367 void touchEventSync(const WebTouchEvent&, CompletionHandler<void(bool)>&&);
1368 void resetPotentialTapSecurityOrigin();
1369 void updatePotentialTapSecurityOrigin(const WebTouchEvent&, bool wasHandled);
1370 #elif ENABLE(TOUCH_EVENTS)
1371 void touchEvent(const WebTouchEvent&);
1374 #if ENABLE(POINTER_EVENTS)
1375 void cancelPointer(WebCore::PointerID, const WebCore::IntPoint&);
1376 void touchWithIdentifierWasRemoved(WebCore::PointerID);
1379 #if ENABLE(CONTEXT_MENUS)
1380 void contextMenuHidden() { m_isShowingContextMenu = false; }
1382 #if ENABLE(CONTEXT_MENU_EVENT)
1383 void contextMenuForKeyEvent();
1386 static bool scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity);
1387 static bool logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity);
1389 void loadURLInFrame(URL&&, const String& referrer, WebCore::FrameIdentifier);
1390 void loadDataInFrame(IPC::DataReference&&, String&& MIMEType, String&& encodingName, URL&& baseURL, WebCore::FrameIdentifier);
1392 enum class WasRestoredByAPIRequest { No, Yes };
1393 void restoreSessionInternal(const Vector<BackForwardListItemState>&, WasRestoredByAPIRequest, WebBackForwardListProxy::OverwriteExistingItem);
1394 void restoreSession(const Vector<BackForwardListItemState>&);
1395 void didRemoveBackForwardItem(const WebCore::BackForwardItemIdentifier&);
1396 void updateBackForwardListForReattach(const Vector<WebKit::BackForwardListItemState>&);
1397 void setCurrentHistoryItemForReattach(WebKit::BackForwardListItemState&&);
1399 void requestFontAttributesAtSelectionStart(CallbackID);
1401 #if ENABLE(REMOTE_INSPECTOR)
1402 void setIndicating(bool);
1405 void setBackgroundColor(const Optional<WebCore::Color>&);
1408 void setTopContentInsetFenced(float, IPC::Attachment);
1410 void setTopContentInset(float);
1412 void viewWillStartLiveResize();
1413 void viewWillEndLiveResize();
1415 void getContentsAsString(CallbackID);
1417 void getContentsAsAttributedString(CompletionHandler<void(const AttributedString&)>&&);
1420 void getContentsAsMHTMLData(CallbackID);
1422 void getMainResourceDataOfFrame(WebCore::FrameIdentifier, CallbackID);
1423 void getResourceDataFromFrame(WebCore::FrameIdentifier, const String& resourceURL, CallbackID);
1424 void getRenderTreeExternalRepresentation(CallbackID);
1425 void getSelectionOrContentsAsString(CallbackID);
1426 void getSelectionAsWebArchiveData(CallbackID);
1427 void getSourceForFrame(WebCore::FrameIdentifier, CallbackID);
1428 void getWebArchiveOfFrame(WebCore::FrameIdentifier, CallbackID);
1429 void runJavaScript(WebFrame*, const String&, bool forceUserGesture, const Optional<String>& worldName, CallbackID);
1430 void runJavaScriptInMainFrameScriptWorld(const String&, bool forceUserGesture, const Optional<String>& worldName, CallbackID);
1431 void runJavaScriptInFrame(WebCore::FrameIdentifier, const String&, bool forceUserGesture, CallbackID);
1432 void forceRepaint(CallbackID);
1433 void takeSnapshot(WebCore::IntRect snapshotRect, WebCore::IntSize bitmapSize, uint32_t options, CallbackID);
1435 void preferencesDidChange(const WebPreferencesStore&);
1436 void updatePreferences(const WebPreferencesStore&);
1437 void updatePreferencesGenerated(const WebPreferencesStore&);
1439 #if PLATFORM(IOS_FAMILY)
1440 bool parentProcessHasServiceWorkerEntitlement() const;
1442 bool parentProcessHasServiceWorkerEntitlement() const { return true; }
1445 void didReceivePolicyDecision(WebCore::FrameIdentifier, uint64_t listenerID, WebCore::PolicyCheckIdentifier, WebCore::PolicyAction, uint64_t navigationID, const DownloadID&, Optional<WebsitePoliciesData>&&);
1446 void continueWillSubmitForm(WebCore::FrameIdentifier, uint64_t listenerID);
1447 void setUserAgent(const String&);
1448 void setCustomTextEncodingName(const String&);
1449 void suspendActiveDOMObjectsAndAnimations();
1450 void resumeActiveDOMObjectsAndAnimations();
1453 void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
1454 void performDictionaryLookupOfCurrentSelection();
1455 void performDictionaryLookupForRange(WebCore::Frame&, WebCore::Range&, NSDictionary *options, WebCore::TextIndicatorPresentationTransition);
1456 WebCore::DictionaryPopupInfo dictionaryPopupInfoForRange(WebCore::Frame&, WebCore::Range&, NSDictionary *options, WebCore::TextIndicatorPresentationTransition);
1457 #if ENABLE(PDFKIT_PLUGIN)
1458 WebCore::DictionaryPopupInfo dictionaryPopupInfoForSelectionInPDFPlugin(PDFSelection *, PDFPlugin&, NSDictionary *options, WebCore::TextIndicatorPresentationTransition);
1461 void windowAndViewFramesChanged(const WebCore::FloatRect& windowFrameInScreenCoordinates, const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates, const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
1463 RetainPtr<PDFDocument> pdfDocumentForPrintingFrame(WebCore::Frame*);
1464 void computePagesForPrintingPDFDocument(WebCore::FrameIdentifier, const PrintInfo&, Vector<WebCore::IntRect>& resultPageRects);
1465 void drawPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, const WebCore::IntRect&);
1466 void drawPagesToPDFFromPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, uint32_t first, uint32_t count);
1469 void setMainFrameIsScrollable(bool);
1471 void unapplyEditCommand(WebUndoStepID commandID);
1472 void reapplyEditCommand(WebUndoStepID commandID);
1473 void didRemoveEditCommand(WebUndoStepID commandID);
1475 void findString(const String&, uint32_t findOptions, uint32_t maxMatchCount, Optional<CallbackID>);
1476 void findStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1477 void getImageForFindMatch(uint32_t matchIndex);
1478 void selectFindMatch(uint32_t matchIndex);
1479 void indicateFindMatch(uint32_t matchIndex);
1481 void countStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1482 void replaceMatches(const Vector<uint32_t>& matchIndices, const String& replacementText, bool selectionOnly, CallbackID);
1484 #if USE(COORDINATED_GRAPHICS)
1485 void sendViewportAttributesChanged(const WebCore::ViewportArguments&);
1488 void didChangeSelectedIndexForActivePopupMenu(int32_t newIndex);
1489 void setTextForActivePopupMenu(int32_t index);
1492 void failedToShowPopupMenu();
1495 void didChooseFilesForOpenPanel(const Vector<String>&);
1496 void didCancelForOpenPanel();
1498 #if PLATFORM(IOS_FAMILY)
1499 void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const IPC::DataReference& iconData);
1500 bool isTransparentOrFullyClipped(const WebCore::Element&) const;
1503 #if ENABLE(SANDBOX_EXTENSIONS)
1504 void extendSandboxForFilesFromOpenPanel(SandboxExtension::HandleArray&&);
1507 void didReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed);
1509 void didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed);
1511 #if ENABLE(MEDIA_STREAM)
1512 void userMediaAccessWasGranted(uint64_t userMediaID, WebCore::CaptureDevice&& audioDeviceUID, WebCore::CaptureDevice&& videoDeviceUID, String&& mediaDeviceIdentifierHashSalt, CompletionHandler<void()>&&);
1513 void userMediaAccessWasDenied(uint64_t userMediaID, uint64_t reason, String&& invalidConstraint);
1518 void disableICECandidateFiltering();
1519 void enableICECandidateFiltering();
1522 #if ENABLE(WEB_RTC) && USE(LIBWEBRTC)
1523 void disableEnumeratingAllNetworkInterfaces();
1524 void enableEnumeratingAllNetworkInterfaces();
1527 void stopAllMediaPlayback();
1528 void suspendAllMediaPlayback();
1529 void resumeAllMediaPlayback();
1531 void advanceToNextMisspelling(bool startBeforeSelection);
1532 void changeSpellingToWord(const String& word);
1535 void uppercaseWord();
1536 void lowercaseWord();
1537 void capitalizeWord();
1540 bool shouldDispatchSyntheticMouseEventsWhenModifyingSelection() const;
1541 void platformDidSelectAll();
1543 #if ENABLE(CONTEXT_MENUS)
1544 void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&);
1547 void changeSelectedIndex(int32_t index);
1548 void setCanStartMediaTimerFired();
1550 static bool platformCanHandleRequest(const WebCore::ResourceRequest&);
1552 static PluginView* focusedPluginViewForFrame(WebCore::Frame&);
1554 void reportUsedFeatures();
1556 void updateWebsitePolicies(WebsitePoliciesData&&);
1558 void changeFont(WebCore::FontChanges&&);
1559 void changeFontAttributes(WebCore::FontAttributeChanges&&);
1562 void performImmediateActionHitTestAtLocation(WebCore::FloatPoint);
1563 std::tuple<RefPtr<WebCore::Range>, NSDictionary *> lookupTextAtLocation(WebCore::FloatPoint);
1564 void immediateActionDidUpdate();
1565 void immediateActionDidCancel();
1566 void immediateActionDidComplete();
1568 void dataDetectorsDidPresentUI(WebCore::PageOverlay::PageOverlayID);
1569 void dataDetectorsDidChangeUI(WebCore::PageOverlay::PageOverlayID);
1570 void dataDetectorsDidHideUI(WebCore::PageOverlay::PageOverlayID);
1572 void handleAcceptedCandidate(WebCore::TextCheckingResult);
1576 void requestActiveNowPlayingSessionInfo(CallbackID);
1577 RetainPtr<NSData> accessibilityRemoteTokenData() const;
1578 void accessibilityTransferRemoteToken(RetainPtr<NSData>);
1581 void setShouldDispatchFakeMouseMoveEvents(bool dispatch) { m_shouldDispatchFakeMouseMoveEvents = dispatch; }
1583 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
1584 void playbackTargetSelected(uint64_t, const WebCore::MediaPlaybackTargetContext& outputDevice) const;
1585 void playbackTargetAvailabilityDidChange(uint64_t, bool);
1586 void setShouldPlayToPlaybackTarget(uint64_t, bool);
1587 void playbackTargetPickerWasDismissed(uint64_t);
1590 void clearWheelEventTestMonitor();
1592 void setShouldScaleViewToFitDocument(bool);
1594 void pageStoppedScrolling();
1596 #if ENABLE(VIDEO) && USE(GSTREAMER)
1597 void didEndRequestInstallMissingMediaPlugins(uint32_t result);
1600 void setUserInterfaceLayoutDirection(uint32_t);
1602 bool canPluginHandleResponse(const WebCore::ResourceResponse&);
1604 void simulateDeviceOrientationChange(double alpha, double beta, double gamma);
1606 #if USE(SYSTEM_PREVIEW)
1607 void systemPreviewActionTriggered(WebCore::SystemPreviewInfo, const String& message);
1610 #if ENABLE(SPEECH_SYNTHESIS)
1611 void speakingErrorOccurred();
1612 void boundaryEventOccurred(bool wordBoundary, unsigned charIndex);
1613 void voicesDidChange();
1616 void frameBecameRemote(WebCore::FrameIdentifier, WebCore::GlobalFrameIdentifier&& remoteFrameIdentifier, WebCore::GlobalWindowIdentifier&& remoteWindowIdentifier);
1618 void registerURLSchemeHandler(uint64_t identifier, const String& scheme);
1620 void urlSchemeTaskDidPerformRedirection(uint64_t handlerIdentifier, uint64_t taskIdentifier, WebCore::ResourceResponse&&, WebCore::ResourceRequest&&);
1621 void urlSchemeTaskDidReceiveResponse(uint64_t handlerIdentifier, uint64_t taskIdentifier, const WebCore::ResourceResponse&);
1622 void urlSchemeTaskDidReceiveData(uint64_t handlerIdentifier, uint64_t taskIdentifier, const IPC::DataReference&);
1623 void urlSchemeTaskDidComplete(uint64_t handlerIdentifier, uint64_t taskIdentifier, const WebCore::ResourceError&);
1625 void setIsSuspended(bool);
1627 RefPtr<WebImage> snapshotAtSize(const WebCore::IntRect&, const WebCore::IntSize& bitmapSize, SnapshotOptions);
1628 RefPtr<WebImage> snapshotNode(WebCore::Node&, SnapshotOptions, unsigned maximumPixelCount = std::numeric_limits<unsigned>::max());
1630 RetainPtr<CFDataRef> pdfSnapshotAtSize(WebCore::IntRect, WebCore::IntSize bitmapSize, SnapshotOptions);
1633 #if ENABLE(ATTACHMENT_ELEMENT)
1634 RefPtr<WebCore::HTMLAttachmentElement> attachmentElementWithIdentifier(const String& identifier) const;
1637 bool canShowMIMEType(const String&, const Function<bool(const String&, WebCore::PluginData::AllowedPluginTypes)>& supportsPlugin) const;
1639 void cancelGesturesBlockedOnSynchronousReplies();
1641 bool shouldDispatchUpdateAfterFocusingElement(const WebCore::Element&) const;
1643 void updateMockAccessibilityElementAfterCommittingLoad();
1645 void paintSnapshotAtSize(const WebCore::IntRect&, const WebCore::IntSize&, SnapshotOptions, WebCore::Frame&, WebCore::FrameView&, WebCore::GraphicsContext&);
1647 #if PLATFORM(GTK) || PLATFORM(WPE)
1648 void sendMessageToWebExtension(UserMessage&&);
1649 void sendMessageToWebExtensionWithReply(UserMessage&&, CompletionHandler<void(UserMessage&&)>&&);
1652 WebCore::PageIdentifier m_identifier;
1654 std::unique_ptr<WebCore::Page> m_page;
1655 RefPtr<WebFrame> m_mainFrame;
1657 RefPtr<WebPageGroupProxy> m_pageGroup;
1661 WebCore::IntSize m_viewSize;
1662 std::unique_ptr<DrawingArea> m_drawingArea;
1664 HashSet<PluginView*> m_pluginViews;
1665 bool m_hasSeenPlugin { false };
1667 HashMap<uint64_t, RefPtr<WebCore::TextCheckingRequest>> m_pendingTextCheckingRequestMap;
1669 bool m_useFixedLayout { false };
1671 WebCore::Color m_underlayColor;
1673 bool m_isInRedo { false };
1674 bool m_isClosed { false };
1675 bool m_tabToLinks { false };
1677 bool m_asynchronousPluginInitializationEnabled { false };
1678 bool m_asynchronousPluginInitializationEnabledForAllPlugins { false };
1679 bool m_artificialPluginInitializationDelayEnabled { false };
1680 bool m_scrollingPerformanceLoggingEnabled { false };
1681 bool m_mainFrameIsScrollable { true };
1683 bool m_alwaysShowsHorizontalScroller { false };
1684 bool m_alwaysShowsVerticalScroller { false };
1686 #if PLATFORM(IOS_FAMILY)
1687 bool m_ignoreViewportScalingConstraints { false };
1690 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
1691 bool m_readyToFindPrimarySnapshottedPlugin { false };
1692 bool m_didFindPrimarySnapshottedPlugin { false };
1693 unsigned m_numberOfPrimarySnapshotDetectionAttempts { 0 };
1694 String m_primaryPlugInPageOrigin;
1695 String m_primaryPlugInOrigin;
1696 String m_primaryPlugInMimeType;
1697 RunLoop::Timer<WebPage> m_determinePrimarySnapshottedPlugInTimer;
1700 // The layer hosting mode.
1701 LayerHostingMode m_layerHostingMode;
1704 bool m_pdfPluginEnabled { false };
1705 bool m_hasCachedWindowFrame { false };
1707 // The frame of the containing window in screen coordinates.
1708 WebCore::FloatRect m_windowFrameInScreenCoordinates;
1710 // The frame of the containing window in unflipped screen coordinates.
1711 WebCore::FloatRect m_windowFrameInUnflippedScreenCoordinates;
1713 // The frame of the view in window coordinates.
1714 WebCore::FloatRect m_viewFrameInWindowCoordinates;
1716 // The accessibility position of the view.
1717 WebCore::FloatPoint m_accessibilityPosition;
1719 RetainPtr<WKAccessibilityWebPageObject> m_mockAccessibilityElement;
1722 #if ENABLE(PLATFORM_DRIVEN_TEXT_CHECKING)
1723 UniqueRef<TextCheckingControllerProxy> m_textCheckingControllerProxy;
1726 #if PLATFORM(COCOA) || PLATFORM(GTK)
1727 std::unique_ptr<ViewGestureGeometryCollector> m_viewGestureGeometryCollector;
1731 RetainPtr<NSDictionary> m_dataDetectionContext;
1734 #if ENABLE(ACCESSIBILITY) && USE(ATK)
1735 GRefPtr<AtkObject> m_accessibilityObject;
1738 #if !PLATFORM(IOS_FAMILY)
1739 RefPtr<PageBanner> m_headerBanner;
1740 RefPtr<PageBanner> m_footerBanner;
1743 RunLoop::Timer<WebPage> m_setCanStartMediaTimer;
1744 bool m_mayStartMediaWhenInWindow { false };
1746 HashMap<WebUndoStepID, RefPtr<WebUndoStep>> m_undoStepMap;
1748 #if ENABLE(CONTEXT_MENUS)
1749 std::unique_ptr<API::InjectedBundle::PageContextMenuClient> m_contextMenuClient;
1751 std::unique_ptr<API::InjectedBundle::EditorClient> m_editorClient;
1752 std::unique_ptr<API::InjectedBundle::FormClient> m_formClient;
1753 std::unique_ptr<API::InjectedBundle::PageLoaderClient> m_loaderClient;
1754 InjectedBundlePagePolicyClient m_policyClient;
1755 std::unique_ptr<API::InjectedBundle::ResourceLoadClient> m_resourceLoadClient;
1756 std::unique_ptr<API::InjectedBundle::PageUIClient> m_uiClient;
1757 #if ENABLE(FULLSCREEN_API)
1758 InjectedBundlePageFullScreenClient m_fullScreenClient;
1761 UniqueRef<FindController> m_findController;
1763 RefPtr<WebInspector> m_inspector;
1764 RefPtr<WebInspectorUI> m_inspectorUI;
1765 RefPtr<RemoteWebInspectorUI> m_remoteInspectorUI;
1766 std::unique_ptr<WebPageInspectorTargetController> m_inspectorTargetController;
1768 #if (PLATFORM(IOS_FAMILY) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
1769 RefPtr<PlaybackSessionManager> m_playbackSessionManager;
1770 RefPtr<VideoFullscreenManager> m_videoFullscreenManager;
1773 #if PLATFORM(IOS_FAMILY)
1774 bool m_allowsMediaDocumentInlinePlayback { false };
1775 RefPtr<WebCore::Range> m_startingGestureRange;
1778 #if ENABLE(FULLSCREEN_API)
1779 RefPtr<WebFullScreenManager> m_fullScreenManager;
1782 RefPtr<WebPopupMenu> m_activePopupMenu;
1784 #if ENABLE(CONTEXT_MENUS)
1785 RefPtr<WebContextMenu> m_contextMenu;
1788 #if ENABLE(INPUT_TYPE_COLOR)
1789 WebColorChooser* m_activeColorChooser { nullptr };
1792 #if ENABLE(DATALIST_ELEMENT)
1793 WeakPtr<WebDataListSuggestionPicker> m_activeDataListSuggestionPicker;
1796 RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener;
1797 RefPtr<NotificationPermissionRequestManager> m_notificationPermissionRequestManager;
1799 Ref<WebUserContentController> m_userContentController;
1801 #if ENABLE(GEOLOCATION)
1802 UniqueRef<GeolocationPermissionRequestManager> m_geolocationPermissionRequestManager;
1805 #if ENABLE(MEDIA_STREAM)
1806 UniqueRef<UserMediaPermissionRequestManager> m_userMediaPermissionRequestManager;
1809 std::unique_ptr<WebCore::PrintContext> m_printContext;
1811 RefPtr<WebPrintOperationGtk> m_printOperation;
1814 SandboxExtensionTracker m_sandboxExtensionTracker;
1816 RefPtr<SandboxExtension> m_pendingDropSandboxExtension;
1817 Vector<RefPtr<SandboxExtension>> m_pendingDropExtensionsForFileUpload;
1819 PAL::HysteresisActivity m_pageScrolledHysteresis;
1821 bool m_canRunBeforeUnloadConfirmPanel { false };
1823 bool m_canRunModal { false };
1824 bool m_isRunningModal { false };
1826 #if ENABLE(DRAG_SUPPORT)
1827 bool m_isStartingDrag { false };
1828 WebCore::DragSourceAction m_allowedDragSourceActions { WebCore::DragSourceActionAny };
1831 #if ENABLE(DRAG_SUPPORT) && PLATFORM(IOS_FAMILY)
1832 HashSet<RefPtr<WebCore::HTMLImageElement>> m_pendingImageElementsForDropSnapshot;
1833 RefPtr<WebCore::Range> m_rangeForDropSnapshot;
1836 bool m_cachedMainFrameIsPinnedToLeftSide { true };
1837 bool m_cachedMainFrameIsPinnedToRightSide { true };
1838 bool m_cachedMainFrameIsPinnedToTopSide { true };
1839 bool m_cachedMainFrameIsPinnedToBottomSide { true };
1840 bool m_canShortCircuitHorizontalWheelEvents { false };
1841 bool m_hasWheelEventHandlers { false };
1843 unsigned m_cachedPageCount { 0 };
1845 HashSet<unsigned long> m_trackedNetworkResourceRequestIdentifiers;
1847 WebCore::IntSize m_minimumSizeForAutoLayout;
1848 bool m_autoSizingShouldExpandToViewHeight { false };
1849 Optional<WebCore::IntSize> m_viewportSizeForCSSViewportUnits;
1851 bool m_userIsInteracting { false };
1852 bool m_hasEverFocusedElementDueToUserInteractionSincePageTransition { false };
1853 bool m_isTouchBarUpdateSupressedForHiddenContentEditable { false };
1854 bool m_isNeverRichlyEditableForTouchBar { false };
1855 OptionSet<WebCore::ActivityState::Flag> m_lastActivityStateChanges;
1857 #if ENABLE(CONTEXT_MENUS)
1858 bool m_isShowingContextMenu { false };
1861 RefPtr<WebCore::Element> m_focusedElement;
1862 RefPtr<WebCore::Element> m_recentlyBlurredElement;
1863 bool m_hasPendingInputContextUpdateAfterBlurringAndRefocusingElement { false };
1864 bool m_hasPendingEditorStateUpdate { false };
1866 #if ENABLE(IOS_TOUCH_EVENTS)
1867 CompletionHandler<void(bool)> m_pendingSynchronousTouchEventReply;
1870 #if PLATFORM(IOS_FAMILY)
1871 RefPtr<WebCore::Range> m_currentWordRange;
1872 RefPtr<WebCore::Node> m_interactionNode;
1873 WebCore::IntPoint m_lastInteractionLocation;
1875 bool m_isShowingInputViewForFocusedElement { false };
1877 enum SelectionAnchor { Start, End };
1878 SelectionAnchor m_selectionAnchor { Start };
1880 RefPtr<WebCore::Node> m_potentialTapNode;
1881 WebCore::FloatPoint m_potentialTapLocation;
1882 RefPtr<WebCore::SecurityOrigin> m_potentialTapSecurityOrigin;
1884 WebCore::ViewportConfiguration m_viewportConfiguration;
1886 bool m_hasReceivedVisibleContentRectsAfterDidCommitLoad { false };
1887 bool m_hasRestoredExposedContentRectAfterDidCommitLoad { false };
1888 bool m_scaleWasSetByUIProcess { false };
1889 bool m_userHasChangedPageScaleFactor { false };
1890 bool m_hasStablePageScaleFactor { true };
1891 bool m_useTestingViewportConfiguration { false };
1892 bool m_isInStableState { true };
1893 bool m_forceAlwaysUserScalable { false };
1894 MonotonicTime m_oldestNonStableUpdateVisibleContentRectsTimestamp;
1895 Seconds m_estimatedLatency { 0 };
1896 WebCore::FloatSize m_screenSize;
1897 WebCore::FloatSize m_availableScreenSize;
1898 WebCore::FloatSize m_overrideScreenSize;
1900 RefPtr<WebCore::Range> m_initialSelection;
1901 WebCore::VisibleSelection m_storedSelectionForAccessibility { WebCore::VisibleSelection() };
1902 WebCore::FloatSize m_maximumUnobscuredSize;
1903 int32_t m_deviceOrientation { 0 };
1904 bool m_keyboardIsAttached { false };
1905 bool m_canShowWhileLocked { false };
1906 bool m_inDynamicSizeUpdate { false };
1907 HashMap<std::pair<WebCore::IntSize, double>, WebCore::IntPoint> m_dynamicSizeUpdateHistory;
1908 RefPtr<WebCore::Node> m_pendingSyntheticClickNode;
1909 WebCore::FloatPoint m_pendingSyntheticClickLocation;
1910 WebCore::FloatRect m_previousExposedContentRect;
1911 OptionSet<WebKit::WebEvent::Modifier> m_pendingSyntheticClickModifiers;
1912 WebCore::PointerID m_pendingSyntheticClickPointerId { 0 };
1913 FocusedElementIdentifier m_currentFocusedElementIdentifier { 0 };
1914 Optional<DynamicViewportSizeUpdateID> m_pendingDynamicViewportSizeUpdateID;
1915 double m_lastTransactionPageScaleFactor { 0 };
1916 TransactionID m_lastTransactionIDWithScaleChange;
1918 CompletionHandler<void(InteractionInformationAtPosition&&)> m_pendingSynchronousPositionInformationReply;
1921 WebCore::Timer m_layerVolatilityTimer;
1922 Vector<Function<void(bool)>> m_markLayersAsVolatileCompletionHandlers;
1923 bool m_isSuspendedUnderLock { false };
1925 HashSet<String, ASCIICaseInsensitiveHash> m_mimeTypesWithCustomContentProviders;
1926 Optional<WebCore::Color> m_backgroundColor { WebCore::Color::white };
1928 HashSet<unsigned> m_activeRenderingSuppressionTokens;
1929 unsigned m_maximumRenderingSuppressionToken { 0 };
1931 WebCore::ScrollPinningBehavior m_scrollPinningBehavior { WebCore::DoNotPin };
1932 Optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle;
1934 bool m_useAsyncScrolling { false };
1936 OptionSet<WebCore::ActivityState::Flag> m_activityState;
1938 bool m_isAppNapEnabled { true };
1939 UserActivity m_userActivity;
1941 uint64_t m_pendingNavigationID { 0 };
1942 Optional<WebsitePoliciesData> m_pendingWebsitePolicies;
1944 bool m_mainFrameProgressCompleted { false };
1945 bool m_shouldDispatchFakeMouseMoveEvents { true };
1946 bool m_isEditorStateMissingPostLayoutData { false };
1947 bool m_isSelectingTextWhileInsertingAsynchronously { false };
1949 enum class EditorStateIsContentEditable { No, Yes, Unset };
1950 mutable EditorStateIsContentEditable m_lastEditorStateWasContentEditable { EditorStateIsContentEditable::Unset };
1953 bool m_inputMethodEnabled { false };
1956 #if ENABLE(VIDEO) && USE(GSTREAMER)
1957 RefPtr<WebCore::MediaPlayerRequestInstallMissingPluginsCallback> m_installMediaPluginsCallback;
1961 WallTime m_loadCommitTime;
1964 WebCore::UserInterfaceLayoutDirection m_userInterfaceLayoutDirection { WebCore::UserInterfaceLayoutDirection::LTR };
1966 const String m_overrideContentSecurityPolicy;
1967 const Optional<double> m_cpuLimit;
1969 #if USE(WPE_RENDERER)
1970 IPC::Attachment m_hostFileDescriptor;
1973 HashMap<String, RefPtr<WebURLSchemeHandlerProxy>> m_schemeToURLSchemeHandlerProxyMap;
1974 HashMap<uint64_t, WebURLSchemeHandlerProxy*> m_identifierToURLSchemeHandlerProxyMap;
1976 HashMap<uint64_t, Function<void(bool granted)>> m_storageAccessResponseCallbackMap;
1977 HashMap<ShareSheetCallbackID, Function<void(bool completed)>> m_shareSheetResponseCallbackMap;
1979 #if ENABLE(APPLICATION_MANIFEST)
1980 HashMap<uint64_t, uint64_t> m_applicationManifestFetchCallbackMap;
1983 OptionSet<LayerTreeFreezeReason> m_layerTreeFreezeReasons;
1984 bool m_isSuspended { false };
1985 bool m_needsFontAttributes { false };
1986 bool m_firstFlushAfterCommit { false };
1988 WeakPtr<WebRemoteObjectRegistry> m_remoteObjectRegistry;
1990 WebPageProxyIdentifier m_webPageProxyIdentifier;
1991 WebCore::IntSize m_lastSentIntrinsicContentSize;
1992 #if ENABLE(VIEWPORT_RESIZING)
1993 WebCore::DeferrableOneShotTimer m_shrinkToFitContentTimer;
1995 #if HAVE(VISIBILITY_PROPAGATION_VIEW)
1996 std::unique_ptr<LayerHostingContext> m_contextForVisibilityPropagation;
1998 #if ENABLE(TEXT_AUTOSIZING)
1999 WebCore::Timer m_textAutoSizingAdjustmentTimer;
2003 #if !PLATFORM(IOS_FAMILY)
2004 inline void WebPage::platformWillPerformEditingCommand() { }
2007 } // namespace WebKit