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 "FindController.h"
34 #include "GeolocationPermissionRequestManager.h"
35 #include "ImageOptions.h"
36 #include "InjectedBundlePageDiagnosticLoggingClient.h"
37 #include "InjectedBundlePageEditorClient.h"
38 #include "InjectedBundlePageFullScreenClient.h"
39 #include "InjectedBundlePageLoaderClient.h"
40 #include "InjectedBundlePagePolicyClient.h"
41 #include "InjectedBundlePageResourceLoadClient.h"
42 #include "LayerTreeHost.h"
43 #include "MessageReceiver.h"
44 #include "MessageSender.h"
46 #include "SandboxExtension.h"
47 #include "ShareableBitmap.h"
49 #include "UserMediaPermissionRequestManager.h"
50 #include <WebCore/DictationAlternative.h>
51 #include <WebCore/DictionaryPopupInfo.h>
52 #include <WebCore/DragData.h>
53 #include <WebCore/Editor.h>
54 #include <WebCore/FrameLoaderTypes.h>
55 #include <WebCore/HitTestResult.h>
56 #include <WebCore/HysteresisActivity.h>
57 #include <WebCore/IntRect.h>
58 #include <WebCore/IntSizeHash.h>
59 #include <WebCore/Page.h>
60 #include <WebCore/PageOverlay.h>
61 #include <WebCore/PageVisibilityState.h>
62 #include <WebCore/ScrollTypes.h>
63 #include <WebCore/TextChecking.h>
64 #include <WebCore/TextIndicator.h>
65 #include <WebCore/UserActivity.h>
66 #include <WebCore/UserContentTypes.h>
67 #include <WebCore/UserScriptTypes.h>
68 #include <WebCore/ViewState.h>
69 #include <WebCore/ViewportConfiguration.h>
70 #include <WebCore/WebCoreKeyboardUIMode.h>
72 #include <wtf/HashMap.h>
73 #include <wtf/PassRefPtr.h>
74 #include <wtf/RefPtr.h>
75 #include <wtf/RunLoop.h>
76 #include <wtf/text/WTFString.h>
78 #if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
79 #include "WebPageAccessibilityObject.h"
80 #include <wtf/glib/GRefPtr.h>
84 #include "ArgumentCodersGtk.h"
85 #include "WebPrintOperationGtk.h"
89 #include "GestureTypes.h"
90 #import "WebPageMessages.h"
93 #if ENABLE(IOS_TOUCH_EVENTS)
94 #include <WebKitAdditions/PlatformTouchEventIOS.h>
95 #elif ENABLE(TOUCH_EVENTS)
96 #include <WebCore/PlatformTouchEvent.h>
99 #if ENABLE(CONTEXT_MENUS)
100 #include "InjectedBundlePageContextMenuClient.h"
104 #include "ViewGestureGeometryCollector.h"
105 #include <wtf/RetainPtr.h>
107 OBJC_CLASS NSDictionary;
109 OBJC_CLASS WKAccessibilityWebPageObject;
117 class ArgumentDecoder;
122 class DocumentLoader;
123 class GraphicsContext;
126 class HTMLPlugInElement;
127 class HTMLPlugInImageElement;
133 class ResourceResponse;
134 class ResourceRequest;
136 class SubstituteData;
137 class TextCheckingRequest;
139 class VisibleSelection;
141 struct KeypressCommand;
142 struct MediaPlaybackTargetContext;
143 struct TextCheckingResult;
145 #if ENABLE(VIDEO) && USE(GSTREAMER)
146 class MediaPlayerRequestInstallMissingPluginsCallback;
152 class InjectedBundleBackForwardList;
153 class NotificationPermissionRequestManager;
157 class VisibleContentRectUpdateInfo;
158 class WebColorChooser;
159 class WebContextMenu;
160 class WebContextMenuItemData;
161 class WebDocumentLoader;
164 class WebFullScreenManager;
167 class WebInspectorClient;
168 class WebInspectorUI;
169 class WebKeyboardEvent;
171 class WebNotificationClient;
172 class WebOpenPanelResultListener;
173 class WebPageGroupProxy;
174 class WebPageOverlay;
177 class WebUserContentController;
178 class WebVideoFullscreenManager;
180 struct AssistedNodeInformation;
181 struct AttributedString;
182 struct BackForwardListItemState;
185 struct InteractionInformationAtPosition;
187 struct WebPageCreationParameters;
188 struct WebPreferencesStore;
191 class RemoteLayerTreeTransaction;
194 #if ENABLE(TOUCH_EVENTS)
198 class WebPage : public API::ObjectImpl<API::Object::Type::BundlePage>, public IPC::MessageReceiver, public IPC::MessageSender {
200 static Ref<WebPage> create(uint64_t pageID, const WebPageCreationParameters&);
203 void reinitializeWebPage(const WebPageCreationParameters&);
207 static WebPage* fromCorePage(WebCore::Page*);
209 WebCore::Page* corePage() const { return m_page.get(); }
210 uint64_t pageID() const { return m_pageID; }
211 WebCore::SessionID sessionID() const { return m_page->sessionID(); }
212 bool usesEphemeralSession() const { return m_page->usesEphemeralSession(); }
214 void setSessionID(WebCore::SessionID);
216 void setSize(const WebCore::IntSize&);
217 const WebCore::IntSize& size() const { return m_viewSize; }
218 WebCore::IntRect bounds() const { return WebCore::IntRect(WebCore::IntPoint(), size()); }
220 InjectedBundleBackForwardList* backForwardList();
221 DrawingArea* drawingArea() const { return m_drawingArea.get(); }
222 #if ENABLE(ASYNC_SCROLLING)
223 WebCore::ScrollingCoordinator* scrollingCoordinator() const;
226 WebPageGroupProxy* pageGroup() const { return m_pageGroup.get(); }
228 void scrollMainFrameIfNotAtMaxScrollPosition(const WebCore::IntSize& scrollOffset);
230 bool scrollBy(uint32_t scrollDirection, uint32_t scrollGranularity);
232 void centerSelectionInVisibleArea();
235 void willCommitLayerTree(RemoteLayerTreeTransaction&);
236 void didFlushLayerTreeAtTime(std::chrono::milliseconds);
239 enum class LazyCreationPolicy { UseExistingOnly, CreateIfNeeded };
241 WebInspector* inspector(LazyCreationPolicy = LazyCreationPolicy::CreateIfNeeded);
242 WebInspectorUI* inspectorUI();
243 bool isInspectorPage() { return !!m_inspectorUI; }
246 WebVideoFullscreenManager* videoFullscreenManager();
247 void setAllowsMediaDocumentInlinePlayback(bool);
248 bool allowsMediaDocumentInlinePlayback() const { return m_allowsMediaDocumentInlinePlayback; }
251 #if ENABLE(FULLSCREEN_API)
252 WebFullScreenManager* fullScreenManager();
255 // -- Called by the DrawingArea.
256 // FIXME: We could genericize these into a DrawingArea client interface. Would that be beneficial?
257 void drawRect(WebCore::GraphicsContext&, const WebCore::IntRect&);
258 void layoutIfNeeded();
260 // -- Called from WebCore clients.
261 bool handleEditingKeyboardEvent(WebCore::KeyboardEvent*);
263 void didStartPageTransition();
264 void didCompletePageTransition();
265 void didCommitLoad(WebFrame*);
266 void willReplaceMultipartContent(const WebFrame&);
267 void didReplaceMultipartContent(const WebFrame&);
268 void didFinishLoad(WebFrame*);
270 String userAgent(const WebCore::URL&) const;
271 String userAgent(WebFrame*, const WebCore::URL&) const;
272 String platformUserAgent(const WebCore::URL&) const;
273 WebCore::KeyboardUIMode keyboardUIMode();
275 WebUndoStep* webUndoStep(uint64_t);
276 void addWebUndoStep(uint64_t, WebUndoStep*);
277 void removeWebEditCommand(uint64_t);
278 bool isInRedo() const { return m_isInRedo; }
280 void setActivePopupMenu(WebPopupMenu*);
282 #if ENABLE(INPUT_TYPE_COLOR)
283 WebColorChooser* activeColorChooser() const { return m_activeColorChooser; }
284 void setActiveColorChooser(WebColorChooser*);
285 void didChooseColor(const WebCore::Color&);
286 void didEndColorPicker();
289 WebOpenPanelResultListener* activeOpenPanelResultListener() const { return m_activeOpenPanelResultListener.get(); }
290 void setActiveOpenPanelResultListener(PassRefPtr<WebOpenPanelResultListener>);
292 void didReceiveMessage(IPC::Connection&, IPC::MessageDecoder&) override;
293 void didReceiveSyncMessage(IPC::Connection&, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&) override;
295 // -- InjectedBundle methods
296 #if ENABLE(CONTEXT_MENUS)
297 void setInjectedBundleContextMenuClient(std::unique_ptr<API::InjectedBundle::PageContextMenuClient>);
299 void initializeInjectedBundleEditorClient(WKBundlePageEditorClientBase*);
300 void setInjectedBundleFormClient(std::unique_ptr<API::InjectedBundle::FormClient>);
301 void initializeInjectedBundleLoaderClient(WKBundlePageLoaderClientBase*);
302 void initializeInjectedBundlePolicyClient(WKBundlePagePolicyClientBase*);
303 void initializeInjectedBundleResourceLoadClient(WKBundlePageResourceLoadClientBase*);
304 void setInjectedBundleUIClient(std::unique_ptr<API::InjectedBundle::PageUIClient>);
305 #if ENABLE(FULLSCREEN_API)
306 void initializeInjectedBundleFullScreenClient(WKBundlePageFullScreenClientBase*);
308 void initializeInjectedBundleDiagnosticLoggingClient(WKBundlePageDiagnosticLoggingClientBase*);
310 #if ENABLE(CONTEXT_MENUS)
311 API::InjectedBundle::PageContextMenuClient& injectedBundleContextMenuClient() { return *m_contextMenuClient.get(); }
313 InjectedBundlePageEditorClient& injectedBundleEditorClient() { return m_editorClient; }
314 API::InjectedBundle::FormClient& injectedBundleFormClient() { return *m_formClient.get(); }
315 InjectedBundlePageLoaderClient& injectedBundleLoaderClient() { return m_loaderClient; }
316 InjectedBundlePagePolicyClient& injectedBundlePolicyClient() { return m_policyClient; }
317 InjectedBundlePageResourceLoadClient& injectedBundleResourceLoadClient() { return m_resourceLoadClient; }
318 API::InjectedBundle::PageUIClient& injectedBundleUIClient() { return *m_uiClient.get(); }
319 InjectedBundlePageDiagnosticLoggingClient& injectedBundleDiagnosticLoggingClient() { return m_logDiagnosticMessageClient; }
320 #if ENABLE(FULLSCREEN_API)
321 InjectedBundlePageFullScreenClient& injectedBundleFullScreenClient() { return m_fullScreenClient; }
324 bool findStringFromInjectedBundle(const String&, FindOptions);
326 WebFrame* mainWebFrame() const { return m_mainFrame.get(); }
328 WebCore::MainFrame* mainFrame() const; // May return 0.
329 WebCore::FrameView* mainFrameView() const; // May return 0.
331 PassRefPtr<WebCore::Range> currentSelectionAsRange();
333 #if ENABLE(NETSCAPE_PLUGIN_API)
334 PassRefPtr<Plugin> createPlugin(WebFrame*, WebCore::HTMLPlugInElement*, const Plugin::Parameters&, String& newMIMEType);
338 WebCore::WebGLLoadPolicy webGLPolicyForURL(WebFrame*, const String&);
339 WebCore::WebGLLoadPolicy resolveWebGLPolicyForURL(WebFrame*, const String&);
340 #endif // ENABLE(WEBGL)
342 enum class IncludePostLayoutDataHint { No, Yes };
343 EditorState editorState(IncludePostLayoutDataHint = IncludePostLayoutDataHint::Yes) const;
344 void sendPostLayoutEditorStateIfNeeded();
346 String renderTreeExternalRepresentation() const;
347 String renderTreeExternalRepresentationForPrinting() const;
348 uint64_t renderTreeSize() const;
350 void setTracksRepaints(bool);
351 bool isTrackingRepaints() const;
352 void resetTrackedRepaints();
353 Ref<API::Array> trackedRepaintRects();
355 void executeEditingCommand(const String& commandName, const String& argument);
356 bool isEditingCommandEnabled(const String& commandName);
357 void clearMainFrameName();
360 void sendSetWindowFrame(const WebCore::FloatRect&);
362 double textZoomFactor() const;
363 void setTextZoomFactor(double);
364 double pageZoomFactor() const;
365 void setPageZoomFactor(double);
366 void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
367 void windowScreenDidChange(uint32_t);
369 void scalePage(double scale, const WebCore::IntPoint& origin);
370 void scalePageInViewCoordinates(double scale, WebCore::IntPoint centerInViewCoordinates);
371 double pageScaleFactor() const;
372 double totalScaleFactor() const;
373 double viewScaleFactor() const;
374 void scaleView(double scale);
376 void setUseFixedLayout(bool);
377 bool useFixedLayout() const { return m_useFixedLayout; }
378 void setFixedLayoutSize(const WebCore::IntSize&);
379 WebCore::IntSize fixedLayoutSize() const;
381 void listenForLayoutMilestones(uint32_t /* LayoutMilestones */);
383 void setSuppressScrollbarAnimations(bool);
385 void setEnableVerticalRubberBanding(bool);
386 void setEnableHorizontalRubberBanding(bool);
388 void setBackgroundExtendsBeyondPage(bool);
390 void setPaginationMode(uint32_t /* WebCore::Pagination::Mode */);
391 void setPaginationBehavesLikeColumns(bool);
392 void setPageLength(double);
393 void setGapBetweenPages(double);
395 void postInjectedBundleMessage(const String& messageName, const UserData&);
397 bool drawsBackground() const { return m_drawsBackground; }
398 bool drawsTransparentBackground() const { return m_drawsTransparentBackground; }
400 void setUnderlayColor(const WebCore::Color& color) { m_underlayColor = color; }
401 WebCore::Color underlayColor() const { return m_underlayColor; }
404 void stopLoadingFrame(uint64_t frameID);
405 bool defersLoading() const;
406 void setDefersLoading(bool deferLoading);
408 void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*);
409 void exitAcceleratedCompositingMode();
411 void addPluginView(PluginView*);
412 void removePluginView(PluginView*);
414 bool isVisible() const { return m_viewState & WebCore::ViewState::IsVisible; }
415 bool isVisibleOrOccluded() const { return m_viewState & WebCore::ViewState::IsVisibleOrOccluded; }
417 LayerHostingMode layerHostingMode() const { return m_layerHostingMode; }
418 void setLayerHostingMode(unsigned);
421 void updatePluginsActiveAndFocusedState();
422 const WebCore::FloatRect& windowFrameInScreenCoordinates() const { return m_windowFrameInScreenCoordinates; }
423 const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates() const { return m_windowFrameInUnflippedScreenCoordinates; }
424 const WebCore::FloatRect& viewFrameInWindowCoordinates() const { return m_viewFrameInWindowCoordinates; }
426 bool hasCachedWindowFrame() const { return m_hasCachedWindowFrame; }
429 void setTopOverhangImage(PassRefPtr<WebImage>);
430 void setBottomOverhangImage(PassRefPtr<WebImage>);
431 #endif // !PLATFORM(IOS)
433 void updateHeaderAndFooterLayersForDeviceScaleChange(float scaleFactor);
434 #endif // PLATFORM(COCOA)
436 bool windowIsFocused() const;
437 bool windowAndWebPageAreFocused() const;
440 void setHeaderPageBanner(PassRefPtr<PageBanner>);
441 PageBanner* headerPageBanner();
442 void setFooterPageBanner(PassRefPtr<PageBanner>);
443 PageBanner* footerPageBanner();
445 void hidePageBanners();
446 void showPageBanners();
448 #endif // !PLATFORM(IOS)
450 WebCore::IntPoint screenToRootView(const WebCore::IntPoint&);
451 WebCore::IntRect rootViewToScreen(const WebCore::IntRect&);
454 WebCore::IntPoint accessibilityScreenToRootView(const WebCore::IntPoint&);
455 WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&);
458 PassRefPtr<WebImage> scaledSnapshotWithOptions(const WebCore::IntRect&, double additionalScaleFactor, SnapshotOptions);
459 PassRefPtr<WebImage> snapshotAtSize(const WebCore::IntRect&, const WebCore::IntSize& bitmapSize, SnapshotOptions);
460 PassRefPtr<WebImage> snapshotNode(WebCore::Node&, SnapshotOptions, unsigned maximumPixelCount = std::numeric_limits<unsigned>::max());
462 static const WebEvent* currentEvent();
464 FindController& findController() { return m_findController; }
466 #if ENABLE(GEOLOCATION)
467 GeolocationPermissionRequestManager& geolocationPermissionRequestManager() { return m_geolocationPermissionRequestManager; }
470 #if PLATFORM(IOS) || PLATFORM(EFL)
471 void savePageState(WebCore::HistoryItem&);
472 void restorePageState(const WebCore::HistoryItem&);
475 #if ENABLE(MEDIA_STREAM)
476 UserMediaPermissionRequestManager& userMediaPermissionRequestManager() { return m_userMediaPermissionRequestManager; }
480 WebCore::FloatSize screenSize() const;
481 WebCore::FloatSize availableScreenSize() const;
482 int32_t deviceOrientation() const { return m_deviceOrientation; }
483 void viewportPropertiesDidChange(const WebCore::ViewportArguments&);
484 void didReceiveMobileDocType(bool);
486 void setUseTestingViewportConfiguration(bool useTestingViewport) { m_useTestingViewportConfiguration = useTestingViewport; }
487 bool isUsingTestingViewportConfiguration() const { return m_useTestingViewportConfiguration; }
489 double minimumPageScaleFactor() const;
490 double maximumPageScaleFactor() const;
491 bool allowsUserScaling() const;
492 bool hasStablePageScaleFactor() const { return m_hasStablePageScaleFactor; }
494 void handleTap(const WebCore::IntPoint&, uint64_t lastLayerTreeTransactionId);
495 void potentialTapAtPosition(uint64_t requestID, const WebCore::FloatPoint&);
496 void commitPotentialTap(uint64_t lastLayerTreeTransactionId);
497 void commitPotentialTapFailed();
498 void cancelPotentialTap();
499 void cancelPotentialTapInFrame(WebFrame&);
500 void tapHighlightAtPosition(uint64_t requestID, const WebCore::FloatPoint&);
502 void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&);
503 void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&);
505 void blurAssistedNode();
506 void selectWithGesture(const WebCore::IntPoint&, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithAssistedNode, uint64_t callbackID);
507 void updateSelectionWithTouches(const WebCore::IntPoint& point, uint32_t touches, bool baseIsStart, uint64_t callbackID);
508 void updateBlockSelectionWithTouch(const WebCore::IntPoint&, uint32_t touch, uint32_t handlePosition);
509 void selectWithTwoTouches(const WebCore::IntPoint& from, const WebCore::IntPoint& to, uint32_t gestureType, uint32_t gestureState, uint64_t callbackID);
510 void extendSelection(uint32_t granularity);
511 void selectWordBackward();
512 void moveSelectionByOffset(int32_t offset, uint64_t callbackID);
513 void selectTextWithGranularityAtPoint(const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithAssistedNode, uint64_t callbackID);
514 void selectPositionAtBoundaryWithDirection(const WebCore::IntPoint&, uint32_t granularity, uint32_t direction, bool isInteractingWithAssistedNode, uint64_t callbackID);
515 void moveSelectionAtBoundaryWithDirection(uint32_t granularity, uint32_t direction, uint64_t callbackID);
516 void selectPositionAtPoint(const WebCore::IntPoint&, bool isInteractingWithAssistedNode, uint64_t callbackID);
517 void beginSelectionInDirection(uint32_t direction, uint64_t callbackID);
518 void updateSelectionWithExtentPoint(const WebCore::IntPoint&, bool isInteractingWithAssistedNode, uint64_t callbackID);
519 void updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithAssistedNode, uint64_t callbackID);
521 void elementDidFocus(WebCore::Node*);
522 void elementDidBlur(WebCore::Node*);
523 void requestDictationContext(uint64_t callbackID);
524 void replaceDictatedText(const String& oldText, const String& newText);
525 void replaceSelectedText(const String& oldText, const String& newText);
526 void requestAutocorrectionData(const String& textForAutocorrection, uint64_t callbackID);
527 void applyAutocorrection(const String& correction, const String& originalText, uint64_t callbackID);
528 void syncApplyAutocorrection(const String& correction, const String& originalText, bool& correctionApplied);
529 void requestAutocorrectionContext(uint64_t callbackID);
530 void getAutocorrectionContext(String& beforeText, String& markedText, String& selectedText, String& afterText, uint64_t& location, uint64_t& length);
531 void getPositionInformation(const WebCore::IntPoint&, InteractionInformationAtPosition&);
532 void requestPositionInformation(const WebCore::IntPoint&);
533 void startInteractionWithElementAtPosition(const WebCore::IntPoint&);
534 void stopInteraction();
535 void performActionOnElement(uint32_t action);
536 void focusNextAssistedNode(bool isForward, uint64_t callbackID);
537 void setAssistedNodeValue(const String&);
538 void setAssistedNodeValueAsNumber(double);
539 void setAssistedNodeSelectedIndex(uint32_t index, bool allowMultipleSelection);
540 void resetAssistedNodeForFrame(WebFrame*);
541 WebCore::IntRect rectForElementAtInteractionLocation();
542 void updateSelectionAppearance();
543 void getLookupContextAtPoint(const WebCore::IntPoint, uint64_t callbackID);
545 #if ENABLE(IOS_TOUCH_EVENTS)
546 void dispatchAsynchronousTouchEvents(const Vector<WebTouchEvent, 1>& queue);
549 void contentSizeCategoryDidChange(const String&);
550 void executeEditCommandWithCallback(const String&, uint64_t callbackID);
552 std::chrono::milliseconds eventThrottlingDelay() const;
554 void showInspectorHighlight(const WebCore::Highlight&);
555 void hideInspectorHighlight();
557 void showInspectorIndication();
558 void hideInspectorIndication();
560 void enableInspectorNodeSearch();
561 void disableInspectorNodeSearch();
564 void setLayerTreeStateIsFrozen(bool);
565 bool markLayersVolatileImmediatelyIfPossible();
567 NotificationPermissionRequestManager* notificationPermissionRequestManager();
569 void pageDidScroll();
570 #if USE(COORDINATED_GRAPHICS)
571 void pageDidRequestScroll(const WebCore::IntPoint&);
572 void setFixedVisibleContentRect(const WebCore::IntRect&);
573 void sendViewportAttributesChanged();
576 #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
577 void commitPageTransitionViewport();
580 #if ENABLE(CONTEXT_MENUS)
581 WebContextMenu* contextMenu();
582 WebContextMenu* contextMenuAtPointInWindow(const WebCore::IntPoint&);
585 bool hasLocalDataForURL(const WebCore::URL&);
586 String cachedResponseMIMETypeForURL(const WebCore::URL&);
587 String cachedSuggestedFilenameForURL(const WebCore::URL&);
588 PassRefPtr<WebCore::SharedBuffer> cachedResponseDataForURL(const WebCore::URL&);
590 static bool canHandleRequest(const WebCore::ResourceRequest&);
592 class SandboxExtensionTracker {
594 ~SandboxExtensionTracker();
598 void beginLoad(WebFrame*, const SandboxExtension::Handle& handle);
599 void willPerformLoadDragDestinationAction(PassRefPtr<SandboxExtension> pendingDropSandboxExtension);
600 void didStartProvisionalLoad(WebFrame*);
601 void didCommitProvisionalLoad(WebFrame*);
602 void didFailProvisionalLoad(WebFrame*);
605 void setPendingProvisionalSandboxExtension(PassRefPtr<SandboxExtension>);
607 RefPtr<SandboxExtension> m_pendingProvisionalSandboxExtension;
608 RefPtr<SandboxExtension> m_provisionalSandboxExtension;
609 RefPtr<SandboxExtension> m_committedSandboxExtension;
612 SandboxExtensionTracker& sandboxExtensionTracker() { return m_sandboxExtensionTracker; }
615 void setThemePath(const String&);
619 void setComposition(const String& text, const Vector<WebCore::CompositionUnderline>& underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeLength);
620 void confirmComposition(const String& text, int64_t selectionStart, int64_t selectionLength);
621 void cancelComposition();
624 #if PLATFORM (GTK) && HAVE(GTK_GESTURES)
625 void getCenterForZoomGesture(const WebCore::IntPoint& centerInViewCoordinates, WebCore::IntPoint& result);
628 void didApplyStyle();
629 void didChangeSelection();
630 void discardedComposition();
633 void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
634 WKAccessibilityWebPageObject* accessibilityRemoteObject();
635 NSObject *accessibilityObjectForMainFramePlugin();
636 const WebCore::FloatPoint& accessibilityPosition() const { return m_accessibilityPosition; }
638 void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
640 void insertTextAsync(const String& text, const EditingRange& replacementRange, bool registerUndoGroup = false);
641 void getMarkedRangeAsync(uint64_t callbackID);
642 void getSelectedRangeAsync(uint64_t callbackID);
643 void characterIndexForPointAsync(const WebCore::IntPoint&, uint64_t callbackID);
644 void firstRectForCharacterRangeAsync(const EditingRange&, uint64_t callbackID);
645 void setCompositionAsync(const String& text, Vector<WebCore::CompositionUnderline> underlines, const EditingRange& selectionRange, const EditingRange& replacementRange);
646 void confirmCompositionAsync();
649 void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::DictationAlternative>& dictationAlternativeLocations, bool registerUndoGroup = false);
650 void attributedSubstringForCharacterRangeAsync(const EditingRange&, uint64_t callbackID);
651 void fontAtSelection(uint64_t callbackID);
652 #if !USE(ASYNC_NSTEXTINPUTCLIENT)
653 void insertText(const String& text, const EditingRange& replacementRange, bool& handled, EditorState& newState);
654 void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, const EditingRange& selectionRange, const EditingRange& replacementRange, EditorState& newState);
655 void confirmComposition(EditorState& newState);
656 void insertDictatedText(const String& text, const EditingRange& replacementRange, const Vector<WebCore::DictationAlternative>& dictationAlternativeLocations, bool& handled, EditorState& newState);
657 void getAttributedSubstringFromRange(const EditingRange&, AttributedString&);
658 void getMarkedRange(EditingRange&);
659 void getSelectedRange(EditingRange&);
660 void characterIndexForPoint(const WebCore::IntPoint point, uint64_t& result);
661 void firstRectForCharacterRange(const EditingRange&, WebCore::IntRect& resultRect);
662 void executeKeypressCommands(const Vector<WebCore::KeypressCommand>&, bool& handled, EditorState& newState);
663 void cancelComposition(EditorState& newState);
667 void readSelectionFromPasteboard(const WTF::String& pasteboardName, bool& result);
668 void getStringSelectionForPasteboard(WTF::String& stringValue);
669 void getDataSelectionForPasteboard(const WTF::String pasteboardType, SharedMemory::Handle& handle, uint64_t& size);
670 void shouldDelayWindowOrderingEvent(const WebKit::WebMouseEvent&, bool& result);
671 void acceptsFirstMouse(int eventNumber, const WebKit::WebMouseEvent&, bool& result);
672 bool performNonEditingBehaviorForSelector(const String&, WebCore::KeyboardEvent*);
674 #if ENABLE(SERVICE_CONTROLS)
675 void replaceSelectionWithPasteboardData(const Vector<String>& types, const IPC::DataReference&);
679 void confirmComposition(const String& compositionString);
680 void setComposition(const WTF::String& compositionString, const WTF::Vector<WebCore::CompositionUnderline>& underlines, uint64_t cursorPosition);
681 void cancelComposition();
684 #if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
685 void updateAccessibilityTree();
688 void setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length);
689 bool hasCompositionForTesting();
690 void confirmCompositionForTesting(const String& compositionString);
692 // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require
693 // any synchronous messages, and should be removed when <rdar://problem/8775115> is fixed.
698 void speak(const String&);
701 void performDictionaryLookupForSelection(WebCore::Frame*, const WebCore::VisibleSelection&, WebCore::TextIndicatorPresentationTransition);
704 bool isSmartInsertDeleteEnabled();
705 void setSmartInsertDeleteEnabled(bool);
707 bool isSelectTrailingWhitespaceEnabled();
708 void setSelectTrailingWhitespaceEnabled(bool);
710 void replaceSelectionWithText(WebCore::Frame*, const String&);
711 void clearSelection();
712 void restoreSelectionInFocusedEditableElement();
714 #if ENABLE(DRAG_SUPPORT)
716 void performDragControllerAction(uint64_t action, WebCore::DragData);
718 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&);
720 void dragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation);
722 void willPerformLoadDragDestinationAction();
723 void mayPerformUploadDragDestinationAction();
725 void willStartDrag() { ASSERT(!m_isStartingDrag); m_isStartingDrag = true; }
726 void didStartDrag() { ASSERT(m_isStartingDrag); m_isStartingDrag = false; }
727 #endif // ENABLE(DRAG_SUPPORT)
729 void beginPrinting(uint64_t frameID, const PrintInfo&);
731 void computePagesForPrinting(uint64_t frameID, const PrintInfo&, uint64_t callbackID);
732 void computePagesForPrintingImpl(uint64_t frameID, const PrintInfo&, Vector<WebCore::IntRect>& pageRects, double& totalScaleFactor);
734 void drawRectToImage(uint64_t frameID, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, uint64_t callbackID);
735 void drawPagesToPDF(uint64_t frameID, const PrintInfo&, uint32_t first, uint32_t count, uint64_t callbackID);
736 void drawPagesToPDFImpl(uint64_t frameID, const PrintInfo&, uint32_t first, uint32_t count, RetainPtr<CFMutableDataRef>& pdfPageData);
738 void computePagesForPrintingAndStartDrawingToPDF(uint64_t frameID, const PrintInfo&, uint32_t firstPage, PassRefPtr<Messages::WebPage::ComputePagesForPrintingAndStartDrawingToPDF::DelayedReply>);
741 void drawPagesForPrinting(uint64_t frameID, const PrintInfo&, uint64_t callbackID);
742 void didFinishPrintOperation(const WebCore::ResourceError&, uint64_t callbackID);
745 void addResourceRequest(unsigned long, const WebCore::ResourceRequest&);
746 void removeResourceRequest(unsigned long);
748 void setMediaVolume(float);
750 void setMayStartMediaWhenInWindow(bool);
752 #if ENABLE(MEDIA_SESSION)
753 void handleMediaEvent(uint32_t /* WebCore::MediaEventType */);
754 void setVolumeOfMediaElement(double, uint64_t);
757 void updateMainFrameScrollOffsetPinning();
759 bool mainFrameHasCustomContentProvider() const;
760 void addMIMETypeWithCustomContentProvider(const String&);
762 void mainFrameDidLayout();
764 bool canRunBeforeUnloadConfirmPanel() const { return m_canRunBeforeUnloadConfirmPanel; }
765 void setCanRunBeforeUnloadConfirmPanel(bool canRunBeforeUnloadConfirmPanel) { m_canRunBeforeUnloadConfirmPanel = canRunBeforeUnloadConfirmPanel; }
767 bool canRunModal() const { return m_canRunModal; }
768 void setCanRunModal(bool canRunModal) { m_canRunModal = canRunModal; }
772 void setDeviceScaleFactor(float);
773 float deviceScaleFactor() const;
775 void forceRepaintWithoutCallback();
777 void unmarkAllMisspellings();
778 void unmarkAllBadGrammar();
780 void handleAlternativeTextUIResult(const String&);
783 // For testing purpose.
784 void simulateMouseDown(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
785 void simulateMouseUp(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
786 void simulateMouseMotion(WebCore::IntPoint, double time);
788 #if ENABLE(CONTEXT_MENUS)
789 void contextMenuShowing() { m_isShowingContextMenu = true; }
792 void wheelEvent(const WebWheelEvent&);
794 void wheelEventHandlersChanged(bool);
795 void recomputeShortCircuitHorizontalWheelEventsState();
797 void updateVisibilityState(bool isInitialState = false);
800 void setViewportConfigurationMinimumLayoutSize(const WebCore::FloatSize&);
801 void setMaximumUnobscuredSize(const WebCore::FloatSize&);
802 void setDeviceOrientation(int32_t);
803 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);
804 void synchronizeDynamicViewportUpdate(double& newTargetScale, WebCore::FloatPoint& newScrollPosition, uint64_t& nextValidLayerTreeTransactionID);
805 void updateVisibleContentRects(const VisibleContentRectUpdateInfo&, double oldestTimestamp);
806 bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; }
807 void willStartUserTriggeredZooming();
808 void applicationWillResignActive();
809 void applicationDidEnterBackground(bool isSuspendedUnderLock);
810 void applicationWillEnterForeground(bool isSuspendedUnderLock);
811 void applicationDidBecomeActive();
812 void zoomToRect(WebCore::FloatRect, double minimumScale, double maximumScale);
813 void completePendingSyntheticClickForContentChangeObserver();
816 #if ENABLE(IOS_TOUCH_EVENTS)
817 void dispatchTouchEvent(const WebTouchEvent&, bool& handled);
820 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
821 uint64_t nativeWindowHandle() { return m_nativeWindowHandle; }
824 bool shouldUseCustomContentProviderForResponse(const WebCore::ResourceResponse&);
825 bool canPluginHandleResponse(const WebCore::ResourceResponse& response);
827 bool asynchronousPluginInitializationEnabled() const { return m_asynchronousPluginInitializationEnabled; }
828 void setAsynchronousPluginInitializationEnabled(bool enabled) { m_asynchronousPluginInitializationEnabled = enabled; }
829 bool asynchronousPluginInitializationEnabledForAllPlugins() const { return m_asynchronousPluginInitializationEnabledForAllPlugins; }
830 void setAsynchronousPluginInitializationEnabledForAllPlugins(bool enabled) { m_asynchronousPluginInitializationEnabledForAllPlugins = enabled; }
831 bool artificialPluginInitializationDelayEnabled() const { return m_artificialPluginInitializationDelayEnabled; }
832 void setArtificialPluginInitializationDelayEnabled(bool enabled) { m_artificialPluginInitializationDelayEnabled = enabled; }
833 void setTabToLinksEnabled(bool enabled) { m_tabToLinks = enabled; }
834 bool tabToLinksEnabled() const { return m_tabToLinks; }
836 bool scrollingPerformanceLoggingEnabled() const { return m_scrollingPerformanceLoggingEnabled; }
837 void setScrollingPerformanceLoggingEnabled(bool);
840 bool shouldUsePDFPlugin() const;
841 bool pdfPluginEnabled() const { return m_pdfPluginEnabled; }
842 void setPDFPluginEnabled(bool enabled) { m_pdfPluginEnabled = enabled; }
845 void savePDFToFileInDownloadsFolder(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size);
847 void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
850 bool mainFrameIsScrollable() const { return m_mainFrameIsScrollable; }
852 void setMinimumLayoutSize(const WebCore::IntSize&);
853 WebCore::IntSize minimumLayoutSize() const { return m_minimumLayoutSize; }
855 void setAutoSizingShouldExpandToViewHeight(bool shouldExpand);
856 bool autoSizingShouldExpandToViewHeight() { return m_autoSizingShouldExpandToViewHeight; }
858 bool canShowMIMEType(const String& MIMEType) const;
860 void addTextCheckingRequest(uint64_t requestID, PassRefPtr<WebCore::TextCheckingRequest>);
861 void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
862 void didCancelCheckingText(uint64_t requestID);
864 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
865 void determinePrimarySnapshottedPlugIn();
866 void determinePrimarySnapshottedPlugInTimerFired();
867 void resetPrimarySnapshottedPlugIn();
868 bool matchesPrimaryPlugIn(const String& pageOrigin, const String& pluginOrigin, const String& mimeType) const;
869 bool plugInIntersectsSearchRect(WebCore::HTMLPlugInImageElement& pluginImageElement);
870 bool plugInIsPrimarySize(WebCore::HTMLPlugInImageElement& pluginImageElement, unsigned &pluginArea);
873 unsigned extendIncrementalRenderingSuppression();
874 void stopExtendingIncrementalRenderingSuppression(unsigned token);
875 bool shouldExtendIncrementalRenderingSuppression() { return !m_activeRenderingSuppressionTokens.isEmpty(); }
877 WebCore::ScrollPinningBehavior scrollPinningBehavior() { return m_scrollPinningBehavior; }
878 void setScrollPinningBehavior(uint32_t /* WebCore::ScrollPinningBehavior */ pinning);
880 WTF::Optional<WebCore::ScrollbarOverlayStyle> scrollbarOverlayStyle() { return m_scrollbarOverlayStyle; }
881 void setScrollbarOverlayStyle(WTF::Optional<uint32_t /* WebCore::ScrollbarOverlayStyle */> scrollbarStyle);
883 Ref<WebCore::DocumentLoader> createDocumentLoader(WebCore::Frame&, const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
884 void updateCachedDocumentLoader(WebDocumentLoader&, WebCore::Frame&);
886 void getBytecodeProfile(uint64_t callbackID);
888 // Some platforms require accessibility-enabled processes to spin the run loop so that the WebProcess doesn't hang.
889 // While this is not ideal, it does not have to be applied to every platform at the moment.
890 static bool synchronousMessagesShouldSpinRunLoop();
892 #if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION)
893 void handleTelephoneNumberClick(const String& number, const WebCore::IntPoint&);
894 void handleSelectionServiceClick(WebCore::FrameSelection&, const Vector<String>& telephoneNumbers, const WebCore::IntPoint&);
897 void didChangeScrollOffsetForFrame(WebCore::Frame*);
899 void setMainFrameProgressCompleted(bool completed) { m_mainFrameProgressCompleted = completed; }
900 bool shouldDispatchFakeMouseMoveEvents() const { return m_shouldDispatchFakeMouseMoveEvents; }
902 void setPageActivityState(WebCore::PageActivityState::Flags);
904 void postMessage(const String& messageName, API::Object* messageBody);
905 void postSynchronousMessageForTesting(const String& messageName, API::Object* messageBody, RefPtr<API::Object>& returnData);
908 void setInputMethodState(bool);
911 void imageOrMediaDocumentSizeChanged(const WebCore::IntSize&);
914 void requestInstallMissingMediaPlugins(const String& details, const String& description, WebCore::MediaPlayerRequestInstallMissingPluginsCallback&);
918 void addUserScript(const String& source, WebCore::UserContentInjectedFrames, WebCore::UserScriptInjectionTime);
919 void addUserStyleSheet(const String& source, WebCore::UserContentInjectedFrames);
920 void removeAllUserContent();
922 void dispatchDidLayout(WebCore::LayoutMilestones);
925 WebPage(uint64_t pageID, const WebPageCreationParameters&);
927 // IPC::MessageSender
928 virtual IPC::Connection* messageSenderConnection() override;
929 virtual uint64_t messageSenderDestinationID() override;
931 void platformInitialize();
932 void platformDetach();
933 void platformEditorState(WebCore::Frame&, EditorState& result, IncludePostLayoutDataHint) const;
935 void didReceiveWebPageMessage(IPC::Connection&, IPC::MessageDecoder&);
936 void didReceiveSyncWebPageMessage(IPC::Connection&, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&);
939 void resetViewportDefaultConfiguration(WebFrame* mainFrame);
940 void viewportConfigurationChanged();
941 void updateViewportSizeForCSSViewportUnits();
943 static void convertSelectionRectsToRootView(WebCore::FrameView*, Vector<WebCore::SelectionRect>&);
944 PassRefPtr<WebCore::Range> rangeForWebSelectionAtPosition(const WebCore::IntPoint&, const WebCore::VisiblePosition&, SelectionFlags&);
945 PassRefPtr<WebCore::Range> rangeForBlockAtPoint(const WebCore::IntPoint&);
946 void computeExpandAndShrinkThresholdsForHandle(const WebCore::IntPoint&, SelectionHandlePosition, float& growThreshold, float& shrinkThreshold);
947 PassRefPtr<WebCore::Range> changeBlockSelection(const WebCore::IntPoint&, SelectionHandlePosition, float& growThreshold, float& shrinkThreshold, SelectionFlags&);
948 PassRefPtr<WebCore::Range> expandedRangeFromHandle(WebCore::Range*, SelectionHandlePosition);
949 PassRefPtr<WebCore::Range> contractedRangeFromHandle(WebCore::Range* currentRange, SelectionHandlePosition, SelectionFlags&);
950 void getAssistedNodeInformation(AssistedNodeInformation&);
951 void platformInitializeAccessibility();
952 void handleSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location);
953 void completeSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location);
954 void sendTapHighlightForNodeIfNecessary(uint64_t requestID, WebCore::Node*);
955 void resetTextAutosizingBeforeLayoutIfNeeded(const WebCore::FloatSize& oldSize, const WebCore::FloatSize& newSize);
956 WebCore::VisiblePosition visiblePositionInFocusedNodeForPoint(const WebCore::Frame&, const WebCore::IntPoint&, bool isInteractingWithAssistedNode);
957 PassRefPtr<WebCore::Range> rangeForGranularityAtPoint(const WebCore::Frame&, const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithAssistedNode);
958 void volatilityTimerFired();
961 static const char* interpretKeyEvent(const WebCore::KeyboardEvent*);
963 bool performDefaultBehaviorForKeyEvent(const WebKeyboardEvent&);
966 bool executeKeypressCommandsInternal(const Vector<WebCore::KeypressCommand>&, WebCore::KeyboardEvent*);
969 String sourceForFrame(WebFrame*);
971 void loadDataImpl(uint64_t navigationID, PassRefPtr<WebCore::SharedBuffer>, const String& MIMEType, const String& encodingName, const WebCore::URL& baseURL, const WebCore::URL& failingURL, const UserData&);
972 void loadString(uint64_t navigationID, const String&, const String& MIMEType, const WebCore::URL& baseURL, const WebCore::URL& failingURL, const UserData&);
974 bool platformHasLocalDataForURL(const WebCore::URL&);
978 void loadRequest(uint64_t navigationID, const WebCore::ResourceRequest&, const SandboxExtension::Handle&, uint64_t shouldOpenExternalURLsPolicy, const UserData&);
979 void loadData(uint64_t navigationID, const IPC::DataReference&, const String& MIMEType, const String& encodingName, const String& baseURL, const UserData&);
980 void loadHTMLString(uint64_t navigationID, const String& htmlString, const String& baseURL, const UserData&);
981 void loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL, const String& provisionalLoadErrorURL, const UserData&);
982 void loadPlainTextString(const String&, const UserData&);
983 void loadWebArchiveData(const IPC::DataReference&, const UserData&);
984 void navigateToPDFLinkWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint);
985 void reload(uint64_t navigationID, bool reloadFromOrigin, const SandboxExtension::Handle&);
986 void goForward(uint64_t navigationID, uint64_t);
987 void goBack(uint64_t navigationID, uint64_t);
988 void goToBackForwardItem(uint64_t navigationID, uint64_t);
989 void tryRestoreScrollPosition();
990 void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, uint64_t callbackID);
991 void updateIsInWindow(bool isInitialState = false);
992 void setViewState(WebCore::ViewState::Flags, bool wantsDidUpdateViewState, const Vector<uint64_t>& callbackIDs);
993 void validateCommand(const String&, uint64_t);
994 void executeEditCommand(const String&, const String&);
995 void setEditable(bool);
997 void updateUserActivity();
999 void mouseEvent(const WebMouseEvent&);
1000 void keyEvent(const WebKeyboardEvent&);
1001 #if ENABLE(IOS_TOUCH_EVENTS)
1002 void touchEventSync(const WebTouchEvent&, bool& handled);
1003 #elif ENABLE(TOUCH_EVENTS)
1004 void touchEvent(const WebTouchEvent&);
1006 #if ENABLE(CONTEXT_MENUS)
1007 void contextMenuHidden() { m_isShowingContextMenu = false; }
1010 static bool scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity);
1011 static bool logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity);
1013 void loadURLInFrame(const String&, uint64_t frameID);
1015 void restoreSession(const Vector<BackForwardListItemState>&);
1016 void didRemoveBackForwardItem(uint64_t);
1018 #if ENABLE(REMOTE_INSPECTOR)
1019 void setAllowsRemoteInspection(bool);
1022 void setDrawsBackground(bool);
1023 void setDrawsTransparentBackground(bool);
1025 void setTopContentInset(float);
1027 void viewWillStartLiveResize();
1028 void viewWillEndLiveResize();
1030 void getContentsAsString(uint64_t callbackID);
1032 void getContentsAsMHTMLData(uint64_t callbackID, bool useBinaryEncoding);
1034 void getMainResourceDataOfFrame(uint64_t frameID, uint64_t callbackID);
1035 void getResourceDataFromFrame(uint64_t frameID, const String& resourceURL, uint64_t callbackID);
1036 void getRenderTreeExternalRepresentation(uint64_t callbackID);
1037 void getSelectionOrContentsAsString(uint64_t callbackID);
1038 void getSelectionAsWebArchiveData(uint64_t callbackID);
1039 void getSourceForFrame(uint64_t frameID, uint64_t callbackID);
1040 void getWebArchiveOfFrame(uint64_t frameID, uint64_t callbackID);
1041 void runJavaScriptInMainFrame(const String&, uint64_t callbackID);
1042 void forceRepaint(uint64_t callbackID);
1043 void takeSnapshot(WebCore::IntRect snapshotRect, WebCore::IntSize bitmapSize, uint32_t options, uint64_t callbackID);
1045 void preferencesDidChange(const WebPreferencesStore&);
1046 void platformPreferencesDidChange(const WebPreferencesStore&);
1047 void updatePreferences(const WebPreferencesStore&);
1049 void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t navigationID, uint64_t downloadID);
1050 void setUserAgent(const String&);
1051 void setCustomTextEncodingName(const String&);
1052 void suspendActiveDOMObjectsAndAnimations();
1053 void resumeActiveDOMObjectsAndAnimations();
1056 void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
1057 void performDictionaryLookupOfCurrentSelection();
1058 void performDictionaryLookupForRange(WebCore::Frame*, WebCore::Range&, NSDictionary *options, WebCore::TextIndicatorPresentationTransition);
1059 WebCore::DictionaryPopupInfo dictionaryPopupInfoForRange(WebCore::Frame*, WebCore::Range&, NSDictionary **options, WebCore::TextIndicatorPresentationTransition);
1060 #if ENABLE(PDFKIT_PLUGIN)
1061 WebCore::DictionaryPopupInfo dictionaryPopupInfoForSelectionInPDFPlugin(PDFSelection *, PDFPlugin&, NSDictionary **options, WebCore::TextIndicatorPresentationTransition);
1064 void windowAndViewFramesChanged(const WebCore::FloatRect& windowFrameInScreenCoordinates, const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates, const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
1066 RetainPtr<PDFDocument> pdfDocumentForPrintingFrame(WebCore::Frame*);
1067 void computePagesForPrintingPDFDocument(uint64_t frameID, const PrintInfo&, Vector<WebCore::IntRect>& resultPageRects);
1068 void drawPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, const WebCore::IntRect&);
1069 void drawPagesToPDFFromPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, uint32_t first, uint32_t count);
1072 void setMainFrameIsScrollable(bool);
1074 void unapplyEditCommand(uint64_t commandID);
1075 void reapplyEditCommand(uint64_t commandID);
1076 void didRemoveEditCommand(uint64_t commandID);
1078 void findString(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1079 void findStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1080 void getImageForFindMatch(uint32_t matchIndex);
1081 void selectFindMatch(uint32_t matchIndex);
1083 void countStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1085 #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
1086 void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize& area);
1089 void didChangeSelectedIndexForActivePopupMenu(int32_t newIndex);
1090 void setTextForActivePopupMenu(int32_t index);
1093 void failedToShowPopupMenu();
1097 void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const IPC::DataReference& iconData);
1099 void didChooseFilesForOpenPanel(const Vector<String>&);
1100 void didCancelForOpenPanel();
1101 #if ENABLE(SANDBOX_EXTENSIONS)
1102 void extendSandboxForFileFromOpenPanel(const SandboxExtension::Handle&);
1105 void didReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed);
1107 void didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed);
1109 #if ENABLE(MEDIA_STREAM)
1110 WK_EXPORT void didReceiveUserMediaPermissionDecision(uint64_t userMediaID, bool allowed, const String& audioDeviceUID, const String& videoDeviceUID);
1113 void advanceToNextMisspelling(bool startBeforeSelection);
1114 void changeSpellingToWord(const String& word);
1116 void uppercaseWord();
1117 void lowercaseWord();
1118 void capitalizeWord();
1121 #if ENABLE(CONTEXT_MENUS)
1122 void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&);
1125 void changeSelectedIndex(int32_t index);
1126 void setCanStartMediaTimerFired();
1128 bool canHandleUserEvents() const;
1130 static bool platformCanHandleRequest(const WebCore::ResourceRequest&);
1132 static PluginView* focusedPluginViewForFrame(WebCore::Frame&);
1133 static PluginView* pluginViewForFrame(WebCore::Frame*);
1135 static PassRefPtr<WebCore::Range> rangeFromEditingRange(WebCore::Frame&, const EditingRange&);
1137 void reportUsedFeatures();
1140 void performImmediateActionHitTestAtLocation(WebCore::FloatPoint);
1141 RefPtr<WebCore::Range> lookupTextAtLocation(WebCore::FloatPoint, NSDictionary **options);
1142 void immediateActionDidUpdate();
1143 void immediateActionDidCancel();
1144 void immediateActionDidComplete();
1145 void setFont(const String& fontFamily, double fontSize, uint64_t fontTraits);
1147 void dataDetectorsDidPresentUI(WebCore::PageOverlay::PageOverlayID);
1148 void dataDetectorsDidChangeUI(WebCore::PageOverlay::PageOverlayID);
1149 void dataDetectorsDidHideUI(WebCore::PageOverlay::PageOverlayID);
1152 void setShouldDispatchFakeMouseMoveEvents(bool dispatch) { m_shouldDispatchFakeMouseMoveEvents = dispatch; }
1154 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
1155 void playbackTargetSelected(uint64_t, const WebCore::MediaPlaybackTargetContext& outputDevice) const;
1156 void playbackTargetAvailabilityDidChange(uint64_t, bool);
1157 void setShouldPlayToPlaybackTarget(uint64_t, bool);
1160 void clearWheelEventTestTrigger();
1162 void setShouldScaleViewToFitDocument(bool);
1163 void setUserContentExtensionsEnabled(bool);
1165 void pageStoppedScrolling();
1167 #if ENABLE(VIDEO) && USE(GSTREAMER)
1168 void didEndRequestInstallMissingMediaPlugins(uint32_t result);
1173 std::unique_ptr<WebCore::Page> m_page;
1174 RefPtr<WebFrame> m_mainFrame;
1175 RefPtr<InjectedBundleBackForwardList> m_backForwardList;
1177 RefPtr<WebPageGroupProxy> m_pageGroup;
1181 WebCore::IntSize m_viewSize;
1182 std::unique_ptr<DrawingArea> m_drawingArea;
1184 HashSet<PluginView*> m_pluginViews;
1185 bool m_hasSeenPlugin;
1187 HashMap<uint64_t, RefPtr<WebCore::TextCheckingRequest>> m_pendingTextCheckingRequestMap;
1189 bool m_useFixedLayout;
1191 bool m_drawsBackground;
1192 bool m_drawsTransparentBackground;
1194 WebCore::Color m_underlayColor;
1201 bool m_asynchronousPluginInitializationEnabled;
1202 bool m_asynchronousPluginInitializationEnabledForAllPlugins;
1203 bool m_artificialPluginInitializationDelayEnabled;
1205 bool m_scrollingPerformanceLoggingEnabled;
1207 bool m_mainFrameIsScrollable;
1209 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
1210 bool m_readyToFindPrimarySnapshottedPlugin;
1211 bool m_didFindPrimarySnapshottedPlugin;
1212 unsigned m_numberOfPrimarySnapshotDetectionAttempts;
1213 String m_primaryPlugInPageOrigin;
1214 String m_primaryPlugInOrigin;
1215 String m_primaryPlugInMimeType;
1216 RunLoop::Timer<WebPage> m_determinePrimarySnapshottedPlugInTimer;
1219 // The layer hosting mode.
1220 LayerHostingMode m_layerHostingMode;
1223 bool m_pdfPluginEnabled;
1225 bool m_hasCachedWindowFrame;
1227 // The frame of the containing window in screen coordinates.
1228 WebCore::FloatRect m_windowFrameInScreenCoordinates;
1230 // The frame of the containing window in unflipped screen coordinates.
1231 WebCore::FloatRect m_windowFrameInUnflippedScreenCoordinates;
1233 // The frame of the view in window coordinates.
1234 WebCore::FloatRect m_viewFrameInWindowCoordinates;
1236 // The accessibility position of the view.
1237 WebCore::FloatPoint m_accessibilityPosition;
1239 RetainPtr<WKAccessibilityWebPageObject> m_mockAccessibilityElement;
1241 ViewGestureGeometryCollector m_viewGestureGeometryCollector;
1243 #elif HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
1244 GRefPtr<WebPageAccessibilityObject> m_accessibilityObject;
1247 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
1248 // Our view's window in the UI process.
1249 uint64_t m_nativeWindowHandle;
1253 RefPtr<PageBanner> m_headerBanner;
1254 RefPtr<PageBanner> m_footerBanner;
1255 #endif // !PLATFORM(IOS)
1257 RunLoop::Timer<WebPage> m_setCanStartMediaTimer;
1258 bool m_mayStartMediaWhenInWindow;
1260 HashMap<uint64_t, RefPtr<WebUndoStep>> m_undoStepMap;
1262 #if ENABLE(CONTEXT_MENUS)
1263 std::unique_ptr<API::InjectedBundle::PageContextMenuClient> m_contextMenuClient;
1265 InjectedBundlePageEditorClient m_editorClient;
1266 std::unique_ptr<API::InjectedBundle::FormClient> m_formClient;
1267 InjectedBundlePageLoaderClient m_loaderClient;
1268 InjectedBundlePagePolicyClient m_policyClient;
1269 InjectedBundlePageResourceLoadClient m_resourceLoadClient;
1270 std::unique_ptr<API::InjectedBundle::PageUIClient> m_uiClient;
1271 #if ENABLE(FULLSCREEN_API)
1272 InjectedBundlePageFullScreenClient m_fullScreenClient;
1274 InjectedBundlePageDiagnosticLoggingClient m_logDiagnosticMessageClient;
1276 FindController m_findController;
1278 RefPtr<WebInspector> m_inspector;
1279 RefPtr<WebInspectorUI> m_inspectorUI;
1281 RefPtr<WebVideoFullscreenManager> m_videoFullscreenManager;
1282 bool m_allowsMediaDocumentInlinePlayback { false };
1284 #if ENABLE(FULLSCREEN_API)
1285 RefPtr<WebFullScreenManager> m_fullScreenManager;
1287 RefPtr<WebPopupMenu> m_activePopupMenu;
1288 #if ENABLE(CONTEXT_MENUS)
1289 RefPtr<WebContextMenu> m_contextMenu;
1291 #if ENABLE(INPUT_TYPE_COLOR)
1292 WebColorChooser* m_activeColorChooser;
1294 RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener;
1295 RefPtr<NotificationPermissionRequestManager> m_notificationPermissionRequestManager;
1297 RefPtr<WebUserContentController> m_userContentController;
1299 #if ENABLE(GEOLOCATION)
1300 GeolocationPermissionRequestManager m_geolocationPermissionRequestManager;
1303 #if ENABLE(MEDIA_STREAM)
1304 UserMediaPermissionRequestManager m_userMediaPermissionRequestManager;
1307 std::unique_ptr<WebCore::PrintContext> m_printContext;
1309 RefPtr<WebPrintOperationGtk> m_printOperation;
1312 SandboxExtensionTracker m_sandboxExtensionTracker;
1314 RefPtr<SandboxExtension> m_pendingDropSandboxExtension;
1315 Vector<RefPtr<SandboxExtension>> m_pendingDropExtensionsForFileUpload;
1317 WebCore::HysteresisActivity m_pageScrolledHysteresis;
1319 bool m_canRunBeforeUnloadConfirmPanel;
1322 bool m_isRunningModal;
1324 #if ENABLE(DRAG_SUPPORT)
1325 bool m_isStartingDrag;
1328 bool m_cachedMainFrameIsPinnedToLeftSide;
1329 bool m_cachedMainFrameIsPinnedToRightSide;
1330 bool m_cachedMainFrameIsPinnedToTopSide;
1331 bool m_cachedMainFrameIsPinnedToBottomSide;
1332 bool m_canShortCircuitHorizontalWheelEvents;
1333 bool m_hasWheelEventHandlers;
1335 unsigned m_cachedPageCount;
1337 HashSet<unsigned long> m_trackedNetworkResourceRequestIdentifiers;
1339 WebCore::IntSize m_minimumLayoutSize;
1340 bool m_autoSizingShouldExpandToViewHeight;
1342 #if ENABLE(CONTEXT_MENUS)
1343 bool m_isShowingContextMenu;
1347 RefPtr<WebCore::Node> m_assistedNode;
1348 RefPtr<WebCore::Range> m_currentWordRange;
1349 RefPtr<WebCore::Node> m_interactionNode;
1350 WebCore::IntPoint m_lastInteractionLocation;
1352 enum SelectionAnchor {
1356 SelectionAnchor m_selectionAnchor;
1358 RefPtr<WebCore::Node> m_potentialTapNode;
1359 WebCore::FloatPoint m_potentialTapLocation;
1361 WebCore::ViewportConfiguration m_viewportConfiguration;
1362 bool m_hasReceivedVisibleContentRectsAfterDidCommitLoad;
1363 bool m_scaleWasSetByUIProcess;
1364 bool m_userHasChangedPageScaleFactor;
1365 bool m_hasStablePageScaleFactor;
1366 bool m_userIsInteracting;
1367 bool m_hasFocusedDueToUserInteraction { false };
1368 bool m_hasPendingBlurNotification;
1369 bool m_useTestingViewportConfiguration;
1370 bool m_isInStableState;
1371 std::chrono::milliseconds m_oldestNonStableUpdateVisibleContentRectsTimestamp;
1372 std::chrono::milliseconds m_estimatedLatency;
1373 WebCore::FloatSize m_screenSize;
1374 WebCore::FloatSize m_availableScreenSize;
1375 RefPtr<WebCore::Range> m_currentBlockSelection;
1376 RefPtr<WebCore::Range> m_initialSelection;
1377 WebCore::IntSize m_blockSelectionDesiredSize;
1378 WebCore::FloatSize m_maximumUnobscuredSize;
1379 int32_t m_deviceOrientation;
1380 bool m_inDynamicSizeUpdate;
1381 HashMap<std::pair<WebCore::IntSize, double>, WebCore::IntPoint> m_dynamicSizeUpdateHistory;
1382 RefPtr<WebCore::Node> m_pendingSyntheticClickNode;
1383 WebCore::FloatPoint m_pendingSyntheticClickLocation;
1384 WebCore::FloatRect m_previousExposedContentRect;
1385 WebCore::Timer m_volatilityTimer;
1388 HashSet<String, CaseFoldingHash> m_mimeTypesWithCustomContentProviders;
1389 WebCore::Color m_backgroundColor;
1391 HashSet<unsigned> m_activeRenderingSuppressionTokens;
1392 unsigned m_maximumRenderingSuppressionToken;
1394 WebCore::ScrollPinningBehavior m_scrollPinningBehavior;
1395 WTF::Optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle;
1397 bool m_useAsyncScrolling;
1399 WebCore::ViewState::Flags m_viewState;
1400 WebCore::PageActivityState::Flags m_activityState;
1402 bool m_processSuppressionEnabled;
1403 UserActivity m_userActivity;
1405 uint64_t m_pendingNavigationID;
1408 WebCore::WebGLLoadPolicy m_systemWebGLPolicy;
1411 bool m_mainFrameProgressCompleted;
1412 bool m_shouldDispatchFakeMouseMoveEvents;
1413 bool m_isEditorStateMissingPostLayoutData { false };
1416 bool m_inputMethodEnabled { false };
1419 #if ENABLE(VIDEO) && USE(GSTREAMER)
1420 RefPtr<WebCore::MediaPlayerRequestInstallMissingPluginsCallback> m_installMediaPluginsCallback;
1424 } // namespace WebKit