[iOS] Synchronize the WKContentView and UIScrollView updates with the tiles being...
[WebKit-https.git] / Source / WebKit2 / WebProcess / WebPage / WebPage.h
1 /*
2  * Copyright (C) 2010, 2011, 2013 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
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.
12  *
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.
24  */
25
26 #ifndef WebPage_h
27 #define WebPage_h
28
29 #include "APIObject.h"
30 #include "DrawingArea.h"
31 #include "FindController.h"
32 #include "GeolocationPermissionRequestManager.h"
33 #include "ImageOptions.h"
34 #include "InjectedBundlePageDiagnosticLoggingClient.h"
35 #include "InjectedBundlePageEditorClient.h"
36 #include "InjectedBundlePageFormClient.h"
37 #include "InjectedBundlePageFullScreenClient.h"
38 #include "InjectedBundlePageLoaderClient.h"
39 #include "InjectedBundlePagePolicyClient.h"
40 #include "InjectedBundlePageResourceLoadClient.h"
41 #include "InjectedBundlePageUIClient.h"
42 #include "MessageReceiver.h"
43 #include "MessageSender.h"
44 #include "TapHighlightController.h"
45 #include "Plugin.h"
46 #include "SandboxExtension.h"
47 #include "ShareableBitmap.h"
48 #include "WebUndoStep.h"
49 #include <WebCore/DictationAlternative.h>
50 #include <WebCore/DragData.h>
51 #include <WebCore/Editor.h>
52 #include <WebCore/FrameLoaderTypes.h>
53 #include <WebCore/IntRect.h>
54 #include <WebCore/Page.h>
55 #include <WebCore/PageVisibilityState.h>
56 #include <WebCore/PlatformScreen.h>
57 #include <WebCore/ScrollTypes.h>
58 #include <WebCore/TextChecking.h>
59 #include <WebCore/UserActivity.h>
60 #include <WebCore/ViewState.h>
61 #include <WebCore/ViewportConfiguration.h>
62 #include <WebCore/WebCoreKeyboardUIMode.h>
63 #include <wtf/HashMap.h>
64 #include <wtf/OwnPtr.h>
65 #include <wtf/PassRefPtr.h>
66 #include <wtf/RefPtr.h>
67 #include <wtf/text/WTFString.h>
68
69 #if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
70 #include "WebPageAccessibilityObject.h"
71 #include <wtf/gobject/GRefPtr.h>
72 #endif
73
74 #if PLATFORM(GTK)
75 #include "ArgumentCodersGtk.h"
76 #include "WebPrintOperationGtk.h"
77 #endif
78
79 #if ENABLE(TOUCH_EVENTS)
80 #if PLATFORM(IOS)
81 #include <WebKitAdditions/PlatformTouchEventIOS.h>
82 #else
83 #include <WebCore/PlatformTouchEvent.h>
84 #endif
85 #endif
86
87 #if ENABLE(CONTEXT_MENUS)
88 #include "InjectedBundlePageContextMenuClient.h"
89 #endif
90
91 #if PLATFORM(MAC)
92 #include "DictionaryPopupInfo.h"
93 #include "LayerHostingContext.h"
94 #include "ViewGestureGeometryCollector.h"
95 #include <wtf/RetainPtr.h>
96 OBJC_CLASS CALayer;
97 OBJC_CLASS NSDictionary;
98 OBJC_CLASS NSObject;
99 OBJC_CLASS WKAccessibilityWebPageObject;
100
101 #define ENABLE_PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC 1
102 #endif
103
104 namespace API {
105 class Array;
106 }
107
108 namespace IPC {
109     class ArgumentDecoder;
110     class Connection;
111 }
112
113 namespace WebCore {
114     class GraphicsContext;
115     class Frame;
116     class FrameView;
117     class HTMLPlugInElement;
118     class IntPoint;
119     class KeyboardEvent;
120     class Page;
121     class PrintContext;
122     class Range;
123     class ResourceResponse;
124     class ResourceRequest;
125     class SharedBuffer;
126     class SubstituteData;
127     class TextCheckingRequest;
128     class VisibleSelection;
129     struct KeypressCommand;
130     struct TextCheckingResult;
131 }
132
133 namespace WebKit {
134
135 class DrawingArea;
136 class InjectedBundleBackForwardList;
137 class NotificationPermissionRequestManager;
138 class PageBanner;
139 class PageOverlay;
140 class PluginView;
141 class SessionState;
142 class WebColorChooser;
143 class WebContextMenu;
144 class WebContextMenuItemData;
145 class WebEvent;
146 class WebFrame;
147 class WebFullScreenManager;
148 class WebImage;
149 class WebInspector;
150 class WebInspectorClient;
151 class WebKeyboardEvent;
152 class WebMouseEvent;
153 class WebNotificationClient;
154 class WebOpenPanelResultListener;
155 class WebPageGroupProxy;
156 class WebPopupMenu;
157 class WebWheelEvent;
158 struct AttributedString;
159 struct EditorState;
160 struct InteractionInformationAtPosition;
161 struct PrintInfo;
162 struct WebPageCreationParameters;
163 struct WebPreferencesStore;
164
165 #if ENABLE(TOUCH_EVENTS)
166 class WebTouchEvent;
167 #endif
168
169 typedef Vector<RefPtr<PageOverlay>> PageOverlayList;
170
171 class WebPage : public API::ObjectImpl<API::Object::Type::BundlePage>, public IPC::MessageReceiver, public IPC::MessageSender {
172 public:
173     static PassRefPtr<WebPage> create(uint64_t pageID, const WebPageCreationParameters&);
174     virtual ~WebPage();
175
176     void reinitializeWebPage(const WebPageCreationParameters&);
177
178     void close();
179
180     static WebPage* fromCorePage(WebCore::Page*);
181
182     WebCore::Page* corePage() const { return m_page.get(); }
183     uint64_t pageID() const { return m_pageID; }
184     uint64_t sessionID() const;
185     void setSessionID(uint64_t);
186
187     void setSize(const WebCore::IntSize&);
188     const WebCore::IntSize& size() const { return m_viewSize; }
189     WebCore::IntRect bounds() const { return WebCore::IntRect(WebCore::IntPoint(), size()); }
190     
191     InjectedBundleBackForwardList* backForwardList();
192     DrawingArea* drawingArea() const { return m_drawingArea.get(); }
193 #if ENABLE(ASYNC_SCROLLING)
194     WebCore::ScrollingCoordinator* scrollingCoordinator() const;
195 #endif
196
197     WebPageGroupProxy* pageGroup() const { return m_pageGroup.get(); }
198
199     void scrollMainFrameIfNotAtMaxScrollPosition(const WebCore::IntSize& scrollOffset);
200
201     bool scrollBy(uint32_t scrollDirection, uint32_t scrollGranularity);
202
203     void centerSelectionInVisibleArea();
204
205 #if ENABLE(INSPECTOR)
206     WebInspector* inspector();
207 #endif
208
209 #if ENABLE(FULLSCREEN_API)
210     WebFullScreenManager* fullScreenManager();
211 #endif
212
213     // -- Called by the DrawingArea.
214     // FIXME: We could genericize these into a DrawingArea client interface. Would that be beneficial?
215     void drawRect(WebCore::GraphicsContext&, const WebCore::IntRect&);
216     void drawPageOverlay(PageOverlay*, WebCore::GraphicsContext&, const WebCore::IntRect&);
217     void layoutIfNeeded();
218
219     // -- Called from WebCore clients.
220 #if PLATFORM(MAC)
221     bool handleEditingKeyboardEvent(WebCore::KeyboardEvent*, bool saveCommands);
222 #elif !PLATFORM(GTK)
223     bool handleEditingKeyboardEvent(WebCore::KeyboardEvent*);
224 #endif
225
226     void didStartPageTransition();
227     void didCompletePageTransition();
228     void didCommitLoad(WebFrame*);
229     void didFinishLoad(WebFrame*);
230     void show();
231     String userAgent() const { return m_userAgent; }
232     WebCore::IntRect windowResizerRect() const;
233     WebCore::KeyboardUIMode keyboardUIMode();
234
235     WebUndoStep* webUndoStep(uint64_t);
236     void addWebUndoStep(uint64_t, WebUndoStep*);
237     void removeWebEditCommand(uint64_t);
238     bool isInRedo() const { return m_isInRedo; }
239
240     void setActivePopupMenu(WebPopupMenu*);
241
242 #if ENABLE(INPUT_TYPE_COLOR)
243     WebColorChooser* activeColorChooser() const { return m_activeColorChooser; }
244     void setActiveColorChooser(WebColorChooser*);
245     void didChooseColor(const WebCore::Color&);
246     void didEndColorPicker();
247 #endif
248
249     WebOpenPanelResultListener* activeOpenPanelResultListener() const { return m_activeOpenPanelResultListener.get(); }
250     void setActiveOpenPanelResultListener(PassRefPtr<WebOpenPanelResultListener>);
251
252     void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&) override;
253     void didReceiveSyncMessage(IPC::Connection*, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&) override;
254
255     // -- InjectedBundle methods
256 #if ENABLE(CONTEXT_MENUS)
257     void initializeInjectedBundleContextMenuClient(WKBundlePageContextMenuClientBase*);
258 #endif
259     void initializeInjectedBundleEditorClient(WKBundlePageEditorClientBase*);
260     void initializeInjectedBundleFormClient(WKBundlePageFormClientBase*);
261     void initializeInjectedBundleLoaderClient(WKBundlePageLoaderClientBase*);
262     void initializeInjectedBundlePolicyClient(WKBundlePagePolicyClientBase*);
263     void initializeInjectedBundleResourceLoadClient(WKBundlePageResourceLoadClientBase*);
264     void initializeInjectedBundleUIClient(WKBundlePageUIClientBase*);
265 #if ENABLE(FULLSCREEN_API)
266     void initializeInjectedBundleFullScreenClient(WKBundlePageFullScreenClientBase*);
267 #endif
268     void initializeInjectedBundleDiagnosticLoggingClient(WKBundlePageDiagnosticLoggingClientBase*);
269
270 #if ENABLE(CONTEXT_MENUS)
271     InjectedBundlePageContextMenuClient& injectedBundleContextMenuClient() { return m_contextMenuClient; }
272 #endif
273     InjectedBundlePageEditorClient& injectedBundleEditorClient() { return m_editorClient; }
274     InjectedBundlePageFormClient& injectedBundleFormClient() { return m_formClient; }
275     InjectedBundlePageLoaderClient& injectedBundleLoaderClient() { return m_loaderClient; }
276     InjectedBundlePagePolicyClient& injectedBundlePolicyClient() { return m_policyClient; }
277     InjectedBundlePageResourceLoadClient& injectedBundleResourceLoadClient() { return m_resourceLoadClient; }
278     InjectedBundlePageUIClient& injectedBundleUIClient() { return m_uiClient; }
279     InjectedBundlePageDiagnosticLoggingClient& injectedBundleDiagnosticLoggingClient() { return m_logDiagnosticMessageClient; }
280 #if ENABLE(FULLSCREEN_API)
281     InjectedBundlePageFullScreenClient& injectedBundleFullScreenClient() { return m_fullScreenClient; }
282 #endif
283
284     bool findStringFromInjectedBundle(const String&, FindOptions);
285
286     WebFrame* mainWebFrame() const { return m_mainFrame.get(); }
287
288     WebCore::Frame* mainFrame() const; // May return 0.
289     WebCore::FrameView* mainFrameView() const; // May return 0.
290
291     PassRefPtr<WebCore::Range> currentSelectionAsRange();
292
293 #if ENABLE(NETSCAPE_PLUGIN_API)
294     PassRefPtr<Plugin> createPlugin(WebFrame*, WebCore::HTMLPlugInElement*, const Plugin::Parameters&, String& newMIMEType);
295 #endif
296
297 #if ENABLE(WEBGL)
298     WebCore::WebGLLoadPolicy webGLPolicyForURL(WebFrame*, const String&);
299 #endif // ENABLE(WEBGL)
300     
301     EditorState editorState() const;
302
303     String renderTreeExternalRepresentation() const;
304     String renderTreeExternalRepresentationForPrinting() const;
305     uint64_t renderTreeSize() const;
306
307     void setTracksRepaints(bool);
308     bool isTrackingRepaints() const;
309     void resetTrackedRepaints();
310     PassRefPtr<API::Array> trackedRepaintRects();
311
312     void executeEditingCommand(const String& commandName, const String& argument);
313     bool isEditingCommandEnabled(const String& commandName);
314     void clearMainFrameName();
315     void sendClose();
316
317     void sendSetWindowFrame(const WebCore::FloatRect&);
318
319     double textZoomFactor() const;
320     void setTextZoomFactor(double);
321     double pageZoomFactor() const;
322     void setPageZoomFactor(double);
323     void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
324     void windowScreenDidChange(uint64_t);
325
326     void scalePage(double scale, const WebCore::IntPoint& origin);
327     double pageScaleFactor() const;
328
329     void setUseFixedLayout(bool);
330     bool useFixedLayout() const { return m_useFixedLayout; }
331     void setFixedLayoutSize(const WebCore::IntSize&);
332
333     void listenForLayoutMilestones(uint32_t /* LayoutMilestones */);
334
335     void setSuppressScrollbarAnimations(bool);
336
337     void setBackgroundExtendsBeyondPage(bool);
338
339     void setPaginationMode(uint32_t /* WebCore::Pagination::Mode */);
340     void setPaginationBehavesLikeColumns(bool);
341     void setPageLength(double);
342     void setGapBetweenPages(double);
343
344     void postInjectedBundleMessage(const String& messageName, IPC::MessageDecoder&);
345
346     bool drawsBackground() const { return m_drawsBackground; }
347     bool drawsTransparentBackground() const { return m_drawsTransparentBackground; }
348
349     void setUnderlayColor(const WebCore::Color& color) { m_underlayColor = color; }
350     WebCore::Color underlayColor() const { return m_underlayColor; }
351
352     void stopLoading();
353     void stopLoadingFrame(uint64_t frameID);
354     void setDefersLoading(bool deferLoading);
355
356     void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*);
357     void exitAcceleratedCompositingMode();
358
359     void addPluginView(PluginView*);
360     void removePluginView(PluginView*);
361
362     bool isVisible() const { return m_viewState & WebCore::ViewState::IsVisible; }
363     bool isVisibleOrOccluded() const { return m_viewState & WebCore::ViewState::IsVisibleOrOccluded; }
364
365     LayerHostingMode layerHostingMode() const { return m_layerHostingMode; }
366     void setLayerHostingMode(unsigned);
367
368 #if PLATFORM(MAC)
369     void updatePluginsActiveAndFocusedState();
370     const WebCore::FloatRect& windowFrameInScreenCoordinates() const { return m_windowFrameInScreenCoordinates; }
371     const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates() const { return m_windowFrameInUnflippedScreenCoordinates; }
372     const WebCore::FloatRect& viewFrameInWindowCoordinates() const { return m_viewFrameInWindowCoordinates; }
373
374     bool hasCachedWindowFrame() const { return m_hasCachedWindowFrame; }
375
376 #if !PLATFORM(IOS)
377     void setTopOverhangImage(PassRefPtr<WebImage>);
378     void setBottomOverhangImage(PassRefPtr<WebImage>);
379 #endif // !PLATFORM(IOS)
380
381     void updateHeaderAndFooterLayersForDeviceScaleChange(float scaleFactor);
382 #endif // PLATFORM(MAC)
383
384     bool windowIsFocused() const;
385     bool windowAndWebPageAreFocused() const;
386     void installPageOverlay(PassRefPtr<PageOverlay>, bool shouldFadeIn = false);
387     void uninstallPageOverlay(PageOverlay*, bool shouldFadeOut = false);
388     bool hasPageOverlay() const { return m_pageOverlays.size(); }
389     PageOverlayList& pageOverlays() { return m_pageOverlays; }
390
391 #if !PLATFORM(IOS)
392     void setHeaderPageBanner(PassRefPtr<PageBanner>);
393     PageBanner* headerPageBanner();
394     void setFooterPageBanner(PassRefPtr<PageBanner>);
395     PageBanner* footerPageBanner();
396
397     void hidePageBanners();
398     void showPageBanners();
399 #endif // !PLATFORM(IOS)
400
401     WebCore::IntPoint screenToWindow(const WebCore::IntPoint&);
402     WebCore::IntRect windowToScreen(const WebCore::IntRect&);
403
404     PassRefPtr<WebImage> scaledSnapshotWithOptions(const WebCore::IntRect&, double scaleFactor, SnapshotOptions);
405
406     static const WebEvent* currentEvent();
407
408     FindController& findController() { return m_findController; }
409
410 #if ENABLE(GEOLOCATION)
411     GeolocationPermissionRequestManager& geolocationPermissionRequestManager() { return m_geolocationPermissionRequestManager; }
412 #endif
413
414 #if PLATFORM(IOS)
415     void viewportPropertiesDidChange(const WebCore::ViewportArguments&);
416
417     double minimumPageScaleFactor() const;
418     double maximumPageScaleFactor() const;
419     bool allowsUserScaling() const;
420
421     void handleTap(const WebCore::IntPoint&);
422     void tapHighlightAtPosition(uint64_t requestID, const WebCore::FloatPoint&);
423
424     void blurAssistedNode();
425     void selectWithGesture(const WebCore::IntPoint&, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, uint64_t callbackID);
426     void updateSelectionWithTouches(const WebCore::IntPoint& point, uint32_t touches, bool baseIsStart, uint64_t callbackID);
427     void selectWithTwoTouches(const WebCore::IntPoint& from, const WebCore::IntPoint& to, uint32_t gestureType, uint32_t gestureState, uint64_t callbackID);
428     void extendSelection(uint32_t granularity);
429     void elementDidFocus(WebCore::Node*);
430     void elementDidBlur(WebCore::Node*);
431     void requestAutocorrectionData(const String& textForAutocorrection, uint64_t callbackID);
432     void applyAutocorrection(const String& correction, const String& originalText, uint64_t callbackID);
433     void requestAutocorrectionContext(uint64_t callbackID);
434     void getAutocorrectionContext(String& beforeText, String& markedText, String& selectedText, String& afterText, uint64_t& location, uint64_t& length);
435     void insertText(const String& text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd);
436     void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd);
437     void confirmComposition();
438     void getPositionInformation(const WebCore::IntPoint&, InteractionInformationAtPosition&);
439     void requestPositionInformation(const WebCore::IntPoint&);
440     void startInteractionWithElementAtPosition(const WebCore::IntPoint&);
441     void stopInteraction();
442     void performActionOnElement(uint32_t action);
443 #endif
444
445     NotificationPermissionRequestManager* notificationPermissionRequestManager();
446
447     void pageDidScroll();
448 #if USE(TILED_BACKING_STORE)
449     void pageDidRequestScroll(const WebCore::IntPoint&);
450     void setFixedVisibleContentRect(const WebCore::IntRect&);
451     void sendViewportAttributesChanged();
452 #endif
453
454 #if ENABLE(CONTEXT_MENUS)
455     WebContextMenu* contextMenu();
456     WebContextMenu* contextMenuAtPointInWindow(const WebCore::IntPoint&);
457 #endif
458     
459     bool hasLocalDataForURL(const WebCore::URL&);
460     String cachedResponseMIMETypeForURL(const WebCore::URL&);
461     String cachedSuggestedFilenameForURL(const WebCore::URL&);
462     PassRefPtr<WebCore::SharedBuffer> cachedResponseDataForURL(const WebCore::URL&);
463
464     static bool canHandleRequest(const WebCore::ResourceRequest&);
465
466     class SandboxExtensionTracker {
467     public:
468         ~SandboxExtensionTracker();
469
470         void invalidate();
471
472         void beginLoad(WebFrame*, const SandboxExtension::Handle& handle);
473         void willPerformLoadDragDestinationAction(PassRefPtr<SandboxExtension> pendingDropSandboxExtension);
474         void didStartProvisionalLoad(WebFrame*);
475         void didCommitProvisionalLoad(WebFrame*);
476         void didFailProvisionalLoad(WebFrame*);
477
478     private:
479         void setPendingProvisionalSandboxExtension(PassRefPtr<SandboxExtension>);
480
481         RefPtr<SandboxExtension> m_pendingProvisionalSandboxExtension;
482         RefPtr<SandboxExtension> m_provisionalSandboxExtension;
483         RefPtr<SandboxExtension> m_committedSandboxExtension;
484     };
485
486     SandboxExtensionTracker& sandboxExtensionTracker() { return m_sandboxExtensionTracker; }
487
488 #if PLATFORM(EFL)
489     void setThemePath(const String&);
490 #endif
491
492 #if USE(TILED_BACKING_STORE)
493     void commitPageTransitionViewport();
494 #endif
495
496 #if PLATFORM(GTK)
497     void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd);
498     void confirmComposition(const String& text, int64_t selectionStart, int64_t selectionLength);
499     void cancelComposition();
500 #endif
501
502     void didChangeSelection();
503
504 #if PLATFORM(MAC)
505     void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
506     WKAccessibilityWebPageObject* accessibilityRemoteObject();
507     NSObject *accessibilityObjectForMainFramePlugin();
508     const WebCore::FloatPoint& accessibilityPosition() const { return m_accessibilityPosition; }
509     
510     void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
511
512     void cancelComposition(EditorState& newState);
513 #if !PLATFORM(IOS)
514     void insertText(const String& text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, bool& handled, EditorState& newState);
515     void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, EditorState& newState);
516     void confirmComposition(EditorState& newState);
517 #endif
518     void getMarkedRange(uint64_t& location, uint64_t& length);
519     void getSelectedRange(uint64_t& location, uint64_t& length);
520     void getAttributedSubstringFromRange(uint64_t location, uint64_t length, AttributedString&);
521     void characterIndexForPoint(const WebCore::IntPoint point, uint64_t& result);
522     void firstRectForCharacterRange(uint64_t location, uint64_t length, WebCore::IntRect& resultRect);
523     void executeKeypressCommands(const Vector<WebCore::KeypressCommand>&, bool& handled, EditorState& newState);
524     void readSelectionFromPasteboard(const WTF::String& pasteboardName, bool& result);
525     void getStringSelectionForPasteboard(WTF::String& stringValue);
526     void getDataSelectionForPasteboard(const WTF::String pasteboardType, SharedMemory::Handle& handle, uint64_t& size);
527     void shouldDelayWindowOrderingEvent(const WebKit::WebMouseEvent&, bool& result);
528     void acceptsFirstMouse(int eventNumber, const WebKit::WebMouseEvent&, bool& result);
529     bool performNonEditingBehaviorForSelector(const String&, WebCore::KeyboardEvent*);
530     void insertDictatedText(const String& text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, const Vector<WebCore::DictationAlternative>& dictationAlternativeLocations, bool& handled, EditorState& newState);
531 #elif PLATFORM(EFL)
532     void confirmComposition(const String& compositionString);
533     void setComposition(const WTF::String& compositionString, const WTF::Vector<WebCore::CompositionUnderline>& underlines, uint64_t cursorPosition);
534     void cancelComposition();
535 #elif PLATFORM(GTK)
536 #if USE(TEXTURE_MAPPER_GL)
537     void setAcceleratedCompositingWindowId(int64_t nativeWindowHandle);
538 #endif
539 #endif
540
541 #if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
542     void updateAccessibilityTree();
543 #endif
544
545     void setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length);
546     bool hasCompositionForTesting();
547     void confirmCompositionForTesting(const String& compositionString);
548
549     // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require
550     // any synchronous messages, and should be removed when <rdar://problem/8775115> is fixed.
551     void dummy(bool&);
552
553 #if PLATFORM(MAC)
554     void performDictionaryLookupForSelection(WebCore::Frame*, const WebCore::VisibleSelection&);
555
556     bool isSpeaking();
557     void speak(const String&);
558     void stopSpeaking();
559
560 #endif
561
562     bool isSmartInsertDeleteEnabled();
563     void setSmartInsertDeleteEnabled(bool);
564
565     bool isSelectTrailingWhitespaceEnabled();
566     void setSelectTrailingWhitespaceEnabled(bool);
567
568     void replaceSelectionWithText(WebCore::Frame*, const String&);
569     void clearSelection();
570
571 #if ENABLE(DRAG_SUPPORT)
572 #if PLATFORM(GTK)
573     void performDragControllerAction(uint64_t action, WebCore::DragData);
574 #else
575     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&);
576 #endif
577     void dragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation);
578
579     void willPerformLoadDragDestinationAction();
580     void mayPerformUploadDragDestinationAction();
581 #endif // ENABLE(DRAG_SUPPORT)
582
583     void beginPrinting(uint64_t frameID, const PrintInfo&);
584     void endPrinting();
585     void computePagesForPrinting(uint64_t frameID, const PrintInfo&, uint64_t callbackID);
586 #if PLATFORM(MAC)
587     void drawRectToImage(uint64_t frameID, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, uint64_t callbackID);
588     void drawPagesToPDF(uint64_t frameID, const PrintInfo&, uint32_t first, uint32_t count, uint64_t callbackID);
589 #elif PLATFORM(GTK)
590     void drawPagesForPrinting(uint64_t frameID, const PrintInfo&, uint64_t callbackID);
591 #endif
592
593     void setMediaVolume(float);
594     void setMayStartMediaWhenInWindow(bool);
595
596     void updateMainFrameScrollOffsetPinning();
597
598     void mainFrameDidLayout();
599
600     bool canRunBeforeUnloadConfirmPanel() const { return m_canRunBeforeUnloadConfirmPanel; }
601     void setCanRunBeforeUnloadConfirmPanel(bool canRunBeforeUnloadConfirmPanel) { m_canRunBeforeUnloadConfirmPanel = canRunBeforeUnloadConfirmPanel; }
602
603     bool canRunModal() const { return m_canRunModal; }
604     void setCanRunModal(bool canRunModal) { m_canRunModal = canRunModal; }
605
606     void runModal();
607
608     void setDeviceScaleFactor(float);
609     float deviceScaleFactor() const;
610
611     void setMemoryCacheMessagesEnabled(bool);
612
613     void forceRepaintWithoutCallback();
614
615     void unmarkAllMisspellings();
616     void unmarkAllBadGrammar();
617 #if PLATFORM(MAC)
618     void handleAlternativeTextUIResult(const String&);
619 #endif
620
621     // For testing purpose.
622     void simulateMouseDown(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
623     void simulateMouseUp(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
624     void simulateMouseMotion(WebCore::IntPoint, double time);
625
626 #if ENABLE(CONTEXT_MENUS)
627     void contextMenuShowing() { m_isShowingContextMenu = true; }
628 #endif
629
630     void wheelEvent(const WebWheelEvent&);
631
632     void numWheelEventHandlersChanged(unsigned);
633     void recomputeShortCircuitHorizontalWheelEventsState();
634
635     void setVisibilityStatePrerender();
636     void updateVisibilityState(bool isInitialState = false);
637
638 #if PLATFORM(IOS)
639     void setViewportConfigurationMinimumLayoutSize(const WebCore::IntSize&);
640     void viewportConfigurationChanged();
641     void willStartUserTriggeredZooming();
642     void didFinishScrolling(const WebCore::FloatPoint& contentOffset);
643     void didFinishZooming(float);
644 #endif
645
646 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
647     uint64_t nativeWindowHandle() { return m_nativeWindowHandle; }
648 #endif
649
650     bool canPluginHandleResponse(const WebCore::ResourceResponse& response);
651
652     bool asynchronousPluginInitializationEnabled() const { return m_asynchronousPluginInitializationEnabled; }
653     void setAsynchronousPluginInitializationEnabled(bool enabled) { m_asynchronousPluginInitializationEnabled = enabled; }
654     bool asynchronousPluginInitializationEnabledForAllPlugins() const { return m_asynchronousPluginInitializationEnabledForAllPlugins; }
655     void setAsynchronousPluginInitializationEnabledForAllPlugins(bool enabled) { m_asynchronousPluginInitializationEnabledForAllPlugins = enabled; }
656     bool artificialPluginInitializationDelayEnabled() const { return m_artificialPluginInitializationDelayEnabled; }
657     void setArtificialPluginInitializationDelayEnabled(bool enabled) { m_artificialPluginInitializationDelayEnabled = enabled; }
658     void setTabToLinksEnabled(bool enabled) { m_tabToLinks = enabled; }
659     bool tabToLinksEnabled() const { return m_tabToLinks; }
660
661     bool scrollingPerformanceLoggingEnabled() const { return m_scrollingPerformanceLoggingEnabled; }
662     void setScrollingPerformanceLoggingEnabled(bool);
663
664 #if PLATFORM(MAC)
665     bool shouldUsePDFPlugin() const;
666     bool pdfPluginEnabled() const { return m_pdfPluginEnabled; }
667     void setPDFPluginEnabled(bool enabled) { m_pdfPluginEnabled = enabled; }
668 #endif
669
670     void savePDFToFileInDownloadsFolder(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size);
671 #if PLATFORM(MAC)
672     void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
673 #endif
674
675     bool mainFrameIsScrollable() const { return m_mainFrameIsScrollable; }
676
677     void setMinimumLayoutSize(const WebCore::IntSize&);
678     WebCore::IntSize minimumLayoutSize() const { return m_minimumLayoutSize; }
679
680     void setAutoSizingShouldExpandToViewHeight(bool shouldExpand);
681     bool autoSizingShouldExpandToViewHeight() { return m_autoSizingShouldExpandToViewHeight; }
682
683     bool canShowMIMEType(const String& MIMEType) const;
684
685     void addTextCheckingRequest(uint64_t requestID, PassRefPtr<WebCore::TextCheckingRequest>);
686     void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
687     void didCancelCheckingText(uint64_t requestID);
688
689 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
690     void determinePrimarySnapshottedPlugIn();
691     void determinePrimarySnapshottedPlugInTimerFired();
692     void resetPrimarySnapshottedPlugIn();
693     bool matchesPrimaryPlugIn(const String& pageOrigin, const String& pluginOrigin, const String& mimeType) const;
694 #endif
695
696     unsigned extendIncrementalRenderingSuppression();
697     void stopExtendingIncrementalRenderingSuppression(unsigned token);
698     bool shouldExtendIncrementalRenderingSuppression() { return !m_activeRenderingSuppressionTokens.isEmpty(); }
699
700     WebCore::ScrollPinningBehavior scrollPinningBehavior() { return m_scrollPinningBehavior; }
701     void setScrollPinningBehavior(uint32_t /* WebCore::ScrollPinningBehavior */ pinning);
702
703     WKTypeRef pageOverlayCopyAccessibilityAttributeValue(WKStringRef attribute, WKTypeRef parameter);
704     WKArrayRef pageOverlayCopyAccessibilityAttributesNames(bool parameterizedNames);
705
706     PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(WebCore::Frame&, const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
707
708 private:
709     WebPage(uint64_t pageID, const WebPageCreationParameters&);
710
711     // IPC::MessageSender
712     virtual IPC::Connection* messageSenderConnection() override;
713     virtual uint64_t messageSenderDestinationID() override;
714
715     void platformInitialize();
716
717     void didReceiveWebPageMessage(IPC::Connection*, IPC::MessageDecoder&);
718     void didReceiveSyncWebPageMessage(IPC::Connection*, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&);
719
720 #if PLATFORM(IOS)
721     static void convertSelectionRectsToRootView(WebCore::FrameView*, Vector<WebCore::SelectionRect>&);
722 #endif
723 #if !PLATFORM(MAC)
724     static const char* interpretKeyEvent(const WebCore::KeyboardEvent*);
725 #endif
726     bool performDefaultBehaviorForKeyEvent(const WebKeyboardEvent&);
727
728 #if PLATFORM(MAC)
729     bool executeKeypressCommandsInternal(const Vector<WebCore::KeypressCommand>&, WebCore::KeyboardEvent*);
730 #endif
731
732     String sourceForFrame(WebFrame*);
733
734     void loadDataImpl(PassRefPtr<WebCore::SharedBuffer>, const String& MIMEType, const String& encodingName, const WebCore::URL& baseURL, const WebCore::URL& failingURL, IPC::MessageDecoder&);
735     void loadString(const String&, const String& MIMEType, const WebCore::URL& baseURL, const WebCore::URL& failingURL, IPC::MessageDecoder&);
736
737     bool platformHasLocalDataForURL(const WebCore::URL&);
738
739     // Actions
740     void tryClose();
741     void loadRequest(uint64_t navigationID, const WebCore::ResourceRequest&, const SandboxExtension::Handle&, IPC::MessageDecoder&);
742     void loadData(const IPC::DataReference&, const String& MIMEType, const String& encodingName, const String& baseURL, IPC::MessageDecoder&);
743     void loadHTMLString(const String& htmlString, const String& baseURL, IPC::MessageDecoder&);
744     void loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL, IPC::MessageDecoder&);
745     void loadPlainTextString(const String&, IPC::MessageDecoder&);
746     void loadWebArchiveData(const IPC::DataReference&, IPC::MessageDecoder&);
747     void reload(uint64_t navigationID, bool reloadFromOrigin, const SandboxExtension::Handle&);
748     void goForward(uint64_t);
749     void goBack(uint64_t);
750     void goToBackForwardItem(uint64_t);
751     void tryRestoreScrollPosition();
752     void setActive(bool);
753     void setFocused(bool);
754     void setViewIsVisible(bool);
755     void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&);
756     void setWindowResizerSize(const WebCore::IntSize&);
757     void setIsInWindow(bool);
758     void setIsVisuallyIdle(bool);
759     void setViewState(WebCore::ViewState::Flags, bool wantsDidUpdateViewState);
760     void setViewStateInternal(WebCore::ViewState::Flags, bool isInitialState);
761     void validateCommand(const String&, uint64_t);
762     void executeEditCommand(const String&);
763
764     void mouseEvent(const WebMouseEvent&);
765     void mouseEventSyncForTesting(const WebMouseEvent&, bool&);
766     void wheelEventSyncForTesting(const WebWheelEvent&, bool&);
767     void keyEvent(const WebKeyboardEvent&);
768     void keyEventSyncForTesting(const WebKeyboardEvent&, bool&);
769 #if ENABLE(TOUCH_EVENTS)
770     void touchEvent(const WebTouchEvent&);
771     void touchEventSyncForTesting(const WebTouchEvent&, bool& handled);
772 #endif
773 #if ENABLE(CONTEXT_MENUS)
774     void contextMenuHidden() { m_isShowingContextMenu = false; }
775 #endif
776
777     static bool scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity);
778     static bool logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity);
779
780     void loadURLInFrame(const String&, uint64_t frameID);
781
782     uint64_t restoreSession(const SessionState&);
783     void restoreSessionAndNavigateToCurrentItem(const SessionState&);
784
785     void didRemoveBackForwardItem(uint64_t);
786
787     void setDrawsBackground(bool);
788     void setDrawsTransparentBackground(bool);
789
790     void viewWillStartLiveResize();
791     void viewWillEndLiveResize();
792
793     void getContentsAsString(uint64_t callbackID);
794 #if ENABLE(MHTML)
795     void getContentsAsMHTMLData(uint64_t callbackID, bool useBinaryEncoding);
796 #endif
797     void getMainResourceDataOfFrame(uint64_t frameID, uint64_t callbackID);
798     void getResourceDataFromFrame(uint64_t frameID, const String& resourceURL, uint64_t callbackID);
799     void getRenderTreeExternalRepresentation(uint64_t callbackID);
800     void getSelectionOrContentsAsString(uint64_t callbackID);
801     void getSelectionAsWebArchiveData(uint64_t callbackID);
802     void getSourceForFrame(uint64_t frameID, uint64_t callbackID);
803     void getWebArchiveOfFrame(uint64_t frameID, uint64_t callbackID);
804     void runJavaScriptInMainFrame(const String&, uint64_t callbackID);
805     void forceRepaint(uint64_t callbackID);
806
807     void preferencesDidChange(const WebPreferencesStore&);
808     void platformPreferencesDidChange(const WebPreferencesStore&);
809     void updatePreferences(const WebPreferencesStore&);
810
811     void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t downloadID);
812     void setUserAgent(const String&);
813     void setCustomTextEncodingName(const String&);
814     void suspendActiveDOMObjectsAndAnimations();
815     void resumeActiveDOMObjectsAndAnimations();
816
817 #if PLATFORM(MAC)
818     void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
819     void performDictionaryLookupForRange(WebCore::Frame*, WebCore::Range*, NSDictionary *options);
820
821     void windowAndViewFramesChanged(const WebCore::FloatRect& windowFrameInScreenCoordinates, const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates, const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
822
823     RetainPtr<PDFDocument> pdfDocumentForPrintingFrame(WebCore::Frame*);
824     void computePagesForPrintingPDFDocument(uint64_t frameID, const PrintInfo&, Vector<WebCore::IntRect>& resultPageRects);
825     void drawPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, const WebCore::IntRect&);
826     void drawPagesToPDFFromPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, uint32_t first, uint32_t count);
827 #endif
828
829     void setMainFrameIsScrollable(bool);
830
831     void unapplyEditCommand(uint64_t commandID);
832     void reapplyEditCommand(uint64_t commandID);
833     void didRemoveEditCommand(uint64_t commandID);
834
835     void findString(const String&, uint32_t findOptions, uint32_t maxMatchCount);
836     void findStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
837     void getImageForFindMatch(uint32_t matchIndex);
838     void selectFindMatch(uint32_t matchIndex);
839     void hideFindUI();
840     void countStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
841
842 #if USE(COORDINATED_GRAPHICS)
843     void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize& area);
844 #endif
845
846     void didChangeSelectedIndexForActivePopupMenu(int32_t newIndex);
847     void setTextForActivePopupMenu(int32_t index);
848
849 #if PLATFORM(GTK)
850     void failedToShowPopupMenu();
851 #endif
852
853     void didChooseFilesForOpenPanel(const Vector<String>&);
854     void didCancelForOpenPanel();
855 #if ENABLE(WEB_PROCESS_SANDBOX)
856     void extendSandboxForFileFromOpenPanel(const SandboxExtension::Handle&);
857 #endif
858
859     void didReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed);
860
861     void didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed);
862
863     void advanceToNextMisspelling(bool startBeforeSelection);
864     void changeSpellingToWord(const String& word);
865 #if USE(APPKIT)
866     void uppercaseWord();
867     void lowercaseWord();
868     void capitalizeWord();
869 #endif
870
871 #if ENABLE(CONTEXT_MENUS)
872     void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&);
873 #endif
874
875     void changeSelectedIndex(int32_t index);
876     void setCanStartMediaTimerFired();
877     void didUpdateViewStateTimerFired();
878
879     bool canHandleUserEvents() const;
880
881     void setMainFrameInViewSourceMode(bool);
882
883     static bool platformCanHandleRequest(const WebCore::ResourceRequest&);
884
885     static PluginView* focusedPluginViewForFrame(WebCore::Frame&);
886     static PluginView* pluginViewForFrame(WebCore::Frame*);
887
888     void reportUsedFeatures();
889
890     uint64_t m_pageID;
891     uint64_t m_sessionID;
892
893     OwnPtr<WebCore::Page> m_page;
894     RefPtr<WebFrame> m_mainFrame;
895     RefPtr<InjectedBundleBackForwardList> m_backForwardList;
896
897     RefPtr<WebPageGroupProxy> m_pageGroup;
898
899     String m_userAgent;
900
901     WebCore::IntSize m_viewSize;
902     std::unique_ptr<DrawingArea> m_drawingArea;
903
904     HashSet<PluginView*> m_pluginViews;
905     bool m_hasSeenPlugin;
906
907     HashMap<uint64_t, RefPtr<WebCore::TextCheckingRequest>> m_pendingTextCheckingRequestMap;
908
909     bool m_useFixedLayout;
910
911     bool m_drawsBackground;
912     bool m_drawsTransparentBackground;
913
914     WebCore::Color m_underlayColor;
915
916     bool m_isInRedo;
917     bool m_isClosed;
918
919     bool m_tabToLinks;
920     
921     bool m_asynchronousPluginInitializationEnabled;
922     bool m_asynchronousPluginInitializationEnabledForAllPlugins;
923     bool m_artificialPluginInitializationDelayEnabled;
924
925     bool m_scrollingPerformanceLoggingEnabled;
926
927     bool m_mainFrameIsScrollable;
928
929 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
930     bool m_readyToFindPrimarySnapshottedPlugin;
931     bool m_didFindPrimarySnapshottedPlugin;
932     unsigned m_numberOfPrimarySnapshotDetectionAttempts;
933     String m_primaryPlugInPageOrigin;
934     String m_primaryPlugInOrigin;
935     String m_primaryPlugInMimeType;
936     RunLoop::Timer<WebPage> m_determinePrimarySnapshottedPlugInTimer;
937 #endif
938
939     // The layer hosting mode.
940     LayerHostingMode m_layerHostingMode;
941
942 #if PLATFORM(MAC)
943     bool m_pdfPluginEnabled;
944
945     bool m_hasCachedWindowFrame;
946
947     // The frame of the containing window in screen coordinates.
948     WebCore::FloatRect m_windowFrameInScreenCoordinates;
949
950     // The frame of the containing window in unflipped screen coordinates.
951     WebCore::FloatRect m_windowFrameInUnflippedScreenCoordinates;
952
953     // The frame of the view in window coordinates.
954     WebCore::FloatRect m_viewFrameInWindowCoordinates;
955
956     // The accessibility position of the view.
957     WebCore::FloatPoint m_accessibilityPosition;
958     
959     RetainPtr<WKAccessibilityWebPageObject> m_mockAccessibilityElement;
960
961     WebCore::KeyboardEvent* m_keyboardEventBeingInterpreted;
962
963 #if !PLATFORM(IOS)
964     ViewGestureGeometryCollector m_viewGestureGeometryCollector;
965 #endif
966
967 #elif HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
968     GRefPtr<WebPageAccessibilityObject> m_accessibilityObject;
969 #endif
970
971 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
972     // Our view's window in the UI process.
973     uint64_t m_nativeWindowHandle;
974 #endif
975
976 #if !PLATFORM(IOS)
977     RefPtr<PageBanner> m_headerBanner;
978     RefPtr<PageBanner> m_footerBanner;
979 #endif // !PLATFORM(IOS)
980
981     RunLoop::Timer<WebPage> m_setCanStartMediaTimer;
982     RunLoop::Timer<WebPage> m_sendDidUpdateViewStateTimer;
983     bool m_mayStartMediaWhenInWindow;
984
985     HashMap<uint64_t, RefPtr<WebUndoStep>> m_undoStepMap;
986
987     WebCore::IntSize m_windowResizerSize;
988
989 #if ENABLE(CONTEXT_MENUS)
990     InjectedBundlePageContextMenuClient m_contextMenuClient;
991 #endif
992     InjectedBundlePageEditorClient m_editorClient;
993     InjectedBundlePageFormClient m_formClient;
994     InjectedBundlePageLoaderClient m_loaderClient;
995     InjectedBundlePagePolicyClient m_policyClient;
996     InjectedBundlePageResourceLoadClient m_resourceLoadClient;
997     InjectedBundlePageUIClient m_uiClient;
998 #if ENABLE(FULLSCREEN_API)
999     InjectedBundlePageFullScreenClient m_fullScreenClient;
1000 #endif
1001     InjectedBundlePageDiagnosticLoggingClient m_logDiagnosticMessageClient;
1002
1003     FindController m_findController;
1004     PageOverlayList m_pageOverlays;
1005
1006 #if ENABLE(INSPECTOR)
1007     RefPtr<WebInspector> m_inspector;
1008 #endif
1009 #if ENABLE(FULLSCREEN_API)
1010     RefPtr<WebFullScreenManager> m_fullScreenManager;
1011 #endif
1012     RefPtr<WebPopupMenu> m_activePopupMenu;
1013 #if ENABLE(CONTEXT_MENUS)
1014     RefPtr<WebContextMenu> m_contextMenu;
1015 #endif
1016 #if ENABLE(INPUT_TYPE_COLOR)
1017     WebColorChooser* m_activeColorChooser;
1018 #endif
1019     RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener;
1020     RefPtr<NotificationPermissionRequestManager> m_notificationPermissionRequestManager;
1021
1022 #if ENABLE(GEOLOCATION)
1023     GeolocationPermissionRequestManager m_geolocationPermissionRequestManager;
1024 #endif
1025
1026     OwnPtr<WebCore::PrintContext> m_printContext;
1027 #if PLATFORM(GTK)
1028     RefPtr<WebPrintOperationGtk> m_printOperation;
1029 #endif
1030
1031     SandboxExtensionTracker m_sandboxExtensionTracker;
1032
1033     RefPtr<SandboxExtension> m_pendingDropSandboxExtension;
1034     Vector<RefPtr<SandboxExtension>> m_pendingDropExtensionsForFileUpload;
1035
1036     bool m_canRunBeforeUnloadConfirmPanel;
1037
1038     bool m_canRunModal;
1039     bool m_isRunningModal;
1040
1041     bool m_cachedMainFrameIsPinnedToLeftSide;
1042     bool m_cachedMainFrameIsPinnedToRightSide;
1043     bool m_cachedMainFrameIsPinnedToTopSide;
1044     bool m_cachedMainFrameIsPinnedToBottomSide;
1045     bool m_canShortCircuitHorizontalWheelEvents;
1046     unsigned m_numWheelEventHandlers;
1047
1048     unsigned m_cachedPageCount;
1049
1050     WebCore::IntSize m_minimumLayoutSize;
1051     bool m_autoSizingShouldExpandToViewHeight;
1052
1053 #if ENABLE(CONTEXT_MENUS)
1054     bool m_isShowingContextMenu;
1055 #endif
1056     
1057 #if PLATFORM(IOS)
1058     RefPtr<WebCore::Node> m_assistedNode;
1059     RefPtr<WebCore::Range> m_currentWordRange;
1060     RefPtr<WebCore::Node> m_interactionNode;
1061     bool m_shouldReturnWordAtSelection;
1062
1063     WebCore::ViewportConfiguration m_viewportConfiguration;
1064     bool m_userHasChangedPageScaleFactor;
1065 #endif
1066
1067     WebInspectorClient* m_inspectorClient;
1068
1069     WebCore::Color m_backgroundColor;
1070
1071     HashSet<unsigned> m_activeRenderingSuppressionTokens;
1072     unsigned m_maximumRenderingSuppressionToken;
1073     
1074     WebCore::ScrollPinningBehavior m_scrollPinningBehavior;
1075
1076     bool m_useAsyncScrolling;
1077
1078     WebCore::ViewState::Flags m_viewState;
1079
1080     UserActivity m_processSuppressionDisabledByWebPreference;
1081
1082     uint64_t m_pendingNavigationID;
1083 };
1084
1085 } // namespace WebKit
1086
1087 #endif // WebPage_h