2 * Copyright (C) 2010, 2011, 2013 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.
29 #include "APIInjectedBundleFormClient.h"
30 #include "APIInjectedBundlePageContextMenuClient.h"
31 #include "APIInjectedBundlePageUIClient.h"
32 #include "APIObject.h"
33 #include "DictionaryPopupInfo.h"
34 #include "FindController.h"
35 #include "GeolocationPermissionRequestManager.h"
36 #include "ImageOptions.h"
37 #include "InjectedBundlePageDiagnosticLoggingClient.h"
38 #include "InjectedBundlePageEditorClient.h"
39 #include "InjectedBundlePageFullScreenClient.h"
40 #include "InjectedBundlePageLoaderClient.h"
41 #include "InjectedBundlePagePolicyClient.h"
42 #include "InjectedBundlePageResourceLoadClient.h"
43 #include "LayerTreeHost.h"
44 #include "MessageReceiver.h"
45 #include "MessageSender.h"
47 #include "SandboxExtension.h"
48 #include "ShareableBitmap.h"
50 #include "UserMediaPermissionRequestManager.h"
51 #include <WebCore/DictationAlternative.h>
52 #include <WebCore/DragData.h>
53 #include <WebCore/Editor.h>
54 #include <WebCore/FrameLoaderTypes.h>
55 #include <WebCore/HitTestResult.h>
56 #include <WebCore/IntRect.h>
57 #include <WebCore/IntSizeHash.h>
58 #include <WebCore/Page.h>
59 #include <WebCore/PageOverlay.h>
60 #include <WebCore/PageVisibilityState.h>
61 #include <WebCore/ScrollTypes.h>
62 #include <WebCore/TextChecking.h>
63 #include <WebCore/TextIndicator.h>
64 #include <WebCore/UserActivity.h>
65 #include <WebCore/ViewState.h>
66 #include <WebCore/ViewportConfiguration.h>
67 #include <WebCore/WebCoreKeyboardUIMode.h>
69 #include <wtf/HashMap.h>
70 #include <wtf/PassRefPtr.h>
71 #include <wtf/RefPtr.h>
72 #include <wtf/RunLoop.h>
73 #include <wtf/text/WTFString.h>
75 #if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
76 #include "WebPageAccessibilityObject.h"
77 #include <wtf/gobject/GRefPtr.h>
81 #include "ArgumentCodersGtk.h"
82 #include "WebPrintOperationGtk.h"
86 #include "GestureTypes.h"
87 #import "WebPageMessages.h"
90 #if ENABLE(IOS_TOUCH_EVENTS)
91 #include <WebKitAdditions/PlatformTouchEventIOS.h>
92 #elif ENABLE(TOUCH_EVENTS)
93 #include <WebCore/PlatformTouchEvent.h>
96 #if ENABLE(CONTEXT_MENUS)
97 #include "InjectedBundlePageContextMenuClient.h"
101 #include "ViewGestureGeometryCollector.h"
102 #include <wtf/RetainPtr.h>
104 OBJC_CLASS NSDictionary;
106 OBJC_CLASS WKAccessibilityWebPageObject;
108 #define ENABLE_PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC 1
116 class ArgumentDecoder;
121 class DocumentLoader;
122 class GraphicsContext;
125 class HTMLPlugInElement;
126 class HTMLPlugInImageElement;
132 class ResourceResponse;
133 class ResourceRequest;
135 class SubstituteData;
136 class TextCheckingRequest;
138 class VisibleSelection;
140 struct KeypressCommand;
141 struct MediaPlaybackTargetContext;
142 struct TextCheckingResult;
147 class InjectedBundleBackForwardList;
148 class NotificationPermissionRequestManager;
152 class VisibleContentRectUpdateInfo;
153 class WebColorChooser;
154 class WebContextMenu;
155 class WebContextMenuItemData;
158 class WebFullScreenManager;
161 class WebInspectorClient;
162 class WebInspectorUI;
163 class WebKeyboardEvent;
165 class WebNotificationClient;
166 class WebOpenPanelResultListener;
167 class WebPageGroupProxy;
168 class WebPageOverlay;
171 class WebUserContentController;
172 class WebVideoFullscreenManager;
174 struct AssistedNodeInformation;
175 struct AttributedString;
176 struct BackForwardListItemState;
179 struct InteractionInformationAtPosition;
181 struct WebPageCreationParameters;
182 struct WebPreferencesStore;
185 class RemoteLayerTreeTransaction;
188 #if ENABLE(TOUCH_EVENTS)
192 class WebPage : public API::ObjectImpl<API::Object::Type::BundlePage>, public IPC::MessageReceiver, public IPC::MessageSender {
194 static PassRefPtr<WebPage> create(uint64_t pageID, const WebPageCreationParameters&);
197 void reinitializeWebPage(const WebPageCreationParameters&);
201 static WebPage* fromCorePage(WebCore::Page*);
203 WebCore::Page* corePage() const { return m_page.get(); }
204 uint64_t pageID() const { return m_pageID; }
205 WebCore::SessionID sessionID() const { return m_page->sessionID(); }
206 bool usesEphemeralSession() const { return m_page->usesEphemeralSession(); }
208 void setSessionID(WebCore::SessionID);
210 void setSize(const WebCore::IntSize&);
211 const WebCore::IntSize& size() const { return m_viewSize; }
212 WebCore::IntRect bounds() const { return WebCore::IntRect(WebCore::IntPoint(), size()); }
214 InjectedBundleBackForwardList* backForwardList();
215 DrawingArea* drawingArea() const { return m_drawingArea.get(); }
216 #if ENABLE(ASYNC_SCROLLING)
217 WebCore::ScrollingCoordinator* scrollingCoordinator() const;
220 WebPageGroupProxy* pageGroup() const { return m_pageGroup.get(); }
222 void scrollMainFrameIfNotAtMaxScrollPosition(const WebCore::IntSize& scrollOffset);
224 bool scrollBy(uint32_t scrollDirection, uint32_t scrollGranularity);
226 void centerSelectionInVisibleArea();
229 void willCommitLayerTree(RemoteLayerTreeTransaction&);
230 void didFlushLayerTreeAtTime(std::chrono::milliseconds);
233 WebInspector* inspector();
234 WebInspectorUI* inspectorUI();
235 bool isInspectorPage() { return !!m_inspectorUI; }
238 WebVideoFullscreenManager* videoFullscreenManager();
241 #if ENABLE(FULLSCREEN_API)
242 WebFullScreenManager* fullScreenManager();
245 // -- Called by the DrawingArea.
246 // FIXME: We could genericize these into a DrawingArea client interface. Would that be beneficial?
247 void drawRect(WebCore::GraphicsContext&, const WebCore::IntRect&);
248 void layoutIfNeeded();
250 // -- Called from WebCore clients.
251 bool handleEditingKeyboardEvent(WebCore::KeyboardEvent*);
253 void didStartPageTransition();
254 void didCompletePageTransition();
255 void didCommitLoad(WebFrame*);
256 void willReplaceMultipartContent(const WebFrame&);
257 void didReplaceMultipartContent(const WebFrame&);
258 void didFinishLoad(WebFrame*);
260 String userAgent(const WebCore::URL&) const;
261 String userAgent(WebFrame*, const WebCore::URL&) const;
262 String platformUserAgent(const WebCore::URL&) const;
263 WebCore::IntRect windowResizerRect() const;
264 WebCore::KeyboardUIMode keyboardUIMode();
266 WebUndoStep* webUndoStep(uint64_t);
267 void addWebUndoStep(uint64_t, WebUndoStep*);
268 void removeWebEditCommand(uint64_t);
269 bool isInRedo() const { return m_isInRedo; }
271 void setActivePopupMenu(WebPopupMenu*);
273 #if ENABLE(INPUT_TYPE_COLOR)
274 WebColorChooser* activeColorChooser() const { return m_activeColorChooser; }
275 void setActiveColorChooser(WebColorChooser*);
276 void didChooseColor(const WebCore::Color&);
277 void didEndColorPicker();
280 WebOpenPanelResultListener* activeOpenPanelResultListener() const { return m_activeOpenPanelResultListener.get(); }
281 void setActiveOpenPanelResultListener(PassRefPtr<WebOpenPanelResultListener>);
283 void didReceiveMessage(IPC::Connection&, IPC::MessageDecoder&) override;
284 void didReceiveSyncMessage(IPC::Connection&, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&) override;
286 // -- InjectedBundle methods
287 #if ENABLE(CONTEXT_MENUS)
288 void setInjectedBundleContextMenuClient(std::unique_ptr<API::InjectedBundle::PageContextMenuClient>);
290 void initializeInjectedBundleEditorClient(WKBundlePageEditorClientBase*);
291 void setInjectedBundleFormClient(std::unique_ptr<API::InjectedBundle::FormClient>);
292 void initializeInjectedBundleLoaderClient(WKBundlePageLoaderClientBase*);
293 void initializeInjectedBundlePolicyClient(WKBundlePagePolicyClientBase*);
294 void initializeInjectedBundleResourceLoadClient(WKBundlePageResourceLoadClientBase*);
295 void setInjectedBundleUIClient(std::unique_ptr<API::InjectedBundle::PageUIClient>);
296 #if ENABLE(FULLSCREEN_API)
297 void initializeInjectedBundleFullScreenClient(WKBundlePageFullScreenClientBase*);
299 void initializeInjectedBundleDiagnosticLoggingClient(WKBundlePageDiagnosticLoggingClientBase*);
301 #if ENABLE(CONTEXT_MENUS)
302 API::InjectedBundle::PageContextMenuClient& injectedBundleContextMenuClient() { return *m_contextMenuClient.get(); }
304 InjectedBundlePageEditorClient& injectedBundleEditorClient() { return m_editorClient; }
305 API::InjectedBundle::FormClient& injectedBundleFormClient() { return *m_formClient.get(); }
306 InjectedBundlePageLoaderClient& injectedBundleLoaderClient() { return m_loaderClient; }
307 InjectedBundlePagePolicyClient& injectedBundlePolicyClient() { return m_policyClient; }
308 InjectedBundlePageResourceLoadClient& injectedBundleResourceLoadClient() { return m_resourceLoadClient; }
309 API::InjectedBundle::PageUIClient& injectedBundleUIClient() { return *m_uiClient.get(); }
310 InjectedBundlePageDiagnosticLoggingClient& injectedBundleDiagnosticLoggingClient() { return m_logDiagnosticMessageClient; }
311 #if ENABLE(FULLSCREEN_API)
312 InjectedBundlePageFullScreenClient& injectedBundleFullScreenClient() { return m_fullScreenClient; }
315 bool findStringFromInjectedBundle(const String&, FindOptions);
317 WebFrame* mainWebFrame() const { return m_mainFrame.get(); }
319 WebCore::MainFrame* mainFrame() const; // May return 0.
320 WebCore::FrameView* mainFrameView() const; // May return 0.
322 PassRefPtr<WebCore::Range> currentSelectionAsRange();
324 #if ENABLE(NETSCAPE_PLUGIN_API)
325 PassRefPtr<Plugin> createPlugin(WebFrame*, WebCore::HTMLPlugInElement*, const Plugin::Parameters&, String& newMIMEType);
329 WebCore::WebGLLoadPolicy webGLPolicyForURL(WebFrame*, const String&);
330 WebCore::WebGLLoadPolicy resolveWebGLPolicyForURL(WebFrame*, const String&);
331 #endif // ENABLE(WEBGL)
333 enum class IncludePostLayoutDataHint { No, Yes };
334 EditorState editorState(IncludePostLayoutDataHint = IncludePostLayoutDataHint::Yes) const;
335 void sendPostLayoutEditorStateIfNeeded();
337 String renderTreeExternalRepresentation() const;
338 String renderTreeExternalRepresentationForPrinting() const;
339 uint64_t renderTreeSize() const;
341 void setTracksRepaints(bool);
342 bool isTrackingRepaints() const;
343 void resetTrackedRepaints();
344 Ref<API::Array> trackedRepaintRects();
346 void executeEditingCommand(const String& commandName, const String& argument);
347 bool isEditingCommandEnabled(const String& commandName);
348 void clearMainFrameName();
351 void sendSetWindowFrame(const WebCore::FloatRect&);
353 double textZoomFactor() const;
354 void setTextZoomFactor(double);
355 double pageZoomFactor() const;
356 void setPageZoomFactor(double);
357 void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
358 void windowScreenDidChange(uint32_t);
360 void scalePage(double scale, const WebCore::IntPoint& origin);
361 void scalePageInViewCoordinates(double scale, WebCore::IntPoint centerInViewCoordinates);
362 double pageScaleFactor() const;
363 double totalScaleFactor() const;
364 double viewScaleFactor() const;
365 void scaleView(double scale);
367 void scaleViewAndUpdateGeometryFenced(double scale, WebCore::IntSize viewSize, uint64_t callbackID);
370 void setUseFixedLayout(bool);
371 bool useFixedLayout() const { return m_useFixedLayout; }
372 void setFixedLayoutSize(const WebCore::IntSize&);
373 WebCore::IntSize fixedLayoutSize() const;
375 void listenForLayoutMilestones(uint32_t /* LayoutMilestones */);
377 void setSuppressScrollbarAnimations(bool);
379 void setEnableVerticalRubberBanding(bool);
380 void setEnableHorizontalRubberBanding(bool);
382 void setBackgroundExtendsBeyondPage(bool);
384 void setPaginationMode(uint32_t /* WebCore::Pagination::Mode */);
385 void setPaginationBehavesLikeColumns(bool);
386 void setPageLength(double);
387 void setGapBetweenPages(double);
389 void postInjectedBundleMessage(const String& messageName, const UserData&);
391 bool drawsBackground() const { return m_drawsBackground; }
392 bool drawsTransparentBackground() const { return m_drawsTransparentBackground; }
394 void setUnderlayColor(const WebCore::Color& color) { m_underlayColor = color; }
395 WebCore::Color underlayColor() const { return m_underlayColor; }
398 void stopLoadingFrame(uint64_t frameID);
399 bool defersLoading() const;
400 void setDefersLoading(bool deferLoading);
402 void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*);
403 void exitAcceleratedCompositingMode();
405 void addPluginView(PluginView*);
406 void removePluginView(PluginView*);
408 bool isVisible() const { return m_viewState & WebCore::ViewState::IsVisible; }
409 bool isVisibleOrOccluded() const { return m_viewState & WebCore::ViewState::IsVisibleOrOccluded; }
411 LayerHostingMode layerHostingMode() const { return m_layerHostingMode; }
412 void setLayerHostingMode(unsigned);
415 void updatePluginsActiveAndFocusedState();
416 const WebCore::FloatRect& windowFrameInScreenCoordinates() const { return m_windowFrameInScreenCoordinates; }
417 const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates() const { return m_windowFrameInUnflippedScreenCoordinates; }
418 const WebCore::FloatRect& viewFrameInWindowCoordinates() const { return m_viewFrameInWindowCoordinates; }
420 bool hasCachedWindowFrame() const { return m_hasCachedWindowFrame; }
423 void setTopOverhangImage(PassRefPtr<WebImage>);
424 void setBottomOverhangImage(PassRefPtr<WebImage>);
425 #endif // !PLATFORM(IOS)
427 void updateHeaderAndFooterLayersForDeviceScaleChange(float scaleFactor);
428 #endif // PLATFORM(COCOA)
430 bool windowIsFocused() const;
431 bool windowAndWebPageAreFocused() const;
434 void setHeaderPageBanner(PassRefPtr<PageBanner>);
435 PageBanner* headerPageBanner();
436 void setFooterPageBanner(PassRefPtr<PageBanner>);
437 PageBanner* footerPageBanner();
439 void hidePageBanners();
440 void showPageBanners();
442 #endif // !PLATFORM(IOS)
444 WebCore::IntPoint screenToRootView(const WebCore::IntPoint&);
445 WebCore::IntRect rootViewToScreen(const WebCore::IntRect&);
448 WebCore::IntPoint accessibilityScreenToRootView(const WebCore::IntPoint&);
449 WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&);
452 PassRefPtr<WebImage> scaledSnapshotWithOptions(const WebCore::IntRect&, double additionalScaleFactor, SnapshotOptions);
453 PassRefPtr<WebImage> snapshotAtSize(const WebCore::IntRect&, const WebCore::IntSize& bitmapSize, SnapshotOptions);
454 PassRefPtr<WebImage> snapshotNode(WebCore::Node&, SnapshotOptions, unsigned maximumPixelCount = std::numeric_limits<unsigned>::max());
456 static const WebEvent* currentEvent();
458 FindController& findController() { return m_findController; }
460 #if ENABLE(GEOLOCATION)
461 GeolocationPermissionRequestManager& geolocationPermissionRequestManager() { return m_geolocationPermissionRequestManager; }
464 #if PLATFORM(IOS) || PLATFORM(EFL)
465 void savePageState(WebCore::HistoryItem&);
466 void restorePageState(const WebCore::HistoryItem&);
469 #if ENABLE(MEDIA_STREAM)
470 UserMediaPermissionRequestManager& userMediaPermissionRequestManager() { return m_userMediaPermissionRequestManager; }
474 WebCore::FloatSize screenSize() const;
475 WebCore::FloatSize availableScreenSize() const;
476 int32_t deviceOrientation() const { return m_deviceOrientation; }
477 void viewportPropertiesDidChange(const WebCore::ViewportArguments&);
478 void didReceiveMobileDocType(bool);
480 void setUseTestingViewportConfiguration(bool useTestingViewport) { m_useTestingViewportConfiguration = useTestingViewport; }
481 bool isUsingTestingViewportConfiguration() const { return m_useTestingViewportConfiguration; }
483 double minimumPageScaleFactor() const;
484 double maximumPageScaleFactor() const;
485 bool allowsUserScaling() const;
486 bool hasStablePageScaleFactor() const { return m_hasStablePageScaleFactor; }
488 void handleTap(const WebCore::IntPoint&, uint64_t lastLayerTreeTransactionId);
489 void potentialTapAtPosition(uint64_t requestID, const WebCore::FloatPoint&);
490 void commitPotentialTap(uint64_t lastLayerTreeTransactionId);
491 void commitPotentialTapFailed();
492 void cancelPotentialTap();
493 void tapHighlightAtPosition(uint64_t requestID, const WebCore::FloatPoint&);
495 void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&);
496 void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&);
498 void blurAssistedNode();
499 void selectWithGesture(const WebCore::IntPoint&, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, uint64_t callbackID);
500 void updateSelectionWithTouches(const WebCore::IntPoint& point, uint32_t touches, bool baseIsStart, uint64_t callbackID);
501 void updateBlockSelectionWithTouch(const WebCore::IntPoint&, uint32_t touch, uint32_t handlePosition);
502 void selectWithTwoTouches(const WebCore::IntPoint& from, const WebCore::IntPoint& to, uint32_t gestureType, uint32_t gestureState, uint64_t callbackID);
503 void extendSelection(uint32_t granularity);
504 void selectWordBackward();
505 void moveSelectionByOffset(int32_t offset, uint64_t callbackID);
506 void selectTextWithGranularityAtPoint(const WebCore::IntPoint&, uint32_t granularity, uint64_t callbackID);
507 void selectPositionAtBoundaryWithDirection(const WebCore::IntPoint&, uint32_t granularity, uint32_t direction, uint64_t callbackID);
508 void moveSelectionAtBoundaryWithDirection(uint32_t granularity, uint32_t direction, uint64_t callbackID);
509 void selectPositionAtPoint(const WebCore::IntPoint&, uint64_t callbackID);
510 void beginSelectionInDirection(uint32_t direction, uint64_t callbackID);
511 void updateSelectionWithExtentPoint(const WebCore::IntPoint&, uint64_t callbackID);
513 void elementDidFocus(WebCore::Node*);
514 void elementDidBlur(WebCore::Node*);
515 void requestDictationContext(uint64_t callbackID);
516 void replaceDictatedText(const String& oldText, const String& newText);
517 void replaceSelectedText(const String& oldText, const String& newText);
518 void requestAutocorrectionData(const String& textForAutocorrection, uint64_t callbackID);
519 void applyAutocorrection(const String& correction, const String& originalText, uint64_t callbackID);
520 void syncApplyAutocorrection(const String& correction, const String& originalText, bool& correctionApplied);
521 void requestAutocorrectionContext(uint64_t callbackID);
522 void getAutocorrectionContext(String& beforeText, String& markedText, String& selectedText, String& afterText, uint64_t& location, uint64_t& length);
523 void getPositionInformation(const WebCore::IntPoint&, InteractionInformationAtPosition&);
524 void requestPositionInformation(const WebCore::IntPoint&);
525 void startInteractionWithElementAtPosition(const WebCore::IntPoint&);
526 void stopInteraction();
527 void performActionOnElement(uint32_t action);
528 void focusNextAssistedNode(bool isForward, uint64_t callbackID);
529 void setAssistedNodeValue(const String&);
530 void setAssistedNodeValueAsNumber(double);
531 void setAssistedNodeSelectedIndex(uint32_t index, bool allowMultipleSelection);
532 void resetAssistedNodeForFrame(WebFrame*);
533 WebCore::IntRect rectForElementAtInteractionLocation();
534 void updateSelectionAppearance();
535 void getLookupContextAtPoint(const WebCore::IntPoint, uint64_t callbackID);
537 #if ENABLE(IOS_TOUCH_EVENTS)
538 void dispatchAsynchronousTouchEvents(const Vector<WebTouchEvent, 1>& queue);
541 void contentSizeCategoryDidChange(const String&);
542 void executeEditCommandWithCallback(const String&, uint64_t callbackID);
544 std::chrono::milliseconds eventThrottlingDelay() const;
546 void showInspectorHighlight(const WebCore::Highlight&);
547 void hideInspectorHighlight();
549 void showInspectorIndication();
550 void hideInspectorIndication();
552 void enableInspectorNodeSearch();
553 void disableInspectorNodeSearch();
556 void setLayerTreeStateIsFrozen(bool);
557 bool markLayersVolatileImmediatelyIfPossible();
559 NotificationPermissionRequestManager* notificationPermissionRequestManager();
561 void pageDidScroll();
562 #if USE(COORDINATED_GRAPHICS)
563 void pageDidRequestScroll(const WebCore::IntPoint&);
564 void setFixedVisibleContentRect(const WebCore::IntRect&);
565 void sendViewportAttributesChanged();
568 #if ENABLE(CONTEXT_MENUS)
569 WebContextMenu* contextMenu();
570 WebContextMenu* contextMenuAtPointInWindow(const WebCore::IntPoint&);
573 bool hasLocalDataForURL(const WebCore::URL&);
574 String cachedResponseMIMETypeForURL(const WebCore::URL&);
575 String cachedSuggestedFilenameForURL(const WebCore::URL&);
576 PassRefPtr<WebCore::SharedBuffer> cachedResponseDataForURL(const WebCore::URL&);
578 static bool canHandleRequest(const WebCore::ResourceRequest&);
580 class SandboxExtensionTracker {
582 ~SandboxExtensionTracker();
586 void beginLoad(WebFrame*, const SandboxExtension::Handle& handle);
587 void willPerformLoadDragDestinationAction(PassRefPtr<SandboxExtension> pendingDropSandboxExtension);
588 void didStartProvisionalLoad(WebFrame*);
589 void didCommitProvisionalLoad(WebFrame*);
590 void didFailProvisionalLoad(WebFrame*);
593 void setPendingProvisionalSandboxExtension(PassRefPtr<SandboxExtension>);
595 RefPtr<SandboxExtension> m_pendingProvisionalSandboxExtension;
596 RefPtr<SandboxExtension> m_provisionalSandboxExtension;
597 RefPtr<SandboxExtension> m_committedSandboxExtension;
600 SandboxExtensionTracker& sandboxExtensionTracker() { return m_sandboxExtensionTracker; }
603 void setThemePath(const String&);
606 #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
607 void commitPageTransitionViewport();
611 void setComposition(const String& text, const Vector<WebCore::CompositionUnderline>& underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeLength);
612 void confirmComposition(const String& text, int64_t selectionStart, int64_t selectionLength);
613 void cancelComposition();
616 #if PLATFORM (GTK) && HAVE(GTK_GESTURES)
617 void getCenterForZoomGesture(const WebCore::IntPoint& centerInViewCoordinates, WebCore::IntPoint& result);
620 void didChangeSelection();
621 void discardedComposition();
624 void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
625 WKAccessibilityWebPageObject* accessibilityRemoteObject();
626 NSObject *accessibilityObjectForMainFramePlugin();
627 const WebCore::FloatPoint& accessibilityPosition() const { return m_accessibilityPosition; }
629 void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
631 void insertTextAsync(const String& text, const EditingRange& replacementRange, bool registerUndoGroup = false);
632 void getMarkedRangeAsync(uint64_t callbackID);
633 void getSelectedRangeAsync(uint64_t callbackID);
634 void characterIndexForPointAsync(const WebCore::IntPoint&, uint64_t callbackID);
635 void firstRectForCharacterRangeAsync(const EditingRange&, uint64_t callbackID);
636 void setCompositionAsync(const String& text, Vector<WebCore::CompositionUnderline> underlines, const EditingRange& selectionRange, const EditingRange& replacementRange);
637 void confirmCompositionAsync();
640 void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::DictationAlternative>& dictationAlternativeLocations, bool registerUndoGroup = false);
641 void attributedSubstringForCharacterRangeAsync(const EditingRange&, uint64_t callbackID);
642 void fontAtSelection(uint64_t callbackID);
643 #if !USE(ASYNC_NSTEXTINPUTCLIENT)
644 void insertText(const String& text, const EditingRange& replacementRange, bool& handled, EditorState& newState);
645 void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, const EditingRange& selectionRange, const EditingRange& replacementRange, EditorState& newState);
646 void confirmComposition(EditorState& newState);
647 void insertDictatedText(const String& text, const EditingRange& replacementRange, const Vector<WebCore::DictationAlternative>& dictationAlternativeLocations, bool& handled, EditorState& newState);
648 void getAttributedSubstringFromRange(const EditingRange&, AttributedString&);
649 void getMarkedRange(EditingRange&);
650 void getSelectedRange(EditingRange&);
651 void characterIndexForPoint(const WebCore::IntPoint point, uint64_t& result);
652 void firstRectForCharacterRange(const EditingRange&, WebCore::IntRect& resultRect);
653 void executeKeypressCommands(const Vector<WebCore::KeypressCommand>&, bool& handled, EditorState& newState);
654 void cancelComposition(EditorState& newState);
658 void readSelectionFromPasteboard(const WTF::String& pasteboardName, bool& result);
659 void getStringSelectionForPasteboard(WTF::String& stringValue);
660 void getDataSelectionForPasteboard(const WTF::String pasteboardType, SharedMemory::Handle& handle, uint64_t& size);
661 void shouldDelayWindowOrderingEvent(const WebKit::WebMouseEvent&, bool& result);
662 void acceptsFirstMouse(int eventNumber, const WebKit::WebMouseEvent&, bool& result);
663 bool performNonEditingBehaviorForSelector(const String&, WebCore::KeyboardEvent*);
665 #if ENABLE(SERVICE_CONTROLS)
666 void replaceSelectionWithPasteboardData(const Vector<String>& types, const IPC::DataReference&);
670 void confirmComposition(const String& compositionString);
671 void setComposition(const WTF::String& compositionString, const WTF::Vector<WebCore::CompositionUnderline>& underlines, uint64_t cursorPosition);
672 void cancelComposition();
675 #if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
676 void updateAccessibilityTree();
679 void setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length);
680 bool hasCompositionForTesting();
681 void confirmCompositionForTesting(const String& compositionString);
683 // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require
684 // any synchronous messages, and should be removed when <rdar://problem/8775115> is fixed.
689 void speak(const String&);
692 void performDictionaryLookupForSelection(WebCore::Frame*, const WebCore::VisibleSelection&, WebCore::TextIndicatorPresentationTransition);
695 bool isSmartInsertDeleteEnabled();
696 void setSmartInsertDeleteEnabled(bool);
698 bool isSelectTrailingWhitespaceEnabled();
699 void setSelectTrailingWhitespaceEnabled(bool);
701 void replaceSelectionWithText(WebCore::Frame*, const String&);
702 void clearSelection();
703 void restoreSelectionInFocusedEditableElement();
705 #if ENABLE(DRAG_SUPPORT)
707 void performDragControllerAction(uint64_t action, WebCore::DragData);
709 void performDragControllerAction(uint64_t action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t draggingSourceOperationMask, const WTF::String& dragStorageName, uint32_t flags, const SandboxExtension::Handle&, const SandboxExtension::HandleArray&);
711 void dragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation);
713 void willPerformLoadDragDestinationAction();
714 void mayPerformUploadDragDestinationAction();
716 void willStartDrag() { ASSERT(!m_isStartingDrag); m_isStartingDrag = true; }
717 void didStartDrag() { ASSERT(m_isStartingDrag); m_isStartingDrag = false; }
718 #endif // ENABLE(DRAG_SUPPORT)
720 void beginPrinting(uint64_t frameID, const PrintInfo&);
722 void computePagesForPrinting(uint64_t frameID, const PrintInfo&, uint64_t callbackID);
723 void computePagesForPrintingImpl(uint64_t frameID, const PrintInfo&, Vector<WebCore::IntRect>& pageRects, double& totalScaleFactor);
725 void drawRectToImage(uint64_t frameID, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, uint64_t callbackID);
726 void drawPagesToPDF(uint64_t frameID, const PrintInfo&, uint32_t first, uint32_t count, uint64_t callbackID);
727 void drawPagesToPDFImpl(uint64_t frameID, const PrintInfo&, uint32_t first, uint32_t count, RetainPtr<CFMutableDataRef>& pdfPageData);
729 void computePagesForPrintingAndStartDrawingToPDF(uint64_t frameID, const PrintInfo&, uint32_t firstPage, PassRefPtr<Messages::WebPage::ComputePagesForPrintingAndStartDrawingToPDF::DelayedReply>);
732 void drawPagesForPrinting(uint64_t frameID, const PrintInfo&, uint64_t callbackID);
733 void didFinishPrintOperation(const WebCore::ResourceError&, uint64_t callbackID);
736 void addResourceRequest(unsigned long, const WebCore::ResourceRequest&);
737 void removeResourceRequest(unsigned long);
739 void setMediaVolume(float);
741 void setMayStartMediaWhenInWindow(bool);
743 void updateMainFrameScrollOffsetPinning();
745 bool mainFrameHasCustomContentProvider() const;
746 void addMIMETypeWithCustomContentProvider(const String&);
748 void mainFrameDidLayout();
750 bool canRunBeforeUnloadConfirmPanel() const { return m_canRunBeforeUnloadConfirmPanel; }
751 void setCanRunBeforeUnloadConfirmPanel(bool canRunBeforeUnloadConfirmPanel) { m_canRunBeforeUnloadConfirmPanel = canRunBeforeUnloadConfirmPanel; }
753 bool canRunModal() const { return m_canRunModal; }
754 void setCanRunModal(bool canRunModal) { m_canRunModal = canRunModal; }
758 void setDeviceScaleFactor(float);
759 float deviceScaleFactor() const;
761 void forceRepaintWithoutCallback();
763 void unmarkAllMisspellings();
764 void unmarkAllBadGrammar();
766 void handleAlternativeTextUIResult(const String&);
769 // For testing purpose.
770 void simulateMouseDown(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
771 void simulateMouseUp(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
772 void simulateMouseMotion(WebCore::IntPoint, double time);
774 #if ENABLE(CONTEXT_MENUS)
775 void contextMenuShowing() { m_isShowingContextMenu = true; }
778 void wheelEvent(const WebWheelEvent&);
780 void wheelEventHandlersChanged(bool);
781 void recomputeShortCircuitHorizontalWheelEventsState();
783 void updateVisibilityState(bool isInitialState = false);
786 void setViewportConfigurationMinimumLayoutSize(const WebCore::FloatSize&);
787 void setMaximumUnobscuredSize(const WebCore::FloatSize&);
788 void setDeviceOrientation(int32_t);
789 void dynamicViewportSizeUpdate(const WebCore::FloatSize& minimumLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, double scale, int32_t deviceOrientation, uint64_t dynamicViewportSizeUpdateID);
790 void synchronizeDynamicViewportUpdate(double& newTargetScale, WebCore::FloatPoint& newScrollPosition, uint64_t& nextValidLayerTreeTransactionID);
791 void updateVisibleContentRects(const VisibleContentRectUpdateInfo&, double oldestTimestamp);
792 bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; }
793 void willStartUserTriggeredZooming();
794 void applicationWillResignActive();
795 void applicationDidEnterBackground();
796 void applicationWillEnterForeground();
797 void applicationDidBecomeActive();
798 void zoomToRect(WebCore::FloatRect, double minimumScale, double maximumScale);
799 void completePendingSyntheticClickForContentChangeObserver();
802 #if ENABLE(IOS_TOUCH_EVENTS)
803 void dispatchTouchEvent(const WebTouchEvent&, bool& handled);
806 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
807 uint64_t nativeWindowHandle() { return m_nativeWindowHandle; }
810 bool shouldUseCustomContentProviderForResponse(const WebCore::ResourceResponse&);
811 bool canPluginHandleResponse(const WebCore::ResourceResponse& response);
813 bool asynchronousPluginInitializationEnabled() const { return m_asynchronousPluginInitializationEnabled; }
814 void setAsynchronousPluginInitializationEnabled(bool enabled) { m_asynchronousPluginInitializationEnabled = enabled; }
815 bool asynchronousPluginInitializationEnabledForAllPlugins() const { return m_asynchronousPluginInitializationEnabledForAllPlugins; }
816 void setAsynchronousPluginInitializationEnabledForAllPlugins(bool enabled) { m_asynchronousPluginInitializationEnabledForAllPlugins = enabled; }
817 bool artificialPluginInitializationDelayEnabled() const { return m_artificialPluginInitializationDelayEnabled; }
818 void setArtificialPluginInitializationDelayEnabled(bool enabled) { m_artificialPluginInitializationDelayEnabled = enabled; }
819 void setTabToLinksEnabled(bool enabled) { m_tabToLinks = enabled; }
820 bool tabToLinksEnabled() const { return m_tabToLinks; }
822 bool scrollingPerformanceLoggingEnabled() const { return m_scrollingPerformanceLoggingEnabled; }
823 void setScrollingPerformanceLoggingEnabled(bool);
826 bool shouldUsePDFPlugin() const;
827 bool pdfPluginEnabled() const { return m_pdfPluginEnabled; }
828 void setPDFPluginEnabled(bool enabled) { m_pdfPluginEnabled = enabled; }
831 void savePDFToFileInDownloadsFolder(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size);
833 void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
836 bool mainFrameIsScrollable() const { return m_mainFrameIsScrollable; }
838 void setMinimumLayoutSize(const WebCore::IntSize&);
839 WebCore::IntSize minimumLayoutSize() const { return m_minimumLayoutSize; }
841 void setAutoSizingShouldExpandToViewHeight(bool shouldExpand);
842 bool autoSizingShouldExpandToViewHeight() { return m_autoSizingShouldExpandToViewHeight; }
844 bool canShowMIMEType(const String& MIMEType) const;
846 void addTextCheckingRequest(uint64_t requestID, PassRefPtr<WebCore::TextCheckingRequest>);
847 void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
848 void didCancelCheckingText(uint64_t requestID);
850 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
851 void determinePrimarySnapshottedPlugIn();
852 void determinePrimarySnapshottedPlugInTimerFired();
853 void resetPrimarySnapshottedPlugIn();
854 bool matchesPrimaryPlugIn(const String& pageOrigin, const String& pluginOrigin, const String& mimeType) const;
855 bool plugInIntersectsSearchRect(WebCore::HTMLPlugInImageElement& pluginImageElement);
856 bool plugInIsPrimarySize(WebCore::HTMLPlugInImageElement& pluginImageElement, unsigned &pluginArea);
859 unsigned extendIncrementalRenderingSuppression();
860 void stopExtendingIncrementalRenderingSuppression(unsigned token);
861 bool shouldExtendIncrementalRenderingSuppression() { return !m_activeRenderingSuppressionTokens.isEmpty(); }
863 WebCore::ScrollPinningBehavior scrollPinningBehavior() { return m_scrollPinningBehavior; }
864 void setScrollPinningBehavior(uint32_t /* WebCore::ScrollPinningBehavior */ pinning);
866 WTF::Optional<WebCore::ScrollbarOverlayStyle> scrollbarOverlayStyle() { return m_scrollbarOverlayStyle; }
867 void setScrollbarOverlayStyle(WTF::Optional<uint32_t /* WebCore::ScrollbarOverlayStyle */> scrollbarStyle);
869 PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(WebCore::Frame&, const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
871 void getBytecodeProfile(uint64_t callbackID);
873 // Some platforms require accessibility-enabled processes to spin the run loop so that the WebProcess doesn't hang.
874 // While this is not ideal, it does not have to be applied to every platform at the moment.
875 static bool synchronousMessagesShouldSpinRunLoop();
877 #if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION)
878 void handleTelephoneNumberClick(const String& number, const WebCore::IntPoint&);
879 void handleSelectionServiceClick(WebCore::FrameSelection&, const Vector<String>& telephoneNumbers, const WebCore::IntPoint&);
882 void didChangeScrollOffsetForFrame(WebCore::Frame*);
884 void setMainFrameProgressCompleted(bool completed) { m_mainFrameProgressCompleted = completed; }
885 bool shouldDispatchFakeMouseMoveEvents() const { return m_shouldDispatchFakeMouseMoveEvents; }
887 void setPageActivityState(WebCore::PageActivityState::Flags);
889 void postMessage(const String& messageName, API::Object* messageBody);
890 void postSynchronousMessage(const String& messageName, API::Object* messageBody, RefPtr<API::Object>& returnData);
893 WebPage(uint64_t pageID, const WebPageCreationParameters&);
895 // IPC::MessageSender
896 virtual IPC::Connection* messageSenderConnection() override;
897 virtual uint64_t messageSenderDestinationID() override;
899 void platformInitialize();
900 void platformDetach();
901 void platformEditorState(WebCore::Frame&, EditorState& result, IncludePostLayoutDataHint) const;
903 void didReceiveWebPageMessage(IPC::Connection&, IPC::MessageDecoder&);
904 void didReceiveSyncWebPageMessage(IPC::Connection&, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&);
907 void resetViewportDefaultConfiguration(WebFrame* mainFrame);
908 void viewportConfigurationChanged();
909 void updateViewportSizeForCSSViewportUnits();
911 static void convertSelectionRectsToRootView(WebCore::FrameView*, Vector<WebCore::SelectionRect>&);
912 PassRefPtr<WebCore::Range> rangeForWebSelectionAtPosition(const WebCore::IntPoint&, const WebCore::VisiblePosition&, SelectionFlags&);
913 PassRefPtr<WebCore::Range> rangeForBlockAtPoint(const WebCore::IntPoint&);
914 void computeExpandAndShrinkThresholdsForHandle(const WebCore::IntPoint&, SelectionHandlePosition, float& growThreshold, float& shrinkThreshold);
915 PassRefPtr<WebCore::Range> changeBlockSelection(const WebCore::IntPoint&, SelectionHandlePosition, float& growThreshold, float& shrinkThreshold, SelectionFlags&);
916 PassRefPtr<WebCore::Range> expandedRangeFromHandle(WebCore::Range*, SelectionHandlePosition);
917 PassRefPtr<WebCore::Range> contractedRangeFromHandle(WebCore::Range* currentRange, SelectionHandlePosition, SelectionFlags&);
918 void getAssistedNodeInformation(AssistedNodeInformation&);
919 void platformInitializeAccessibility();
920 void handleSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location);
921 void completeSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location);
922 void sendTapHighlightForNodeIfNecessary(uint64_t requestID, WebCore::Node*);
923 void resetTextAutosizingBeforeLayoutIfNeeded(const WebCore::FloatSize& oldSize, const WebCore::FloatSize& newSize);
924 WebCore::VisiblePosition visiblePositionInFocusedNodeForPoint(WebCore::Frame&, const WebCore::IntPoint&);
925 void volatilityTimerFired();
928 static const char* interpretKeyEvent(const WebCore::KeyboardEvent*);
930 bool performDefaultBehaviorForKeyEvent(const WebKeyboardEvent&);
933 bool executeKeypressCommandsInternal(const Vector<WebCore::KeypressCommand>&, WebCore::KeyboardEvent*);
936 String sourceForFrame(WebFrame*);
938 void loadDataImpl(uint64_t navigationID, PassRefPtr<WebCore::SharedBuffer>, const String& MIMEType, const String& encodingName, const WebCore::URL& baseURL, const WebCore::URL& failingURL, const UserData&);
939 void loadString(uint64_t navigationID, const String&, const String& MIMEType, const WebCore::URL& baseURL, const WebCore::URL& failingURL, const UserData&);
941 bool platformHasLocalDataForURL(const WebCore::URL&);
945 void loadRequest(uint64_t navigationID, const WebCore::ResourceRequest&, const SandboxExtension::Handle&, uint64_t shouldOpenExternalURLsPolicy, const UserData&);
946 void loadData(const IPC::DataReference&, const String& MIMEType, const String& encodingName, const String& baseURL, const UserData&);
947 void loadHTMLString(uint64_t navigationID, const String& htmlString, const String& baseURL, const UserData&);
948 void loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL, const String& provisionalLoadErrorURL, const UserData&);
949 void loadPlainTextString(const String&, const UserData&);
950 void loadWebArchiveData(const IPC::DataReference&, const UserData&);
951 void navigateToPDFLinkWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint);
952 void reload(uint64_t navigationID, bool reloadFromOrigin, const SandboxExtension::Handle&);
953 void goForward(uint64_t navigationID, uint64_t);
954 void goBack(uint64_t navigationID, uint64_t);
955 void goToBackForwardItem(uint64_t navigationID, uint64_t);
956 void tryRestoreScrollPosition();
957 void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, uint64_t callbackID);
958 void setWindowResizerSize(const WebCore::IntSize&);
959 void updateIsInWindow(bool isInitialState = false);
960 void setViewState(WebCore::ViewState::Flags, bool wantsDidUpdateViewState, const Vector<uint64_t>& callbackIDs);
961 void validateCommand(const String&, uint64_t);
962 void executeEditCommand(const String&);
963 void setEditable(bool);
965 void updateUserActivity();
967 void mouseEvent(const WebMouseEvent&);
968 void mouseEventSyncForTesting(const WebMouseEvent&, bool&);
969 void wheelEventSyncForTesting(const WebWheelEvent&, bool&);
970 void keyEvent(const WebKeyboardEvent&);
971 void keyEventSyncForTesting(const WebKeyboardEvent&, bool&);
972 #if ENABLE(IOS_TOUCH_EVENTS)
973 void touchEventSync(const WebTouchEvent&, bool& handled);
974 #elif ENABLE(TOUCH_EVENTS)
975 void touchEvent(const WebTouchEvent&);
976 void touchEventSyncForTesting(const WebTouchEvent&, bool& handled);
978 #if ENABLE(CONTEXT_MENUS)
979 void contextMenuHidden() { m_isShowingContextMenu = false; }
982 static bool scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity);
983 static bool logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity);
985 void loadURLInFrame(const String&, uint64_t frameID);
987 void restoreSession(const Vector<BackForwardListItemState>&);
988 void didRemoveBackForwardItem(uint64_t);
990 #if ENABLE(REMOTE_INSPECTOR)
991 void setAllowsRemoteInspection(bool);
994 void setDrawsBackground(bool);
995 void setDrawsTransparentBackground(bool);
997 void setTopContentInset(float);
999 void viewWillStartLiveResize();
1000 void viewWillEndLiveResize();
1002 void getContentsAsString(uint64_t callbackID);
1004 void getContentsAsMHTMLData(uint64_t callbackID, bool useBinaryEncoding);
1006 void getMainResourceDataOfFrame(uint64_t frameID, uint64_t callbackID);
1007 void getResourceDataFromFrame(uint64_t frameID, const String& resourceURL, uint64_t callbackID);
1008 void getRenderTreeExternalRepresentation(uint64_t callbackID);
1009 void getSelectionOrContentsAsString(uint64_t callbackID);
1010 void getSelectionAsWebArchiveData(uint64_t callbackID);
1011 void getSourceForFrame(uint64_t frameID, uint64_t callbackID);
1012 void getWebArchiveOfFrame(uint64_t frameID, uint64_t callbackID);
1013 void runJavaScriptInMainFrame(const String&, uint64_t callbackID);
1014 void forceRepaint(uint64_t callbackID);
1015 void takeSnapshot(WebCore::IntRect snapshotRect, WebCore::IntSize bitmapSize, uint32_t options, uint64_t callbackID);
1017 void preferencesDidChange(const WebPreferencesStore&);
1018 void platformPreferencesDidChange(const WebPreferencesStore&);
1019 void updatePreferences(const WebPreferencesStore&);
1021 void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t navigationID, uint64_t downloadID);
1022 void setUserAgent(const String&);
1023 void setCustomTextEncodingName(const String&);
1024 void suspendActiveDOMObjectsAndAnimations();
1025 void resumeActiveDOMObjectsAndAnimations();
1028 void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
1029 void performDictionaryLookupOfCurrentSelection();
1030 void performDictionaryLookupForRange(WebCore::Frame*, WebCore::Range&, NSDictionary *options, WebCore::TextIndicatorPresentationTransition);
1031 DictionaryPopupInfo dictionaryPopupInfoForRange(WebCore::Frame* frame, WebCore::Range& range, NSDictionary **options, WebCore::TextIndicatorPresentationTransition presentationTransition);
1032 #if ENABLE(PDFKIT_PLUGIN)
1033 DictionaryPopupInfo dictionaryPopupInfoForSelectionInPDFPlugin(PDFSelection *, PDFPlugin&, NSDictionary **options, WebCore::TextIndicatorPresentationTransition);
1036 void windowAndViewFramesChanged(const WebCore::FloatRect& windowFrameInScreenCoordinates, const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates, const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
1038 RetainPtr<PDFDocument> pdfDocumentForPrintingFrame(WebCore::Frame*);
1039 void computePagesForPrintingPDFDocument(uint64_t frameID, const PrintInfo&, Vector<WebCore::IntRect>& resultPageRects);
1040 void drawPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, const WebCore::IntRect&);
1041 void drawPagesToPDFFromPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, uint32_t first, uint32_t count);
1044 void setMainFrameIsScrollable(bool);
1046 void unapplyEditCommand(uint64_t commandID);
1047 void reapplyEditCommand(uint64_t commandID);
1048 void didRemoveEditCommand(uint64_t commandID);
1050 void findString(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1051 void findStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1052 void getImageForFindMatch(uint32_t matchIndex);
1053 void selectFindMatch(uint32_t matchIndex);
1055 void countStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1057 #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
1058 void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize& area);
1061 void didChangeSelectedIndexForActivePopupMenu(int32_t newIndex);
1062 void setTextForActivePopupMenu(int32_t index);
1065 void failedToShowPopupMenu();
1069 void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const IPC::DataReference& iconData);
1071 void didChooseFilesForOpenPanel(const Vector<String>&);
1072 void didCancelForOpenPanel();
1073 #if ENABLE(SANDBOX_EXTENSIONS)
1074 void extendSandboxForFileFromOpenPanel(const SandboxExtension::Handle&);
1077 void didReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed);
1079 void didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed);
1081 #if ENABLE(MEDIA_STREAM)
1082 void didReceiveUserMediaPermissionDecision(uint64_t userMediaID, bool allowed);
1085 void advanceToNextMisspelling(bool startBeforeSelection);
1086 void changeSpellingToWord(const String& word);
1088 void uppercaseWord();
1089 void lowercaseWord();
1090 void capitalizeWord();
1093 #if ENABLE(CONTEXT_MENUS)
1094 void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&);
1097 void changeSelectedIndex(int32_t index);
1098 void setCanStartMediaTimerFired();
1100 bool canHandleUserEvents() const;
1102 static bool platformCanHandleRequest(const WebCore::ResourceRequest&);
1104 static PluginView* focusedPluginViewForFrame(WebCore::Frame&);
1105 static PluginView* pluginViewForFrame(WebCore::Frame*);
1107 static PassRefPtr<WebCore::Range> rangeFromEditingRange(WebCore::Frame&, const EditingRange&);
1109 void reportUsedFeatures();
1112 void performImmediateActionHitTestAtLocation(WebCore::FloatPoint);
1113 PassRefPtr<WebCore::Range> lookupTextAtLocation(WebCore::FloatPoint, NSDictionary **options);
1114 void immediateActionDidUpdate();
1115 void immediateActionDidCancel();
1116 void immediateActionDidComplete();
1117 void setFont(const String& fontFamily, double fontSize, uint64_t fontTraits);
1119 void dataDetectorsDidPresentUI(WebCore::PageOverlay::PageOverlayID);
1120 void dataDetectorsDidChangeUI(WebCore::PageOverlay::PageOverlayID);
1121 void dataDetectorsDidHideUI(WebCore::PageOverlay::PageOverlayID);
1124 void setShouldDispatchFakeMouseMoveEvents(bool dispatch) { m_shouldDispatchFakeMouseMoveEvents = dispatch; }
1126 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
1127 void playbackTargetSelected(uint64_t, const WebCore::MediaPlaybackTargetContext& outputDevice) const;
1128 void playbackTargetAvailabilityDidChange(uint64_t, bool);
1129 void setShouldPlayToPlaybackTarget(uint64_t, bool);
1132 void clearWheelEventTestTrigger();
1134 void setShouldScaleViewToFitDocument(bool);
1138 std::unique_ptr<WebCore::Page> m_page;
1139 RefPtr<WebFrame> m_mainFrame;
1140 RefPtr<InjectedBundleBackForwardList> m_backForwardList;
1142 RefPtr<WebPageGroupProxy> m_pageGroup;
1146 WebCore::IntSize m_viewSize;
1147 std::unique_ptr<DrawingArea> m_drawingArea;
1149 HashSet<PluginView*> m_pluginViews;
1150 bool m_hasSeenPlugin;
1152 HashMap<uint64_t, RefPtr<WebCore::TextCheckingRequest>> m_pendingTextCheckingRequestMap;
1154 bool m_useFixedLayout;
1156 bool m_drawsBackground;
1157 bool m_drawsTransparentBackground;
1159 WebCore::Color m_underlayColor;
1166 bool m_asynchronousPluginInitializationEnabled;
1167 bool m_asynchronousPluginInitializationEnabledForAllPlugins;
1168 bool m_artificialPluginInitializationDelayEnabled;
1170 bool m_scrollingPerformanceLoggingEnabled;
1172 bool m_mainFrameIsScrollable;
1174 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
1175 bool m_readyToFindPrimarySnapshottedPlugin;
1176 bool m_didFindPrimarySnapshottedPlugin;
1177 unsigned m_numberOfPrimarySnapshotDetectionAttempts;
1178 String m_primaryPlugInPageOrigin;
1179 String m_primaryPlugInOrigin;
1180 String m_primaryPlugInMimeType;
1181 RunLoop::Timer<WebPage> m_determinePrimarySnapshottedPlugInTimer;
1184 // The layer hosting mode.
1185 LayerHostingMode m_layerHostingMode;
1188 bool m_pdfPluginEnabled;
1190 bool m_hasCachedWindowFrame;
1192 // The frame of the containing window in screen coordinates.
1193 WebCore::FloatRect m_windowFrameInScreenCoordinates;
1195 // The frame of the containing window in unflipped screen coordinates.
1196 WebCore::FloatRect m_windowFrameInUnflippedScreenCoordinates;
1198 // The frame of the view in window coordinates.
1199 WebCore::FloatRect m_viewFrameInWindowCoordinates;
1201 // The accessibility position of the view.
1202 WebCore::FloatPoint m_accessibilityPosition;
1204 RetainPtr<WKAccessibilityWebPageObject> m_mockAccessibilityElement;
1206 ViewGestureGeometryCollector m_viewGestureGeometryCollector;
1208 #elif HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
1209 GRefPtr<WebPageAccessibilityObject> m_accessibilityObject;
1212 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
1213 // Our view's window in the UI process.
1214 uint64_t m_nativeWindowHandle;
1218 RefPtr<PageBanner> m_headerBanner;
1219 RefPtr<PageBanner> m_footerBanner;
1220 #endif // !PLATFORM(IOS)
1222 RunLoop::Timer<WebPage> m_setCanStartMediaTimer;
1223 bool m_mayStartMediaWhenInWindow;
1225 HashMap<uint64_t, RefPtr<WebUndoStep>> m_undoStepMap;
1227 WebCore::IntSize m_windowResizerSize;
1229 #if ENABLE(CONTEXT_MENUS)
1230 std::unique_ptr<API::InjectedBundle::PageContextMenuClient> m_contextMenuClient;
1232 InjectedBundlePageEditorClient m_editorClient;
1233 std::unique_ptr<API::InjectedBundle::FormClient> m_formClient;
1234 InjectedBundlePageLoaderClient m_loaderClient;
1235 InjectedBundlePagePolicyClient m_policyClient;
1236 InjectedBundlePageResourceLoadClient m_resourceLoadClient;
1237 std::unique_ptr<API::InjectedBundle::PageUIClient> m_uiClient;
1238 #if ENABLE(FULLSCREEN_API)
1239 InjectedBundlePageFullScreenClient m_fullScreenClient;
1241 InjectedBundlePageDiagnosticLoggingClient m_logDiagnosticMessageClient;
1243 FindController m_findController;
1245 RefPtr<WebInspector> m_inspector;
1246 RefPtr<WebInspectorUI> m_inspectorUI;
1248 RefPtr<WebVideoFullscreenManager> m_videoFullscreenManager;
1250 #if ENABLE(FULLSCREEN_API)
1251 RefPtr<WebFullScreenManager> m_fullScreenManager;
1253 RefPtr<WebPopupMenu> m_activePopupMenu;
1254 #if ENABLE(CONTEXT_MENUS)
1255 RefPtr<WebContextMenu> m_contextMenu;
1257 #if ENABLE(INPUT_TYPE_COLOR)
1258 WebColorChooser* m_activeColorChooser;
1260 RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener;
1261 RefPtr<NotificationPermissionRequestManager> m_notificationPermissionRequestManager;
1263 RefPtr<WebUserContentController> m_userContentController;
1265 #if ENABLE(GEOLOCATION)
1266 GeolocationPermissionRequestManager m_geolocationPermissionRequestManager;
1269 #if ENABLE(MEDIA_STREAM)
1270 UserMediaPermissionRequestManager m_userMediaPermissionRequestManager;
1273 std::unique_ptr<WebCore::PrintContext> m_printContext;
1275 RefPtr<WebPrintOperationGtk> m_printOperation;
1278 SandboxExtensionTracker m_sandboxExtensionTracker;
1280 RefPtr<SandboxExtension> m_pendingDropSandboxExtension;
1281 Vector<RefPtr<SandboxExtension>> m_pendingDropExtensionsForFileUpload;
1283 bool m_canRunBeforeUnloadConfirmPanel;
1286 bool m_isRunningModal;
1288 #if ENABLE(DRAG_SUPPORT)
1289 bool m_isStartingDrag;
1292 bool m_cachedMainFrameIsPinnedToLeftSide;
1293 bool m_cachedMainFrameIsPinnedToRightSide;
1294 bool m_cachedMainFrameIsPinnedToTopSide;
1295 bool m_cachedMainFrameIsPinnedToBottomSide;
1296 bool m_canShortCircuitHorizontalWheelEvents;
1297 bool m_hasWheelEventHandlers;
1299 unsigned m_cachedPageCount;
1301 HashSet<unsigned long> m_trackedNetworkResourceRequestIdentifiers;
1303 WebCore::IntSize m_minimumLayoutSize;
1304 bool m_autoSizingShouldExpandToViewHeight;
1306 #if ENABLE(CONTEXT_MENUS)
1307 bool m_isShowingContextMenu;
1311 RefPtr<WebCore::Node> m_assistedNode;
1312 RefPtr<WebCore::Range> m_currentWordRange;
1313 RefPtr<WebCore::Node> m_interactionNode;
1314 WebCore::IntPoint m_lastInteractionLocation;
1316 enum SelectionAnchor {
1320 SelectionAnchor m_selectionAnchor;
1322 RefPtr<WebCore::Node> m_potentialTapNode;
1323 WebCore::FloatPoint m_potentialTapLocation;
1325 WebCore::ViewportConfiguration m_viewportConfiguration;
1326 uint64_t m_firstLayerTreeTransactionIDAfterDidCommitLoad;
1327 bool m_hasReceivedVisibleContentRectsAfterDidCommitLoad;
1328 bool m_scaleWasSetByUIProcess;
1329 bool m_userHasChangedPageScaleFactor;
1330 bool m_hasStablePageScaleFactor;
1331 bool m_userIsInteracting;
1332 bool m_hasPendingBlurNotification;
1333 bool m_useTestingViewportConfiguration;
1334 bool m_isInStableState;
1335 std::chrono::milliseconds m_oldestNonStableUpdateVisibleContentRectsTimestamp;
1336 std::chrono::milliseconds m_estimatedLatency;
1337 WebCore::FloatSize m_screenSize;
1338 WebCore::FloatSize m_availableScreenSize;
1339 RefPtr<WebCore::Range> m_currentBlockSelection;
1340 WebCore::IntSize m_blockSelectionDesiredSize;
1341 WebCore::FloatSize m_maximumUnobscuredSize;
1342 int32_t m_deviceOrientation;
1343 bool m_inDynamicSizeUpdate;
1344 HashMap<std::pair<WebCore::IntSize, double>, WebCore::IntPoint> m_dynamicSizeUpdateHistory;
1345 RefPtr<WebCore::Node> m_pendingSyntheticClickNode;
1346 WebCore::FloatPoint m_pendingSyntheticClickLocation;
1347 WebCore::FloatRect m_previousExposedContentRect;
1348 WebCore::Timer m_volatilityTimer;
1351 WebInspectorClient* m_inspectorClient;
1353 HashSet<String, CaseFoldingHash> m_mimeTypesWithCustomContentProviders;
1354 WebCore::Color m_backgroundColor;
1356 HashSet<unsigned> m_activeRenderingSuppressionTokens;
1357 unsigned m_maximumRenderingSuppressionToken;
1359 WebCore::ScrollPinningBehavior m_scrollPinningBehavior;
1360 WTF::Optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle;
1362 bool m_useAsyncScrolling;
1364 WebCore::ViewState::Flags m_viewState;
1365 WebCore::PageActivityState::Flags m_activityState;
1367 bool m_processSuppressionEnabled;
1368 UserActivity m_userActivity;
1370 uint64_t m_pendingNavigationID;
1373 WebCore::WebGLLoadPolicy m_systemWebGLPolicy;
1376 bool m_mainFrameProgressCompleted;
1377 bool m_shouldDispatchFakeMouseMoveEvents;
1378 bool m_isEditorStateMissingPostLayoutData { false };
1381 } // namespace WebKit