| 1 | /* |
| 2 | * Copyright (C) 2006-2017 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 | #pragma once |
| 22 | |
| 23 | #include "ActivityState.h" |
| 24 | #include "DisabledAdaptations.h" |
| 25 | #include "Document.h" |
| 26 | #include "FindOptions.h" |
| 27 | #include "FrameLoaderTypes.h" |
| 28 | #include "LayoutMilestone.h" |
| 29 | #include "LayoutRect.h" |
| 30 | #include "LengthBox.h" |
| 31 | #include "MediaProducer.h" |
| 32 | #include "Pagination.h" |
| 33 | #include "RTCController.h" |
| 34 | #include "Region.h" |
| 35 | #include "RegistrableDomain.h" |
| 36 | #include "RenderingUpdateScheduler.h" |
| 37 | #include "ScrollTypes.h" |
| 38 | #include "Supplementable.h" |
| 39 | #include "Timer.h" |
| 40 | #include "UserInterfaceLayoutDirection.h" |
| 41 | #include "ViewportArguments.h" |
| 42 | #include "VisibilityState.h" |
| 43 | #include "WheelEventTestTrigger.h" |
| 44 | #include <memory> |
| 45 | #include <pal/SessionID.h> |
| 46 | #include <wtf/Assertions.h> |
| 47 | #include <wtf/Forward.h> |
| 48 | #include <wtf/Function.h> |
| 49 | #include <wtf/HashSet.h> |
| 50 | #include <wtf/Noncopyable.h> |
| 51 | #include <wtf/Ref.h> |
| 52 | #include <wtf/UniqueRef.h> |
| 53 | #include <wtf/WeakPtr.h> |
| 54 | #include <wtf/text/WTFString.h> |
| 55 | |
| 56 | #if PLATFORM(COCOA) |
| 57 | #include <wtf/SchedulePair.h> |
| 58 | #endif |
| 59 | |
| 60 | #if ENABLE(APPLICATION_MANIFEST) |
| 61 | #include "ApplicationManifest.h" |
| 62 | #endif |
| 63 | |
| 64 | #if ENABLE(MEDIA_SESSION) |
| 65 | #include "MediaSessionEvents.h" |
| 66 | #endif |
| 67 | |
| 68 | #if ENABLE(WIRELESS_PLAYBACK_TARGET) |
| 69 | #include "MediaPlaybackTargetContext.h" |
| 70 | #endif |
| 71 | |
| 72 | namespace JSC { |
| 73 | class Debugger; |
| 74 | } |
| 75 | |
| 76 | namespace WebCore { |
| 77 | |
| 78 | namespace IDBClient { |
| 79 | class IDBConnectionToServer; |
| 80 | } |
| 81 | |
| 82 | class AlternativeTextClient; |
| 83 | class ApplicationCacheStorage; |
| 84 | class AuthenticatorCoordinator; |
| 85 | class BackForwardController; |
| 86 | class BackForwardClient; |
| 87 | class CacheStorageProvider; |
| 88 | class Chrome; |
| 89 | class ChromeClient; |
| 90 | class Color; |
| 91 | class ; |
| 92 | class ; |
| 93 | class CookieJar; |
| 94 | class DOMRect; |
| 95 | class DOMRectList; |
| 96 | class DatabaseProvider; |
| 97 | class DiagnosticLoggingClient; |
| 98 | class DragCaretController; |
| 99 | class DragClient; |
| 100 | class DragController; |
| 101 | class EditorClient; |
| 102 | class Element; |
| 103 | class FocusController; |
| 104 | class Frame; |
| 105 | class FrameLoaderClient; |
| 106 | class HistoryItem; |
| 107 | class HTMLMediaElement; |
| 108 | class UserInputBridge; |
| 109 | class InspectorClient; |
| 110 | class InspectorController; |
| 111 | class LibWebRTCProvider; |
| 112 | class LowPowerModeNotifier; |
| 113 | class MediaCanStartListener; |
| 114 | class MediaPlaybackTarget; |
| 115 | class PageConfiguration; |
| 116 | class PageConsoleClient; |
| 117 | class PageDebuggable; |
| 118 | class PageGroup; |
| 119 | class PageOverlayController; |
| 120 | class PaymentCoordinator; |
| 121 | class PerformanceLogging; |
| 122 | class PerformanceLoggingClient; |
| 123 | class PerformanceMonitor; |
| 124 | class PlugInClient; |
| 125 | class PluginData; |
| 126 | class PluginInfoProvider; |
| 127 | class PluginViewBase; |
| 128 | class PointerCaptureController; |
| 129 | class PointerLockController; |
| 130 | class ProgressTracker; |
| 131 | class ProgressTrackerClient; |
| 132 | class Range; |
| 133 | class RenderObject; |
| 134 | class RenderTheme; |
| 135 | class ResourceUsageOverlay; |
| 136 | class VisibleSelection; |
| 137 | class ScrollLatchingState; |
| 138 | class ScrollableArea; |
| 139 | class ScrollingCoordinator; |
| 140 | class ServicesOverlayController; |
| 141 | class Settings; |
| 142 | class SocketProvider; |
| 143 | class StorageNamespace; |
| 144 | class StorageNamespaceProvider; |
| 145 | class UserContentProvider; |
| 146 | class ValidationMessageClient; |
| 147 | class ActivityStateChangeObserver; |
| 148 | class VisitedLinkStore; |
| 149 | class WebGLStateTracker; |
| 150 | class SpeechSynthesisClient; |
| 151 | class WheelEventDeltaFilter; |
| 152 | |
| 153 | typedef uint64_t SharedStringHash; |
| 154 | |
| 155 | enum FindDirection { |
| 156 | FindDirectionForward, |
| 157 | FindDirectionBackward |
| 158 | }; |
| 159 | |
| 160 | enum class EventThrottlingBehavior { |
| 161 | Responsive, |
| 162 | Unresponsive |
| 163 | }; |
| 164 | |
| 165 | enum class CompositingPolicy : uint8_t { |
| 166 | Normal, |
| 167 | Conservative, // Used in low memory situations. |
| 168 | }; |
| 169 | |
| 170 | enum class CanWrap : bool; |
| 171 | enum class DidWrap : bool; |
| 172 | enum class RouteSharingPolicy : uint8_t; |
| 173 | enum class ShouldTreatAsContinuingLoad : bool; |
| 174 | |
| 175 | class Page : public Supplementable<Page>, public CanMakeWeakPtr<Page> { |
| 176 | WTF_MAKE_NONCOPYABLE(Page); |
| 177 | WTF_MAKE_FAST_ALLOCATED; |
| 178 | friend class SettingsBase; |
| 179 | |
| 180 | public: |
| 181 | WEBCORE_EXPORT static void updateStyleForAllPagesAfterGlobalChangeInEnvironment(); |
| 182 | WEBCORE_EXPORT static void clearPreviousItemFromAllPages(HistoryItem*); |
| 183 | |
| 184 | void updateStyleAfterChangeInEnvironment(); |
| 185 | |
| 186 | WEBCORE_EXPORT explicit Page(PageConfiguration&&); |
| 187 | WEBCORE_EXPORT ~Page(); |
| 188 | |
| 189 | WEBCORE_EXPORT uint64_t renderTreeSize() const; |
| 190 | |
| 191 | WEBCORE_EXPORT void setNeedsRecalcStyleInAllFrames(); |
| 192 | |
| 193 | WEBCORE_EXPORT OptionSet<DisabledAdaptations> disabledAdaptations() const; |
| 194 | WEBCORE_EXPORT ViewportArguments viewportArguments() const; |
| 195 | |
| 196 | const Optional<ViewportArguments>& overrideViewportArguments() const { return m_overrideViewportArguments; } |
| 197 | WEBCORE_EXPORT void setOverrideViewportArguments(const Optional<ViewportArguments>&); |
| 198 | |
| 199 | static void refreshPlugins(bool reload); |
| 200 | WEBCORE_EXPORT PluginData& pluginData(); |
| 201 | void clearPluginData(); |
| 202 | |
| 203 | WEBCORE_EXPORT void setCanStartMedia(bool); |
| 204 | bool canStartMedia() const { return m_canStartMedia; } |
| 205 | |
| 206 | EditorClient& editorClient() { return m_editorClient.get(); } |
| 207 | PlugInClient* plugInClient() const { return m_plugInClient; } |
| 208 | |
| 209 | Frame& mainFrame() { return m_mainFrame.get(); } |
| 210 | const Frame& mainFrame() const { return m_mainFrame.get(); } |
| 211 | |
| 212 | bool openedByDOM() const; |
| 213 | void setOpenedByDOM(); |
| 214 | |
| 215 | bool openedByDOMWithOpener() const { return m_openedByDOMWithOpener; } |
| 216 | void setOpenedByDOMWithOpener() { m_openedByDOMWithOpener = true; } |
| 217 | |
| 218 | WEBCORE_EXPORT void goToItem(HistoryItem&, FrameLoadType, ShouldTreatAsContinuingLoad); |
| 219 | |
| 220 | WEBCORE_EXPORT void setGroupName(const String&); |
| 221 | WEBCORE_EXPORT const String& groupName() const; |
| 222 | |
| 223 | PageGroup& group(); |
| 224 | |
| 225 | WEBCORE_EXPORT static void forEachPage(const WTF::Function<void(Page&)>&); |
| 226 | |
| 227 | void incrementSubframeCount() { ++m_subframeCount; } |
| 228 | void decrementSubframeCount() { ASSERT(m_subframeCount); --m_subframeCount; } |
| 229 | int subframeCount() const { checkSubframeCountConsistency(); return m_subframeCount; } |
| 230 | |
| 231 | void incrementNestedRunLoopCount(); |
| 232 | void decrementNestedRunLoopCount(); |
| 233 | bool insideNestedRunLoop() const { return m_nestedRunLoopCount > 0; } |
| 234 | WEBCORE_EXPORT void whenUnnested(WTF::Function<void()>&&); |
| 235 | |
| 236 | #if ENABLE(REMOTE_INSPECTOR) |
| 237 | WEBCORE_EXPORT bool remoteInspectionAllowed() const; |
| 238 | WEBCORE_EXPORT void setRemoteInspectionAllowed(bool); |
| 239 | WEBCORE_EXPORT String remoteInspectionNameOverride() const; |
| 240 | WEBCORE_EXPORT void setRemoteInspectionNameOverride(const String&); |
| 241 | void remoteInspectorInformationDidChange() const; |
| 242 | #endif |
| 243 | |
| 244 | Chrome& chrome() const { return *m_chrome; } |
| 245 | DragCaretController& dragCaretController() const { return *m_dragCaretController; } |
| 246 | #if ENABLE(DRAG_SUPPORT) |
| 247 | DragController& dragController() const { return *m_dragController; } |
| 248 | #endif |
| 249 | FocusController& focusController() const { return *m_focusController; } |
| 250 | #if ENABLE(CONTEXT_MENUS) |
| 251 | ContextMenuController& () const { return *m_contextMenuController; } |
| 252 | #endif |
| 253 | UserInputBridge& userInputBridge() const { return *m_userInputBridge; } |
| 254 | InspectorController& inspectorController() const { return *m_inspectorController; } |
| 255 | #if ENABLE(POINTER_EVENTS) |
| 256 | PointerCaptureController& pointerCaptureController() const { return *m_pointerCaptureController; } |
| 257 | #endif |
| 258 | #if ENABLE(POINTER_LOCK) |
| 259 | PointerLockController& pointerLockController() const { return *m_pointerLockController; } |
| 260 | #endif |
| 261 | LibWebRTCProvider& libWebRTCProvider() { return m_libWebRTCProvider.get(); } |
| 262 | RTCController& rtcController() { return m_rtcController; } |
| 263 | WEBCORE_EXPORT void disableICECandidateFiltering(); |
| 264 | WEBCORE_EXPORT void enableICECandidateFiltering(); |
| 265 | bool shouldEnableICECandidateFilteringByDefault() const { return m_shouldEnableICECandidateFilteringByDefault; } |
| 266 | |
| 267 | void didChangeMainDocument(); |
| 268 | |
| 269 | PerformanceMonitor* performanceMonitor() { return m_performanceMonitor.get(); } |
| 270 | |
| 271 | RenderingUpdateScheduler& renderingUpdateScheduler(); |
| 272 | |
| 273 | ValidationMessageClient* validationMessageClient() const { return m_validationMessageClient.get(); } |
| 274 | void updateValidationBubbleStateIfNeeded(); |
| 275 | |
| 276 | WEBCORE_EXPORT ScrollingCoordinator* scrollingCoordinator(); |
| 277 | |
| 278 | WEBCORE_EXPORT String scrollingStateTreeAsText(); |
| 279 | WEBCORE_EXPORT String synchronousScrollingReasonsAsText(); |
| 280 | WEBCORE_EXPORT Ref<DOMRectList> nonFastScrollableRects(); |
| 281 | |
| 282 | WEBCORE_EXPORT Ref<DOMRectList> touchEventRectsForEvent(const String& eventName); |
| 283 | WEBCORE_EXPORT Ref<DOMRectList> passiveTouchEventListenerRects(); |
| 284 | |
| 285 | Settings& settings() const { return *m_settings; } |
| 286 | ProgressTracker& progress() const { return *m_progress; } |
| 287 | BackForwardController& backForward() const { return *m_backForwardController; } |
| 288 | |
| 289 | Seconds domTimerAlignmentInterval() const { return m_domTimerAlignmentInterval; } |
| 290 | |
| 291 | void setTabKeyCyclesThroughElements(bool b) { m_tabKeyCyclesThroughElements = b; } |
| 292 | bool tabKeyCyclesThroughElements() const { return m_tabKeyCyclesThroughElements; } |
| 293 | |
| 294 | WEBCORE_EXPORT bool findString(const String&, FindOptions, DidWrap* = nullptr); |
| 295 | WEBCORE_EXPORT uint32_t replaceRangesWithText(const Vector<Ref<Range>>& rangesToReplace, const String& replacementText, bool selectionOnly); |
| 296 | WEBCORE_EXPORT uint32_t replaceSelectionWithText(const String& replacementText); |
| 297 | |
| 298 | WEBCORE_EXPORT RefPtr<Range> rangeOfString(const String&, Range*, FindOptions); |
| 299 | |
| 300 | WEBCORE_EXPORT unsigned countFindMatches(const String&, FindOptions, unsigned maxMatchCount); |
| 301 | WEBCORE_EXPORT unsigned markAllMatchesForText(const String&, FindOptions, bool shouldHighlight, unsigned maxMatchCount); |
| 302 | |
| 303 | WEBCORE_EXPORT void unmarkAllTextMatches(); |
| 304 | |
| 305 | WEBCORE_EXPORT void dispatchBeforePrintEvent(); |
| 306 | WEBCORE_EXPORT void dispatchAfterPrintEvent(); |
| 307 | |
| 308 | // find all the Ranges for the matching text. |
| 309 | // Upon return, indexForSelection will be one of the following: |
| 310 | // 0 if there is no user selection |
| 311 | // the index of the first range after the user selection |
| 312 | // NoMatchAfterUserSelection if there is no matching text after the user selection. |
| 313 | enum { NoMatchAfterUserSelection = -1 }; |
| 314 | WEBCORE_EXPORT void findStringMatchingRanges(const String&, FindOptions, int maxCount, Vector<RefPtr<Range>>&, int& indexForSelection); |
| 315 | #if PLATFORM(COCOA) |
| 316 | void platformInitialize(); |
| 317 | WEBCORE_EXPORT void addSchedulePair(Ref<SchedulePair>&&); |
| 318 | WEBCORE_EXPORT void removeSchedulePair(Ref<SchedulePair>&&); |
| 319 | SchedulePairHashSet* scheduledRunLoopPairs() { return m_scheduledRunLoopPairs.get(); } |
| 320 | |
| 321 | std::unique_ptr<SchedulePairHashSet> m_scheduledRunLoopPairs; |
| 322 | #endif |
| 323 | |
| 324 | WEBCORE_EXPORT const VisibleSelection& selection() const; |
| 325 | |
| 326 | WEBCORE_EXPORT void setDefersLoading(bool); |
| 327 | bool defersLoading() const { return m_defersLoading; } |
| 328 | |
| 329 | WEBCORE_EXPORT void clearUndoRedoOperations(); |
| 330 | |
| 331 | WEBCORE_EXPORT bool inLowQualityImageInterpolationMode() const; |
| 332 | WEBCORE_EXPORT void setInLowQualityImageInterpolationMode(bool = true); |
| 333 | |
| 334 | float mediaVolume() const { return m_mediaVolume; } |
| 335 | WEBCORE_EXPORT void setMediaVolume(float); |
| 336 | |
| 337 | WEBCORE_EXPORT void setPageScaleFactor(float scale, const IntPoint& origin, bool inStableState = true); |
| 338 | float pageScaleFactor() const { return m_pageScaleFactor; } |
| 339 | |
| 340 | UserInterfaceLayoutDirection userInterfaceLayoutDirection() const { return m_userInterfaceLayoutDirection; } |
| 341 | WEBCORE_EXPORT void setUserInterfaceLayoutDirection(UserInterfaceLayoutDirection); |
| 342 | |
| 343 | WEBCORE_EXPORT void updateMediaElementRateChangeRestrictions(); |
| 344 | |
| 345 | void didStartProvisionalLoad(); |
| 346 | void didFinishLoad(); // Called when the load has been committed in the main frame. |
| 347 | |
| 348 | // The view scale factor is multiplied into the page scale factor by all |
| 349 | // callers of setPageScaleFactor. |
| 350 | WEBCORE_EXPORT void setViewScaleFactor(float); |
| 351 | float viewScaleFactor() const { return m_viewScaleFactor; } |
| 352 | |
| 353 | WEBCORE_EXPORT void setZoomedOutPageScaleFactor(float); |
| 354 | float zoomedOutPageScaleFactor() const { return m_zoomedOutPageScaleFactor; } |
| 355 | |
| 356 | float deviceScaleFactor() const { return m_deviceScaleFactor; } |
| 357 | WEBCORE_EXPORT void setDeviceScaleFactor(float); |
| 358 | |
| 359 | float initialScale() const { return m_initialScale; } |
| 360 | WEBCORE_EXPORT void setInitialScale(float); |
| 361 | |
| 362 | float topContentInset() const { return m_topContentInset; } |
| 363 | WEBCORE_EXPORT void setTopContentInset(float); |
| 364 | |
| 365 | const FloatBoxExtent& obscuredInsets() const { return m_obscuredInsets; } |
| 366 | void setObscuredInsets(const FloatBoxExtent& obscuredInsets) { m_obscuredInsets = obscuredInsets; } |
| 367 | |
| 368 | const FloatBoxExtent& contentInsets() const { return m_contentInsets; } |
| 369 | void setContentInsets(const FloatBoxExtent& insets) { m_contentInsets = insets; } |
| 370 | |
| 371 | const FloatBoxExtent& unobscuredSafeAreaInsets() const { return m_unobscuredSafeAreaInsets; } |
| 372 | WEBCORE_EXPORT void setUnobscuredSafeAreaInsets(const FloatBoxExtent&); |
| 373 | |
| 374 | #if PLATFORM(IOS_FAMILY) |
| 375 | bool enclosedInScrollableAncestorView() const { return m_enclosedInScrollableAncestorView; } |
| 376 | void setEnclosedInScrollableAncestorView(bool f) { m_enclosedInScrollableAncestorView = f; } |
| 377 | #endif |
| 378 | |
| 379 | bool useSystemAppearance() const { return m_useSystemAppearance; } |
| 380 | WEBCORE_EXPORT void setUseSystemAppearance(bool); |
| 381 | |
| 382 | WEBCORE_EXPORT bool useDarkAppearance() const; |
| 383 | bool useInactiveAppearance() const { return m_useInactiveAppearance; } |
| 384 | WEBCORE_EXPORT void effectiveAppearanceDidChange(bool useDarkAppearance, bool useInactiveAppearance); |
| 385 | bool defaultUseDarkAppearance() const { return m_useDarkAppearance; } |
| 386 | void setUseDarkAppearanceOverride(Optional<bool>); |
| 387 | |
| 388 | #if ENABLE(TEXT_AUTOSIZING) |
| 389 | float textAutosizingWidth() const { return m_textAutosizingWidth; } |
| 390 | void setTextAutosizingWidth(float textAutosizingWidth) { m_textAutosizingWidth = textAutosizingWidth; } |
| 391 | #endif |
| 392 | |
| 393 | const FloatBoxExtent& fullscreenInsets() const { return m_fullscreenInsets; } |
| 394 | WEBCORE_EXPORT void setFullscreenInsets(const FloatBoxExtent&); |
| 395 | |
| 396 | const Seconds fullscreenAutoHideDuration() const { return m_fullscreenAutoHideDuration; } |
| 397 | WEBCORE_EXPORT void setFullscreenAutoHideDuration(Seconds); |
| 398 | WEBCORE_EXPORT void setFullscreenControlsHidden(bool); |
| 399 | |
| 400 | bool shouldSuppressScrollbarAnimations() const { return m_suppressScrollbarAnimations; } |
| 401 | WEBCORE_EXPORT void setShouldSuppressScrollbarAnimations(bool suppressAnimations); |
| 402 | void lockAllOverlayScrollbarsToHidden(bool lockOverlayScrollbars); |
| 403 | |
| 404 | WEBCORE_EXPORT void setVerticalScrollElasticity(ScrollElasticity); |
| 405 | ScrollElasticity verticalScrollElasticity() const { return static_cast<ScrollElasticity>(m_verticalScrollElasticity); } |
| 406 | |
| 407 | WEBCORE_EXPORT void setHorizontalScrollElasticity(ScrollElasticity); |
| 408 | ScrollElasticity horizontalScrollElasticity() const { return static_cast<ScrollElasticity>(m_horizontalScrollElasticity); } |
| 409 | |
| 410 | WEBCORE_EXPORT void accessibilitySettingsDidChange(); |
| 411 | WEBCORE_EXPORT void appearanceDidChange(); |
| 412 | |
| 413 | // Page and FrameView both store a Pagination value. Page::pagination() is set only by API, |
| 414 | // and FrameView::pagination() is set only by CSS. Page::pagination() will affect all |
| 415 | // FrameViews in the page cache, but FrameView::pagination() only affects the current |
| 416 | // FrameView. |
| 417 | const Pagination& () const { return m_pagination; } |
| 418 | WEBCORE_EXPORT void (const Pagination&); |
| 419 | bool () const { return m_paginationLineGridEnabled; } |
| 420 | WEBCORE_EXPORT void (bool flag); |
| 421 | |
| 422 | WEBCORE_EXPORT unsigned pageCount() const; |
| 423 | |
| 424 | WEBCORE_EXPORT DiagnosticLoggingClient& diagnosticLoggingClient() const; |
| 425 | |
| 426 | PerformanceLoggingClient* performanceLoggingClient() const { return m_performanceLoggingClient.get(); } |
| 427 | |
| 428 | WheelEventDeltaFilter* wheelEventDeltaFilter() { return m_recentWheelEventDeltaFilter.get(); } |
| 429 | PageOverlayController& pageOverlayController() { return *m_pageOverlayController; } |
| 430 | |
| 431 | #if PLATFORM(MAC) |
| 432 | #if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION) |
| 433 | ServicesOverlayController& servicesOverlayController() { return *m_servicesOverlayController; } |
| 434 | #endif // ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION) |
| 435 | |
| 436 | ScrollLatchingState* latchingState(); |
| 437 | void pushNewLatchingState(); |
| 438 | void popLatchingState(); |
| 439 | void resetLatchingState(); |
| 440 | void removeLatchingStateForTarget(Element&); |
| 441 | #endif // PLATFORM(MAC) |
| 442 | |
| 443 | #if ENABLE(APPLE_PAY) |
| 444 | PaymentCoordinator& paymentCoordinator() const { return *m_paymentCoordinator; } |
| 445 | WEBCORE_EXPORT void setPaymentCoordinator(std::unique_ptr<PaymentCoordinator>&&); |
| 446 | #endif |
| 447 | |
| 448 | #if ENABLE(WEB_AUTHN) |
| 449 | AuthenticatorCoordinator& authenticatorCoordinator() { return m_authenticatorCoordinator.get(); } |
| 450 | #endif |
| 451 | |
| 452 | #if ENABLE(APPLICATION_MANIFEST) |
| 453 | const Optional<ApplicationManifest>& applicationManifest() const { return m_applicationManifest; } |
| 454 | #endif |
| 455 | |
| 456 | // Notifications when the Page starts and stops being presented via a native window. |
| 457 | WEBCORE_EXPORT void setActivityState(OptionSet<ActivityState::Flag>); |
| 458 | OptionSet<ActivityState::Flag> activityState() const { return m_activityState; } |
| 459 | |
| 460 | bool isWindowActive() const; |
| 461 | bool isVisibleAndActive() const; |
| 462 | WEBCORE_EXPORT void setIsVisible(bool); |
| 463 | WEBCORE_EXPORT void setIsPrerender(); |
| 464 | bool isVisible() const { return m_activityState.contains(ActivityState::IsVisible); } |
| 465 | |
| 466 | // Notification that this Page was moved into or out of a native window. |
| 467 | WEBCORE_EXPORT void setIsInWindow(bool); |
| 468 | bool isInWindow() const { return m_activityState.contains(ActivityState::IsInWindow); } |
| 469 | |
| 470 | void setIsClosing() { m_isClosing = true; } |
| 471 | bool isClosing() const { return m_isClosing; } |
| 472 | |
| 473 | void setIsRestoringCachedPage(bool value) { m_isRestoringCachedPage = value; } |
| 474 | bool isRestoringCachedPage() const { return m_isRestoringCachedPage; } |
| 475 | |
| 476 | WEBCORE_EXPORT void addActivityStateChangeObserver(ActivityStateChangeObserver&); |
| 477 | WEBCORE_EXPORT void removeActivityStateChangeObserver(ActivityStateChangeObserver&); |
| 478 | |
| 479 | WEBCORE_EXPORT void layoutIfNeeded(); |
| 480 | WEBCORE_EXPORT void updateRendering(); |
| 481 | |
| 482 | WEBCORE_EXPORT void suspendScriptedAnimations(); |
| 483 | WEBCORE_EXPORT void resumeScriptedAnimations(); |
| 484 | bool scriptedAnimationsSuspended() const { return m_scriptedAnimationsSuspended; } |
| 485 | |
| 486 | void userStyleSheetLocationChanged(); |
| 487 | const String& userStyleSheet() const; |
| 488 | |
| 489 | WEBCORE_EXPORT void userAgentChanged(); |
| 490 | |
| 491 | void dnsPrefetchingStateChanged(); |
| 492 | void storageBlockingStateChanged(); |
| 493 | |
| 494 | #if ENABLE(RESOURCE_USAGE) |
| 495 | void setResourceUsageOverlayVisible(bool); |
| 496 | #endif |
| 497 | |
| 498 | void setDebugger(JSC::Debugger*); |
| 499 | JSC::Debugger* debugger() const { return m_debugger; } |
| 500 | |
| 501 | WEBCORE_EXPORT void invalidateStylesForAllLinks(); |
| 502 | WEBCORE_EXPORT void invalidateStylesForLink(SharedStringHash); |
| 503 | |
| 504 | void invalidateInjectedStyleSheetCacheInAllFrames(); |
| 505 | |
| 506 | StorageNamespace* sessionStorage(bool optionalCreate = true); |
| 507 | void setSessionStorage(RefPtr<StorageNamespace>&&); |
| 508 | |
| 509 | StorageNamespace* ephemeralLocalStorage(bool optionalCreate = true); |
| 510 | void setEphemeralLocalStorage(RefPtr<StorageNamespace>&&); |
| 511 | |
| 512 | bool hasCustomHTMLTokenizerTimeDelay() const; |
| 513 | double customHTMLTokenizerTimeDelay() const; |
| 514 | |
| 515 | WEBCORE_EXPORT void setMemoryCacheClientCallsEnabled(bool); |
| 516 | bool areMemoryCacheClientCallsEnabled() const { return m_areMemoryCacheClientCallsEnabled; } |
| 517 | |
| 518 | // Don't allow more than a certain number of frames in a page. |
| 519 | // This seems like a reasonable upper bound, and otherwise mutually |
| 520 | // recursive frameset pages can quickly bring the program to its knees |
| 521 | // with exponential growth in the number of frames. |
| 522 | static const int maxNumberOfFrames = 1000; |
| 523 | |
| 524 | void setEditable(bool isEditable) { m_isEditable = isEditable; } |
| 525 | bool isEditable() { return m_isEditable; } |
| 526 | |
| 527 | WEBCORE_EXPORT VisibilityState visibilityState() const; |
| 528 | WEBCORE_EXPORT void resumeAnimatingImages(); |
| 529 | |
| 530 | WEBCORE_EXPORT void addLayoutMilestones(OptionSet<LayoutMilestone>); |
| 531 | WEBCORE_EXPORT void removeLayoutMilestones(OptionSet<LayoutMilestone>); |
| 532 | OptionSet<LayoutMilestone> requestedLayoutMilestones() const { return m_requestedLayoutMilestones; } |
| 533 | |
| 534 | WEBCORE_EXPORT void (int); |
| 535 | WEBCORE_EXPORT void (int); |
| 536 | |
| 537 | int () const { return m_headerHeight; } |
| 538 | int () const { return m_footerHeight; } |
| 539 | |
| 540 | WEBCORE_EXPORT Color pageExtendedBackgroundColor() const; |
| 541 | |
| 542 | bool isCountingRelevantRepaintedObjects() const; |
| 543 | void setIsCountingRelevantRepaintedObjects(bool isCounting) { m_isCountingRelevantRepaintedObjects = isCounting; } |
| 544 | void startCountingRelevantRepaintedObjects(); |
| 545 | void resetRelevantPaintedObjectCounter(); |
| 546 | void addRelevantRepaintedObject(RenderObject*, const LayoutRect& objectPaintRect); |
| 547 | void addRelevantUnpaintedObject(RenderObject*, const LayoutRect& objectPaintRect); |
| 548 | |
| 549 | WEBCORE_EXPORT void suspendActiveDOMObjectsAndAnimations(); |
| 550 | WEBCORE_EXPORT void resumeActiveDOMObjectsAndAnimations(); |
| 551 | void suspendDeviceMotionAndOrientationUpdates(); |
| 552 | void resumeDeviceMotionAndOrientationUpdates(); |
| 553 | |
| 554 | #ifndef NDEBUG |
| 555 | void setIsPainting(bool painting) { m_isPainting = painting; } |
| 556 | bool isPainting() const { return m_isPainting; } |
| 557 | #endif |
| 558 | |
| 559 | AlternativeTextClient* alternativeTextClient() const { return m_alternativeTextClient; } |
| 560 | |
| 561 | bool hasSeenPlugin(const String& serviceType) const; |
| 562 | WEBCORE_EXPORT bool hasSeenAnyPlugin() const; |
| 563 | void sawPlugin(const String& serviceType); |
| 564 | void resetSeenPlugins(); |
| 565 | |
| 566 | bool hasSeenMediaEngine(const String& engineName) const; |
| 567 | bool hasSeenAnyMediaEngine() const; |
| 568 | void sawMediaEngine(const String& engineName); |
| 569 | void resetSeenMediaEngines(); |
| 570 | |
| 571 | PageConsoleClient& console() { return *m_consoleClient; } |
| 572 | |
| 573 | #if ENABLE(REMOTE_INSPECTOR) |
| 574 | PageDebuggable& inspectorDebuggable() const { return *m_inspectorDebuggable.get(); } |
| 575 | #endif |
| 576 | |
| 577 | void hiddenPageCSSAnimationSuspensionStateChanged(); |
| 578 | |
| 579 | #if ENABLE(VIDEO_TRACK) |
| 580 | void captionPreferencesChanged(); |
| 581 | #endif |
| 582 | |
| 583 | void forbidPrompts(); |
| 584 | void allowPrompts(); |
| 585 | bool arePromptsAllowed(); |
| 586 | |
| 587 | void mainFrameLoadStarted(const URL&, FrameLoadType); |
| 588 | |
| 589 | void setLastSpatialNavigationCandidateCount(unsigned count) { m_lastSpatialNavigationCandidatesCount = count; } |
| 590 | unsigned lastSpatialNavigationCandidateCount() const { return m_lastSpatialNavigationCandidatesCount; } |
| 591 | |
| 592 | ApplicationCacheStorage& applicationCacheStorage() { return m_applicationCacheStorage; } |
| 593 | DatabaseProvider& databaseProvider() { return m_databaseProvider; } |
| 594 | CacheStorageProvider& cacheStorageProvider() { return m_cacheStorageProvider; } |
| 595 | SocketProvider& socketProvider() { return m_socketProvider; } |
| 596 | CookieJar& cookieJar() { return m_cookieJar.get(); } |
| 597 | |
| 598 | StorageNamespaceProvider& storageNamespaceProvider() { return m_storageNamespaceProvider.get(); } |
| 599 | void setStorageNamespaceProvider(Ref<StorageNamespaceProvider>&&); |
| 600 | |
| 601 | PluginInfoProvider& pluginInfoProvider(); |
| 602 | |
| 603 | WEBCORE_EXPORT UserContentProvider& userContentProvider(); |
| 604 | WEBCORE_EXPORT void setUserContentProvider(Ref<UserContentProvider>&&); |
| 605 | |
| 606 | VisitedLinkStore& visitedLinkStore(); |
| 607 | WEBCORE_EXPORT void setVisitedLinkStore(Ref<VisitedLinkStore>&&); |
| 608 | |
| 609 | WEBCORE_EXPORT PAL::SessionID sessionID() const; |
| 610 | WEBCORE_EXPORT void setSessionID(PAL::SessionID); |
| 611 | WEBCORE_EXPORT void enableLegacyPrivateBrowsing(bool privateBrowsingEnabled); |
| 612 | bool usesEphemeralSession() const { return m_sessionID.isEphemeral(); } |
| 613 | |
| 614 | MediaProducer::MediaStateFlags mediaState() const { return m_mediaState; } |
| 615 | void updateIsPlayingMedia(uint64_t); |
| 616 | MediaProducer::MutedStateFlags mutedState() const { return m_mutedState; } |
| 617 | bool isAudioMuted() const { return m_mutedState & MediaProducer::AudioIsMuted; } |
| 618 | bool isMediaCaptureMuted() const { return m_mutedState & MediaProducer::MediaStreamCaptureIsMuted; }; |
| 619 | void schedulePlaybackControlsManagerUpdate(); |
| 620 | WEBCORE_EXPORT void setMuted(MediaProducer::MutedStateFlags); |
| 621 | WEBCORE_EXPORT void stopMediaCapture(); |
| 622 | |
| 623 | WEBCORE_EXPORT void stopAllMediaPlayback(); |
| 624 | WEBCORE_EXPORT void suspendAllMediaPlayback(); |
| 625 | WEBCORE_EXPORT void resumeAllMediaPlayback(); |
| 626 | bool mediaPlaybackIsSuspended() const { return m_mediaPlaybackIsSuspended; } |
| 627 | WEBCORE_EXPORT void suspendAllMediaBuffering(); |
| 628 | WEBCORE_EXPORT void resumeAllMediaBuffering(); |
| 629 | bool mediaBufferingIsSuspended() const { return m_mediaBufferingIsSuspended; } |
| 630 | |
| 631 | #if ENABLE(MEDIA_SESSION) |
| 632 | WEBCORE_EXPORT void handleMediaEvent(MediaEventType); |
| 633 | WEBCORE_EXPORT void setVolumeOfMediaElement(double, uint64_t); |
| 634 | #endif |
| 635 | |
| 636 | #if ENABLE(WIRELESS_PLAYBACK_TARGET) |
| 637 | void addPlaybackTargetPickerClient(uint64_t); |
| 638 | void removePlaybackTargetPickerClient(uint64_t); |
| 639 | void showPlaybackTargetPicker(uint64_t, const IntPoint&, bool, RouteSharingPolicy, const String&); |
| 640 | void playbackTargetPickerClientStateDidChange(uint64_t, MediaProducer::MediaStateFlags); |
| 641 | WEBCORE_EXPORT void setMockMediaPlaybackTargetPickerEnabled(bool); |
| 642 | WEBCORE_EXPORT void setMockMediaPlaybackTargetPickerState(const String&, MediaPlaybackTargetContext::State); |
| 643 | |
| 644 | WEBCORE_EXPORT void setPlaybackTarget(uint64_t, Ref<MediaPlaybackTarget>&&); |
| 645 | WEBCORE_EXPORT void playbackTargetAvailabilityDidChange(uint64_t, bool); |
| 646 | WEBCORE_EXPORT void setShouldPlayToPlaybackTarget(uint64_t, bool); |
| 647 | #endif |
| 648 | |
| 649 | RefPtr<WheelEventTestTrigger> testTrigger() const { return m_testTrigger; } |
| 650 | WEBCORE_EXPORT WheelEventTestTrigger& ensureTestTrigger(); |
| 651 | void clearTrigger() { m_testTrigger = nullptr; } |
| 652 | bool expectsWheelEventTriggers() const { return !!m_testTrigger; } |
| 653 | |
| 654 | #if ENABLE(VIDEO) |
| 655 | bool allowsMediaDocumentInlinePlayback() const { return m_allowsMediaDocumentInlinePlayback; } |
| 656 | WEBCORE_EXPORT void setAllowsMediaDocumentInlinePlayback(bool); |
| 657 | #endif |
| 658 | |
| 659 | bool allowsPlaybackControlsForAutoplayingAudio() const { return m_allowsPlaybackControlsForAutoplayingAudio; } |
| 660 | void setAllowsPlaybackControlsForAutoplayingAudio(bool allowsPlaybackControlsForAutoplayingAudio) { m_allowsPlaybackControlsForAutoplayingAudio = allowsPlaybackControlsForAutoplayingAudio; } |
| 661 | |
| 662 | #if ENABLE(INDEXED_DATABASE) |
| 663 | IDBClient::IDBConnectionToServer& idbConnection(); |
| 664 | WEBCORE_EXPORT IDBClient::IDBConnectionToServer* optionalIDBConnection(); |
| 665 | WEBCORE_EXPORT void clearIDBConnection(); |
| 666 | #endif |
| 667 | |
| 668 | void setShowAllPlugins(bool showAll) { m_showAllPlugins = showAll; } |
| 669 | bool showAllPlugins() const; |
| 670 | |
| 671 | WEBCORE_EXPORT void setDOMTimerAlignmentIntervalIncreaseLimit(Seconds); |
| 672 | |
| 673 | bool isControlledByAutomation() const { return m_controlledByAutomation; } |
| 674 | void setControlledByAutomation(bool controlled) { m_controlledByAutomation = controlled; } |
| 675 | |
| 676 | WEBCORE_EXPORT bool isAlwaysOnLoggingAllowed() const; |
| 677 | |
| 678 | String captionUserPreferencesStyleSheet(); |
| 679 | void setCaptionUserPreferencesStyleSheet(const String&); |
| 680 | |
| 681 | bool isResourceCachingDisabled() const { return m_resourceCachingDisabled || m_resourceCachingDisabledOverride; } |
| 682 | void setResourceCachingDisabled(bool disabled) { m_resourceCachingDisabled = disabled; } |
| 683 | |
| 684 | // Web Inspector can override whatever value is set via WebKit SPI, but only while it is open. |
| 685 | void setResourceCachingDisabledOverride(bool disabled) { m_resourceCachingDisabledOverride = disabled; } |
| 686 | |
| 687 | Optional<EventThrottlingBehavior> eventThrottlingBehaviorOverride() const { return m_eventThrottlingBehaviorOverride; } |
| 688 | void setEventThrottlingBehaviorOverride(Optional<EventThrottlingBehavior> throttling) { m_eventThrottlingBehaviorOverride = throttling; } |
| 689 | |
| 690 | Optional<CompositingPolicy> compositingPolicyOverride() const { return m_compositingPolicyOverride; } |
| 691 | void setCompositingPolicyOverride(Optional<CompositingPolicy> policy) { m_compositingPolicyOverride = policy; } |
| 692 | |
| 693 | WebGLStateTracker* webGLStateTracker() const { return m_webGLStateTracker.get(); } |
| 694 | |
| 695 | #if ENABLE(SPEECH_SYNTHESIS) |
| 696 | SpeechSynthesisClient* speechSynthesisClient() const { return m_speechSynthesisClient.get(); } |
| 697 | #endif |
| 698 | |
| 699 | bool isOnlyNonUtilityPage() const; |
| 700 | bool isUtilityPage() const { return m_isUtilityPage; } |
| 701 | |
| 702 | #if ENABLE(DATA_INTERACTION) |
| 703 | WEBCORE_EXPORT bool hasSelectionAtPosition(const FloatPoint&) const; |
| 704 | #endif |
| 705 | |
| 706 | bool isLowPowerModeEnabled() const; |
| 707 | WEBCORE_EXPORT void setLowPowerModeEnabledOverrideForTesting(Optional<bool>); |
| 708 | |
| 709 | WEBCORE_EXPORT void applicationWillResignActive(); |
| 710 | WEBCORE_EXPORT void applicationDidEnterBackground(); |
| 711 | WEBCORE_EXPORT void applicationWillEnterForeground(); |
| 712 | WEBCORE_EXPORT void applicationDidBecomeActive(); |
| 713 | |
| 714 | PerformanceLogging& performanceLogging() const { return *m_performanceLogging; } |
| 715 | |
| 716 | void configureLoggingChannel(const String&, WTFLogChannelState, WTFLogLevel); |
| 717 | |
| 718 | private: |
| 719 | struct Navigation { |
| 720 | RegistrableDomain domain; |
| 721 | FrameLoadType type; |
| 722 | }; |
| 723 | void logNavigation(const Navigation&); |
| 724 | |
| 725 | WEBCORE_EXPORT void initGroup(); |
| 726 | |
| 727 | void setIsInWindowInternal(bool); |
| 728 | void setIsVisibleInternal(bool); |
| 729 | void setIsVisuallyIdleInternal(bool); |
| 730 | |
| 731 | #if ASSERT_DISABLED |
| 732 | void checkSubframeCountConsistency() const { } |
| 733 | #else |
| 734 | void checkSubframeCountConsistency() const; |
| 735 | #endif |
| 736 | |
| 737 | enum ShouldHighlightMatches { DoNotHighlightMatches, HighlightMatches }; |
| 738 | enum ShouldMarkMatches { DoNotMarkMatches, MarkMatches }; |
| 739 | |
| 740 | unsigned findMatchesForText(const String&, FindOptions, unsigned maxMatchCount, ShouldHighlightMatches, ShouldMarkMatches); |
| 741 | |
| 742 | Optional<std::pair<MediaCanStartListener&, Document&>> takeAnyMediaCanStartListener(); |
| 743 | |
| 744 | #if ENABLE(VIDEO) |
| 745 | void playbackControlsManagerUpdateTimerFired(); |
| 746 | #endif |
| 747 | |
| 748 | Vector<Ref<PluginViewBase>> pluginViews(); |
| 749 | |
| 750 | void handleLowModePowerChange(bool); |
| 751 | |
| 752 | void forEachDocument(const WTF::Function<void(Document&)>&); |
| 753 | |
| 754 | enum class TimerThrottlingState { Disabled, Enabled, EnabledIncreasing }; |
| 755 | void hiddenPageDOMTimerThrottlingStateChanged(); |
| 756 | void setTimerThrottlingState(TimerThrottlingState); |
| 757 | void updateTimerThrottlingState(); |
| 758 | void updateDOMTimerAlignmentInterval(); |
| 759 | void domTimerAlignmentIntervalIncreaseTimerFired(); |
| 760 | |
| 761 | const std::unique_ptr<Chrome> m_chrome; |
| 762 | const std::unique_ptr<DragCaretController> m_dragCaretController; |
| 763 | |
| 764 | #if ENABLE(DRAG_SUPPORT) |
| 765 | const std::unique_ptr<DragController> m_dragController; |
| 766 | #endif |
| 767 | const std::unique_ptr<FocusController> m_focusController; |
| 768 | #if ENABLE(CONTEXT_MENUS) |
| 769 | const std::unique_ptr<ContextMenuController> ; |
| 770 | #endif |
| 771 | const std::unique_ptr<UserInputBridge> m_userInputBridge; |
| 772 | const std::unique_ptr<InspectorController> m_inspectorController; |
| 773 | #if ENABLE(POINTER_EVENTS) |
| 774 | const std::unique_ptr<PointerCaptureController> m_pointerCaptureController; |
| 775 | #endif |
| 776 | #if ENABLE(POINTER_LOCK) |
| 777 | const std::unique_ptr<PointerLockController> m_pointerLockController; |
| 778 | #endif |
| 779 | RefPtr<ScrollingCoordinator> m_scrollingCoordinator; |
| 780 | |
| 781 | const RefPtr<Settings> m_settings; |
| 782 | const std::unique_ptr<ProgressTracker> m_progress; |
| 783 | |
| 784 | const std::unique_ptr<BackForwardController> m_backForwardController; |
| 785 | Ref<Frame> m_mainFrame; |
| 786 | |
| 787 | RefPtr<PluginData> m_pluginData; |
| 788 | |
| 789 | UniqueRef<EditorClient> m_editorClient; |
| 790 | PlugInClient* m_plugInClient; |
| 791 | std::unique_ptr<ValidationMessageClient> m_validationMessageClient; |
| 792 | std::unique_ptr<DiagnosticLoggingClient> m_diagnosticLoggingClient; |
| 793 | std::unique_ptr<PerformanceLoggingClient> m_performanceLoggingClient; |
| 794 | |
| 795 | std::unique_ptr<WebGLStateTracker> m_webGLStateTracker; |
| 796 | |
| 797 | #if ENABLE(SPEECH_SYNTHESIS) |
| 798 | std::unique_ptr<SpeechSynthesisClient> m_speechSynthesisClient; |
| 799 | #endif |
| 800 | |
| 801 | UniqueRef<LibWebRTCProvider> m_libWebRTCProvider; |
| 802 | RTCController m_rtcController; |
| 803 | |
| 804 | int m_nestedRunLoopCount { 0 }; |
| 805 | WTF::Function<void()> m_unnestCallback; |
| 806 | |
| 807 | int m_subframeCount { 0 }; |
| 808 | String m_groupName; |
| 809 | bool m_openedByDOM { false }; |
| 810 | bool m_openedByDOMWithOpener { false }; |
| 811 | |
| 812 | bool m_tabKeyCyclesThroughElements { true }; |
| 813 | bool m_defersLoading { false }; |
| 814 | unsigned m_defersLoadingCallCount { 0 }; |
| 815 | |
| 816 | bool m_inLowQualityInterpolationMode { false }; |
| 817 | bool m_areMemoryCacheClientCallsEnabled { true }; |
| 818 | float m_mediaVolume { 1 }; |
| 819 | MediaProducer::MutedStateFlags m_mutedState { MediaProducer::NoneMuted }; |
| 820 | |
| 821 | float m_pageScaleFactor { 1 }; |
| 822 | float m_zoomedOutPageScaleFactor { 0 }; |
| 823 | float m_deviceScaleFactor { 1 }; |
| 824 | float m_viewScaleFactor { 1 }; |
| 825 | |
| 826 | float m_topContentInset { 0 }; |
| 827 | FloatBoxExtent m_obscuredInsets; |
| 828 | FloatBoxExtent m_contentInsets; |
| 829 | FloatBoxExtent m_unobscuredSafeAreaInsets; |
| 830 | FloatBoxExtent m_fullscreenInsets; |
| 831 | Seconds m_fullscreenAutoHideDuration { 0_s }; |
| 832 | |
| 833 | #if PLATFORM(IOS_FAMILY) |
| 834 | bool m_enclosedInScrollableAncestorView { false }; |
| 835 | #endif |
| 836 | |
| 837 | bool m_useSystemAppearance { false }; |
| 838 | bool m_useInactiveAppearance { false }; |
| 839 | bool m_useDarkAppearance { false }; |
| 840 | Optional<bool> m_useDarkAppearanceOverride; |
| 841 | |
| 842 | #if ENABLE(TEXT_AUTOSIZING) |
| 843 | float m_textAutosizingWidth { 0 }; |
| 844 | #endif |
| 845 | float m_initialScale { 1.0f }; |
| 846 | |
| 847 | bool m_suppressScrollbarAnimations { false }; |
| 848 | |
| 849 | unsigned m_verticalScrollElasticity : 2; // ScrollElasticity |
| 850 | unsigned m_horizontalScrollElasticity : 2; // ScrollElasticity |
| 851 | |
| 852 | Pagination ; |
| 853 | bool { false }; |
| 854 | |
| 855 | String m_userStyleSheetPath; |
| 856 | mutable String m_userStyleSheet; |
| 857 | mutable bool m_didLoadUserStyleSheet { false }; |
| 858 | mutable Optional<WallTime> m_userStyleSheetModificationTime; |
| 859 | |
| 860 | String m_captionUserPreferencesStyleSheet; |
| 861 | |
| 862 | std::unique_ptr<PageGroup> m_singlePageGroup; |
| 863 | PageGroup* m_group { nullptr }; |
| 864 | |
| 865 | JSC::Debugger* m_debugger { nullptr }; |
| 866 | |
| 867 | bool m_canStartMedia { true }; |
| 868 | |
| 869 | RefPtr<StorageNamespace> m_sessionStorage; |
| 870 | RefPtr<StorageNamespace> m_ephemeralLocalStorage; |
| 871 | |
| 872 | TimerThrottlingState m_timerThrottlingState { TimerThrottlingState::Disabled }; |
| 873 | MonotonicTime m_timerThrottlingStateLastChangedTime; |
| 874 | Seconds m_domTimerAlignmentInterval; |
| 875 | Timer m_domTimerAlignmentIntervalIncreaseTimer; |
| 876 | Seconds m_domTimerAlignmentIntervalIncreaseLimit; |
| 877 | |
| 878 | bool m_isEditable { false }; |
| 879 | bool m_isPrerender { false }; |
| 880 | OptionSet<ActivityState::Flag> m_activityState; |
| 881 | |
| 882 | OptionSet<LayoutMilestone> m_requestedLayoutMilestones; |
| 883 | |
| 884 | int { 0 }; |
| 885 | int { 0 }; |
| 886 | |
| 887 | std::unique_ptr<RenderingUpdateScheduler> m_renderingUpdateScheduler; |
| 888 | |
| 889 | HashSet<RenderObject*> m_relevantUnpaintedRenderObjects; |
| 890 | Region m_topRelevantPaintedRegion; |
| 891 | Region m_bottomRelevantPaintedRegion; |
| 892 | Region m_relevantUnpaintedRegion; |
| 893 | bool m_isCountingRelevantRepaintedObjects { false }; |
| 894 | #ifndef NDEBUG |
| 895 | bool m_isPainting { false }; |
| 896 | #endif |
| 897 | AlternativeTextClient* m_alternativeTextClient; |
| 898 | |
| 899 | bool m_scriptedAnimationsSuspended { false }; |
| 900 | const std::unique_ptr<PageConsoleClient> m_consoleClient; |
| 901 | |
| 902 | #if ENABLE(REMOTE_INSPECTOR) |
| 903 | const std::unique_ptr<PageDebuggable> m_inspectorDebuggable; |
| 904 | #endif |
| 905 | |
| 906 | #if ENABLE(INDEXED_DATABASE) |
| 907 | RefPtr<IDBClient::IDBConnectionToServer> m_idbConnectionToServer; |
| 908 | #endif |
| 909 | |
| 910 | HashSet<String> m_seenPlugins; |
| 911 | HashSet<String> m_seenMediaEngines; |
| 912 | |
| 913 | unsigned m_lastSpatialNavigationCandidatesCount { 0 }; |
| 914 | unsigned m_forbidPromptsDepth { 0 }; |
| 915 | |
| 916 | Ref<SocketProvider> m_socketProvider; |
| 917 | Ref<CookieJar> m_cookieJar; |
| 918 | Ref<ApplicationCacheStorage> m_applicationCacheStorage; |
| 919 | Ref<CacheStorageProvider> m_cacheStorageProvider; |
| 920 | Ref<DatabaseProvider> m_databaseProvider; |
| 921 | Ref<PluginInfoProvider> m_pluginInfoProvider; |
| 922 | Ref<StorageNamespaceProvider> m_storageNamespaceProvider; |
| 923 | Ref<UserContentProvider> m_userContentProvider; |
| 924 | Ref<VisitedLinkStore> m_visitedLinkStore; |
| 925 | RefPtr<WheelEventTestTrigger> m_testTrigger; |
| 926 | |
| 927 | HashSet<ActivityStateChangeObserver*> m_activityStateChangeObservers; |
| 928 | |
| 929 | #if ENABLE(RESOURCE_USAGE) |
| 930 | std::unique_ptr<ResourceUsageOverlay> m_resourceUsageOverlay; |
| 931 | #endif |
| 932 | |
| 933 | PAL::SessionID m_sessionID; |
| 934 | |
| 935 | bool m_isClosing { false }; |
| 936 | bool m_isRestoringCachedPage { false }; |
| 937 | |
| 938 | MediaProducer::MediaStateFlags m_mediaState { MediaProducer::IsNotPlaying }; |
| 939 | |
| 940 | #if ENABLE(VIDEO) |
| 941 | Timer m_playbackControlsManagerUpdateTimer; |
| 942 | #endif |
| 943 | |
| 944 | bool m_allowsMediaDocumentInlinePlayback { false }; |
| 945 | bool m_allowsPlaybackControlsForAutoplayingAudio { false }; |
| 946 | bool m_showAllPlugins { false }; |
| 947 | bool m_controlledByAutomation { false }; |
| 948 | bool m_resourceCachingDisabled { false }; |
| 949 | bool m_resourceCachingDisabledOverride { false }; |
| 950 | bool m_isUtilityPage; |
| 951 | UserInterfaceLayoutDirection m_userInterfaceLayoutDirection { UserInterfaceLayoutDirection::LTR }; |
| 952 | |
| 953 | // For testing. |
| 954 | Optional<EventThrottlingBehavior> m_eventThrottlingBehaviorOverride; |
| 955 | Optional<CompositingPolicy> m_compositingPolicyOverride; |
| 956 | |
| 957 | std::unique_ptr<PerformanceMonitor> m_performanceMonitor; |
| 958 | std::unique_ptr<LowPowerModeNotifier> m_lowPowerModeNotifier; |
| 959 | Optional<bool> m_lowPowerModeEnabledOverrideForTesting; |
| 960 | |
| 961 | Optional<Navigation> m_navigationToLogWhenVisible; |
| 962 | |
| 963 | std::unique_ptr<PerformanceLogging> m_performanceLogging; |
| 964 | #if PLATFORM(MAC) |
| 965 | Vector<ScrollLatchingState> m_latchingState; |
| 966 | #if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION) |
| 967 | std::unique_ptr<ServicesOverlayController> m_servicesOverlayController; |
| 968 | #endif |
| 969 | #endif |
| 970 | |
| 971 | std::unique_ptr<WheelEventDeltaFilter> m_recentWheelEventDeltaFilter; |
| 972 | std::unique_ptr<PageOverlayController> m_pageOverlayController; |
| 973 | |
| 974 | #if ENABLE(APPLE_PAY) |
| 975 | std::unique_ptr<PaymentCoordinator> m_paymentCoordinator; |
| 976 | #endif |
| 977 | |
| 978 | #if ENABLE(WEB_AUTHN) |
| 979 | UniqueRef<AuthenticatorCoordinator> m_authenticatorCoordinator; |
| 980 | #endif |
| 981 | |
| 982 | #if ENABLE(APPLICATION_MANIFEST) |
| 983 | Optional<ApplicationManifest> m_applicationManifest; |
| 984 | #endif |
| 985 | |
| 986 | Optional<ViewportArguments> m_overrideViewportArguments; |
| 987 | |
| 988 | bool m_shouldEnableICECandidateFilteringByDefault { true }; |
| 989 | bool m_mediaPlaybackIsSuspended { false }; |
| 990 | bool m_mediaBufferingIsSuspended { false }; |
| 991 | bool m_inUpdateRendering { false }; |
| 992 | }; |
| 993 | |
| 994 | inline PageGroup& Page::group() |
| 995 | { |
| 996 | if (!m_group) |
| 997 | initGroup(); |
| 998 | return *m_group; |
| 999 | } |
| 1000 | |
| 1001 | } // namespace WebCore |
| 1002 | |