1/*
2 * Copyright (C) 2006-2010, 2013, 2015 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20
21#ifndef Page_h
22#define Page_h
23
24#include "FindOptions.h"
25#include "FrameLoaderTypes.h"
26#include "LayoutMilestones.h"
27#include "LayoutRect.h"
28#include "MediaProducer.h"
29#include "PageThrottler.h"
30#include "PageVisibilityState.h"
31#include "Pagination.h"
32#include "PlatformScreen.h"
33#include "Region.h"
34#include "ScrollTypes.h"
35#include "SessionID.h"
36#include "Supplementable.h"
37#include "ViewState.h"
38#include "ViewportArguments.h"
39#include "WheelEventTestTrigger.h"
40#include <memory>
41#include <wtf/Forward.h>
42#include <wtf/HashMap.h>
43#include <wtf/HashSet.h>
44#include <wtf/Noncopyable.h>
45#include <wtf/Ref.h>
46#include <wtf/RefCounted.h>
47#include <wtf/text/WTFString.h>
48
49#if OS(SOLARIS)
50#include <sys/time.h> // For time_t structure.
51#endif
52
53#if PLATFORM(COCOA)
54#include <wtf/SchedulePair.h>
55#endif
56
57#if ENABLE(MEDIA_SESSION)
58#include "MediaSessionEvents.h"
59#endif
60
61#if ENABLE(WIRELESS_PLAYBACK_TARGET)
62#include "MediaPlaybackTargetContext.h"
63#endif
64
65namespace JSC {
66class Debugger;
67}
68
69namespace WebCore {
70
71namespace IDBClient {
72class IDBConnectionToServer;
73}
74
75class AlternativeTextClient;
76class ApplicationCacheStorage;
77class BackForwardController;
78class BackForwardClient;
79class Chrome;
80class ChromeClient;
81class ClientRectList;
82class Color;
83class ContextMenuClient;
84class ContextMenuController;
85class DatabaseProvider;
86class DragCaretController;
87class DragClient;
88class DragController;
89class EditorClient;
90class FocusController;
91class Frame;
92class FrameLoaderClient;
93class HistoryItem;
94class HTMLMediaElement;
95class UserInputBridge;
96class InspectorClient;
97class InspectorController;
98class MainFrame;
99class MediaCanStartListener;
100class MediaPlaybackTarget;
101class PageConfiguration;
102class PageConsoleClient;
103class PageDebuggable;
104class PageGroup;
105class PageThrottler;
106class PlugInClient;
107class PluginData;
108class PluginViewBase;
109class PointerLockController;
110class ProgressTracker;
111class ProgressTrackerClient;
112class Range;
113class RenderObject;
114class RenderTheme;
115class ReplayController;
116class ResourceUsageOverlay;
117class VisibleSelection;
118class ScrollableArea;
119class ScrollingCoordinator;
120class Settings;
121class StorageNamespace;
122class StorageNamespaceProvider;
123class UserContentController;
124class ValidationMessageClient;
125class ViewStateChangeObserver;
126class VisitedLinkStore;
127
128typedef uint64_t LinkHash;
129
130enum FindDirection { FindDirectionForward, FindDirectionBackward };
131
132class Page : public Supplementable<Page> {
133 WTF_MAKE_NONCOPYABLE(Page);
134 WTF_MAKE_FAST_ALLOCATED;
135 friend class Settings;
136 friend class PageThrottler;
137
138public:
139 WEBCORE_EXPORT static void updateStyleForAllPagesAfterGlobalChangeInEnvironment();
140 WEBCORE_EXPORT static void clearPreviousItemFromAllPages(HistoryItem*);
141 WEBCORE_EXPORT static void setTabSuspensionEnabled(bool);
142
143 WEBCORE_EXPORT explicit Page(PageConfiguration&);
144 WEBCORE_EXPORT ~Page();
145
146 WEBCORE_EXPORT uint64_t renderTreeSize() const;
147
148 void setNeedsRecalcStyleInAllFrames();
149
150 RenderTheme& theme() const { return *m_theme; }
151
152 WEBCORE_EXPORT ViewportArguments viewportArguments() const;
153
154 static void refreshPlugins(bool reload);
155 WEBCORE_EXPORT PluginData& pluginData() const;
156
157 WEBCORE_EXPORT void setCanStartMedia(bool);
158 bool canStartMedia() const { return m_canStartMedia; }
159
160 EditorClient& editorClient() { return m_editorClient; }
161 PlugInClient* plugInClient() const { return m_plugInClient; }
162
163 MainFrame& mainFrame() { ASSERT(m_mainFrame); return *m_mainFrame; }
164 const MainFrame& mainFrame() const { ASSERT(m_mainFrame); return *m_mainFrame; }
165
166 bool inPageCache() const;
167
168 bool openedByDOM() const;
169 void setOpenedByDOM();
170
171 WEBCORE_EXPORT void goToItem(HistoryItem&, FrameLoadType);
172
173 WEBCORE_EXPORT void setGroupName(const String&);
174 WEBCORE_EXPORT const String& groupName() const;
175
176 PageGroup& group();
177 PageGroup* groupPtr() { return m_group; } // can return 0
178
179 static void forEachPage(std::function<void(Page&)>);
180
181 void incrementSubframeCount() { ++m_subframeCount; }
182 void decrementSubframeCount() { ASSERT(m_subframeCount); --m_subframeCount; }
183 int subframeCount() const { checkSubframeCountConsistency(); return m_subframeCount; }
184
185#if ENABLE(REMOTE_INSPECTOR)
186 WEBCORE_EXPORT bool remoteInspectionAllowed() const;
187 WEBCORE_EXPORT void setRemoteInspectionAllowed(bool);
188 WEBCORE_EXPORT String remoteInspectionNameOverride() const;
189 WEBCORE_EXPORT void setRemoteInspectionNameOverride(const String&);
190 void remoteInspectorInformationDidChange() const;
191#endif
192
193 Chrome& chrome() const { return *m_chrome; }
194 DragCaretController& dragCaretController() const { return *m_dragCaretController; }
195#if ENABLE(DRAG_SUPPORT)
196 DragController& dragController() const { return *m_dragController; }
197#endif
198 FocusController& focusController() const { return *m_focusController; }
199#if ENABLE(CONTEXT_MENUS)
200 ContextMenuController& contextMenuController() const { return *m_contextMenuController; }
201#endif
202 UserInputBridge& userInputBridge() const { return *m_userInputBridge; }
203#if ENABLE(WEB_REPLAY)
204 ReplayController& replayController() const { return *m_replayController; }
205#endif
206 InspectorController& inspectorController() const { return *m_inspectorController; }
207#if ENABLE(POINTER_LOCK)
208 PointerLockController& pointerLockController() const { return *m_pointerLockController; }
209#endif
210 ValidationMessageClient* validationMessageClient() const { return m_validationMessageClient; }
211
212 WEBCORE_EXPORT ScrollingCoordinator* scrollingCoordinator();
213
214 WEBCORE_EXPORT String scrollingStateTreeAsText();
215 WEBCORE_EXPORT String synchronousScrollingReasonsAsText();
216 WEBCORE_EXPORT Ref<ClientRectList> nonFastScrollableRects();
217
218 Settings& settings() const { return *m_settings; }
219 ProgressTracker& progress() const { return *m_progress; }
220 BackForwardController& backForward() const { return *m_backForwardController; }
221
222 double domTimerAlignmentInterval() const { return m_timerAlignmentInterval; }
223
224#if ENABLE(VIEW_MODE_CSS_MEDIA)
225 enum ViewMode {
226 ViewModeInvalid,
227 ViewModeWindowed,
228 ViewModeFloating,
229 ViewModeFullscreen,
230 ViewModeMaximized,
231 ViewModeMinimized
232 };
233 static ViewMode stringToViewMode(const String&);
234
235 ViewMode viewMode() const { return m_viewMode; }
236 WEBCORE_EXPORT void setViewMode(ViewMode);
237#endif // ENABLE(VIEW_MODE_CSS_MEDIA)
238
239 void setTabKeyCyclesThroughElements(bool b) { m_tabKeyCyclesThroughElements = b; }
240 bool tabKeyCyclesThroughElements() const { return m_tabKeyCyclesThroughElements; }
241
242 WEBCORE_EXPORT bool findString(const String&, FindOptions);
243
244 WEBCORE_EXPORT RefPtr<Range> rangeOfString(const String&, Range*, FindOptions);
245
246 WEBCORE_EXPORT unsigned countFindMatches(const String&, FindOptions, unsigned maxMatchCount);
247 WEBCORE_EXPORT unsigned markAllMatchesForText(const String&, FindOptions, bool shouldHighlight, unsigned maxMatchCount);
248
249 WEBCORE_EXPORT void unmarkAllTextMatches();
250
251 // find all the Ranges for the matching text.
252 // Upon return, indexForSelection will be one of the following:
253 // 0 if there is no user selection
254 // the index of the first range after the user selection
255 // NoMatchAfterUserSelection if there is no matching text after the user selection.
256 enum { NoMatchAfterUserSelection = -1 };
257 WEBCORE_EXPORT void findStringMatchingRanges(const String&, FindOptions, int maxCount, Vector<RefPtr<Range>>&, int& indexForSelection);
258#if PLATFORM(COCOA)
259 void platformInitialize();
260 WEBCORE_EXPORT void addSchedulePair(Ref<SchedulePair>&&);
261 WEBCORE_EXPORT void removeSchedulePair(Ref<SchedulePair>&&);
262 SchedulePairHashSet* scheduledRunLoopPairs() { return m_scheduledRunLoopPairs.get(); }
263
264 std::unique_ptr<SchedulePairHashSet> m_scheduledRunLoopPairs;
265#endif
266
267 WEBCORE_EXPORT const VisibleSelection& selection() const;
268
269 WEBCORE_EXPORT void setDefersLoading(bool);
270 bool defersLoading() const { return m_defersLoading; }
271
272 WEBCORE_EXPORT void clearUndoRedoOperations();
273
274 WEBCORE_EXPORT bool inLowQualityImageInterpolationMode() const;
275 WEBCORE_EXPORT void setInLowQualityImageInterpolationMode(bool = true);
276
277 float mediaVolume() const { return m_mediaVolume; }
278 WEBCORE_EXPORT void setMediaVolume(float);
279
280 WEBCORE_EXPORT void setPageScaleFactor(float scale, const IntPoint& origin, bool inStableState = true);
281 float pageScaleFactor() const { return m_pageScaleFactor; }
282
283 // The view scale factor is multiplied into the page scale factor by all
284 // callers of setPageScaleFactor.
285 WEBCORE_EXPORT void setViewScaleFactor(float);
286 float viewScaleFactor() const { return m_viewScaleFactor; }
287
288 WEBCORE_EXPORT void setZoomedOutPageScaleFactor(float);
289 float zoomedOutPageScaleFactor() const { return m_zoomedOutPageScaleFactor; }
290
291 float deviceScaleFactor() const { return m_deviceScaleFactor; }
292 WEBCORE_EXPORT void setDeviceScaleFactor(float);
293
294 float topContentInset() const { return m_topContentInset; }
295 WEBCORE_EXPORT void setTopContentInset(float);
296
297#if ENABLE(IOS_TEXT_AUTOSIZING)
298 float textAutosizingWidth() const { return m_textAutosizingWidth; }
299 void setTextAutosizingWidth(float textAutosizingWidth) { m_textAutosizingWidth = textAutosizingWidth; }
300#endif
301
302 bool shouldSuppressScrollbarAnimations() const { return m_suppressScrollbarAnimations; }
303 WEBCORE_EXPORT void setShouldSuppressScrollbarAnimations(bool suppressAnimations);
304 void lockAllOverlayScrollbarsToHidden(bool lockOverlayScrollbars);
305
306 WEBCORE_EXPORT void setVerticalScrollElasticity(ScrollElasticity);
307 ScrollElasticity verticalScrollElasticity() const { return static_cast<ScrollElasticity>(m_verticalScrollElasticity); }
308
309 WEBCORE_EXPORT void setHorizontalScrollElasticity(ScrollElasticity);
310 ScrollElasticity horizontalScrollElasticity() const { return static_cast<ScrollElasticity>(m_horizontalScrollElasticity); }
311
312 // Page and FrameView both store a Pagination value. Page::pagination() is set only by API,
313 // and FrameView::pagination() is set only by CSS. Page::pagination() will affect all
314 // FrameViews in the page cache, but FrameView::pagination() only affects the current
315 // FrameView.
316 const Pagination& pagination() const { return m_pagination; }
317 WEBCORE_EXPORT void setPagination(const Pagination&);
318 bool paginationLineGridEnabled() const { return m_paginationLineGridEnabled; }
319 WEBCORE_EXPORT void setPaginationLineGridEnabled(bool flag);
320
321 WEBCORE_EXPORT unsigned pageCount() const;
322
323 // Notifications when the Page starts and stops being presented via a native window.
324 WEBCORE_EXPORT void setViewState(ViewState::Flags);
325 void setPageActivityState(PageActivityState::Flags);
326 WEBCORE_EXPORT void setIsVisible(bool);
327 WEBCORE_EXPORT void setIsPrerender();
328 bool isVisible() const { return m_viewState & ViewState::IsVisible; }
329
330 // Notification that this Page was moved into or out of a native window.
331 WEBCORE_EXPORT void setIsInWindow(bool);
332 bool isInWindow() const { return m_viewState & ViewState::IsInWindow; }
333
334 void setIsClosing() { m_isClosing = true; }
335 bool isClosing() const { return m_isClosing; }
336
337 void addViewStateChangeObserver(ViewStateChangeObserver&);
338 void removeViewStateChangeObserver(ViewStateChangeObserver&);
339
340 WEBCORE_EXPORT void suspendScriptedAnimations();
341 WEBCORE_EXPORT void resumeScriptedAnimations();
342 bool scriptedAnimationsSuspended() const { return m_scriptedAnimationsSuspended; }
343
344 void userStyleSheetLocationChanged();
345 const String& userStyleSheet() const;
346
347 void dnsPrefetchingStateChanged();
348 void storageBlockingStateChanged();
349
350#if ENABLE(RESOURCE_USAGE)
351 void setResourceUsageOverlayVisible(bool);
352#endif
353
354 void setDebugger(JSC::Debugger*);
355 JSC::Debugger* debugger() const { return m_debugger; }
356
357 WEBCORE_EXPORT void invalidateStylesForAllLinks();
358 WEBCORE_EXPORT void invalidateStylesForLink(LinkHash);
359
360 StorageNamespace* sessionStorage(bool optionalCreate = true);
361 void setSessionStorage(RefPtr<StorageNamespace>&&);
362
363 bool hasCustomHTMLTokenizerTimeDelay() const;
364 double customHTMLTokenizerTimeDelay() const;
365
366 WEBCORE_EXPORT void setMemoryCacheClientCallsEnabled(bool);
367 bool areMemoryCacheClientCallsEnabled() const { return m_areMemoryCacheClientCallsEnabled; }
368
369 // Don't allow more than a certain number of frames in a page.
370 // This seems like a reasonable upper bound, and otherwise mutually
371 // recursive frameset pages can quickly bring the program to its knees
372 // with exponential growth in the number of frames.
373 static const int maxNumberOfFrames = 1000;
374
375 static bool s_tabSuspensionIsEnabled;
376
377 void setEditable(bool isEditable) { m_isEditable = isEditable; }
378 bool isEditable() { return m_isEditable; }
379
380 WEBCORE_EXPORT PageVisibilityState visibilityState() const;
381 WEBCORE_EXPORT void resumeAnimatingImages();
382
383#if PLATFORM(QT)
384 void pluginVisibilityChanged(bool visible);
385#endif // PLATFORM(QT)
386
387 WEBCORE_EXPORT void addLayoutMilestones(LayoutMilestones);
388 WEBCORE_EXPORT void removeLayoutMilestones(LayoutMilestones);
389 LayoutMilestones requestedLayoutMilestones() const { return m_requestedLayoutMilestones; }
390
391#if ENABLE(RUBBER_BANDING)
392 WEBCORE_EXPORT void addHeaderWithHeight(int);
393 WEBCORE_EXPORT void addFooterWithHeight(int);
394#endif
395
396 int headerHeight() const { return m_headerHeight; }
397 int footerHeight() const { return m_footerHeight; }
398
399 WEBCORE_EXPORT Color pageExtendedBackgroundColor() const;
400
401 bool isCountingRelevantRepaintedObjects() const;
402 void setIsCountingRelevantRepaintedObjects(bool isCounting) { m_isCountingRelevantRepaintedObjects = isCounting; }
403 void startCountingRelevantRepaintedObjects();
404 void resetRelevantPaintedObjectCounter();
405 void addRelevantRepaintedObject(RenderObject*, const LayoutRect& objectPaintRect);
406 void addRelevantUnpaintedObject(RenderObject*, const LayoutRect& objectPaintRect);
407
408 WEBCORE_EXPORT void suspendActiveDOMObjectsAndAnimations();
409 WEBCORE_EXPORT void resumeActiveDOMObjectsAndAnimations();
410 void suspendDeviceMotionAndOrientationUpdates();
411 void resumeDeviceMotionAndOrientationUpdates();
412
413#ifndef NDEBUG
414 void setIsPainting(bool painting) { m_isPainting = painting; }
415 bool isPainting() const { return m_isPainting; }
416#endif
417
418 AlternativeTextClient* alternativeTextClient() const { return m_alternativeTextClient; }
419
420 bool hasSeenPlugin(const String& serviceType) const;
421 WEBCORE_EXPORT bool hasSeenAnyPlugin() const;
422 void sawPlugin(const String& serviceType);
423 void resetSeenPlugins();
424
425 bool hasSeenMediaEngine(const String& engineName) const;
426 bool hasSeenAnyMediaEngine() const;
427 void sawMediaEngine(const String& engineName);
428 void resetSeenMediaEngines();
429
430 PageThrottler& pageThrottler() { return m_pageThrottler; }
431
432 PageConsoleClient& console() { return *m_consoleClient; }
433
434#if ENABLE(REMOTE_INSPECTOR)
435 PageDebuggable& inspectorDebuggable() const { return *m_inspectorDebuggable.get(); }
436#endif
437
438 void hiddenPageCSSAnimationSuspensionStateChanged();
439
440#if ENABLE(VIDEO_TRACK)
441 void captionPreferencesChanged();
442#endif
443
444 void forbidPrompts();
445 void allowPrompts();
446 bool arePromptsAllowed();
447
448 void setLastSpatialNavigationCandidateCount(unsigned count) { m_lastSpatialNavigationCandidatesCount = count; }
449 unsigned lastSpatialNavigationCandidateCount() const { return m_lastSpatialNavigationCandidatesCount; }
450
451 ApplicationCacheStorage& applicationCacheStorage() { return m_applicationCacheStorage; }
452 DatabaseProvider& databaseProvider() { return m_databaseProvider; }
453
454 StorageNamespaceProvider& storageNamespaceProvider() { return m_storageNamespaceProvider.get(); }
455 void setStorageNamespaceProvider(Ref<StorageNamespaceProvider>&&);
456
457 UserContentController* userContentController() { return m_userContentController.get(); }
458 WEBCORE_EXPORT void setUserContentController(UserContentController*);
459
460 VisitedLinkStore& visitedLinkStore();
461 WEBCORE_EXPORT void setVisitedLinkStore(Ref<VisitedLinkStore>&&);
462
463 WEBCORE_EXPORT SessionID sessionID() const;
464 WEBCORE_EXPORT void setSessionID(SessionID);
465 WEBCORE_EXPORT void enableLegacyPrivateBrowsing(bool privateBrowsingEnabled);
466 bool usesEphemeralSession() const { return m_sessionID.isEphemeral(); }
467
468 MediaProducer::MediaStateFlags mediaState() const { return m_mediaState; }
469 void updateIsPlayingMedia(uint64_t);
470 bool isMuted() const { return m_muted; }
471 WEBCORE_EXPORT void setMuted(bool);
472
473#if ENABLE(MEDIA_SESSION)
474 WEBCORE_EXPORT void handleMediaEvent(MediaEventType);
475 WEBCORE_EXPORT void setVolumeOfMediaElement(double, uint64_t);
476#endif
477
478#if ENABLE(WIRELESS_PLAYBACK_TARGET)
479 void addPlaybackTargetPickerClient(uint64_t);
480 void removePlaybackTargetPickerClient(uint64_t);
481 void showPlaybackTargetPicker(uint64_t, const IntPoint&, bool);
482 void playbackTargetPickerClientStateDidChange(uint64_t, MediaProducer::MediaStateFlags);
483 WEBCORE_EXPORT void setMockMediaPlaybackTargetPickerEnabled(bool);
484 WEBCORE_EXPORT void setMockMediaPlaybackTargetPickerState(const String&, MediaPlaybackTargetContext::State);
485
486 WEBCORE_EXPORT void setPlaybackTarget(uint64_t, Ref<MediaPlaybackTarget>&&);
487 WEBCORE_EXPORT void playbackTargetAvailabilityDidChange(uint64_t, bool);
488 WEBCORE_EXPORT void setShouldPlayToPlaybackTarget(uint64_t, bool);
489#endif
490
491 RefPtr<WheelEventTestTrigger> testTrigger() const { return m_testTrigger; }
492 WEBCORE_EXPORT WheelEventTestTrigger& ensureTestTrigger();
493 void clearTrigger() { m_testTrigger = nullptr; }
494 bool expectsWheelEventTriggers() const { return !!m_testTrigger; }
495
496#if ENABLE(VIDEO)
497 bool allowsMediaDocumentInlinePlayback() const { return m_allowsMediaDocumentInlinePlayback; }
498 WEBCORE_EXPORT void setAllowsMediaDocumentInlinePlayback(bool);
499#endif
500
501#if ENABLE(INDEXED_DATABASE)
502 IDBClient::IDBConnectionToServer& idbConnection();
503#endif
504
505 void setShowAllPlugins(bool showAll) { m_showAllPlugins = showAll; }
506 bool showAllPlugins() const;
507 void setIsTabSuspended(bool);
508
509private:
510 WEBCORE_EXPORT void initGroup();
511
512 void setIsInWindowInternal(bool);
513 void setIsVisibleInternal(bool);
514 void setIsVisuallyIdleInternal(bool);
515
516#if ASSERT_DISABLED
517 void checkSubframeCountConsistency() const { }
518#else
519 void checkSubframeCountConsistency() const;
520#endif
521
522 enum ShouldHighlightMatches { DoNotHighlightMatches, HighlightMatches };
523 enum ShouldMarkMatches { DoNotMarkMatches, MarkMatches };
524
525 unsigned findMatchesForText(const String&, FindOptions, unsigned maxMatchCount, ShouldHighlightMatches, ShouldMarkMatches);
526
527 MediaCanStartListener* takeAnyMediaCanStartListener();
528
529 Vector<Ref<PluginViewBase>> pluginViews();
530
531 void hiddenPageDOMTimerThrottlingStateChanged();
532 void setTimerThrottlingEnabled(bool);
533 void setDOMTimerAlignmentInterval(double);
534 void timerAlignmentIntervalTimerFired();
535 bool canTabSuspend();
536 void updateTabSuspensionState();
537 void tabSuspensionTimerFired();
538
539 const std::unique_ptr<Chrome> m_chrome;
540 const std::unique_ptr<DragCaretController> m_dragCaretController;
541
542#if ENABLE(DRAG_SUPPORT)
543 const std::unique_ptr<DragController> m_dragController;
544#endif
545 const std::unique_ptr<FocusController> m_focusController;
546#if ENABLE(CONTEXT_MENUS)
547 const std::unique_ptr<ContextMenuController> m_contextMenuController;
548#endif
549 const std::unique_ptr<UserInputBridge> m_userInputBridge;
550#if ENABLE(WEB_REPLAY)
551 const std::unique_ptr<ReplayController> m_replayController;
552#endif
553 const std::unique_ptr<InspectorController> m_inspectorController;
554#if ENABLE(POINTER_LOCK)
555 const std::unique_ptr<PointerLockController> m_pointerLockController;
556#endif
557 RefPtr<ScrollingCoordinator> m_scrollingCoordinator;
558
559 const RefPtr<Settings> m_settings;
560 const std::unique_ptr<ProgressTracker> m_progress;
561
562 const std::unique_ptr<BackForwardController> m_backForwardController;
563 const RefPtr<MainFrame> m_mainFrame;
564
565 mutable RefPtr<PluginData> m_pluginData;
566
567 RefPtr<RenderTheme> m_theme;
568
569 EditorClient& m_editorClient;
570 PlugInClient* m_plugInClient;
571 ValidationMessageClient* m_validationMessageClient;
572
573 int m_subframeCount;
574 String m_groupName;
575 bool m_openedByDOM;
576
577 bool m_tabKeyCyclesThroughElements;
578 bool m_defersLoading;
579 unsigned m_defersLoadingCallCount;
580
581 bool m_inLowQualityInterpolationMode;
582 bool m_areMemoryCacheClientCallsEnabled;
583 float m_mediaVolume;
584 bool m_muted;
585
586 float m_pageScaleFactor;
587 float m_zoomedOutPageScaleFactor;
588 float m_deviceScaleFactor { 1 };
589 float m_viewScaleFactor { 1 };
590
591 float m_topContentInset;
592
593#if ENABLE(IOS_TEXT_AUTOSIZING)
594 float m_textAutosizingWidth;
595#endif
596
597 bool m_suppressScrollbarAnimations;
598
599 unsigned m_verticalScrollElasticity : 2; // ScrollElasticity
600 unsigned m_horizontalScrollElasticity : 2; // ScrollElasticity
601
602 Pagination m_pagination;
603 bool m_paginationLineGridEnabled { false };
604
605 String m_userStyleSheetPath;
606 mutable String m_userStyleSheet;
607 mutable bool m_didLoadUserStyleSheet;
608 mutable time_t m_userStyleSheetModificationTime;
609
610 std::unique_ptr<PageGroup> m_singlePageGroup;
611 PageGroup* m_group;
612
613 JSC::Debugger* m_debugger;
614
615 bool m_canStartMedia;
616
617 RefPtr<StorageNamespace> m_sessionStorage;
618
619#if ENABLE(VIEW_MODE_CSS_MEDIA)
620 ViewMode m_viewMode;
621#endif // ENABLE(VIEW_MODE_CSS_MEDIA)
622
623 bool m_timerThrottlingEnabled;
624 double m_timerAlignmentInterval;
625
626 bool m_isEditable;
627 bool m_isPrerender;
628 ViewState::Flags m_viewState;
629 PageActivityState::Flags m_pageActivityState;
630
631 LayoutMilestones m_requestedLayoutMilestones;
632
633 int m_headerHeight;
634 int m_footerHeight;
635
636 HashSet<RenderObject*> m_relevantUnpaintedRenderObjects;
637 Region m_topRelevantPaintedRegion;
638 Region m_bottomRelevantPaintedRegion;
639 Region m_relevantUnpaintedRegion;
640 bool m_isCountingRelevantRepaintedObjects;
641#ifndef NDEBUG
642 bool m_isPainting;
643#endif
644 AlternativeTextClient* m_alternativeTextClient;
645
646 bool m_scriptedAnimationsSuspended;
647 PageThrottler m_pageThrottler;
648 const std::unique_ptr<PageConsoleClient> m_consoleClient;
649
650#if ENABLE(REMOTE_INSPECTOR)
651 const std::unique_ptr<PageDebuggable> m_inspectorDebuggable;
652#endif
653
654#if ENABLE(INDEXED_DATABASE)
655 RefPtr<IDBClient::IDBConnectionToServer> m_idbIDBConnectionToServer;
656#endif
657
658 HashSet<String> m_seenPlugins;
659 HashSet<String> m_seenMediaEngines;
660
661 unsigned m_lastSpatialNavigationCandidatesCount;
662 unsigned m_forbidPromptsDepth;
663
664 Ref<ApplicationCacheStorage> m_applicationCacheStorage;
665 Ref<DatabaseProvider> m_databaseProvider;
666 Ref<StorageNamespaceProvider> m_storageNamespaceProvider;
667 RefPtr<UserContentController> m_userContentController;
668 Ref<VisitedLinkStore> m_visitedLinkStore;
669 RefPtr<WheelEventTestTrigger> m_testTrigger;
670
671 HashSet<ViewStateChangeObserver*> m_viewStateChangeObservers;
672
673#if ENABLE(RESOURCE_USAGE)
674 std::unique_ptr<ResourceUsageOverlay> m_resourceUsageOverlay;
675#endif
676
677 SessionID m_sessionID;
678
679 bool m_isClosing;
680 bool m_isTabSuspended { false };
681 Timer m_tabSuspensionTimer;
682
683 MediaProducer::MediaStateFlags m_mediaState { MediaProducer::IsNotPlaying };
684
685 bool m_allowsMediaDocumentInlinePlayback { false };
686 bool m_showAllPlugins { false };
687};
688
689inline PageGroup& Page::group()
690{
691 if (!m_group)
692 initGroup();
693 return *m_group;
694}
695
696} // namespace WebCore
697
698#endif // Page_h
699