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 didFinishLoad(WebFrame*);
258 String userAgent(const WebCore::URL&) const;
259 String userAgent(WebFrame*, const WebCore::URL&) const;
260 String platformUserAgent(const WebCore::URL&) const;
261 WebCore::IntRect windowResizerRect() const;
262 WebCore::KeyboardUIMode keyboardUIMode();
264 WebUndoStep* webUndoStep(uint64_t);
265 void addWebUndoStep(uint64_t, WebUndoStep*);
266 void removeWebEditCommand(uint64_t);
267 bool isInRedo() const { return m_isInRedo; }
269 void setActivePopupMenu(WebPopupMenu*);
271 #if ENABLE(INPUT_TYPE_COLOR)
272 WebColorChooser* activeColorChooser() const { return m_activeColorChooser; }
273 void setActiveColorChooser(WebColorChooser*);
274 void didChooseColor(const WebCore::Color&);
275 void didEndColorPicker();
278 WebOpenPanelResultListener* activeOpenPanelResultListener() const { return m_activeOpenPanelResultListener.get(); }
279 void setActiveOpenPanelResultListener(PassRefPtr<WebOpenPanelResultListener>);
281 void didReceiveMessage(IPC::Connection&, IPC::MessageDecoder&) override;
282 void didReceiveSyncMessage(IPC::Connection&, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&) override;
284 // -- InjectedBundle methods
285 #if ENABLE(CONTEXT_MENUS)
286 void setInjectedBundleContextMenuClient(std::unique_ptr<API::InjectedBundle::PageContextMenuClient>);
288 void initializeInjectedBundleEditorClient(WKBundlePageEditorClientBase*);
289 void setInjectedBundleFormClient(std::unique_ptr<API::InjectedBundle::FormClient>);
290 void initializeInjectedBundleLoaderClient(WKBundlePageLoaderClientBase*);
291 void initializeInjectedBundlePolicyClient(WKBundlePagePolicyClientBase*);
292 void initializeInjectedBundleResourceLoadClient(WKBundlePageResourceLoadClientBase*);
293 void setInjectedBundleUIClient(std::unique_ptr<API::InjectedBundle::PageUIClient>);
294 #if ENABLE(FULLSCREEN_API)
295 void initializeInjectedBundleFullScreenClient(WKBundlePageFullScreenClientBase*);
297 void initializeInjectedBundleDiagnosticLoggingClient(WKBundlePageDiagnosticLoggingClientBase*);
299 #if ENABLE(CONTEXT_MENUS)
300 API::InjectedBundle::PageContextMenuClient& injectedBundleContextMenuClient() { return *m_contextMenuClient.get(); }
302 InjectedBundlePageEditorClient& injectedBundleEditorClient() { return m_editorClient; }
303 API::InjectedBundle::FormClient& injectedBundleFormClient() { return *m_formClient.get(); }
304 InjectedBundlePageLoaderClient& injectedBundleLoaderClient() { return m_loaderClient; }
305 InjectedBundlePagePolicyClient& injectedBundlePolicyClient() { return m_policyClient; }
306 InjectedBundlePageResourceLoadClient& injectedBundleResourceLoadClient() { return m_resourceLoadClient; }
307 API::InjectedBundle::PageUIClient& injectedBundleUIClient() { return *m_uiClient.get(); }
308 InjectedBundlePageDiagnosticLoggingClient& injectedBundleDiagnosticLoggingClient() { return m_logDiagnosticMessageClient; }
309 #if ENABLE(FULLSCREEN_API)
310 InjectedBundlePageFullScreenClient& injectedBundleFullScreenClient() { return m_fullScreenClient; }
313 bool findStringFromInjectedBundle(const String&, FindOptions);
315 WebFrame* mainWebFrame() const { return m_mainFrame.get(); }
317 WebCore::MainFrame* mainFrame() const; // May return 0.
318 WebCore::FrameView* mainFrameView() const; // May return 0.
320 PassRefPtr<WebCore::Range> currentSelectionAsRange();
322 #if ENABLE(NETSCAPE_PLUGIN_API)
323 PassRefPtr<Plugin> createPlugin(WebFrame*, WebCore::HTMLPlugInElement*, const Plugin::Parameters&, String& newMIMEType);
327 WebCore::WebGLLoadPolicy webGLPolicyForURL(WebFrame*, const String&);
328 WebCore::WebGLLoadPolicy resolveWebGLPolicyForURL(WebFrame*, const String&);
329 #endif // ENABLE(WEBGL)
331 enum class IncludePostLayoutDataHint { No, Yes };
332 EditorState editorState(IncludePostLayoutDataHint = IncludePostLayoutDataHint::Yes) const;
333 void sendPostLayoutEditorStateIfNeeded();
335 String renderTreeExternalRepresentation() const;
336 String renderTreeExternalRepresentationForPrinting() const;
337 uint64_t renderTreeSize() const;
339 void setTracksRepaints(bool);
340 bool isTrackingRepaints() const;
341 void resetTrackedRepaints();
342 Ref<API::Array> trackedRepaintRects();
344 void executeEditingCommand(const String& commandName, const String& argument);
345 bool isEditingCommandEnabled(const String& commandName);
346 void clearMainFrameName();
349 void sendSetWindowFrame(const WebCore::FloatRect&);
351 double textZoomFactor() const;
352 void setTextZoomFactor(double);
353 double pageZoomFactor() const;
354 void setPageZoomFactor(double);
355 void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
356 void windowScreenDidChange(uint32_t);
358 void scalePage(double scale, const WebCore::IntPoint& origin);
359 void scalePageInViewCoordinates(double scale, WebCore::IntPoint centerInViewCoordinates);
360 double pageScaleFactor() const;
361 double totalScaleFactor() const;
362 double viewScaleFactor() const { return m_viewScaleFactor; }
363 void scaleView(double scale);
365 void setUseFixedLayout(bool);
366 bool useFixedLayout() const { return m_useFixedLayout; }
367 void setFixedLayoutSize(const WebCore::IntSize&);
368 WebCore::IntSize fixedLayoutSize() const;
370 void listenForLayoutMilestones(uint32_t /* LayoutMilestones */);
372 void setSuppressScrollbarAnimations(bool);
374 void setEnableVerticalRubberBanding(bool);
375 void setEnableHorizontalRubberBanding(bool);
377 void setBackgroundExtendsBeyondPage(bool);
379 void setPaginationMode(uint32_t /* WebCore::Pagination::Mode */);
380 void setPaginationBehavesLikeColumns(bool);
381 void setPageLength(double);
382 void setGapBetweenPages(double);
384 void postInjectedBundleMessage(const String& messageName, const UserData&);
386 bool drawsBackground() const { return m_drawsBackground; }
387 bool drawsTransparentBackground() const { return m_drawsTransparentBackground; }
389 void setUnderlayColor(const WebCore::Color& color) { m_underlayColor = color; }
390 WebCore::Color underlayColor() const { return m_underlayColor; }
393 void stopLoadingFrame(uint64_t frameID);
394 bool defersLoading() const;
395 void setDefersLoading(bool deferLoading);
397 void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*);
398 void exitAcceleratedCompositingMode();
400 void addPluginView(PluginView*);
401 void removePluginView(PluginView*);
403 bool isVisible() const { return m_viewState & WebCore::ViewState::IsVisible; }
404 bool isVisibleOrOccluded() const { return m_viewState & WebCore::ViewState::IsVisibleOrOccluded; }
406 LayerHostingMode layerHostingMode() const { return m_layerHostingMode; }
407 void setLayerHostingMode(unsigned);
410 void updatePluginsActiveAndFocusedState();
411 const WebCore::FloatRect& windowFrameInScreenCoordinates() const { return m_windowFrameInScreenCoordinates; }
412 const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates() const { return m_windowFrameInUnflippedScreenCoordinates; }
413 const WebCore::FloatRect& viewFrameInWindowCoordinates() const { return m_viewFrameInWindowCoordinates; }
415 bool hasCachedWindowFrame() const { return m_hasCachedWindowFrame; }
418 void setTopOverhangImage(PassRefPtr<WebImage>);
419 void setBottomOverhangImage(PassRefPtr<WebImage>);
420 #endif // !PLATFORM(IOS)
422 void updateHeaderAndFooterLayersForDeviceScaleChange(float scaleFactor);
423 #endif // PLATFORM(COCOA)
425 bool windowIsFocused() const;
426 bool windowAndWebPageAreFocused() const;
429 void setHeaderPageBanner(PassRefPtr<PageBanner>);
430 PageBanner* headerPageBanner();
431 void setFooterPageBanner(PassRefPtr<PageBanner>);
432 PageBanner* footerPageBanner();
434 void hidePageBanners();
435 void showPageBanners();
437 #endif // !PLATFORM(IOS)
439 WebCore::IntPoint screenToRootView(const WebCore::IntPoint&);
440 WebCore::IntRect rootViewToScreen(const WebCore::IntRect&);
443 WebCore::IntPoint accessibilityScreenToRootView(const WebCore::IntPoint&);
444 WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&);
447 PassRefPtr<WebImage> scaledSnapshotWithOptions(const WebCore::IntRect&, double additionalScaleFactor, SnapshotOptions);
448 PassRefPtr<WebImage> snapshotAtSize(const WebCore::IntRect&, const WebCore::IntSize& bitmapSize, SnapshotOptions);
449 PassRefPtr<WebImage> snapshotNode(WebCore::Node&, SnapshotOptions, unsigned maximumPixelCount = std::numeric_limits<unsigned>::max());
451 static const WebEvent* currentEvent();
453 FindController& findController() { return m_findController; }
455 #if ENABLE(GEOLOCATION)
456 GeolocationPermissionRequestManager& geolocationPermissionRequestManager() { return m_geolocationPermissionRequestManager; }
459 #if PLATFORM(IOS) || PLATFORM(EFL)
460 void savePageState(WebCore::HistoryItem&);
461 void restorePageState(const WebCore::HistoryItem&);
464 #if ENABLE(MEDIA_STREAM)
465 UserMediaPermissionRequestManager& userMediaPermissionRequestManager() { return m_userMediaPermissionRequestManager; }
469 WebCore::FloatSize screenSize() const;
470 WebCore::FloatSize availableScreenSize() const;
471 int32_t deviceOrientation() const { return m_deviceOrientation; }
472 void viewportPropertiesDidChange(const WebCore::ViewportArguments&);
473 void didReceiveMobileDocType(bool);
475 void setUseTestingViewportConfiguration(bool useTestingViewport) { m_useTestingViewportConfiguration = useTestingViewport; }
476 bool isUsingTestingViewportConfiguration() const { return m_useTestingViewportConfiguration; }
478 double minimumPageScaleFactor() const;
479 double maximumPageScaleFactor() const;
480 bool allowsUserScaling() const;
481 bool hasStablePageScaleFactor() const { return m_hasStablePageScaleFactor; }
483 void handleTap(const WebCore::IntPoint&, uint64_t lastLayerTreeTransactionId);
484 void potentialTapAtPosition(uint64_t requestID, const WebCore::FloatPoint&);
485 void commitPotentialTap(uint64_t lastLayerTreeTransactionId);
486 void commitPotentialTapFailed();
487 void cancelPotentialTap();
488 void tapHighlightAtPosition(uint64_t requestID, const WebCore::FloatPoint&);
490 void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&);
491 void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&);
493 void blurAssistedNode();
494 void selectWithGesture(const WebCore::IntPoint&, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, uint64_t callbackID);
495 void updateSelectionWithTouches(const WebCore::IntPoint& point, uint32_t touches, bool baseIsStart, uint64_t callbackID);
496 void updateBlockSelectionWithTouch(const WebCore::IntPoint&, uint32_t touch, uint32_t handlePosition);
497 void selectWithTwoTouches(const WebCore::IntPoint& from, const WebCore::IntPoint& to, uint32_t gestureType, uint32_t gestureState, uint64_t callbackID);
498 void extendSelection(uint32_t granularity);
499 void selectWordBackward();
500 void moveSelectionByOffset(int32_t offset, uint64_t callbackID);
501 void selectTextWithGranularityAtPoint(const WebCore::IntPoint&, uint32_t granularity, uint64_t callbackID);
502 void selectPositionAtBoundaryWithDirection(const WebCore::IntPoint&, uint32_t granularity, uint32_t direction, uint64_t callbackID);
503 void selectPositionAtPoint(const WebCore::IntPoint&, uint64_t callbackID);
504 void beginSelectionInDirection(uint32_t direction, uint64_t callbackID);
505 void updateSelectionWithExtentPoint(const WebCore::IntPoint&, uint64_t callbackID);
507 void elementDidFocus(WebCore::Node*);
508 void elementDidBlur(WebCore::Node*);
509 void requestDictationContext(uint64_t callbackID);
510 void replaceDictatedText(const String& oldText, const String& newText);
511 void replaceSelectedText(const String& oldText, const String& newText);
512 void requestAutocorrectionData(const String& textForAutocorrection, uint64_t callbackID);
513 void applyAutocorrection(const String& correction, const String& originalText, uint64_t callbackID);
514 void syncApplyAutocorrection(const String& correction, const String& originalText, bool& correctionApplied);
515 void requestAutocorrectionContext(uint64_t callbackID);
516 void getAutocorrectionContext(String& beforeText, String& markedText, String& selectedText, String& afterText, uint64_t& location, uint64_t& length);
517 void getPositionInformation(const WebCore::IntPoint&, InteractionInformationAtPosition&);
518 void requestPositionInformation(const WebCore::IntPoint&);
519 void startInteractionWithElementAtPosition(const WebCore::IntPoint&);
520 void stopInteraction();
521 void performActionOnElement(uint32_t action);
522 void focusNextAssistedNode(bool isForward, uint64_t callbackID);
523 void setAssistedNodeValue(const String&);
524 void setAssistedNodeValueAsNumber(double);
525 void setAssistedNodeSelectedIndex(uint32_t index, bool allowMultipleSelection);
526 void resetAssistedNodeForFrame(WebFrame*);
527 WebCore::IntRect rectForElementAtInteractionLocation();
528 void updateSelectionAppearance();
530 #if ENABLE(IOS_TOUCH_EVENTS)
531 void dispatchAsynchronousTouchEvents(const Vector<WebTouchEvent, 1>& queue);
534 void contentSizeCategoryDidChange(const String&);
535 void executeEditCommandWithCallback(const String&, uint64_t callbackID);
537 std::chrono::milliseconds eventThrottlingDelay() const;
539 void showInspectorHighlight(const WebCore::Highlight&);
540 void hideInspectorHighlight();
542 void showInspectorIndication();
543 void hideInspectorIndication();
545 void enableInspectorNodeSearch();
546 void disableInspectorNodeSearch();
549 NotificationPermissionRequestManager* notificationPermissionRequestManager();
551 void pageDidScroll();
552 #if USE(TILED_BACKING_STORE)
553 void pageDidRequestScroll(const WebCore::IntPoint&);
554 void setFixedVisibleContentRect(const WebCore::IntRect&);
555 void sendViewportAttributesChanged();
558 #if ENABLE(CONTEXT_MENUS)
559 WebContextMenu* contextMenu();
560 WebContextMenu* contextMenuAtPointInWindow(const WebCore::IntPoint&);
563 bool hasLocalDataForURL(const WebCore::URL&);
564 String cachedResponseMIMETypeForURL(const WebCore::URL&);
565 String cachedSuggestedFilenameForURL(const WebCore::URL&);
566 PassRefPtr<WebCore::SharedBuffer> cachedResponseDataForURL(const WebCore::URL&);
568 static bool canHandleRequest(const WebCore::ResourceRequest&);
570 class SandboxExtensionTracker {
572 ~SandboxExtensionTracker();
576 void beginLoad(WebFrame*, const SandboxExtension::Handle& handle);
577 void willPerformLoadDragDestinationAction(PassRefPtr<SandboxExtension> pendingDropSandboxExtension);
578 void didStartProvisionalLoad(WebFrame*);
579 void didCommitProvisionalLoad(WebFrame*);
580 void didFailProvisionalLoad(WebFrame*);
583 void setPendingProvisionalSandboxExtension(PassRefPtr<SandboxExtension>);
585 RefPtr<SandboxExtension> m_pendingProvisionalSandboxExtension;
586 RefPtr<SandboxExtension> m_provisionalSandboxExtension;
587 RefPtr<SandboxExtension> m_committedSandboxExtension;
590 SandboxExtensionTracker& sandboxExtensionTracker() { return m_sandboxExtensionTracker; }
593 void setThemePath(const String&);
596 #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
597 void commitPageTransitionViewport();
601 void setComposition(const String& text, const Vector<WebCore::CompositionUnderline>& underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeLength);
602 void confirmComposition(const String& text, int64_t selectionStart, int64_t selectionLength);
603 void cancelComposition();
606 #if PLATFORM (GTK) && HAVE(GTK_GESTURES)
607 void getCenterForZoomGesture(const WebCore::IntPoint& centerInViewCoordinates, WebCore::IntPoint& result);
610 void didChangeSelection();
611 void discardedComposition();
614 void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
615 WKAccessibilityWebPageObject* accessibilityRemoteObject();
616 NSObject *accessibilityObjectForMainFramePlugin();
617 const WebCore::FloatPoint& accessibilityPosition() const { return m_accessibilityPosition; }
619 void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
621 void insertTextAsync(const String& text, const EditingRange& replacementRange, bool registerUndoGroup = false);
622 void getMarkedRangeAsync(uint64_t callbackID);
623 void getSelectedRangeAsync(uint64_t callbackID);
624 void characterIndexForPointAsync(const WebCore::IntPoint&, uint64_t callbackID);
625 void firstRectForCharacterRangeAsync(const EditingRange&, uint64_t callbackID);
626 void setCompositionAsync(const String& text, Vector<WebCore::CompositionUnderline> underlines, const EditingRange& selectionRange, const EditingRange& replacementRange);
627 void confirmCompositionAsync();
630 void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::DictationAlternative>& dictationAlternativeLocations, bool registerUndoGroup = false);
631 void attributedSubstringForCharacterRangeAsync(const EditingRange&, uint64_t callbackID);
632 void fontAtSelection(uint64_t callbackID);
633 #if !USE(ASYNC_NSTEXTINPUTCLIENT)
634 void insertText(const String& text, const EditingRange& replacementRange, bool& handled, EditorState& newState);
635 void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, const EditingRange& selectionRange, const EditingRange& replacementRange, EditorState& newState);
636 void confirmComposition(EditorState& newState);
637 void insertDictatedText(const String& text, const EditingRange& replacementRange, const Vector<WebCore::DictationAlternative>& dictationAlternativeLocations, bool& handled, EditorState& newState);
638 void getAttributedSubstringFromRange(const EditingRange&, AttributedString&);
639 void getMarkedRange(EditingRange&);
640 void getSelectedRange(EditingRange&);
641 void characterIndexForPoint(const WebCore::IntPoint point, uint64_t& result);
642 void firstRectForCharacterRange(const EditingRange&, WebCore::IntRect& resultRect);
643 void executeKeypressCommands(const Vector<WebCore::KeypressCommand>&, bool& handled, EditorState& newState);
644 void cancelComposition(EditorState& newState);
648 void readSelectionFromPasteboard(const WTF::String& pasteboardName, bool& result);
649 void getStringSelectionForPasteboard(WTF::String& stringValue);
650 void getDataSelectionForPasteboard(const WTF::String pasteboardType, SharedMemory::Handle& handle, uint64_t& size);
651 void shouldDelayWindowOrderingEvent(const WebKit::WebMouseEvent&, bool& result);
652 void acceptsFirstMouse(int eventNumber, const WebKit::WebMouseEvent&, bool& result);
653 bool performNonEditingBehaviorForSelector(const String&, WebCore::KeyboardEvent*);
655 #if ENABLE(SERVICE_CONTROLS)
656 void replaceSelectionWithPasteboardData(const Vector<String>& types, const IPC::DataReference&);
660 void confirmComposition(const String& compositionString);
661 void setComposition(const WTF::String& compositionString, const WTF::Vector<WebCore::CompositionUnderline>& underlines, uint64_t cursorPosition);
662 void cancelComposition();
665 #if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
666 void updateAccessibilityTree();
669 void setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length);
670 bool hasCompositionForTesting();
671 void confirmCompositionForTesting(const String& compositionString);
673 // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require
674 // any synchronous messages, and should be removed when <rdar://problem/8775115> is fixed.
679 void speak(const String&);
682 void performDictionaryLookupForSelection(WebCore::Frame*, const WebCore::VisibleSelection&, WebCore::TextIndicatorPresentationTransition);
685 bool isSmartInsertDeleteEnabled();
686 void setSmartInsertDeleteEnabled(bool);
688 bool isSelectTrailingWhitespaceEnabled();
689 void setSelectTrailingWhitespaceEnabled(bool);
691 void replaceSelectionWithText(WebCore::Frame*, const String&);
692 void clearSelection();
693 void restoreSelectionInFocusedEditableElement();
695 #if ENABLE(DRAG_SUPPORT)
697 void performDragControllerAction(uint64_t action, WebCore::DragData);
699 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&);
701 void dragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation);
703 void willPerformLoadDragDestinationAction();
704 void mayPerformUploadDragDestinationAction();
706 void willStartDrag() { ASSERT(!m_isStartingDrag); m_isStartingDrag = true; }
707 void didStartDrag() { ASSERT(m_isStartingDrag); m_isStartingDrag = false; }
708 #endif // ENABLE(DRAG_SUPPORT)
710 void beginPrinting(uint64_t frameID, const PrintInfo&);
712 void computePagesForPrinting(uint64_t frameID, const PrintInfo&, uint64_t callbackID);
713 void computePagesForPrintingImpl(uint64_t frameID, const PrintInfo&, Vector<WebCore::IntRect>& pageRects, double& totalScaleFactor);
715 void drawRectToImage(uint64_t frameID, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, uint64_t callbackID);
716 void drawPagesToPDF(uint64_t frameID, const PrintInfo&, uint32_t first, uint32_t count, uint64_t callbackID);
717 void drawPagesToPDFImpl(uint64_t frameID, const PrintInfo&, uint32_t first, uint32_t count, RetainPtr<CFMutableDataRef>& pdfPageData);
719 void computePagesForPrintingAndStartDrawingToPDF(uint64_t frameID, const PrintInfo&, uint32_t firstPage, PassRefPtr<Messages::WebPage::ComputePagesForPrintingAndStartDrawingToPDF::DelayedReply>);
722 void drawPagesForPrinting(uint64_t frameID, const PrintInfo&, uint64_t callbackID);
723 void didFinishPrintOperation(const WebCore::ResourceError&, uint64_t callbackID);
726 void addResourceRequest(unsigned long, const WebCore::ResourceRequest&);
727 void removeResourceRequest(unsigned long);
729 void setMediaVolume(float);
731 void setMayStartMediaWhenInWindow(bool);
733 void updateMainFrameScrollOffsetPinning();
735 bool mainFrameHasCustomContentProvider() const;
736 void addMIMETypeWithCustomContentProvider(const String&);
738 void mainFrameDidLayout();
740 bool canRunBeforeUnloadConfirmPanel() const { return m_canRunBeforeUnloadConfirmPanel; }
741 void setCanRunBeforeUnloadConfirmPanel(bool canRunBeforeUnloadConfirmPanel) { m_canRunBeforeUnloadConfirmPanel = canRunBeforeUnloadConfirmPanel; }
743 bool canRunModal() const { return m_canRunModal; }
744 void setCanRunModal(bool canRunModal) { m_canRunModal = canRunModal; }
748 void setDeviceScaleFactor(float);
749 float deviceScaleFactor() const;
751 void forceRepaintWithoutCallback();
753 void unmarkAllMisspellings();
754 void unmarkAllBadGrammar();
756 void handleAlternativeTextUIResult(const String&);
759 // For testing purpose.
760 void simulateMouseDown(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
761 void simulateMouseUp(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
762 void simulateMouseMotion(WebCore::IntPoint, double time);
764 #if ENABLE(CONTEXT_MENUS)
765 void contextMenuShowing() { m_isShowingContextMenu = true; }
768 void wheelEvent(const WebWheelEvent&);
770 void wheelEventHandlersChanged(bool);
771 void recomputeShortCircuitHorizontalWheelEventsState();
773 void updateVisibilityState(bool isInitialState = false);
776 void setViewportConfigurationMinimumLayoutSize(const WebCore::FloatSize&);
777 void setMaximumUnobscuredSize(const WebCore::FloatSize&);
778 void setDeviceOrientation(int32_t);
779 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);
780 void synchronizeDynamicViewportUpdate(double& newTargetScale, WebCore::FloatPoint& newScrollPosition, uint64_t& nextValidLayerTreeTransactionID);
781 void updateVisibleContentRects(const VisibleContentRectUpdateInfo&, double oldestTimestamp);
782 bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; }
783 void willStartUserTriggeredZooming();
784 void applicationWillResignActive();
785 void applicationWillEnterForeground();
786 void applicationDidBecomeActive();
787 void zoomToRect(WebCore::FloatRect, double minimumScale, double maximumScale);
788 void completePendingSyntheticClickForContentChangeObserver();
791 #if ENABLE(IOS_TOUCH_EVENTS)
792 void dispatchTouchEvent(const WebTouchEvent&, bool& handled);
795 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
796 uint64_t nativeWindowHandle() { return m_nativeWindowHandle; }
799 bool shouldUseCustomContentProviderForResponse(const WebCore::ResourceResponse&);
800 bool canPluginHandleResponse(const WebCore::ResourceResponse& response);
802 bool asynchronousPluginInitializationEnabled() const { return m_asynchronousPluginInitializationEnabled; }
803 void setAsynchronousPluginInitializationEnabled(bool enabled) { m_asynchronousPluginInitializationEnabled = enabled; }
804 bool asynchronousPluginInitializationEnabledForAllPlugins() const { return m_asynchronousPluginInitializationEnabledForAllPlugins; }
805 void setAsynchronousPluginInitializationEnabledForAllPlugins(bool enabled) { m_asynchronousPluginInitializationEnabledForAllPlugins = enabled; }
806 bool artificialPluginInitializationDelayEnabled() const { return m_artificialPluginInitializationDelayEnabled; }
807 void setArtificialPluginInitializationDelayEnabled(bool enabled) { m_artificialPluginInitializationDelayEnabled = enabled; }
808 void setTabToLinksEnabled(bool enabled) { m_tabToLinks = enabled; }
809 bool tabToLinksEnabled() const { return m_tabToLinks; }
811 bool scrollingPerformanceLoggingEnabled() const { return m_scrollingPerformanceLoggingEnabled; }
812 void setScrollingPerformanceLoggingEnabled(bool);
815 bool shouldUsePDFPlugin() const;
816 bool pdfPluginEnabled() const { return m_pdfPluginEnabled; }
817 void setPDFPluginEnabled(bool enabled) { m_pdfPluginEnabled = enabled; }
820 void savePDFToFileInDownloadsFolder(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size);
822 void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
825 bool mainFrameIsScrollable() const { return m_mainFrameIsScrollable; }
827 void setMinimumLayoutSize(const WebCore::IntSize&);
828 WebCore::IntSize minimumLayoutSize() const { return m_minimumLayoutSize; }
830 void setAutoSizingShouldExpandToViewHeight(bool shouldExpand);
831 bool autoSizingShouldExpandToViewHeight() { return m_autoSizingShouldExpandToViewHeight; }
833 bool canShowMIMEType(const String& MIMEType) const;
835 void addTextCheckingRequest(uint64_t requestID, PassRefPtr<WebCore::TextCheckingRequest>);
836 void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
837 void didCancelCheckingText(uint64_t requestID);
839 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
840 void determinePrimarySnapshottedPlugIn();
841 void determinePrimarySnapshottedPlugInTimerFired();
842 void resetPrimarySnapshottedPlugIn();
843 bool matchesPrimaryPlugIn(const String& pageOrigin, const String& pluginOrigin, const String& mimeType) const;
844 bool plugInIntersectsSearchRect(WebCore::HTMLPlugInImageElement& pluginImageElement);
845 bool plugInIsPrimarySize(WebCore::HTMLPlugInImageElement& pluginImageElement, unsigned &pluginArea);
848 unsigned extendIncrementalRenderingSuppression();
849 void stopExtendingIncrementalRenderingSuppression(unsigned token);
850 bool shouldExtendIncrementalRenderingSuppression() { return !m_activeRenderingSuppressionTokens.isEmpty(); }
852 WebCore::ScrollPinningBehavior scrollPinningBehavior() { return m_scrollPinningBehavior; }
853 void setScrollPinningBehavior(uint32_t /* WebCore::ScrollPinningBehavior */ pinning);
855 PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(WebCore::Frame&, const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
857 void getBytecodeProfile(uint64_t callbackID);
859 // Some platforms require accessibility-enabled processes to spin the run loop so that the WebProcess doesn't hang.
860 // While this is not ideal, it does not have to be applied to every platform at the moment.
861 static bool synchronousMessagesShouldSpinRunLoop();
863 #if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION)
864 void handleTelephoneNumberClick(const String& number, const WebCore::IntPoint&);
865 void handleSelectionServiceClick(WebCore::FrameSelection&, const Vector<String>& telephoneNumbers, const WebCore::IntPoint&);
868 void didChangeScrollOffsetForFrame(WebCore::Frame*);
870 void setMainFrameProgressCompleted(bool completed) { m_mainFrameProgressCompleted = completed; }
871 bool shouldDispatchFakeMouseMoveEvents() const { return m_shouldDispatchFakeMouseMoveEvents; }
873 void setPageActivityState(WebCore::PageActivityState::Flags);
875 void postMessage(const String& messageName, API::Object* messageBody);
876 void postSynchronousMessage(const String& messageName, API::Object* messageBody, RefPtr<API::Object>& returnData);
879 WebPage(uint64_t pageID, const WebPageCreationParameters&);
881 // IPC::MessageSender
882 virtual IPC::Connection* messageSenderConnection() override;
883 virtual uint64_t messageSenderDestinationID() override;
885 void platformInitialize();
886 void platformDetach();
887 void platformEditorState(WebCore::Frame&, EditorState& result, IncludePostLayoutDataHint) const;
889 void didReceiveWebPageMessage(IPC::Connection&, IPC::MessageDecoder&);
890 void didReceiveSyncWebPageMessage(IPC::Connection&, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&);
893 void resetViewportDefaultConfiguration(WebFrame* mainFrame);
894 void viewportConfigurationChanged();
895 void updateViewportSizeForCSSViewportUnits();
897 static void convertSelectionRectsToRootView(WebCore::FrameView*, Vector<WebCore::SelectionRect>&);
898 PassRefPtr<WebCore::Range> rangeForWebSelectionAtPosition(const WebCore::IntPoint&, const WebCore::VisiblePosition&, SelectionFlags&);
899 PassRefPtr<WebCore::Range> rangeForBlockAtPoint(const WebCore::IntPoint&);
900 void computeExpandAndShrinkThresholdsForHandle(const WebCore::IntPoint&, SelectionHandlePosition, float& growThreshold, float& shrinkThreshold);
901 PassRefPtr<WebCore::Range> changeBlockSelection(const WebCore::IntPoint&, SelectionHandlePosition, float& growThreshold, float& shrinkThreshold, SelectionFlags&);
902 PassRefPtr<WebCore::Range> expandedRangeFromHandle(WebCore::Range*, SelectionHandlePosition);
903 PassRefPtr<WebCore::Range> contractedRangeFromHandle(WebCore::Range* currentRange, SelectionHandlePosition, SelectionFlags&);
904 void getAssistedNodeInformation(AssistedNodeInformation&);
905 void platformInitializeAccessibility();
906 void handleSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location);
907 void completeSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location);
908 void sendTapHighlightForNodeIfNecessary(uint64_t requestID, WebCore::Node*);
909 void resetTextAutosizingBeforeLayoutIfNeeded(const WebCore::FloatSize& oldSize, const WebCore::FloatSize& newSize);
910 WebCore::VisiblePosition visiblePositionInFocusedNodeForPoint(WebCore::Frame&, const WebCore::IntPoint&);
913 static const char* interpretKeyEvent(const WebCore::KeyboardEvent*);
915 bool performDefaultBehaviorForKeyEvent(const WebKeyboardEvent&);
918 bool executeKeypressCommandsInternal(const Vector<WebCore::KeypressCommand>&, WebCore::KeyboardEvent*);
921 String sourceForFrame(WebFrame*);
923 void loadDataImpl(uint64_t navigationID, PassRefPtr<WebCore::SharedBuffer>, const String& MIMEType, const String& encodingName, const WebCore::URL& baseURL, const WebCore::URL& failingURL, const UserData&);
924 void loadString(uint64_t navigationID, const String&, const String& MIMEType, const WebCore::URL& baseURL, const WebCore::URL& failingURL, const UserData&);
926 bool platformHasLocalDataForURL(const WebCore::URL&);
930 void loadRequest(uint64_t navigationID, const WebCore::ResourceRequest&, const SandboxExtension::Handle&, const UserData&);
931 void loadData(const IPC::DataReference&, const String& MIMEType, const String& encodingName, const String& baseURL, const UserData&);
932 void loadHTMLString(uint64_t navigationID, const String& htmlString, const String& baseURL, const UserData&);
933 void loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL, const UserData&);
934 void loadPlainTextString(const String&, const UserData&);
935 void loadWebArchiveData(const IPC::DataReference&, const UserData&);
936 void navigateToURLWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint);
937 void reload(uint64_t navigationID, bool reloadFromOrigin, const SandboxExtension::Handle&);
938 void goForward(uint64_t navigationID, uint64_t);
939 void goBack(uint64_t navigationID, uint64_t);
940 void goToBackForwardItem(uint64_t navigationID, uint64_t);
941 void tryRestoreScrollPosition();
942 void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, uint64_t callbackID);
943 void setWindowResizerSize(const WebCore::IntSize&);
944 void updateIsInWindow(bool isInitialState = false);
945 void setViewState(WebCore::ViewState::Flags, bool wantsDidUpdateViewState, const Vector<uint64_t>& callbackIDs);
946 void validateCommand(const String&, uint64_t);
947 void executeEditCommand(const String&);
948 void setEditable(bool);
950 void updateUserActivity();
952 void mouseEvent(const WebMouseEvent&);
953 void mouseEventSyncForTesting(const WebMouseEvent&, bool&);
954 void wheelEventSyncForTesting(const WebWheelEvent&, bool&);
955 void keyEvent(const WebKeyboardEvent&);
956 void keyEventSyncForTesting(const WebKeyboardEvent&, bool&);
957 #if ENABLE(IOS_TOUCH_EVENTS)
958 void touchEventSync(const WebTouchEvent&, bool& handled);
959 #elif ENABLE(TOUCH_EVENTS)
960 void touchEvent(const WebTouchEvent&);
961 void touchEventSyncForTesting(const WebTouchEvent&, bool& handled);
963 #if ENABLE(CONTEXT_MENUS)
964 void contextMenuHidden() { m_isShowingContextMenu = false; }
967 static bool scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity);
968 static bool logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity);
970 void loadURLInFrame(const String&, uint64_t frameID);
972 void restoreSession(const Vector<BackForwardListItemState>&);
973 void didRemoveBackForwardItem(uint64_t);
975 #if ENABLE(REMOTE_INSPECTOR)
976 void setAllowsRemoteInspection(bool);
979 void setDrawsBackground(bool);
980 void setDrawsTransparentBackground(bool);
982 void setTopContentInset(float);
984 void viewWillStartLiveResize();
985 void viewWillEndLiveResize();
987 void getContentsAsString(uint64_t callbackID);
989 void getContentsAsMHTMLData(uint64_t callbackID, bool useBinaryEncoding);
991 void getMainResourceDataOfFrame(uint64_t frameID, uint64_t callbackID);
992 void getResourceDataFromFrame(uint64_t frameID, const String& resourceURL, uint64_t callbackID);
993 void getRenderTreeExternalRepresentation(uint64_t callbackID);
994 void getSelectionOrContentsAsString(uint64_t callbackID);
995 void getSelectionAsWebArchiveData(uint64_t callbackID);
996 void getSourceForFrame(uint64_t frameID, uint64_t callbackID);
997 void getWebArchiveOfFrame(uint64_t frameID, uint64_t callbackID);
998 void runJavaScriptInMainFrame(const String&, uint64_t callbackID);
999 void forceRepaint(uint64_t callbackID);
1000 void takeSnapshot(WebCore::IntRect snapshotRect, WebCore::IntSize bitmapSize, uint32_t options, uint64_t callbackID);
1002 void preferencesDidChange(const WebPreferencesStore&);
1003 void platformPreferencesDidChange(const WebPreferencesStore&);
1004 void updatePreferences(const WebPreferencesStore&);
1006 void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t navigationID, uint64_t downloadID);
1007 void setUserAgent(const String&);
1008 void setCustomTextEncodingName(const String&);
1009 void suspendActiveDOMObjectsAndAnimations();
1010 void resumeActiveDOMObjectsAndAnimations();
1013 void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
1014 void performDictionaryLookupOfCurrentSelection();
1015 void performDictionaryLookupForRange(WebCore::Frame*, WebCore::Range&, NSDictionary *options, WebCore::TextIndicatorPresentationTransition);
1016 DictionaryPopupInfo dictionaryPopupInfoForRange(WebCore::Frame* frame, WebCore::Range& range, NSDictionary **options, WebCore::TextIndicatorPresentationTransition presentationTransition);
1017 #if ENABLE(PDFKIT_PLUGIN)
1018 DictionaryPopupInfo dictionaryPopupInfoForSelectionInPDFPlugin(PDFSelection *, PDFPlugin&, NSDictionary **options, WebCore::TextIndicatorPresentationTransition);
1021 void windowAndViewFramesChanged(const WebCore::FloatRect& windowFrameInScreenCoordinates, const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates, const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
1023 RetainPtr<PDFDocument> pdfDocumentForPrintingFrame(WebCore::Frame*);
1024 void computePagesForPrintingPDFDocument(uint64_t frameID, const PrintInfo&, Vector<WebCore::IntRect>& resultPageRects);
1025 void drawPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, const WebCore::IntRect&);
1026 void drawPagesToPDFFromPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, uint32_t first, uint32_t count);
1029 void setMainFrameIsScrollable(bool);
1031 void unapplyEditCommand(uint64_t commandID);
1032 void reapplyEditCommand(uint64_t commandID);
1033 void didRemoveEditCommand(uint64_t commandID);
1035 void findString(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1036 void findStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1037 void getImageForFindMatch(uint32_t matchIndex);
1038 void selectFindMatch(uint32_t matchIndex);
1040 void countStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1042 #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
1043 void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize& area);
1046 void didChangeSelectedIndexForActivePopupMenu(int32_t newIndex);
1047 void setTextForActivePopupMenu(int32_t index);
1050 void failedToShowPopupMenu();
1054 void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const IPC::DataReference& iconData);
1056 void didChooseFilesForOpenPanel(const Vector<String>&);
1057 void didCancelForOpenPanel();
1058 #if ENABLE(SANDBOX_EXTENSIONS)
1059 void extendSandboxForFileFromOpenPanel(const SandboxExtension::Handle&);
1062 void didReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed);
1064 void didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed);
1066 #if ENABLE(MEDIA_STREAM)
1067 void didReceiveUserMediaPermissionDecision(uint64_t userMediaID, bool allowed);
1070 void advanceToNextMisspelling(bool startBeforeSelection);
1071 void changeSpellingToWord(const String& word);
1073 void uppercaseWord();
1074 void lowercaseWord();
1075 void capitalizeWord();
1078 #if ENABLE(CONTEXT_MENUS)
1079 void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&);
1082 void changeSelectedIndex(int32_t index);
1083 void setCanStartMediaTimerFired();
1085 bool canHandleUserEvents() const;
1087 static bool platformCanHandleRequest(const WebCore::ResourceRequest&);
1089 static PluginView* focusedPluginViewForFrame(WebCore::Frame&);
1090 static PluginView* pluginViewForFrame(WebCore::Frame*);
1092 static PassRefPtr<WebCore::Range> rangeFromEditingRange(WebCore::Frame&, const EditingRange&);
1094 void reportUsedFeatures();
1097 void performActionMenuHitTestAtLocation(WebCore::FloatPoint, bool forImmediateAction);
1098 PassRefPtr<WebCore::Range> lookupTextAtLocation(WebCore::FloatPoint, NSDictionary **options);
1099 void selectLastActionMenuRange();
1100 void focusAndSelectLastActionMenuHitTestResult();
1101 void immediateActionDidUpdate();
1102 void immediateActionDidCancel();
1103 void immediateActionDidComplete();
1104 void setFont(const String& fontFamily, double fontSize, uint64_t fontTraits);
1106 void dataDetectorsDidPresentUI(WebCore::PageOverlay::PageOverlayID);
1107 void dataDetectorsDidChangeUI(WebCore::PageOverlay::PageOverlayID);
1108 void dataDetectorsDidHideUI(WebCore::PageOverlay::PageOverlayID);
1111 void setShouldDispatchFakeMouseMoveEvents(bool dispatch) { m_shouldDispatchFakeMouseMoveEvents = dispatch; }
1113 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
1114 void playbackTargetSelected(uint64_t, const WebCore::MediaPlaybackTargetContext& outputDevice) const;
1115 void playbackTargetAvailabilityDidChange(uint64_t, bool);
1116 void setShouldPlayToPlaybackTarget(uint64_t, bool);
1121 std::unique_ptr<WebCore::Page> m_page;
1122 RefPtr<WebFrame> m_mainFrame;
1123 RefPtr<InjectedBundleBackForwardList> m_backForwardList;
1125 RefPtr<WebPageGroupProxy> m_pageGroup;
1129 WebCore::IntSize m_viewSize;
1130 std::unique_ptr<DrawingArea> m_drawingArea;
1132 HashSet<PluginView*> m_pluginViews;
1133 bool m_hasSeenPlugin;
1135 HashMap<uint64_t, RefPtr<WebCore::TextCheckingRequest>> m_pendingTextCheckingRequestMap;
1137 bool m_useFixedLayout;
1139 bool m_drawsBackground;
1140 bool m_drawsTransparentBackground;
1142 WebCore::Color m_underlayColor;
1149 bool m_asynchronousPluginInitializationEnabled;
1150 bool m_asynchronousPluginInitializationEnabledForAllPlugins;
1151 bool m_artificialPluginInitializationDelayEnabled;
1153 bool m_scrollingPerformanceLoggingEnabled;
1155 bool m_mainFrameIsScrollable;
1157 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
1158 bool m_readyToFindPrimarySnapshottedPlugin;
1159 bool m_didFindPrimarySnapshottedPlugin;
1160 unsigned m_numberOfPrimarySnapshotDetectionAttempts;
1161 String m_primaryPlugInPageOrigin;
1162 String m_primaryPlugInOrigin;
1163 String m_primaryPlugInMimeType;
1164 RunLoop::Timer<WebPage> m_determinePrimarySnapshottedPlugInTimer;
1167 // The layer hosting mode.
1168 LayerHostingMode m_layerHostingMode;
1171 bool m_pdfPluginEnabled;
1173 bool m_hasCachedWindowFrame;
1175 // The frame of the containing window in screen coordinates.
1176 WebCore::FloatRect m_windowFrameInScreenCoordinates;
1178 // The frame of the containing window in unflipped screen coordinates.
1179 WebCore::FloatRect m_windowFrameInUnflippedScreenCoordinates;
1181 // The frame of the view in window coordinates.
1182 WebCore::FloatRect m_viewFrameInWindowCoordinates;
1184 // The accessibility position of the view.
1185 WebCore::FloatPoint m_accessibilityPosition;
1187 RetainPtr<WKAccessibilityWebPageObject> m_mockAccessibilityElement;
1189 ViewGestureGeometryCollector m_viewGestureGeometryCollector;
1191 #elif HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
1192 GRefPtr<WebPageAccessibilityObject> m_accessibilityObject;
1195 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
1196 // Our view's window in the UI process.
1197 uint64_t m_nativeWindowHandle;
1201 RefPtr<PageBanner> m_headerBanner;
1202 RefPtr<PageBanner> m_footerBanner;
1203 #endif // !PLATFORM(IOS)
1205 RunLoop::Timer<WebPage> m_setCanStartMediaTimer;
1206 bool m_mayStartMediaWhenInWindow;
1208 HashMap<uint64_t, RefPtr<WebUndoStep>> m_undoStepMap;
1210 WebCore::IntSize m_windowResizerSize;
1212 #if ENABLE(CONTEXT_MENUS)
1213 std::unique_ptr<API::InjectedBundle::PageContextMenuClient> m_contextMenuClient;
1215 InjectedBundlePageEditorClient m_editorClient;
1216 std::unique_ptr<API::InjectedBundle::FormClient> m_formClient;
1217 InjectedBundlePageLoaderClient m_loaderClient;
1218 InjectedBundlePagePolicyClient m_policyClient;
1219 InjectedBundlePageResourceLoadClient m_resourceLoadClient;
1220 std::unique_ptr<API::InjectedBundle::PageUIClient> m_uiClient;
1221 #if ENABLE(FULLSCREEN_API)
1222 InjectedBundlePageFullScreenClient m_fullScreenClient;
1224 InjectedBundlePageDiagnosticLoggingClient m_logDiagnosticMessageClient;
1226 FindController m_findController;
1228 RefPtr<WebInspector> m_inspector;
1229 RefPtr<WebInspectorUI> m_inspectorUI;
1231 RefPtr<WebVideoFullscreenManager> m_videoFullscreenManager;
1233 #if ENABLE(FULLSCREEN_API)
1234 RefPtr<WebFullScreenManager> m_fullScreenManager;
1236 RefPtr<WebPopupMenu> m_activePopupMenu;
1237 #if ENABLE(CONTEXT_MENUS)
1238 RefPtr<WebContextMenu> m_contextMenu;
1240 #if ENABLE(INPUT_TYPE_COLOR)
1241 WebColorChooser* m_activeColorChooser;
1243 RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener;
1244 RefPtr<NotificationPermissionRequestManager> m_notificationPermissionRequestManager;
1246 RefPtr<WebUserContentController> m_userContentController;
1248 #if ENABLE(GEOLOCATION)
1249 GeolocationPermissionRequestManager m_geolocationPermissionRequestManager;
1252 #if ENABLE(MEDIA_STREAM)
1253 UserMediaPermissionRequestManager m_userMediaPermissionRequestManager;
1256 std::unique_ptr<WebCore::PrintContext> m_printContext;
1258 RefPtr<WebPrintOperationGtk> m_printOperation;
1261 SandboxExtensionTracker m_sandboxExtensionTracker;
1263 RefPtr<SandboxExtension> m_pendingDropSandboxExtension;
1264 Vector<RefPtr<SandboxExtension>> m_pendingDropExtensionsForFileUpload;
1266 bool m_canRunBeforeUnloadConfirmPanel;
1269 bool m_isRunningModal;
1271 #if ENABLE(DRAG_SUPPORT)
1272 bool m_isStartingDrag;
1275 bool m_cachedMainFrameIsPinnedToLeftSide;
1276 bool m_cachedMainFrameIsPinnedToRightSide;
1277 bool m_cachedMainFrameIsPinnedToTopSide;
1278 bool m_cachedMainFrameIsPinnedToBottomSide;
1279 bool m_canShortCircuitHorizontalWheelEvents;
1280 bool m_hasWheelEventHandlers;
1282 unsigned m_cachedPageCount;
1284 HashSet<unsigned long> m_trackedNetworkResourceRequestIdentifiers;
1286 WebCore::IntSize m_minimumLayoutSize;
1287 bool m_autoSizingShouldExpandToViewHeight;
1289 #if ENABLE(CONTEXT_MENUS)
1290 bool m_isShowingContextMenu;
1294 RefPtr<WebCore::Node> m_assistedNode;
1295 RefPtr<WebCore::Range> m_currentWordRange;
1296 RefPtr<WebCore::Node> m_interactionNode;
1297 WebCore::IntPoint m_lastInteractionLocation;
1299 enum SelectionAnchor {
1303 SelectionAnchor m_selectionAnchor;
1305 RefPtr<WebCore::Node> m_potentialTapNode;
1306 WebCore::FloatPoint m_potentialTapLocation;
1308 WebCore::ViewportConfiguration m_viewportConfiguration;
1309 uint64_t m_firstLayerTreeTransactionIDAfterDidCommitLoad;
1310 bool m_hasReceivedVisibleContentRectsAfterDidCommitLoad;
1311 bool m_scaleWasSetByUIProcess;
1312 bool m_userHasChangedPageScaleFactor;
1313 bool m_hasStablePageScaleFactor;
1314 bool m_userIsInteracting;
1315 bool m_hasPendingBlurNotification;
1316 bool m_useTestingViewportConfiguration;
1317 bool m_isInStableState;
1318 std::chrono::milliseconds m_oldestNonStableUpdateVisibleContentRectsTimestamp;
1319 std::chrono::milliseconds m_estimatedLatency;
1320 WebCore::FloatSize m_screenSize;
1321 WebCore::FloatSize m_availableScreenSize;
1322 RefPtr<WebCore::Range> m_currentBlockSelection;
1323 WebCore::IntSize m_blockSelectionDesiredSize;
1324 WebCore::FloatSize m_maximumUnobscuredSize;
1325 int32_t m_deviceOrientation;
1326 bool m_inDynamicSizeUpdate;
1327 HashMap<std::pair<WebCore::IntSize, double>, WebCore::IntPoint> m_dynamicSizeUpdateHistory;
1328 RefPtr<WebCore::Node> m_pendingSyntheticClickNode;
1329 WebCore::FloatPoint m_pendingSyntheticClickLocation;
1332 WebInspectorClient* m_inspectorClient;
1334 HashSet<String, CaseFoldingHash> m_mimeTypesWithCustomContentProviders;
1335 WebCore::Color m_backgroundColor;
1337 HashSet<unsigned> m_activeRenderingSuppressionTokens;
1338 unsigned m_maximumRenderingSuppressionToken;
1340 WebCore::ScrollPinningBehavior m_scrollPinningBehavior;
1342 bool m_useAsyncScrolling;
1344 WebCore::ViewState::Flags m_viewState;
1345 WebCore::PageActivityState::Flags m_activityState;
1347 bool m_processSuppressionEnabled;
1348 UserActivity m_userActivity;
1350 uint64_t m_pendingNavigationID;
1352 double m_viewScaleFactor { 1 };
1355 WebCore::WebGLLoadPolicy m_systemWebGLPolicy;
1359 RefPtr<WebCore::Range> m_lastActionMenuRangeForSelection;
1360 WebCore::HitTestResult m_lastActionMenuHitTestResult;
1361 RefPtr<WebPageOverlay> m_lastActionMenuHitPageOverlay;
1364 bool m_mainFrameProgressCompleted;
1365 bool m_shouldDispatchFakeMouseMoveEvents;
1366 bool m_isEditorStateMissingPostLayoutData { false };
1369 } // namespace WebKit