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();
529 void getLookupContextAtPoint(const WebCore::IntPoint, uint64_t callbackID);
531 #if ENABLE(IOS_TOUCH_EVENTS)
532 void dispatchAsynchronousTouchEvents(const Vector<WebTouchEvent, 1>& queue);
535 void contentSizeCategoryDidChange(const String&);
536 void executeEditCommandWithCallback(const String&, uint64_t callbackID);
538 std::chrono::milliseconds eventThrottlingDelay() const;
540 void showInspectorHighlight(const WebCore::Highlight&);
541 void hideInspectorHighlight();
543 void showInspectorIndication();
544 void hideInspectorIndication();
546 void enableInspectorNodeSearch();
547 void disableInspectorNodeSearch();
550 NotificationPermissionRequestManager* notificationPermissionRequestManager();
552 void pageDidScroll();
553 #if USE(TILED_BACKING_STORE)
554 void pageDidRequestScroll(const WebCore::IntPoint&);
555 void setFixedVisibleContentRect(const WebCore::IntRect&);
556 void sendViewportAttributesChanged();
559 #if ENABLE(CONTEXT_MENUS)
560 WebContextMenu* contextMenu();
561 WebContextMenu* contextMenuAtPointInWindow(const WebCore::IntPoint&);
564 bool hasLocalDataForURL(const WebCore::URL&);
565 String cachedResponseMIMETypeForURL(const WebCore::URL&);
566 String cachedSuggestedFilenameForURL(const WebCore::URL&);
567 PassRefPtr<WebCore::SharedBuffer> cachedResponseDataForURL(const WebCore::URL&);
569 static bool canHandleRequest(const WebCore::ResourceRequest&);
571 class SandboxExtensionTracker {
573 ~SandboxExtensionTracker();
577 void beginLoad(WebFrame*, const SandboxExtension::Handle& handle);
578 void willPerformLoadDragDestinationAction(PassRefPtr<SandboxExtension> pendingDropSandboxExtension);
579 void didStartProvisionalLoad(WebFrame*);
580 void didCommitProvisionalLoad(WebFrame*);
581 void didFailProvisionalLoad(WebFrame*);
584 void setPendingProvisionalSandboxExtension(PassRefPtr<SandboxExtension>);
586 RefPtr<SandboxExtension> m_pendingProvisionalSandboxExtension;
587 RefPtr<SandboxExtension> m_provisionalSandboxExtension;
588 RefPtr<SandboxExtension> m_committedSandboxExtension;
591 SandboxExtensionTracker& sandboxExtensionTracker() { return m_sandboxExtensionTracker; }
594 void setThemePath(const String&);
597 #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
598 void commitPageTransitionViewport();
602 void setComposition(const String& text, const Vector<WebCore::CompositionUnderline>& underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeLength);
603 void confirmComposition(const String& text, int64_t selectionStart, int64_t selectionLength);
604 void cancelComposition();
607 #if PLATFORM (GTK) && HAVE(GTK_GESTURES)
608 void getCenterForZoomGesture(const WebCore::IntPoint& centerInViewCoordinates, WebCore::IntPoint& result);
611 void didChangeSelection();
612 void discardedComposition();
615 void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
616 WKAccessibilityWebPageObject* accessibilityRemoteObject();
617 NSObject *accessibilityObjectForMainFramePlugin();
618 const WebCore::FloatPoint& accessibilityPosition() const { return m_accessibilityPosition; }
620 void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
622 void insertTextAsync(const String& text, const EditingRange& replacementRange, bool registerUndoGroup = false);
623 void getMarkedRangeAsync(uint64_t callbackID);
624 void getSelectedRangeAsync(uint64_t callbackID);
625 void characterIndexForPointAsync(const WebCore::IntPoint&, uint64_t callbackID);
626 void firstRectForCharacterRangeAsync(const EditingRange&, uint64_t callbackID);
627 void setCompositionAsync(const String& text, Vector<WebCore::CompositionUnderline> underlines, const EditingRange& selectionRange, const EditingRange& replacementRange);
628 void confirmCompositionAsync();
631 void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::DictationAlternative>& dictationAlternativeLocations, bool registerUndoGroup = false);
632 void attributedSubstringForCharacterRangeAsync(const EditingRange&, uint64_t callbackID);
633 void fontAtSelection(uint64_t callbackID);
634 #if !USE(ASYNC_NSTEXTINPUTCLIENT)
635 void insertText(const String& text, const EditingRange& replacementRange, bool& handled, EditorState& newState);
636 void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, const EditingRange& selectionRange, const EditingRange& replacementRange, EditorState& newState);
637 void confirmComposition(EditorState& newState);
638 void insertDictatedText(const String& text, const EditingRange& replacementRange, const Vector<WebCore::DictationAlternative>& dictationAlternativeLocations, bool& handled, EditorState& newState);
639 void getAttributedSubstringFromRange(const EditingRange&, AttributedString&);
640 void getMarkedRange(EditingRange&);
641 void getSelectedRange(EditingRange&);
642 void characterIndexForPoint(const WebCore::IntPoint point, uint64_t& result);
643 void firstRectForCharacterRange(const EditingRange&, WebCore::IntRect& resultRect);
644 void executeKeypressCommands(const Vector<WebCore::KeypressCommand>&, bool& handled, EditorState& newState);
645 void cancelComposition(EditorState& newState);
649 void readSelectionFromPasteboard(const WTF::String& pasteboardName, bool& result);
650 void getStringSelectionForPasteboard(WTF::String& stringValue);
651 void getDataSelectionForPasteboard(const WTF::String pasteboardType, SharedMemory::Handle& handle, uint64_t& size);
652 void shouldDelayWindowOrderingEvent(const WebKit::WebMouseEvent&, bool& result);
653 void acceptsFirstMouse(int eventNumber, const WebKit::WebMouseEvent&, bool& result);
654 bool performNonEditingBehaviorForSelector(const String&, WebCore::KeyboardEvent*);
656 #if ENABLE(SERVICE_CONTROLS)
657 void replaceSelectionWithPasteboardData(const Vector<String>& types, const IPC::DataReference&);
661 void confirmComposition(const String& compositionString);
662 void setComposition(const WTF::String& compositionString, const WTF::Vector<WebCore::CompositionUnderline>& underlines, uint64_t cursorPosition);
663 void cancelComposition();
666 #if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
667 void updateAccessibilityTree();
670 void setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length);
671 bool hasCompositionForTesting();
672 void confirmCompositionForTesting(const String& compositionString);
674 // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require
675 // any synchronous messages, and should be removed when <rdar://problem/8775115> is fixed.
680 void speak(const String&);
683 void performDictionaryLookupForSelection(WebCore::Frame*, const WebCore::VisibleSelection&, WebCore::TextIndicatorPresentationTransition);
686 bool isSmartInsertDeleteEnabled();
687 void setSmartInsertDeleteEnabled(bool);
689 bool isSelectTrailingWhitespaceEnabled();
690 void setSelectTrailingWhitespaceEnabled(bool);
692 void replaceSelectionWithText(WebCore::Frame*, const String&);
693 void clearSelection();
694 void restoreSelectionInFocusedEditableElement();
696 #if ENABLE(DRAG_SUPPORT)
698 void performDragControllerAction(uint64_t action, WebCore::DragData);
700 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&);
702 void dragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation);
704 void willPerformLoadDragDestinationAction();
705 void mayPerformUploadDragDestinationAction();
707 void willStartDrag() { ASSERT(!m_isStartingDrag); m_isStartingDrag = true; }
708 void didStartDrag() { ASSERT(m_isStartingDrag); m_isStartingDrag = false; }
709 #endif // ENABLE(DRAG_SUPPORT)
711 void beginPrinting(uint64_t frameID, const PrintInfo&);
713 void computePagesForPrinting(uint64_t frameID, const PrintInfo&, uint64_t callbackID);
714 void computePagesForPrintingImpl(uint64_t frameID, const PrintInfo&, Vector<WebCore::IntRect>& pageRects, double& totalScaleFactor);
716 void drawRectToImage(uint64_t frameID, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, uint64_t callbackID);
717 void drawPagesToPDF(uint64_t frameID, const PrintInfo&, uint32_t first, uint32_t count, uint64_t callbackID);
718 void drawPagesToPDFImpl(uint64_t frameID, const PrintInfo&, uint32_t first, uint32_t count, RetainPtr<CFMutableDataRef>& pdfPageData);
720 void computePagesForPrintingAndStartDrawingToPDF(uint64_t frameID, const PrintInfo&, uint32_t firstPage, PassRefPtr<Messages::WebPage::ComputePagesForPrintingAndStartDrawingToPDF::DelayedReply>);
723 void drawPagesForPrinting(uint64_t frameID, const PrintInfo&, uint64_t callbackID);
724 void didFinishPrintOperation(const WebCore::ResourceError&, uint64_t callbackID);
727 void addResourceRequest(unsigned long, const WebCore::ResourceRequest&);
728 void removeResourceRequest(unsigned long);
730 void setMediaVolume(float);
732 void setMayStartMediaWhenInWindow(bool);
734 void updateMainFrameScrollOffsetPinning();
736 bool mainFrameHasCustomContentProvider() const;
737 void addMIMETypeWithCustomContentProvider(const String&);
739 void mainFrameDidLayout();
741 bool canRunBeforeUnloadConfirmPanel() const { return m_canRunBeforeUnloadConfirmPanel; }
742 void setCanRunBeforeUnloadConfirmPanel(bool canRunBeforeUnloadConfirmPanel) { m_canRunBeforeUnloadConfirmPanel = canRunBeforeUnloadConfirmPanel; }
744 bool canRunModal() const { return m_canRunModal; }
745 void setCanRunModal(bool canRunModal) { m_canRunModal = canRunModal; }
749 void setDeviceScaleFactor(float);
750 float deviceScaleFactor() const;
752 void forceRepaintWithoutCallback();
754 void unmarkAllMisspellings();
755 void unmarkAllBadGrammar();
757 void handleAlternativeTextUIResult(const String&);
760 // For testing purpose.
761 void simulateMouseDown(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
762 void simulateMouseUp(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
763 void simulateMouseMotion(WebCore::IntPoint, double time);
765 #if ENABLE(CONTEXT_MENUS)
766 void contextMenuShowing() { m_isShowingContextMenu = true; }
769 void wheelEvent(const WebWheelEvent&);
771 void wheelEventHandlersChanged(bool);
772 void recomputeShortCircuitHorizontalWheelEventsState();
774 void updateVisibilityState(bool isInitialState = false);
777 void setViewportConfigurationMinimumLayoutSize(const WebCore::FloatSize&);
778 void setMaximumUnobscuredSize(const WebCore::FloatSize&);
779 void setDeviceOrientation(int32_t);
780 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);
781 void synchronizeDynamicViewportUpdate(double& newTargetScale, WebCore::FloatPoint& newScrollPosition, uint64_t& nextValidLayerTreeTransactionID);
782 void updateVisibleContentRects(const VisibleContentRectUpdateInfo&, double oldestTimestamp);
783 bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; }
784 void willStartUserTriggeredZooming();
785 void applicationWillResignActive();
786 void applicationWillEnterForeground();
787 void applicationDidBecomeActive();
788 void zoomToRect(WebCore::FloatRect, double minimumScale, double maximumScale);
789 void completePendingSyntheticClickForContentChangeObserver();
792 #if ENABLE(IOS_TOUCH_EVENTS)
793 void dispatchTouchEvent(const WebTouchEvent&, bool& handled);
796 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
797 uint64_t nativeWindowHandle() { return m_nativeWindowHandle; }
800 bool shouldUseCustomContentProviderForResponse(const WebCore::ResourceResponse&);
801 bool canPluginHandleResponse(const WebCore::ResourceResponse& response);
803 bool asynchronousPluginInitializationEnabled() const { return m_asynchronousPluginInitializationEnabled; }
804 void setAsynchronousPluginInitializationEnabled(bool enabled) { m_asynchronousPluginInitializationEnabled = enabled; }
805 bool asynchronousPluginInitializationEnabledForAllPlugins() const { return m_asynchronousPluginInitializationEnabledForAllPlugins; }
806 void setAsynchronousPluginInitializationEnabledForAllPlugins(bool enabled) { m_asynchronousPluginInitializationEnabledForAllPlugins = enabled; }
807 bool artificialPluginInitializationDelayEnabled() const { return m_artificialPluginInitializationDelayEnabled; }
808 void setArtificialPluginInitializationDelayEnabled(bool enabled) { m_artificialPluginInitializationDelayEnabled = enabled; }
809 void setTabToLinksEnabled(bool enabled) { m_tabToLinks = enabled; }
810 bool tabToLinksEnabled() const { return m_tabToLinks; }
812 bool scrollingPerformanceLoggingEnabled() const { return m_scrollingPerformanceLoggingEnabled; }
813 void setScrollingPerformanceLoggingEnabled(bool);
816 bool shouldUsePDFPlugin() const;
817 bool pdfPluginEnabled() const { return m_pdfPluginEnabled; }
818 void setPDFPluginEnabled(bool enabled) { m_pdfPluginEnabled = enabled; }
821 void savePDFToFileInDownloadsFolder(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size);
823 void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
826 bool mainFrameIsScrollable() const { return m_mainFrameIsScrollable; }
828 void setMinimumLayoutSize(const WebCore::IntSize&);
829 WebCore::IntSize minimumLayoutSize() const { return m_minimumLayoutSize; }
831 void setAutoSizingShouldExpandToViewHeight(bool shouldExpand);
832 bool autoSizingShouldExpandToViewHeight() { return m_autoSizingShouldExpandToViewHeight; }
834 bool canShowMIMEType(const String& MIMEType) const;
836 void addTextCheckingRequest(uint64_t requestID, PassRefPtr<WebCore::TextCheckingRequest>);
837 void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
838 void didCancelCheckingText(uint64_t requestID);
840 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
841 void determinePrimarySnapshottedPlugIn();
842 void determinePrimarySnapshottedPlugInTimerFired();
843 void resetPrimarySnapshottedPlugIn();
844 bool matchesPrimaryPlugIn(const String& pageOrigin, const String& pluginOrigin, const String& mimeType) const;
845 bool plugInIntersectsSearchRect(WebCore::HTMLPlugInImageElement& pluginImageElement);
846 bool plugInIsPrimarySize(WebCore::HTMLPlugInImageElement& pluginImageElement, unsigned &pluginArea);
849 unsigned extendIncrementalRenderingSuppression();
850 void stopExtendingIncrementalRenderingSuppression(unsigned token);
851 bool shouldExtendIncrementalRenderingSuppression() { return !m_activeRenderingSuppressionTokens.isEmpty(); }
853 WebCore::ScrollPinningBehavior scrollPinningBehavior() { return m_scrollPinningBehavior; }
854 void setScrollPinningBehavior(uint32_t /* WebCore::ScrollPinningBehavior */ pinning);
856 PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(WebCore::Frame&, const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
858 void getBytecodeProfile(uint64_t callbackID);
860 // Some platforms require accessibility-enabled processes to spin the run loop so that the WebProcess doesn't hang.
861 // While this is not ideal, it does not have to be applied to every platform at the moment.
862 static bool synchronousMessagesShouldSpinRunLoop();
864 #if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION)
865 void handleTelephoneNumberClick(const String& number, const WebCore::IntPoint&);
866 void handleSelectionServiceClick(WebCore::FrameSelection&, const Vector<String>& telephoneNumbers, const WebCore::IntPoint&);
869 void didChangeScrollOffsetForFrame(WebCore::Frame*);
871 void setMainFrameProgressCompleted(bool completed) { m_mainFrameProgressCompleted = completed; }
872 bool shouldDispatchFakeMouseMoveEvents() const { return m_shouldDispatchFakeMouseMoveEvents; }
874 void setPageActivityState(WebCore::PageActivityState::Flags);
876 void postMessage(const String& messageName, API::Object* messageBody);
877 void postSynchronousMessage(const String& messageName, API::Object* messageBody, RefPtr<API::Object>& returnData);
880 WebPage(uint64_t pageID, const WebPageCreationParameters&);
882 // IPC::MessageSender
883 virtual IPC::Connection* messageSenderConnection() override;
884 virtual uint64_t messageSenderDestinationID() override;
886 void platformInitialize();
887 void platformDetach();
888 void platformEditorState(WebCore::Frame&, EditorState& result, IncludePostLayoutDataHint) const;
890 void didReceiveWebPageMessage(IPC::Connection&, IPC::MessageDecoder&);
891 void didReceiveSyncWebPageMessage(IPC::Connection&, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&);
894 void resetViewportDefaultConfiguration(WebFrame* mainFrame);
895 void viewportConfigurationChanged();
896 void updateViewportSizeForCSSViewportUnits();
898 static void convertSelectionRectsToRootView(WebCore::FrameView*, Vector<WebCore::SelectionRect>&);
899 PassRefPtr<WebCore::Range> rangeForWebSelectionAtPosition(const WebCore::IntPoint&, const WebCore::VisiblePosition&, SelectionFlags&);
900 PassRefPtr<WebCore::Range> rangeForBlockAtPoint(const WebCore::IntPoint&);
901 void computeExpandAndShrinkThresholdsForHandle(const WebCore::IntPoint&, SelectionHandlePosition, float& growThreshold, float& shrinkThreshold);
902 PassRefPtr<WebCore::Range> changeBlockSelection(const WebCore::IntPoint&, SelectionHandlePosition, float& growThreshold, float& shrinkThreshold, SelectionFlags&);
903 PassRefPtr<WebCore::Range> expandedRangeFromHandle(WebCore::Range*, SelectionHandlePosition);
904 PassRefPtr<WebCore::Range> contractedRangeFromHandle(WebCore::Range* currentRange, SelectionHandlePosition, SelectionFlags&);
905 void getAssistedNodeInformation(AssistedNodeInformation&);
906 void platformInitializeAccessibility();
907 void handleSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location);
908 void completeSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location);
909 void sendTapHighlightForNodeIfNecessary(uint64_t requestID, WebCore::Node*);
910 void resetTextAutosizingBeforeLayoutIfNeeded(const WebCore::FloatSize& oldSize, const WebCore::FloatSize& newSize);
911 WebCore::VisiblePosition visiblePositionInFocusedNodeForPoint(WebCore::Frame&, const WebCore::IntPoint&);
914 static const char* interpretKeyEvent(const WebCore::KeyboardEvent*);
916 bool performDefaultBehaviorForKeyEvent(const WebKeyboardEvent&);
919 bool executeKeypressCommandsInternal(const Vector<WebCore::KeypressCommand>&, WebCore::KeyboardEvent*);
922 String sourceForFrame(WebFrame*);
924 void loadDataImpl(uint64_t navigationID, PassRefPtr<WebCore::SharedBuffer>, const String& MIMEType, const String& encodingName, const WebCore::URL& baseURL, const WebCore::URL& failingURL, const UserData&);
925 void loadString(uint64_t navigationID, const String&, const String& MIMEType, const WebCore::URL& baseURL, const WebCore::URL& failingURL, const UserData&);
927 bool platformHasLocalDataForURL(const WebCore::URL&);
931 void loadRequest(uint64_t navigationID, const WebCore::ResourceRequest&, const SandboxExtension::Handle&, const UserData&);
932 void loadData(const IPC::DataReference&, const String& MIMEType, const String& encodingName, const String& baseURL, const UserData&);
933 void loadHTMLString(uint64_t navigationID, const String& htmlString, const String& baseURL, const UserData&);
934 void loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL, const UserData&);
935 void loadPlainTextString(const String&, const UserData&);
936 void loadWebArchiveData(const IPC::DataReference&, const UserData&);
937 void navigateToURLWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint);
938 void reload(uint64_t navigationID, bool reloadFromOrigin, const SandboxExtension::Handle&);
939 void goForward(uint64_t navigationID, uint64_t);
940 void goBack(uint64_t navigationID, uint64_t);
941 void goToBackForwardItem(uint64_t navigationID, uint64_t);
942 void tryRestoreScrollPosition();
943 void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, uint64_t callbackID);
944 void setWindowResizerSize(const WebCore::IntSize&);
945 void updateIsInWindow(bool isInitialState = false);
946 void setViewState(WebCore::ViewState::Flags, bool wantsDidUpdateViewState, const Vector<uint64_t>& callbackIDs);
947 void validateCommand(const String&, uint64_t);
948 void executeEditCommand(const String&);
949 void setEditable(bool);
951 void updateUserActivity();
953 void mouseEvent(const WebMouseEvent&);
954 void mouseEventSyncForTesting(const WebMouseEvent&, bool&);
955 void wheelEventSyncForTesting(const WebWheelEvent&, bool&);
956 void keyEvent(const WebKeyboardEvent&);
957 void keyEventSyncForTesting(const WebKeyboardEvent&, bool&);
958 #if ENABLE(IOS_TOUCH_EVENTS)
959 void touchEventSync(const WebTouchEvent&, bool& handled);
960 #elif ENABLE(TOUCH_EVENTS)
961 void touchEvent(const WebTouchEvent&);
962 void touchEventSyncForTesting(const WebTouchEvent&, bool& handled);
964 #if ENABLE(CONTEXT_MENUS)
965 void contextMenuHidden() { m_isShowingContextMenu = false; }
968 static bool scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity);
969 static bool logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity);
971 void loadURLInFrame(const String&, uint64_t frameID);
973 void restoreSession(const Vector<BackForwardListItemState>&);
974 void didRemoveBackForwardItem(uint64_t);
976 #if ENABLE(REMOTE_INSPECTOR)
977 void setAllowsRemoteInspection(bool);
980 void setDrawsBackground(bool);
981 void setDrawsTransparentBackground(bool);
983 void setTopContentInset(float);
985 void viewWillStartLiveResize();
986 void viewWillEndLiveResize();
988 void getContentsAsString(uint64_t callbackID);
990 void getContentsAsMHTMLData(uint64_t callbackID, bool useBinaryEncoding);
992 void getMainResourceDataOfFrame(uint64_t frameID, uint64_t callbackID);
993 void getResourceDataFromFrame(uint64_t frameID, const String& resourceURL, uint64_t callbackID);
994 void getRenderTreeExternalRepresentation(uint64_t callbackID);
995 void getSelectionOrContentsAsString(uint64_t callbackID);
996 void getSelectionAsWebArchiveData(uint64_t callbackID);
997 void getSourceForFrame(uint64_t frameID, uint64_t callbackID);
998 void getWebArchiveOfFrame(uint64_t frameID, uint64_t callbackID);
999 void runJavaScriptInMainFrame(const String&, uint64_t callbackID);
1000 void forceRepaint(uint64_t callbackID);
1001 void takeSnapshot(WebCore::IntRect snapshotRect, WebCore::IntSize bitmapSize, uint32_t options, uint64_t callbackID);
1003 void preferencesDidChange(const WebPreferencesStore&);
1004 void platformPreferencesDidChange(const WebPreferencesStore&);
1005 void updatePreferences(const WebPreferencesStore&);
1007 void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t navigationID, uint64_t downloadID);
1008 void setUserAgent(const String&);
1009 void setCustomTextEncodingName(const String&);
1010 void suspendActiveDOMObjectsAndAnimations();
1011 void resumeActiveDOMObjectsAndAnimations();
1014 void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
1015 void performDictionaryLookupOfCurrentSelection();
1016 void performDictionaryLookupForRange(WebCore::Frame*, WebCore::Range&, NSDictionary *options, WebCore::TextIndicatorPresentationTransition);
1017 DictionaryPopupInfo dictionaryPopupInfoForRange(WebCore::Frame* frame, WebCore::Range& range, NSDictionary **options, WebCore::TextIndicatorPresentationTransition presentationTransition);
1018 #if ENABLE(PDFKIT_PLUGIN)
1019 DictionaryPopupInfo dictionaryPopupInfoForSelectionInPDFPlugin(PDFSelection *, PDFPlugin&, NSDictionary **options, WebCore::TextIndicatorPresentationTransition);
1022 void windowAndViewFramesChanged(const WebCore::FloatRect& windowFrameInScreenCoordinates, const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates, const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
1024 RetainPtr<PDFDocument> pdfDocumentForPrintingFrame(WebCore::Frame*);
1025 void computePagesForPrintingPDFDocument(uint64_t frameID, const PrintInfo&, Vector<WebCore::IntRect>& resultPageRects);
1026 void drawPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, const WebCore::IntRect&);
1027 void drawPagesToPDFFromPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, uint32_t first, uint32_t count);
1030 void setMainFrameIsScrollable(bool);
1032 void unapplyEditCommand(uint64_t commandID);
1033 void reapplyEditCommand(uint64_t commandID);
1034 void didRemoveEditCommand(uint64_t commandID);
1036 void findString(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1037 void findStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1038 void getImageForFindMatch(uint32_t matchIndex);
1039 void selectFindMatch(uint32_t matchIndex);
1041 void countStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1043 #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
1044 void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize& area);
1047 void didChangeSelectedIndexForActivePopupMenu(int32_t newIndex);
1048 void setTextForActivePopupMenu(int32_t index);
1051 void failedToShowPopupMenu();
1055 void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const IPC::DataReference& iconData);
1057 void didChooseFilesForOpenPanel(const Vector<String>&);
1058 void didCancelForOpenPanel();
1059 #if ENABLE(SANDBOX_EXTENSIONS)
1060 void extendSandboxForFileFromOpenPanel(const SandboxExtension::Handle&);
1063 void didReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed);
1065 void didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed);
1067 #if ENABLE(MEDIA_STREAM)
1068 void didReceiveUserMediaPermissionDecision(uint64_t userMediaID, bool allowed);
1071 void advanceToNextMisspelling(bool startBeforeSelection);
1072 void changeSpellingToWord(const String& word);
1074 void uppercaseWord();
1075 void lowercaseWord();
1076 void capitalizeWord();
1079 #if ENABLE(CONTEXT_MENUS)
1080 void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&);
1083 void changeSelectedIndex(int32_t index);
1084 void setCanStartMediaTimerFired();
1086 bool canHandleUserEvents() const;
1088 static bool platformCanHandleRequest(const WebCore::ResourceRequest&);
1090 static PluginView* focusedPluginViewForFrame(WebCore::Frame&);
1091 static PluginView* pluginViewForFrame(WebCore::Frame*);
1093 static PassRefPtr<WebCore::Range> rangeFromEditingRange(WebCore::Frame&, const EditingRange&);
1095 void reportUsedFeatures();
1098 void performActionMenuHitTestAtLocation(WebCore::FloatPoint, bool forImmediateAction);
1099 PassRefPtr<WebCore::Range> lookupTextAtLocation(WebCore::FloatPoint, NSDictionary **options);
1100 void selectLastActionMenuRange();
1101 void focusAndSelectLastActionMenuHitTestResult();
1102 void immediateActionDidUpdate();
1103 void immediateActionDidCancel();
1104 void immediateActionDidComplete();
1105 void setFont(const String& fontFamily, double fontSize, uint64_t fontTraits);
1107 void dataDetectorsDidPresentUI(WebCore::PageOverlay::PageOverlayID);
1108 void dataDetectorsDidChangeUI(WebCore::PageOverlay::PageOverlayID);
1109 void dataDetectorsDidHideUI(WebCore::PageOverlay::PageOverlayID);
1112 void setShouldDispatchFakeMouseMoveEvents(bool dispatch) { m_shouldDispatchFakeMouseMoveEvents = dispatch; }
1114 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
1115 void playbackTargetSelected(uint64_t, const WebCore::MediaPlaybackTargetContext& outputDevice) const;
1116 void playbackTargetAvailabilityDidChange(uint64_t, bool);
1117 void setShouldPlayToPlaybackTarget(uint64_t, bool);
1122 std::unique_ptr<WebCore::Page> m_page;
1123 RefPtr<WebFrame> m_mainFrame;
1124 RefPtr<InjectedBundleBackForwardList> m_backForwardList;
1126 RefPtr<WebPageGroupProxy> m_pageGroup;
1130 WebCore::IntSize m_viewSize;
1131 std::unique_ptr<DrawingArea> m_drawingArea;
1133 HashSet<PluginView*> m_pluginViews;
1134 bool m_hasSeenPlugin;
1136 HashMap<uint64_t, RefPtr<WebCore::TextCheckingRequest>> m_pendingTextCheckingRequestMap;
1138 bool m_useFixedLayout;
1140 bool m_drawsBackground;
1141 bool m_drawsTransparentBackground;
1143 WebCore::Color m_underlayColor;
1150 bool m_asynchronousPluginInitializationEnabled;
1151 bool m_asynchronousPluginInitializationEnabledForAllPlugins;
1152 bool m_artificialPluginInitializationDelayEnabled;
1154 bool m_scrollingPerformanceLoggingEnabled;
1156 bool m_mainFrameIsScrollable;
1158 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
1159 bool m_readyToFindPrimarySnapshottedPlugin;
1160 bool m_didFindPrimarySnapshottedPlugin;
1161 unsigned m_numberOfPrimarySnapshotDetectionAttempts;
1162 String m_primaryPlugInPageOrigin;
1163 String m_primaryPlugInOrigin;
1164 String m_primaryPlugInMimeType;
1165 RunLoop::Timer<WebPage> m_determinePrimarySnapshottedPlugInTimer;
1168 // The layer hosting mode.
1169 LayerHostingMode m_layerHostingMode;
1172 bool m_pdfPluginEnabled;
1174 bool m_hasCachedWindowFrame;
1176 // The frame of the containing window in screen coordinates.
1177 WebCore::FloatRect m_windowFrameInScreenCoordinates;
1179 // The frame of the containing window in unflipped screen coordinates.
1180 WebCore::FloatRect m_windowFrameInUnflippedScreenCoordinates;
1182 // The frame of the view in window coordinates.
1183 WebCore::FloatRect m_viewFrameInWindowCoordinates;
1185 // The accessibility position of the view.
1186 WebCore::FloatPoint m_accessibilityPosition;
1188 RetainPtr<WKAccessibilityWebPageObject> m_mockAccessibilityElement;
1190 ViewGestureGeometryCollector m_viewGestureGeometryCollector;
1192 #elif HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
1193 GRefPtr<WebPageAccessibilityObject> m_accessibilityObject;
1196 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
1197 // Our view's window in the UI process.
1198 uint64_t m_nativeWindowHandle;
1202 RefPtr<PageBanner> m_headerBanner;
1203 RefPtr<PageBanner> m_footerBanner;
1204 #endif // !PLATFORM(IOS)
1206 RunLoop::Timer<WebPage> m_setCanStartMediaTimer;
1207 bool m_mayStartMediaWhenInWindow;
1209 HashMap<uint64_t, RefPtr<WebUndoStep>> m_undoStepMap;
1211 WebCore::IntSize m_windowResizerSize;
1213 #if ENABLE(CONTEXT_MENUS)
1214 std::unique_ptr<API::InjectedBundle::PageContextMenuClient> m_contextMenuClient;
1216 InjectedBundlePageEditorClient m_editorClient;
1217 std::unique_ptr<API::InjectedBundle::FormClient> m_formClient;
1218 InjectedBundlePageLoaderClient m_loaderClient;
1219 InjectedBundlePagePolicyClient m_policyClient;
1220 InjectedBundlePageResourceLoadClient m_resourceLoadClient;
1221 std::unique_ptr<API::InjectedBundle::PageUIClient> m_uiClient;
1222 #if ENABLE(FULLSCREEN_API)
1223 InjectedBundlePageFullScreenClient m_fullScreenClient;
1225 InjectedBundlePageDiagnosticLoggingClient m_logDiagnosticMessageClient;
1227 FindController m_findController;
1229 RefPtr<WebInspector> m_inspector;
1230 RefPtr<WebInspectorUI> m_inspectorUI;
1232 RefPtr<WebVideoFullscreenManager> m_videoFullscreenManager;
1234 #if ENABLE(FULLSCREEN_API)
1235 RefPtr<WebFullScreenManager> m_fullScreenManager;
1237 RefPtr<WebPopupMenu> m_activePopupMenu;
1238 #if ENABLE(CONTEXT_MENUS)
1239 RefPtr<WebContextMenu> m_contextMenu;
1241 #if ENABLE(INPUT_TYPE_COLOR)
1242 WebColorChooser* m_activeColorChooser;
1244 RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener;
1245 RefPtr<NotificationPermissionRequestManager> m_notificationPermissionRequestManager;
1247 RefPtr<WebUserContentController> m_userContentController;
1249 #if ENABLE(GEOLOCATION)
1250 GeolocationPermissionRequestManager m_geolocationPermissionRequestManager;
1253 #if ENABLE(MEDIA_STREAM)
1254 UserMediaPermissionRequestManager m_userMediaPermissionRequestManager;
1257 std::unique_ptr<WebCore::PrintContext> m_printContext;
1259 RefPtr<WebPrintOperationGtk> m_printOperation;
1262 SandboxExtensionTracker m_sandboxExtensionTracker;
1264 RefPtr<SandboxExtension> m_pendingDropSandboxExtension;
1265 Vector<RefPtr<SandboxExtension>> m_pendingDropExtensionsForFileUpload;
1267 bool m_canRunBeforeUnloadConfirmPanel;
1270 bool m_isRunningModal;
1272 #if ENABLE(DRAG_SUPPORT)
1273 bool m_isStartingDrag;
1276 bool m_cachedMainFrameIsPinnedToLeftSide;
1277 bool m_cachedMainFrameIsPinnedToRightSide;
1278 bool m_cachedMainFrameIsPinnedToTopSide;
1279 bool m_cachedMainFrameIsPinnedToBottomSide;
1280 bool m_canShortCircuitHorizontalWheelEvents;
1281 bool m_hasWheelEventHandlers;
1283 unsigned m_cachedPageCount;
1285 HashSet<unsigned long> m_trackedNetworkResourceRequestIdentifiers;
1287 WebCore::IntSize m_minimumLayoutSize;
1288 bool m_autoSizingShouldExpandToViewHeight;
1290 #if ENABLE(CONTEXT_MENUS)
1291 bool m_isShowingContextMenu;
1295 RefPtr<WebCore::Node> m_assistedNode;
1296 RefPtr<WebCore::Range> m_currentWordRange;
1297 RefPtr<WebCore::Node> m_interactionNode;
1298 WebCore::IntPoint m_lastInteractionLocation;
1300 enum SelectionAnchor {
1304 SelectionAnchor m_selectionAnchor;
1306 RefPtr<WebCore::Node> m_potentialTapNode;
1307 WebCore::FloatPoint m_potentialTapLocation;
1309 WebCore::ViewportConfiguration m_viewportConfiguration;
1310 uint64_t m_firstLayerTreeTransactionIDAfterDidCommitLoad;
1311 bool m_hasReceivedVisibleContentRectsAfterDidCommitLoad;
1312 bool m_scaleWasSetByUIProcess;
1313 bool m_userHasChangedPageScaleFactor;
1314 bool m_hasStablePageScaleFactor;
1315 bool m_userIsInteracting;
1316 bool m_hasPendingBlurNotification;
1317 bool m_useTestingViewportConfiguration;
1318 bool m_isInStableState;
1319 std::chrono::milliseconds m_oldestNonStableUpdateVisibleContentRectsTimestamp;
1320 std::chrono::milliseconds m_estimatedLatency;
1321 WebCore::FloatSize m_screenSize;
1322 WebCore::FloatSize m_availableScreenSize;
1323 RefPtr<WebCore::Range> m_currentBlockSelection;
1324 WebCore::IntSize m_blockSelectionDesiredSize;
1325 WebCore::FloatSize m_maximumUnobscuredSize;
1326 int32_t m_deviceOrientation;
1327 bool m_inDynamicSizeUpdate;
1328 HashMap<std::pair<WebCore::IntSize, double>, WebCore::IntPoint> m_dynamicSizeUpdateHistory;
1329 RefPtr<WebCore::Node> m_pendingSyntheticClickNode;
1330 WebCore::FloatPoint m_pendingSyntheticClickLocation;
1333 WebInspectorClient* m_inspectorClient;
1335 HashSet<String, CaseFoldingHash> m_mimeTypesWithCustomContentProviders;
1336 WebCore::Color m_backgroundColor;
1338 HashSet<unsigned> m_activeRenderingSuppressionTokens;
1339 unsigned m_maximumRenderingSuppressionToken;
1341 WebCore::ScrollPinningBehavior m_scrollPinningBehavior;
1343 bool m_useAsyncScrolling;
1345 WebCore::ViewState::Flags m_viewState;
1346 WebCore::PageActivityState::Flags m_activityState;
1348 bool m_processSuppressionEnabled;
1349 UserActivity m_userActivity;
1351 uint64_t m_pendingNavigationID;
1353 double m_viewScaleFactor { 1 };
1356 WebCore::WebGLLoadPolicy m_systemWebGLPolicy;
1360 RefPtr<WebCore::Range> m_lastActionMenuRangeForSelection;
1361 WebCore::HitTestResult m_lastActionMenuHitTestResult;
1362 RefPtr<WebPageOverlay> m_lastActionMenuHitPageOverlay;
1365 bool m_mainFrameProgressCompleted;
1366 bool m_shouldDispatchFakeMouseMoveEvents;
1367 bool m_isEditorStateMissingPostLayoutData { false };
1370 } // namespace WebKit