Drop MainFrame class
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Apr 2018 18:01:41 +0000 (18:01 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Apr 2018 18:01:41 +0000 (18:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=184191

Reviewed by Darin Adler.

Source/WebCore:

Drop MainFrame class and move contents into Page / Frame since there is a 1:1
relationship between the Page and the MainFrame.

This is ground work for introducing LocalFrame / RemoteFrame concepts.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::create):
(WebCore::ApplePaySession::supportsVersion):
(WebCore::ApplePaySession::canMakePayments):
(WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
(WebCore::ApplePaySession::openPaymentSetup):
(WebCore::ApplePaySession::paymentCoordinator const):
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::paymentCoordinator):
* Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
* Modules/mediastream/UserMediaRequest.cpp:
* Modules/plugins/QuickTimePluginReplacement.mm:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::mainFrame const):
(WebCore::AccessibilityObject::visiblePositionForBounds const):
* accessibility/AccessibilityObject.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
* bindings/js/ScriptController.cpp:
* bindings/js/ScriptState.cpp:
* contentextensions/ContentExtensionsBackend.cpp:
* css/MediaQueryEvaluator.cpp:
(WebCore::displayModeEvaluate):
* dom/DOMImplementation.cpp:
* dom/Document.cpp:
* dom/DocumentMarkerController.cpp:
* dom/Element.cpp:
(WebCore::Element::removedFromAncestor):
* dom/EventDispatcher.cpp:
* dom/ScriptedAnimationController.cpp:
* editing/Editor.cpp:
(WebCore::Editor::scanSelectionForTelephoneNumbers):
* editing/EditorCommand.cpp:
* editing/SelectionRectGatherer.cpp:
(WebCore::SelectionRectGatherer::Notifier::~Notifier):
* editing/cocoa/WebContentReaderCocoa.mm:
* editing/markup.cpp:
* history/CachedFrame.cpp:
* history/CachedPage.cpp:
* history/PageCache.cpp:
(WebCore::destroyRenderTree):
* html/HTMLMediaElement.cpp:
* html/HTMLPlugInImageElement.cpp:
* html/ImageDocument.cpp:
* html/MediaElementSession.cpp:
(WebCore::isMainContentForPurposesOfAutoplay):
* html/canvas/WebGLRenderingContextBase.cpp:
* inspector/InspectorClient.cpp:
* inspector/InspectorController.cpp:
* inspector/InspectorFrontendClientLocal.cpp:
* inspector/InspectorFrontendHost.cpp:
* inspector/InspectorInstrumentation.cpp:
* inspector/InspectorOverlay.cpp:
* inspector/PageScriptDebugServer.cpp:
* inspector/agents/InspectorApplicationCacheAgent.cpp:
* inspector/agents/InspectorCanvasAgent.cpp:
* inspector/agents/InspectorDOMAgent.cpp:
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::mainFrame):
* inspector/agents/InspectorPageAgent.h:
* inspector/agents/page/PageDebuggerAgent.cpp:
* inspector/agents/page/PageRuntimeAgent.cpp:
* loader/DocumentLoader.cpp:
* loader/DocumentWriter.cpp:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::setState):
* loader/HistoryController.cpp:
* loader/NavigationDisabler.h:
* loader/ProgressTracker.cpp:
* loader/ResourceLoadObserver.cpp:
* loader/ResourceLoader.cpp:
* loader/SubframeLoader.cpp:
* loader/SubresourceLoader.cpp:
* loader/appcache/ApplicationCacheHost.cpp:
* loader/archive/mhtml/MHTMLArchive.cpp:
* loader/cache/CachedResource.cpp:
* loader/cache/CachedResourceLoader.cpp:
* page/AutoscrollController.cpp:
* page/Chrome.cpp:
* page/ContextMenuController.cpp:
* page/DOMWindow.cpp:
* page/DebugPageOverlays.cpp:
(WebCore::MouseWheelRegionOverlay::updateRegion):
(WebCore::NonFastScrollableRegionOverlay::updateRegion):
(WebCore::RegionOverlay::create):
(WebCore::RegionOverlay::RegionOverlay):
(WebCore::RegionOverlay::~RegionOverlay):
(WebCore::DebugPageOverlays::ensureRegionOverlayForPage):
(WebCore::DebugPageOverlays::showRegionOverlay):
(WebCore::DebugPageOverlays::hideRegionOverlay):
(WebCore::DebugPageOverlays::regionChanged):
(WebCore::DebugPageOverlays::regionOverlayForPage const):
(WebCore::DebugPageOverlays::updateOverlayRegionVisibility):
(WebCore::DebugPageOverlays::settingsChanged):
* page/DebugPageOverlays.h:
(WebCore::DebugPageOverlays::hasOverlaysForPage const):
(WebCore::DebugPageOverlays::hasOverlays):
(WebCore::DebugPageOverlays::didLayout):
(WebCore::DebugPageOverlays::didChangeEventHandlers):
* page/DragController.cpp:
(WebCore::DragController::performDragOperation):
(WebCore::DragController::tryDHTMLDrag):
(WebCore::DragController::beginDrag):
(WebCore::DragController::doSystemDrag):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
(WebCore::EventHandler::handleWheelEvent):
(WebCore::EventHandler::clearLatchedState):
(WebCore::EventHandler::defaultWheelEventHandler):
* page/FocusController.cpp:
* page/Frame.cpp:
(WebCore::Frame::Frame):
(WebCore::Frame::dropChildren):
(WebCore::Frame::selfOnlyRef):
(WebCore::Frame::selfOnlyDeref):
* page/Frame.h:
(WebCore::Frame::mainFrame const):
* page/FrameTree.cpp:
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
(WebCore::FrameView::setContentsSize):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::setViewExposedRect):
* page/History.cpp:
* page/MainFrame.cpp: Removed.
* page/MainFrame.h: Removed.
* page/MemoryRelease.cpp:
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::m_applicationManifest):
(WebCore::Page::setDeviceScaleFactor):
(WebCore::Page::latchingState):
(WebCore::Page::pushNewLatchingState):
(WebCore::Page::resetLatchingState):
(WebCore::Page::popLatchingState):
(WebCore::Page::removeLatchingStateForTarget):
(WebCore::Page::setPaymentCoordinator):
* page/Page.h:
(WebCore::Page::mainFrame):
(WebCore::Page::mainFrame const):
(WebCore::Page::wheelEventDeltaFilter):
(WebCore::Page::pageOverlayController):
(WebCore::Page::servicesOverlayController):
(WebCore::Page::paymentCoordinator const):
(WebCore::Page::applicationManifest const):
(WebCore::Page::performanceLogging const):
* page/PageConsoleClient.cpp:
* page/PageDebuggable.cpp:
* page/PageGroup.cpp:
* page/PageGroupLoadDeferrer.cpp:
* page/PageOverlay.cpp:
(WebCore::PageOverlay::controller const):
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
(WebCore::PageOverlayController::layerWithDocumentOverlays):
(WebCore::PageOverlayController::layerWithViewOverlays):
(WebCore::PageOverlayController::installPageOverlay):
(WebCore::PageOverlayController::updateForceSynchronousScrollLayerPositionUpdates):
(WebCore::PageOverlayController::didChangeViewExposedRect):
(WebCore::PageOverlayController::updateSettingsForLayer):
(WebCore::PageOverlayController::deviceScaleFactor const):
(WebCore::PageOverlayController::notifyFlushRequired):
(WebCore::PageOverlayController::tiledBackingUsageChanged):
* page/PageOverlayController.h:
* page/PageSerializer.cpp:
* page/PerformanceLogging.cpp:
(WebCore::PerformanceLogging::PerformanceLogging):
(WebCore::PerformanceLogging::didReachPointOfInterest):
* page/PerformanceLogging.h:
* page/PerformanceMonitor.cpp:
* page/ResourceUsageOverlay.cpp:
(WebCore::ResourceUsageOverlay::~ResourceUsageOverlay):
(WebCore::ResourceUsageOverlay::initialize):
* page/SettingsBase.cpp:
* page/SpatialNavigation.cpp:
* page/UserContentProvider.cpp:
* page/ios/FrameIOS.mm:
* page/mac/DragControllerMac.mm:
* page/mac/EventHandlerMac.mm:
(WebCore::latchingIsLockedToPlatformFrame):
(WebCore::latchingIsLockedToAncestorOfThisFrame):
(WebCore::EventHandler::clearOrScheduleClearingLatchedStateIfNeeded):
(WebCore::EventHandler::platformPrepareForWheelEvents):
(WebCore::EventHandler::platformRecordWheelEvent):
(WebCore::EventHandler::platformCompleteWheelEvent):
(WebCore::EventHandler::platformCompletePlatformWidgetWheelEvent):
* page/mac/PageMac.mm:
* page/mac/ServicesOverlayController.h:
(WebCore::ServicesOverlayController::page const):
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::Highlight):
(WebCore::ServicesOverlayController::Highlight::notifyFlushRequired):
(WebCore::ServicesOverlayController::Highlight::deviceScaleFactor const):
(WebCore::ServicesOverlayController::ServicesOverlayController):
(WebCore::ServicesOverlayController::invalidateHighlightsOfType):
(WebCore::ServicesOverlayController::buildPotentialHighlightsIfNeeded):
(WebCore::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown const):
(WebCore::ServicesOverlayController::buildPhoneNumberHighlights):
(WebCore::ServicesOverlayController::buildSelectionHighlight):
(WebCore::ServicesOverlayController::hasRelevantSelectionServices):
(WebCore::ServicesOverlayController::createOverlayIfNeeded):
(WebCore::ServicesOverlayController::telephoneNumberRangesForFocusedFrame):
(WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight):
(WebCore::ServicesOverlayController::mouseEvent):
(WebCore::ServicesOverlayController::handleClick):
(WebCore::ServicesOverlayController::mainFrame const):
* page/scrolling/AsyncScrollingCoordinator.cpp:
* page/scrolling/ScrollingCoordinator.cpp:
* page/scrolling/ios/ScrollingCoordinatorIOS.mm:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
* plugins/DOMMimeType.cpp:
* plugins/PluginInfoProvider.cpp:
(WebCore::PluginInfoProvider::refresh):
* rendering/RenderBox.cpp:
* rendering/RenderLayer.cpp:
* rendering/RenderLayerBacking.cpp:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers const):
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderObject.cpp:
* replay/UserInputBridge.cpp:
* storage/StorageEventDispatcher.cpp:
* style/StyleTreeResolver.cpp:
(WebCore::Style::suspendMemoryCacheClientCalls):
* svg/SVGSVGElement.cpp:
* svg/graphics/SVGImage.cpp:
* testing/InternalSettings.cpp:
* testing/Internals.cpp:
(WebCore::Internals::Internals):
(WebCore::Internals::installMockPageOverlay):
(WebCore::Internals::pageOverlayLayerTreeAsText const):
* testing/MockPageOverlay.cpp:
* testing/MockPageOverlay.h:
* testing/MockPageOverlayClient.cpp:
(WebCore::MockPageOverlayClient::installOverlay):
(WebCore::MockPageOverlayClient::layerTreeAsText):
* testing/MockPageOverlayClient.h:
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::MockPaymentCoordinator):
(WebCore::MockPaymentCoordinator::showPaymentUI):
(WebCore::MockPaymentCoordinator::completeMerchantValidation):
(WebCore::MockPaymentCoordinator::changeShippingOption):
(WebCore::MockPaymentCoordinator::changePaymentMethod):
(WebCore::MockPaymentCoordinator::acceptPayment):
(WebCore::MockPaymentCoordinator::cancelPayment):
* testing/MockPaymentCoordinator.h:
* workers/service/context/ServiceWorkerThreadProxy.cpp:

Source/WebKit:

Drop MainFrame class and move contents into Page / Frame since there is a 1:1
relationship between the Page and the MainFrame.

This is ground work for introducing LocalFrame / RemoteFrame concepts.

* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::paymentCoordinator):
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
* WebProcess/FullScreen/WebFullScreenManager.cpp:
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
* WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
* WebProcess/Plugins/PluginView.cpp:
* WebProcess/Plugins/WebPluginInfoProvider.cpp:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
* WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::~WebInspectorClient):
(WebKit::WebInspectorClient::highlight):
(WebKit::WebInspectorClient::hideHighlight):
(WebKit::WebInspectorClient::showPaintRect):
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
* WebProcess/WebCoreSupport/WebProgressTrackerClient.cpp:
* WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::updateFindUIAfterPageScroll):
(WebKit::FindController::hideFindUI):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::updatePreferences):
* WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm:
* WebProcess/WebPage/WebBackForwardListProxy.cpp:
* WebProcess/WebPage/WebFrame.cpp:
* WebProcess/WebPage/WebInspector.cpp:
* WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.cpp:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::mainFrame const):
(WebKit::WebPage::determinePrimarySnapshottedPlugIn):
(WebKit::WebPage::plugInIntersectsSearchRect):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/WebPageIOS.mm:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::updatePreferences):
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performImmediateActionHitTestAtLocation):
(WebKit::WebPage::dataDetectorsDidPresentUI):
(WebKit::WebPage::dataDetectorsDidChangeUI):
(WebKit::WebPage::dataDetectorsDidHideUI):
* WebProcess/WebProcess.cpp:
* WebProcess/WebStorage/StorageAreaMap.cpp:

Source/WebKitLegacy/mac:

Drop MainFrame class and move contents into Page / Frame since there is a 1:1
relationship between the Page and the MainFrame.

This is ground work for introducing LocalFrame / RemoteFrame concepts.

* WebCoreSupport/WebDragClient.mm:
* WebCoreSupport/WebFrameLoaderClient.mm:
* WebCoreSupport/WebInspectorClient.mm:
* WebCoreSupport/WebPlatformStrategies.mm:
* WebCoreSupport/WebPluginInfoProvider.mm:
* WebView/WebFrame.mm:
* WebView/WebFrameView.mm:
* WebView/WebHTMLView.mm:
* WebView/WebView.mm:

Source/WebKitLegacy/win:

Drop MainFrame class and move contents into Page / Frame since there is a 1:1
relationship between the Page and the MainFrame.

This is ground work for introducing LocalFrame / RemoteFrame concepts.

* WebCoreSupport/AcceleratedCompositingContext.cpp:
* WebCoreSupport/WebContextMenuClient.cpp:
* WebCoreSupport/WebDragClient.cpp:
* WebDropSource.cpp:
* WebFrame.cpp:
* WebView.cpp:

Tools:

* TestWebKitAPI/Tests/WebCore/cocoa/WebCoreNSURLSession.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230211 268f45cc-cd09-0410-ab3c-d52691b4dbfc

191 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/applepay/ApplePaySession.cpp
Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp
Source/WebCore/Modules/mediastream/MediaDevicesEnumerationRequest.cpp
Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Source/WebCore/bindings/js/ScriptController.cpp
Source/WebCore/bindings/js/ScriptState.cpp
Source/WebCore/contentextensions/ContentExtensionsBackend.cpp
Source/WebCore/css/MediaQueryEvaluator.cpp
Source/WebCore/dom/DOMImplementation.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/DocumentMarkerController.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/EventDispatcher.cpp
Source/WebCore/dom/ScriptedAnimationController.cpp
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/EditorCommand.cpp
Source/WebCore/editing/SelectionRectGatherer.cpp
Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm
Source/WebCore/editing/markup.cpp
Source/WebCore/history/CachedFrame.cpp
Source/WebCore/history/CachedPage.cpp
Source/WebCore/history/PageCache.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLPlugInImageElement.cpp
Source/WebCore/html/ImageDocument.cpp
Source/WebCore/html/MediaElementSession.cpp
Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
Source/WebCore/inspector/InspectorClient.cpp
Source/WebCore/inspector/InspectorController.cpp
Source/WebCore/inspector/InspectorFrontendClientLocal.cpp
Source/WebCore/inspector/InspectorFrontendHost.cpp
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorOverlay.cpp
Source/WebCore/inspector/PageScriptDebugServer.cpp
Source/WebCore/inspector/agents/InspectorApplicationCacheAgent.cpp
Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp
Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
Source/WebCore/inspector/agents/InspectorPageAgent.cpp
Source/WebCore/inspector/agents/InspectorPageAgent.h
Source/WebCore/inspector/agents/page/PageDebuggerAgent.cpp
Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp
Source/WebCore/loader/DocumentLoader.cpp
Source/WebCore/loader/DocumentWriter.cpp
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/HistoryController.cpp
Source/WebCore/loader/NavigationDisabler.h
Source/WebCore/loader/ProgressTracker.cpp
Source/WebCore/loader/ResourceLoadObserver.cpp
Source/WebCore/loader/ResourceLoader.cpp
Source/WebCore/loader/SubframeLoader.cpp
Source/WebCore/loader/SubresourceLoader.cpp
Source/WebCore/loader/appcache/ApplicationCacheHost.cpp
Source/WebCore/loader/archive/mhtml/MHTMLArchive.cpp
Source/WebCore/loader/cache/CachedResource.cpp
Source/WebCore/loader/cache/CachedResourceLoader.cpp
Source/WebCore/page/AutoscrollController.cpp
Source/WebCore/page/Chrome.cpp
Source/WebCore/page/ContextMenuController.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/DebugPageOverlays.cpp
Source/WebCore/page/DebugPageOverlays.h
Source/WebCore/page/DragController.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/FocusController.cpp
Source/WebCore/page/Frame.cpp
Source/WebCore/page/Frame.h
Source/WebCore/page/FrameTree.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/History.cpp
Source/WebCore/page/MainFrame.cpp [deleted file]
Source/WebCore/page/MainFrame.h [deleted file]
Source/WebCore/page/MemoryRelease.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/page/PageConsoleClient.cpp
Source/WebCore/page/PageDebuggable.cpp
Source/WebCore/page/PageGroup.cpp
Source/WebCore/page/PageGroupLoadDeferrer.cpp
Source/WebCore/page/PageOverlay.cpp
Source/WebCore/page/PageOverlayController.cpp
Source/WebCore/page/PageOverlayController.h
Source/WebCore/page/PageSerializer.cpp
Source/WebCore/page/PerformanceLogging.cpp
Source/WebCore/page/PerformanceLogging.h
Source/WebCore/page/PerformanceMonitor.cpp
Source/WebCore/page/ResourceUsageOverlay.cpp
Source/WebCore/page/SettingsBase.cpp
Source/WebCore/page/SpatialNavigation.cpp
Source/WebCore/page/UserContentProvider.cpp
Source/WebCore/page/ios/FrameIOS.mm
Source/WebCore/page/mac/DragControllerMac.mm
Source/WebCore/page/mac/EventHandlerMac.mm
Source/WebCore/page/mac/PageMac.mm
Source/WebCore/page/mac/ServicesOverlayController.h
Source/WebCore/page/mac/ServicesOverlayController.mm
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
Source/WebCore/page/scrolling/ios/ScrollingCoordinatorIOS.mm
Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp
Source/WebCore/plugins/DOMMimeType.cpp
Source/WebCore/plugins/PluginInfoProvider.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/replay/UserInputBridge.cpp
Source/WebCore/storage/StorageEventDispatcher.cpp
Source/WebCore/style/StyleTreeResolver.cpp
Source/WebCore/svg/SVGSVGElement.cpp
Source/WebCore/svg/graphics/SVGImage.cpp
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/MockPageOverlay.cpp
Source/WebCore/testing/MockPageOverlay.h
Source/WebCore/testing/MockPageOverlayClient.cpp
Source/WebCore/testing/MockPageOverlayClient.h
Source/WebCore/testing/MockPaymentCoordinator.cpp
Source/WebCore/testing/MockPaymentCoordinator.h
Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebRenderLayer.cpp
Source/WebKit/Shared/WebRenderObject.cpp
Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp
Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp
Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.cpp
Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp
Source/WebKit/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm
Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm
Source/WebKit/WebProcess/Plugins/PluginView.cpp
Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.cpp
Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit/WebProcess/WebCoreSupport/WebContextMenuClient.cpp
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit/WebProcess/WebCoreSupport/WebInspectorClient.cpp
Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
Source/WebKit/WebProcess/WebCoreSupport/WebProgressTrackerClient.cpp
Source/WebKit/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm
Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm
Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.cpp
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp
Source/WebKit/WebProcess/WebPage/FindController.cpp
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm
Source/WebKit/WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm
Source/WebKit/WebProcess/WebPage/WebBackForwardListProxy.cpp
Source/WebKit/WebProcess/WebPage/WebFrame.cpp
Source/WebKit/WebProcess/WebPage/WebInspector.cpp
Source/WebKit/WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.cpp
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKit/WebProcess/WebPage/WebPage.h
Source/WebKit/WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp
Source/WebKit/WebProcess/WebPage/ios/FindControllerIOS.mm
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm
Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm
Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm
Source/WebKit/WebProcess/WebProcess.cpp
Source/WebKit/WebProcess/WebStorage/StorageAreaMap.cpp
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebCoreSupport/WebDragClient.mm
Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm
Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.mm
Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.mm
Source/WebKitLegacy/mac/WebView/WebFrame.mm
Source/WebKitLegacy/mac/WebView/WebFrameView.mm
Source/WebKitLegacy/mac/WebView/WebHTMLView.mm
Source/WebKitLegacy/mac/WebView/WebView.mm
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp
Source/WebKitLegacy/win/WebCoreSupport/WebContextMenuClient.cpp
Source/WebKitLegacy/win/WebCoreSupport/WebDragClient.cpp
Source/WebKitLegacy/win/WebDropSource.cpp
Source/WebKitLegacy/win/WebFrame.cpp
Source/WebKitLegacy/win/WebView.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebCore/cocoa/WebCoreNSURLSession.mm

index 253904e1def4f3c22170b9a354dad7e7ff924b8d..6f54dbcdc12d127510f0c8d4dac9d984202ddcf3 100644 (file)
@@ -1,3 +1,273 @@
+2018-04-03  Chris Dumez  <cdumez@apple.com>
+
+        Drop MainFrame class
+        https://bugs.webkit.org/show_bug.cgi?id=184191
+
+        Reviewed by Darin Adler.
+
+        Drop MainFrame class and move contents into Page / Frame since there is a 1:1
+        relationship between the Page and the MainFrame.
+
+        This is ground work for introducing LocalFrame / RemoteFrame concepts.
+
+        * Modules/applepay/ApplePaySession.cpp:
+        (WebCore::ApplePaySession::create):
+        (WebCore::ApplePaySession::supportsVersion):
+        (WebCore::ApplePaySession::canMakePayments):
+        (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
+        (WebCore::ApplePaySession::openPaymentSetup):
+        (WebCore::ApplePaySession::paymentCoordinator const):
+        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
+        (WebCore::paymentCoordinator):
+        * Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
+        * Modules/mediastream/UserMediaRequest.cpp:
+        * Modules/plugins/QuickTimePluginReplacement.mm:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::mainFrame const):
+        (WebCore::AccessibilityObject::visiblePositionForBounds const):
+        * accessibility/AccessibilityObject.h:
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        * bindings/js/ScriptController.cpp:
+        * bindings/js/ScriptState.cpp:
+        * contentextensions/ContentExtensionsBackend.cpp:
+        * css/MediaQueryEvaluator.cpp:
+        (WebCore::displayModeEvaluate):
+        * dom/DOMImplementation.cpp:
+        * dom/Document.cpp:
+        * dom/DocumentMarkerController.cpp:
+        * dom/Element.cpp:
+        (WebCore::Element::removedFromAncestor):
+        * dom/EventDispatcher.cpp:
+        * dom/ScriptedAnimationController.cpp:
+        * editing/Editor.cpp:
+        (WebCore::Editor::scanSelectionForTelephoneNumbers):
+        * editing/EditorCommand.cpp:
+        * editing/SelectionRectGatherer.cpp:
+        (WebCore::SelectionRectGatherer::Notifier::~Notifier):
+        * editing/cocoa/WebContentReaderCocoa.mm:
+        * editing/markup.cpp:
+        * history/CachedFrame.cpp:
+        * history/CachedPage.cpp:
+        * history/PageCache.cpp:
+        (WebCore::destroyRenderTree):
+        * html/HTMLMediaElement.cpp:
+        * html/HTMLPlugInImageElement.cpp:
+        * html/ImageDocument.cpp:
+        * html/MediaElementSession.cpp:
+        (WebCore::isMainContentForPurposesOfAutoplay):
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        * inspector/InspectorClient.cpp:
+        * inspector/InspectorController.cpp:
+        * inspector/InspectorFrontendClientLocal.cpp:
+        * inspector/InspectorFrontendHost.cpp:
+        * inspector/InspectorInstrumentation.cpp:
+        * inspector/InspectorOverlay.cpp:
+        * inspector/PageScriptDebugServer.cpp:
+        * inspector/agents/InspectorApplicationCacheAgent.cpp:
+        * inspector/agents/InspectorCanvasAgent.cpp:
+        * inspector/agents/InspectorDOMAgent.cpp:
+        * inspector/agents/InspectorPageAgent.cpp:
+        (WebCore::InspectorPageAgent::mainFrame):
+        * inspector/agents/InspectorPageAgent.h:
+        * inspector/agents/page/PageDebuggerAgent.cpp:
+        * inspector/agents/page/PageRuntimeAgent.cpp:
+        * loader/DocumentLoader.cpp:
+        * loader/DocumentWriter.cpp:
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::loadWithDocumentLoader):
+        (WebCore::FrameLoader::setState):
+        * loader/HistoryController.cpp:
+        * loader/NavigationDisabler.h:
+        * loader/ProgressTracker.cpp:
+        * loader/ResourceLoadObserver.cpp:
+        * loader/ResourceLoader.cpp:
+        * loader/SubframeLoader.cpp:
+        * loader/SubresourceLoader.cpp:
+        * loader/appcache/ApplicationCacheHost.cpp:
+        * loader/archive/mhtml/MHTMLArchive.cpp:
+        * loader/cache/CachedResource.cpp:
+        * loader/cache/CachedResourceLoader.cpp:
+        * page/AutoscrollController.cpp:
+        * page/Chrome.cpp:
+        * page/ContextMenuController.cpp:
+        * page/DOMWindow.cpp:
+        * page/DebugPageOverlays.cpp:
+        (WebCore::MouseWheelRegionOverlay::updateRegion):
+        (WebCore::NonFastScrollableRegionOverlay::updateRegion):
+        (WebCore::RegionOverlay::create):
+        (WebCore::RegionOverlay::RegionOverlay):
+        (WebCore::RegionOverlay::~RegionOverlay):
+        (WebCore::DebugPageOverlays::ensureRegionOverlayForPage):
+        (WebCore::DebugPageOverlays::showRegionOverlay):
+        (WebCore::DebugPageOverlays::hideRegionOverlay):
+        (WebCore::DebugPageOverlays::regionChanged):
+        (WebCore::DebugPageOverlays::regionOverlayForPage const):
+        (WebCore::DebugPageOverlays::updateOverlayRegionVisibility):
+        (WebCore::DebugPageOverlays::settingsChanged):
+        * page/DebugPageOverlays.h:
+        (WebCore::DebugPageOverlays::hasOverlaysForPage const):
+        (WebCore::DebugPageOverlays::hasOverlays):
+        (WebCore::DebugPageOverlays::didLayout):
+        (WebCore::DebugPageOverlays::didChangeEventHandlers):
+        * page/DragController.cpp:
+        (WebCore::DragController::performDragOperation):
+        (WebCore::DragController::tryDHTMLDrag):
+        (WebCore::DragController::beginDrag):
+        (WebCore::DragController::doSystemDrag):
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::handleMousePressEvent):
+        (WebCore::EventHandler::mouseMoved):
+        (WebCore::EventHandler::handleMouseReleaseEvent):
+        (WebCore::EventHandler::handleWheelEvent):
+        (WebCore::EventHandler::clearLatchedState):
+        (WebCore::EventHandler::defaultWheelEventHandler):
+        * page/FocusController.cpp:
+        * page/Frame.cpp:
+        (WebCore::Frame::Frame):
+        (WebCore::Frame::dropChildren):
+        (WebCore::Frame::selfOnlyRef):
+        (WebCore::Frame::selfOnlyDeref):
+        * page/Frame.h:
+        (WebCore::Frame::mainFrame const):
+        * page/FrameTree.cpp:
+        * page/FrameView.cpp:
+        (WebCore::FrameView::setFrameRect):
+        (WebCore::FrameView::setContentsSize):
+        (WebCore::FrameView::didChangeScrollOffset):
+        (WebCore::FrameView::setViewExposedRect):
+        * page/History.cpp:
+        * page/MainFrame.cpp: Removed.
+        * page/MainFrame.h: Removed.
+        * page/MemoryRelease.cpp:
+        * page/Page.cpp:
+        (WebCore::Page::Page):
+        (WebCore::m_applicationManifest):
+        (WebCore::Page::setDeviceScaleFactor):
+        (WebCore::Page::latchingState):
+        (WebCore::Page::pushNewLatchingState):
+        (WebCore::Page::resetLatchingState):
+        (WebCore::Page::popLatchingState):
+        (WebCore::Page::removeLatchingStateForTarget):
+        (WebCore::Page::setPaymentCoordinator):
+        * page/Page.h:
+        (WebCore::Page::mainFrame):
+        (WebCore::Page::mainFrame const):
+        (WebCore::Page::wheelEventDeltaFilter):
+        (WebCore::Page::pageOverlayController):
+        (WebCore::Page::servicesOverlayController):
+        (WebCore::Page::paymentCoordinator const):
+        (WebCore::Page::applicationManifest const):
+        (WebCore::Page::performanceLogging const):
+        * page/PageConsoleClient.cpp:
+        * page/PageDebuggable.cpp:
+        * page/PageGroup.cpp:
+        * page/PageGroupLoadDeferrer.cpp:
+        * page/PageOverlay.cpp:
+        (WebCore::PageOverlay::controller const):
+        * page/PageOverlayController.cpp:
+        (WebCore::PageOverlayController::PageOverlayController):
+        (WebCore::PageOverlayController::createRootLayersIfNeeded):
+        (WebCore::PageOverlayController::layerWithDocumentOverlays):
+        (WebCore::PageOverlayController::layerWithViewOverlays):
+        (WebCore::PageOverlayController::installPageOverlay):
+        (WebCore::PageOverlayController::updateForceSynchronousScrollLayerPositionUpdates):
+        (WebCore::PageOverlayController::didChangeViewExposedRect):
+        (WebCore::PageOverlayController::updateSettingsForLayer):
+        (WebCore::PageOverlayController::deviceScaleFactor const):
+        (WebCore::PageOverlayController::notifyFlushRequired):
+        (WebCore::PageOverlayController::tiledBackingUsageChanged):
+        * page/PageOverlayController.h:
+        * page/PageSerializer.cpp:
+        * page/PerformanceLogging.cpp:
+        (WebCore::PerformanceLogging::PerformanceLogging):
+        (WebCore::PerformanceLogging::didReachPointOfInterest):
+        * page/PerformanceLogging.h:
+        * page/PerformanceMonitor.cpp:
+        * page/ResourceUsageOverlay.cpp:
+        (WebCore::ResourceUsageOverlay::~ResourceUsageOverlay):
+        (WebCore::ResourceUsageOverlay::initialize):
+        * page/SettingsBase.cpp:
+        * page/SpatialNavigation.cpp:
+        * page/UserContentProvider.cpp:
+        * page/ios/FrameIOS.mm:
+        * page/mac/DragControllerMac.mm:
+        * page/mac/EventHandlerMac.mm:
+        (WebCore::latchingIsLockedToPlatformFrame):
+        (WebCore::latchingIsLockedToAncestorOfThisFrame):
+        (WebCore::EventHandler::clearOrScheduleClearingLatchedStateIfNeeded):
+        (WebCore::EventHandler::platformPrepareForWheelEvents):
+        (WebCore::EventHandler::platformRecordWheelEvent):
+        (WebCore::EventHandler::platformCompleteWheelEvent):
+        (WebCore::EventHandler::platformCompletePlatformWidgetWheelEvent):
+        * page/mac/PageMac.mm:
+        * page/mac/ServicesOverlayController.h:
+        (WebCore::ServicesOverlayController::page const):
+        * page/mac/ServicesOverlayController.mm:
+        (WebCore::ServicesOverlayController::Highlight::Highlight):
+        (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired):
+        (WebCore::ServicesOverlayController::Highlight::deviceScaleFactor const):
+        (WebCore::ServicesOverlayController::ServicesOverlayController):
+        (WebCore::ServicesOverlayController::invalidateHighlightsOfType):
+        (WebCore::ServicesOverlayController::buildPotentialHighlightsIfNeeded):
+        (WebCore::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown const):
+        (WebCore::ServicesOverlayController::buildPhoneNumberHighlights):
+        (WebCore::ServicesOverlayController::buildSelectionHighlight):
+        (WebCore::ServicesOverlayController::hasRelevantSelectionServices):
+        (WebCore::ServicesOverlayController::createOverlayIfNeeded):
+        (WebCore::ServicesOverlayController::telephoneNumberRangesForFocusedFrame):
+        (WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight):
+        (WebCore::ServicesOverlayController::mouseEvent):
+        (WebCore::ServicesOverlayController::handleClick):
+        (WebCore::ServicesOverlayController::mainFrame const):
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        * page/scrolling/ScrollingCoordinator.cpp:
+        * page/scrolling/ios/ScrollingCoordinatorIOS.mm:
+        * page/scrolling/mac/ScrollingCoordinatorMac.mm:
+        * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
+        * plugins/DOMMimeType.cpp:
+        * plugins/PluginInfoProvider.cpp:
+        (WebCore::PluginInfoProvider::refresh):
+        * rendering/RenderBox.cpp:
+        * rendering/RenderLayer.cpp:
+        * rendering/RenderLayerBacking.cpp:
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers const):
+        (WebCore::RenderLayerCompositor::updateCompositingLayers):
+        (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
+        (WebCore::RenderLayerCompositor::attachRootLayer):
+        (WebCore::RenderLayerCompositor::detachRootLayer):
+        (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
+        * rendering/RenderObject.cpp:
+        * replay/UserInputBridge.cpp:
+        * storage/StorageEventDispatcher.cpp:
+        * style/StyleTreeResolver.cpp:
+        (WebCore::Style::suspendMemoryCacheClientCalls):
+        * svg/SVGSVGElement.cpp:
+        * svg/graphics/SVGImage.cpp:
+        * testing/InternalSettings.cpp:
+        * testing/Internals.cpp:
+        (WebCore::Internals::Internals):
+        (WebCore::Internals::installMockPageOverlay):
+        (WebCore::Internals::pageOverlayLayerTreeAsText const):
+        * testing/MockPageOverlay.cpp:
+        * testing/MockPageOverlay.h:
+        * testing/MockPageOverlayClient.cpp:
+        (WebCore::MockPageOverlayClient::installOverlay):
+        (WebCore::MockPageOverlayClient::layerTreeAsText):
+        * testing/MockPageOverlayClient.h:
+        * testing/MockPaymentCoordinator.cpp:
+        (WebCore::MockPaymentCoordinator::MockPaymentCoordinator):
+        (WebCore::MockPaymentCoordinator::showPaymentUI):
+        (WebCore::MockPaymentCoordinator::completeMerchantValidation):
+        (WebCore::MockPaymentCoordinator::changeShippingOption):
+        (WebCore::MockPaymentCoordinator::changePaymentMethod):
+        (WebCore::MockPaymentCoordinator::acceptPayment):
+        (WebCore::MockPaymentCoordinator::cancelPayment):
+        * testing/MockPaymentCoordinator.h:
+        * workers/service/context/ServiceWorkerThreadProxy.cpp:
+
 2018-04-03  Sihui Liu  <sihui_liu@apple.com>
 
         The referer header is not set after redirect
index bed5e38e3c4dce04db9016e918c6c953350f8884..093b86fa67c1f5057cedd838420edee7d5e7f41d 100644 (file)
 #include "Document.h"
 #include "DocumentLoader.h"
 #include "EventNames.h"
+#include "Frame.h"
 #include "JSDOMPromiseDeferred.h"
 #include "LinkIconCollector.h"
 #include "LinkIconType.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PageConsoleClient.h"
 #include "PaymentAuthorizationStatus.h"
@@ -403,7 +403,10 @@ ExceptionOr<Ref<ApplePaySession>> ApplePaySession::create(Document& document, un
     if (!UserGestureIndicator::processingUserGesture())
         return Exception { InvalidAccessError, "Must create a new ApplePaySession from a user gesture handler." };
 
-    auto& paymentCoordinator = document.frame()->mainFrame().paymentCoordinator();
+    if (!document.page())
+        return Exception { InvalidAccessError, "Frame is detached" };
+
+    auto& paymentCoordinator = document.page()->paymentCoordinator();
 
     if (!version || !paymentCoordinator.supportsVersion(version))
         return Exception { InvalidAccessError, makeString("\"" + String::number(version), "\" is not a supported version.") };
@@ -420,7 +423,7 @@ ApplePaySession::ApplePaySession(Document& document, unsigned version, ApplePayS
     , m_paymentRequest { WTFMove(paymentRequest) }
     , m_version { version }
 {
-    ASSERT(document.frame()->mainFrame().paymentCoordinator().supportsVersion(version));
+    ASSERT(document.page()->paymentCoordinator().supportsVersion(version));
     suspendIfNeeded();
 }
 
@@ -437,7 +440,11 @@ ExceptionOr<bool> ApplePaySession::supportsVersion(ScriptExecutionContext& scrip
     if (canCall.hasException())
         return canCall.releaseException();
 
-    return document.frame()->mainFrame().paymentCoordinator().supportsVersion(version);
+    auto* page = document.page();
+    if (!page)
+        return Exception { InvalidAccessError };
+
+    return page->paymentCoordinator().supportsVersion(version);
 }
 
 static bool shouldDiscloseApplePayCapability(Document& document)
@@ -457,7 +464,11 @@ ExceptionOr<bool> ApplePaySession::canMakePayments(ScriptExecutionContext& scrip
     if (canCall.hasException())
         return canCall.releaseException();
 
-    return document.frame()->mainFrame().paymentCoordinator().canMakePayments();
+    auto* page = document.page();
+    if (!page)
+        return Exception { InvalidAccessError };
+
+    return page->paymentCoordinator().canMakePayments();
 }
 
 ExceptionOr<void> ApplePaySession::canMakePaymentsWithActiveCard(ScriptExecutionContext& scriptExecutionContext, const String& merchantIdentifier, Ref<DeferredPromise>&& passedPromise)
@@ -470,7 +481,11 @@ ExceptionOr<void> ApplePaySession::canMakePaymentsWithActiveCard(ScriptExecution
 
     RefPtr<DeferredPromise> promise(WTFMove(passedPromise));
     if (!shouldDiscloseApplePayCapability(document)) {
-        auto& paymentCoordinator = document.frame()->mainFrame().paymentCoordinator();
+        auto* page = document.page();
+        if (!page)
+            return Exception { InvalidAccessError };
+
+        auto& paymentCoordinator = page->paymentCoordinator();
         bool canMakePayments = paymentCoordinator.canMakePayments();
 
         RunLoop::main().dispatch([promise, canMakePayments]() mutable {
@@ -479,7 +494,11 @@ ExceptionOr<void> ApplePaySession::canMakePaymentsWithActiveCard(ScriptExecution
         return { };
     }
 
-    auto& paymentCoordinator = document.frame()->mainFrame().paymentCoordinator();
+    auto* page = document.page();
+    if (!page)
+        return Exception { InvalidAccessError };
+
+    auto& paymentCoordinator = page->paymentCoordinator();
 
     paymentCoordinator.canMakePaymentsWithActiveCard(merchantIdentifier, document.domain(), [promise](bool canMakePayments) mutable {
         promise->resolve<IDLBoolean>(canMakePayments);
@@ -498,9 +517,13 @@ ExceptionOr<void> ApplePaySession::openPaymentSetup(ScriptExecutionContext& scri
     if (!UserGestureIndicator::processingUserGesture())
         return Exception { InvalidAccessError, "Must call ApplePaySession.openPaymentSetup from a user gesture handler." };
 
-    RefPtr<DeferredPromise> promise(WTFMove(passedPromise));
-    auto& paymentCoordinator = document.frame()->mainFrame().paymentCoordinator();
+    auto* page = document.page();
+    if (!page)
+        return Exception { InvalidAccessError };
 
+    auto& paymentCoordinator = page->paymentCoordinator();
+
+    RefPtr<DeferredPromise> promise(WTFMove(passedPromise));
     paymentCoordinator.openPaymentSetup(merchantIdentifier, document.domain(), [promise](bool result) mutable {
         promise->resolve<IDLBoolean>(result);
     });
@@ -860,7 +883,7 @@ void ApplePaySession::stop()
 
 PaymentCoordinator& ApplePaySession::paymentCoordinator() const
 {
-    return downcast<Document>(*scriptExecutionContext()).frame()->mainFrame().paymentCoordinator();
+    return downcast<Document>(*scriptExecutionContext()).page()->paymentCoordinator();
 }
 
 bool ApplePaySession::canBegin() const
index a6d0e5ae760d22d60de90d287187d60915f9284a..08f404e18dc0d490d8ad3d28574aeb923ab783ef 100644 (file)
 #include "ApplePaySessionPaymentRequest.h"
 #include "Document.h"
 #include "EventNames.h"
+#include "Frame.h"
 #include "JSApplePayPayment.h"
 #include "JSApplePayRequest.h"
 #include "LinkIconCollector.h"
-#include "MainFrame.h"
 #include "MerchantValidationEvent.h"
 #include "Page.h"
 #include "Payment.h"
@@ -64,7 +64,8 @@ bool ApplePayPaymentHandler::handlesIdentifier(const PaymentRequest::MethodIdent
 
 static inline PaymentCoordinator& paymentCoordinator(Document& document)
 {
-    return document.frame()->mainFrame().paymentCoordinator();
+    ASSERT(document.page());
+    return document.page()->paymentCoordinator();
 }
 
 bool ApplePayPaymentHandler::hasActiveSession(Document& document)
index 056d3f44ba42236b2e3a4488d0accfcf2f56f39f..353df63798287a4a03ff841b5bdd1e155dc846aa 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "CaptureDevice.h"
 #include "Document.h"
-#include "MainFrame.h"
+#include "Frame.h"
 #include "SecurityOrigin.h"
 #include "UserMediaController.h"
 
index 53eadd7a01ac8cc5651f31d5766cfa5535cfcd58..6c20be1fe2fa7100a6d8494a7fa5745f5146be7a 100644 (file)
 #include "DeprecatedGlobalSettings.h"
 #include "Document.h"
 #include "DocumentLoader.h"
+#include "Frame.h"
 #include "HTMLIFrameElement.h"
 #include "HTMLParserIdioms.h"
 #include "JSMediaStream.h"
 #include "JSOverconstrainedError.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "MediaConstraints.h"
 #include "RealtimeMediaSourceCenter.h"
 #include "SchemeRegistry.h"
index b0ca4976a32c335538a71ea97220873ff88875c5..fca6002fb5cfe109d389cc7c7fd6dd2ea2e9a7a7 100644 (file)
@@ -31,6 +31,7 @@
 
 #import "CommonVM.h"
 #import "Event.h"
+#import "Frame.h"
 #import "HTMLPlugInElement.h"
 #import "HTMLVideoElement.h"
 #import "JSDOMBinding.h"
@@ -41,7 +42,6 @@
 #import "JSHTMLVideoElement.h"
 #import "JSQuickTimePluginReplacement.h"
 #import "Logging.h"
-#import "MainFrame.h"
 #import "RenderElement.h"
 #import "ScriptController.h"
 #import "ScriptSourceCode.h"
index 5c49ce07ddfdc95cf5da3927ae86ce3688f8a1ea..d040ad8be8c041306df3c096963b11343133044d 100644 (file)
@@ -1342,7 +1342,6 @@ page/IntersectionObserver.cpp
 page/IntersectionObserverEntry.cpp
 page/LayoutContext.cpp
 page/Location.cpp
-page/MainFrame.cpp
 page/MemoryRelease.cpp
 page/MouseEventWithHitTestResults.cpp
 page/Navigator.cpp
index 60b7b4541002da6beb7b66a197f024ed30084c82..4ea8b63096084dacdbe4320f737028c0e5f71591 100644 (file)
                931CBD0F161A44E900E4C874 /* ScrollingStateScrollingNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 931CBD09161A44E900E4C874 /* ScrollingStateScrollingNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
                931CBD11161A44E900E4C874 /* ScrollingStateTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 931CBD0B161A44E900E4C874 /* ScrollingStateTree.h */; settings = {ATTRIBUTES = (Private, ); }; };
                931D72F615FE695300C4C07E /* LayoutMilestones.h in Headers */ = {isa = PBXBuildFile; fileRef = 931D72F515FE695300C4C07E /* LayoutMilestones.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               932AD70617EFA2C40038F8FF /* MainFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 932AD70417EFA2C30038F8FF /* MainFrame.h */; settings = {ATTRIBUTES = (Private, ); }; };
                932CC0B71DFFD158004C0F9F /* MediaTrackConstraints.h in Headers */ = {isa = PBXBuildFile; fileRef = 932CC0B61DFFD158004C0F9F /* MediaTrackConstraints.h */; settings = {ATTRIBUTES = (Private, ); }; };
                932CC0D51DFFD667004C0F9F /* JSMediaTrackConstraints.h in Headers */ = {isa = PBXBuildFile; fileRef = 932CC0D11DFFD667004C0F9F /* JSMediaTrackConstraints.h */; };
                93309DD7099E64920056E581 /* AppendNodeCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 93309D88099E64910056E581 /* AppendNodeCommand.h */; };
                931CBD0B161A44E900E4C874 /* ScrollingStateTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingStateTree.h; sourceTree = "<group>"; };
                931D72F515FE695300C4C07E /* LayoutMilestones.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutMilestones.h; sourceTree = "<group>"; };
                9327A94109968D1A0068A546 /* HTMLOptionsCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLOptionsCollection.cpp; sourceTree = "<group>"; };
-               932AD70317EFA2C30038F8FF /* MainFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MainFrame.cpp; sourceTree = "<group>"; };
-               932AD70417EFA2C30038F8FF /* MainFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainFrame.h; sourceTree = "<group>"; };
                932CC0B61DFFD158004C0F9F /* MediaTrackConstraints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaTrackConstraints.h; sourceTree = "<group>"; };
                932CC0D01DFFD667004C0F9F /* JSMediaTrackConstraints.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaTrackConstraints.cpp; sourceTree = "<group>"; };
                932CC0D11DFFD667004C0F9F /* JSMediaTrackConstraints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaTrackConstraints.h; sourceTree = "<group>"; };
                                BCE1C41A0D982980003B02F2 /* Location.cpp */,
                                BCE1C4190D982980003B02F2 /* Location.h */,
                                BCE1C4220D9829F2003B02F2 /* Location.idl */,
-                               932AD70317EFA2C30038F8FF /* MainFrame.cpp */,
-                               932AD70417EFA2C30038F8FF /* MainFrame.h */,
                                931BCC601124DFCB00BE70DD /* MediaCanStartListener.h */,
                                52E2CAFB19FF0207001EEB4F /* MediaProducer.h */,
                                413E00771DB0E4DE002341D2 /* MemoryRelease.cpp */,
                                93A806171E03B51C008A1F26 /* LongRange.h in Headers */,
                                46EFAF121E5FB9F100E7F34B /* LowPowerModeNotifier.h in Headers */,
                                1A0409DC1A4360B5009E47F3 /* MachSendRight.h in Headers */,
-                               932AD70617EFA2C40038F8FF /* MainFrame.h in Headers */,
                                7AE6C93C1BE0C60100E19E03 /* MainThreadSharedTimer.h in Headers */,
                                1A8F6BC60DB55CDC001DB794 /* ManifestParser.h in Headers */,
                                CE1866451F72E5B400A0CAB6 /* MarkedText.h in Headers */,
index 7c5819a2a2b71d1b6c0639c65bb02de6a4076652..a607dce40c9f4f27f4472081328fefd5c95ee3b8 100644 (file)
@@ -54,7 +54,6 @@
 #include "HTMLParserIdioms.h"
 #include "HitTestResult.h"
 #include "LocalizedStrings.h"
-#include "MainFrame.h"
 #include "MathMLNames.h"
 #include "NodeList.h"
 #include "NodeTraversal.h"
@@ -1034,7 +1033,7 @@ Frame* AccessibilityObject::frame() const
     return node->document().frame();
 }
 
-MainFrame* AccessibilityObject::mainFrame() const
+Frame* AccessibilityObject::mainFrame() const
 {
     Document* document = topDocument();
     if (!document)
@@ -1450,7 +1449,7 @@ VisiblePosition AccessibilityObject::visiblePositionForBounds(const IntRect& rec
     if (rect.isEmpty())
         return VisiblePosition();
     
-    MainFrame* mainFrame = this->mainFrame();
+    auto* mainFrame = this->mainFrame();
     if (!mainFrame)
         return VisiblePosition();
     
index 1b11d4e0ab12a333601bda6ac3810664ca4de259..135b320c91ae72cb261c8d567c14f33eb927d348 100644 (file)
@@ -82,7 +82,6 @@ class Frame;
 class FrameView;
 class IntPoint;
 class IntSize;
-class MainFrame;
 class Node;
 class Page;
 class RenderObject;
@@ -842,7 +841,7 @@ public:
     virtual Document* document() const;
     virtual FrameView* documentFrameView() const;
     Frame* frame() const;
-    MainFrame* mainFrame() const;
+    Frame* mainFrame() const;
     Document* topDocument() const;
     ScrollView* scrollViewAncestor() const;
     String language() const;
index 8ad2ed9bc2d00e754a9991c63eaa3a356b1f830d..70637f058f72277964ff209a106ea2eea8a6fac2 100644 (file)
@@ -52,6 +52,7 @@
 #import "Editor.h"
 #import "Font.h"
 #import "FontCascade.h"
+#import "Frame.h"
 #import "FrameLoaderClient.h"
 #import "FrameSelection.h"
 #import "HTMLAnchorElement.h"
@@ -61,7 +62,6 @@
 #import "HTMLInputElement.h"
 #import "HTMLNames.h"
 #import "LocalizedStrings.h"
-#import "MainFrame.h"
 #import "Page.h"
 #import "PluginDocument.h"
 #import "PluginViewBase.h"
index f09954598d1345d888664a1a4935cf4a2a3f0fe4..cbd9e702eccfd6552f39ff7f89fb3836a93a39b3 100644 (file)
@@ -39,7 +39,6 @@
 #include "JSDocument.h"
 #include "JSMainThreadExecState.h"
 #include "LoadableModuleScript.h"
-#include "MainFrame.h"
 #include "ModuleFetchFailureKind.h"
 #include "ModuleFetchParameters.h"
 #include "NP_jsobject.h"
index 8c29c78eabedf6b760ae1bcc1a643b9d3a10cf99..15be24dbb0523cd33a30bb596d80e6bce6c33715 100644 (file)
@@ -32,9 +32,9 @@
 #include "ScriptState.h"
 
 #include "Document.h"
+#include "Frame.h"
 #include "JSDOMWindowBase.h"
 #include "JSWorkerGlobalScope.h"
-#include "MainFrame.h"
 #include "Node.h"
 #include "Page.h"
 #include "ScriptController.h"
index 654a50cf378c82c2bbafc57db38f071c4c5951a8..eb105a8918f20c45cf3e024cf2ae5947a7fc4758 100644 (file)
@@ -39,7 +39,6 @@
 #include "ExtensionStyleSheets.h"
 #include "Frame.h"
 #include "FrameLoaderClient.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "ResourceLoadInfo.h"
 #include "URL.h"
index add7f8dc6af3adef6b7a126a36b512cc1d46856b..e00f6815b0ee061dc3191964d6b836fe8128db03 100644 (file)
@@ -33,9 +33,9 @@
 #include "CSSPrimitiveValue.h"
 #include "CSSToLengthConversionData.h"
 #include "CSSValueKeywords.h"
+#include "Frame.h"
 #include "FrameView.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "MediaFeatureNames.h"
 #include "MediaList.h"
 #include "MediaQuery.h"
@@ -756,7 +756,7 @@ static bool displayModeEvaluate(CSSValue* value, const CSSToLengthConversionData
 
     auto keyword = downcast<CSSPrimitiveValue>(*value).valueID();
 
-    auto manifest = frame.mainFrame().applicationManifest();
+    auto manifest = frame.page() ? frame.page()->applicationManifest() : std::nullopt;
     if (!manifest)
         return keyword == CSSValueBrowser;
 
index 3041fdead9d7706162242ea959356cc8dca4ddb5..a7b5025d314391146a96853e719635dc0efdd7f2 100644 (file)
@@ -39,7 +39,6 @@
 #include "Image.h"
 #include "ImageDocument.h"
 #include "MIMETypeRegistry.h"
-#include "MainFrame.h"
 #include "MediaDocument.h"
 #include "MediaList.h"
 #include "MediaPlayer.h"
index bad457c476723e1baf20c4deda77c15dc9431d5a..085dfa8bfa8d2d0eeb5f4e4625ea340967262d19 100644 (file)
@@ -70,6 +70,7 @@
 #include "FocusEvent.h"
 #include "FontFaceSet.h"
 #include "FormController.h"
+#include "Frame.h"
 #include "FrameLoader.h"
 #include "FrameLoaderClient.h"
 #include "FrameView.h"
 #include "LayoutDisallowedScope.h"
 #include "LoaderStrategy.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "MediaCanStartListener.h"
 #include "MediaProducer.h"
 #include "MediaQueryList.h"
index 39754a1ad1b1d117a63733c72564efe2b22a06ac..a02ccbc3bf45cc2429d90aa185ee7839a695bf23 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "Chrome.h"
 #include "ChromeClient.h"
-#include "MainFrame.h"
+#include "Frame.h"
 #include "NodeTraversal.h"
 #include "Page.h"
 #include "Range.h"
index f70048d7652c81d86fae36d01686cc12f1bf79f0..07127336dcdfac8ec3d59bf8dcc486b9fc465e3c 100644 (file)
@@ -51,6 +51,7 @@
 #include "EventNames.h"
 #include "FocusController.h"
 #include "FocusEvent.h"
+#include "Frame.h"
 #include "FrameSelection.h"
 #include "FrameView.h"
 #include "HTMLBodyElement.h"
@@ -72,7 +73,6 @@
 #include "JSLazyEventListener.h"
 #include "KeyboardEvent.h"
 #include "KeyframeEffect.h"
-#include "MainFrame.h"
 #include "MutationObserverInterestGroup.h"
 #include "MutationRecord.h"
 #include "NodeRenderStyle.h"
@@ -1802,8 +1802,8 @@ void Element::removedFromAncestor(RemovalType removalType, ContainerNode& oldPar
         frame->animation().cancelAnimations(*this);
 
 #if PLATFORM(MAC)
-    if (frame)
-        frame->mainFrame().removeLatchingStateForTarget(*this);
+    if (frame && frame->page())
+        frame->page()->removeLatchingStateForTarget(*this);
 #endif
 }
 
index 48c2c97d064f269eb72b31bc70aed62bffd17a52..ec5cef7307c2d826c46186afe6a13aecdf2f28f4 100644 (file)
 #include "CompositionEvent.h"
 #include "EventContext.h"
 #include "EventPath.h"
+#include "Frame.h"
 #include "FrameLoader.h"
 #include "FrameView.h"
 #include "HTMLInputElement.h"
 #include "InputEvent.h"
 #include "KeyboardEvent.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "MouseEvent.h"
 #include "ScopedEventQueue.h"
 #include "ScriptDisallowedScope.h"
index 59be70fed416c25d512380ae744205505c46e48c..c4d85d83494deadf88f01d4a5c71c17bde9f6484 100644 (file)
 #include "DisplayRefreshMonitorManager.h"
 #include "Document.h"
 #include "DocumentLoader.h"
+#include "Frame.h"
 #include "FrameView.h"
 #include "InspectorInstrumentation.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "RequestAnimationFrameCallback.h"
 #include "Settings.h"
index 10a998b2d7c7dbbf51b29011bf9cd4c0149e6f67..cb8b6b8bbac85bc0e32ded2ef339c2410290d319 100644 (file)
@@ -68,7 +68,6 @@
 #include "InsertTextCommand.h"
 #include "KeyboardEvent.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "ModifySelectionListLevel.h"
 #include "NodeList.h"
 #include "NodeTraversal.h"
@@ -3453,7 +3452,8 @@ void Editor::scanSelectionForTelephoneNumbers()
 
     FrameSelection& frameSelection = m_frame.selection();
     if (!frameSelection.isRange()) {
-        m_frame.mainFrame().servicesOverlayController().selectedTelephoneNumberRangesChanged();
+        if (auto* page = m_frame.page())
+            page->servicesOverlayController().selectedTelephoneNumberRangesChanged();
         return;
     }
     RefPtr<Range> selectedRange = frameSelection.toNormalizedRange();
@@ -3474,7 +3474,8 @@ void Editor::scanSelectionForTelephoneNumbers()
     RefPtr<Range> extendedRange = extendedSelection.toNormalizedRange();
 
     if (!extendedRange) {
-        m_frame.mainFrame().servicesOverlayController().selectedTelephoneNumberRangesChanged();
+        if (auto* page = m_frame.page())
+            page->servicesOverlayController().selectedTelephoneNumberRangesChanged();
         return;
     }
 
@@ -3486,7 +3487,8 @@ void Editor::scanSelectionForTelephoneNumbers()
             m_detectedTelephoneNumberRanges.append(range);
     }
 
-    m_frame.mainFrame().servicesOverlayController().selectedTelephoneNumberRangesChanged();
+    if (auto* page = m_frame.page())
+        page->servicesOverlayController().selectedTelephoneNumberRangesChanged();
 }
 
 void Editor::scanRangeForTelephoneNumbers(Range& range, const StringView& stringView, Vector<RefPtr<Range>>& markedRanges)
index 94d869296b5a5cc4c301371d92184dd16c1989e9..3bf421383d85a014ecc7221c97a3452a31831756 100644 (file)
@@ -47,7 +47,6 @@
 #include "HTMLNames.h"
 #include "IndentOutdentCommand.h"
 #include "InsertListCommand.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "Pasteboard.h"
 #include "RenderBox.h"
index fd6b243330332f48752ef688573f65e2c91d9013..3b40688cb4da656b344587c0888636c0ab1566cf 100644 (file)
@@ -31,7 +31,6 @@
 #include "Editor.h"
 #include "EditorClient.h"
 #include "Frame.h"
-#include "MainFrame.h"
 #include "RenderView.h"
 #include "ServicesOverlayController.h"
 
@@ -72,7 +71,8 @@ SelectionRectGatherer::Notifier::Notifier(SelectionRectGatherer& gatherer)
 
 SelectionRectGatherer::Notifier::~Notifier()
 {
-    m_gatherer.m_renderView.view().frame().mainFrame().servicesOverlayController().selectionRectsDidChange(m_gatherer.m_rects, m_gatherer.m_gapRects, m_gatherer.isTextOnly());
+    if (auto* page = m_gatherer.m_renderView.view().frame().page())
+        page->servicesOverlayController().selectionRectsDidChange(m_gatherer.m_rects, m_gatherer.m_gapRects, m_gatherer.isTextOnly());
 }
 
 std::unique_ptr<SelectionRectGatherer::Notifier> SelectionRectGatherer::clearAndCreateNotifier()
index 03adbc99e61d500ac95bb25540413ec555b18a7a..27cd6c85351e5bfec987b5cba65adb75fb80c5e8 100644 (file)
@@ -44,7 +44,6 @@
 #import "HTMLImageElement.h"
 #import "HTMLObjectElement.h"
 #import "LegacyWebArchive.h"
-#import "MainFrame.h"
 #import "Page.h"
 #import "PublicURLManager.h"
 #import "RuntimeEnabledFeatures.h"
index 33c38e7e44742746e3dc05a44a1d65ddaede21dd..5551eecf9223d369a0af74d24947437e0bebbf73 100644 (file)
@@ -61,7 +61,6 @@
 #include "HTMLTextAreaElement.h"
 #include "HTMLTextFormControlElement.h"
 #include "LibWebRTCProvider.h"
-#include "MainFrame.h"
 #include "MarkupAccumulator.h"
 #include "NodeList.h"
 #include "Page.h"
index 2102852435439d7a3ca70c4b889cd4a7d941cfcb..e6fe5635ccce2d771e5b2afa667ad2ab366d1be2 100644 (file)
 #include "DOMWindow.h"
 #include "Document.h"
 #include "DocumentLoader.h"
+#include "Frame.h"
 #include "FrameLoader.h"
 #include "FrameLoaderClient.h"
 #include "FrameView.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PageCache.h"
 #include "SVGDocumentExtensions.h"
index b3fb502d9676b37ce19136552b25eeb310d2df84..ac2ba6c703ea8db656851904786acbd8da802f4a 100644 (file)
 #include "Document.h"
 #include "Element.h"
 #include "FocusController.h"
+#include "Frame.h"
 #include "FrameLoader.h"
 #include "FrameView.h"
 #include "HistoryController.h"
 #include "HistoryItem.h"
-#include "MainFrame.h"
 #include "Node.h"
 #include "Page.h"
 #include "PageTransitionEvent.h"
index 3365eb7eb4b7c7e93632cd316af6259584eb6977..edb75c2289bec853f89b962366f0c11c783b4f5a 100644 (file)
 #include "Document.h"
 #include "DocumentLoader.h"
 #include "FocusController.h"
+#include "Frame.h"
 #include "FrameLoader.h"
 #include "FrameLoaderClient.h"
 #include "FrameView.h"
 #include "HistoryController.h"
 #include "IgnoreOpensDuringUnloadCountIncrementer.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "ScriptDisallowedScope.h"
 #include "Settings.h"
@@ -371,7 +371,7 @@ static void setPageCacheState(Page& page, Document::PageCacheState pageCacheStat
 // When entering page cache, tear down the render tree before setting the in-cache flag.
 // This maintains the invariant that render trees are never present in the page cache.
 // Note that destruction happens bottom-up so that the main frame's tree dies last.
-static void destroyRenderTree(MainFrame& mainFrame)
+static void destroyRenderTree(Frame& mainFrame)
 {
     for (Frame* frame = mainFrame.tree().traversePrevious(CanWrap::Yes); frame; frame = frame->tree().traversePrevious(CanWrap::No)) {
         if (!frame->document())
index 17c14b5c707e13ebc35997badf13d1896897db00..66a93fddbe6ee136fdee27d3969de7afd6a95906 100644 (file)
@@ -46,6 +46,7 @@
 #include "DocumentLoader.h"
 #include "ElementChildIterator.h"
 #include "EventNames.h"
+#include "Frame.h"
 #include "FrameLoader.h"
 #include "FrameLoaderClient.h"
 #include "FrameView.h"
@@ -57,7 +58,6 @@
 #include "JSHTMLMediaElement.h"
 #include "Logging.h"
 #include "MIMETypeRegistry.h"
-#include "MainFrame.h"
 #include "MediaController.h"
 #include "MediaControls.h"
 #include "MediaDocument.h"
index d37ff17ee7b2e1f68c5fc22dedc7d1daf05c8d39..d2640eb1c9230d84653dafefc0ea8660a0e32e5d 100644 (file)
@@ -26,6 +26,7 @@
 #include "CommonVM.h"
 #include "ContentSecurityPolicy.h"
 #include "EventNames.h"
+#include "Frame.h"
 #include "FrameLoaderClient.h"
 #include "HTMLImageLoader.h"
 #include "JSDOMConvertBoolean.h"
@@ -34,7 +35,6 @@
 #include "JSShadowRoot.h"
 #include "LocalizedStrings.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "MouseEvent.h"
 #include "Page.h"
 #include "PlatformMouseEvent.h"
index 16b256a2d2fed40bb64a9a923597c212d3628b22..d151273a359493e1b6c538f0f3d9316880364a17 100644 (file)
@@ -31,6 +31,7 @@
 #include "DocumentLoader.h"
 #include "EventListener.h"
 #include "EventNames.h"
+#include "Frame.h"
 #include "FrameLoader.h"
 #include "FrameLoaderClient.h"
 #include "FrameView.h"
@@ -41,7 +42,6 @@
 #include "HTMLNames.h"
 #include "LocalizedStrings.h"
 #include "MIMETypeRegistry.h"
-#include "MainFrame.h"
 #include "MouseEvent.h"
 #include "Page.h"
 #include "RawDataDocumentParser.h"
index a22a01e58d27cb0ea424099897301e7d25d982e2..e4a5fe6d1217731546370150438a469bb082d126 100644 (file)
@@ -39,7 +39,6 @@
 #include "HTMLVideoElement.h"
 #include "HitTestResult.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PlatformMediaSessionManager.h"
 #include "RenderMedia.h"
@@ -717,7 +716,7 @@ static bool isMainContentForPurposesOfAutoplay(const HTMLMediaElement& element)
     if (!document.frame() || !document.frame()->isMainFrame())
         return false;
 
-    MainFrame& mainFrame = document.frame()->mainFrame();
+    auto& mainFrame = document.frame()->mainFrame();
     if (!mainFrame.view() || !mainFrame.view()->renderView())
         return false;
 
index 9078a45e554685b2ab4327fbb33a5056251bb17f..7875da8de5c9118d03551b3811a2213db7742085 100644 (file)
@@ -55,7 +55,6 @@
 #include "IntSize.h"
 #include "JSMainThreadExecState.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "NotImplemented.h"
 #include "OESElementIndexUint.h"
 #include "OESStandardDerivatives.h"
index c54dae2cab5bf93d5839811af3d6fa8058e6db6f..a8578c01c6261c18b4756d669a8a0e122482234d 100644 (file)
@@ -31,8 +31,8 @@
 #include "config.h"
 #include "InspectorClient.h"
 
+#include "Frame.h"
 #include "InspectorController.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "ScriptController.h"
 #include "ScriptSourceCode.h"
index be9c8806d2cd4880a09cfed6fa807bdd502e7a7b..1c3a0339814a2a793f98e544dad92e7867bcc80c 100644 (file)
@@ -36,6 +36,7 @@
 #include "CommonVM.h"
 #include "DOMWindow.h"
 #include "DOMWrapperWorld.h"
+#include "Frame.h"
 #include "GraphicsContext.h"
 #include "InspectorApplicationCacheAgent.h"
 #include "InspectorCSSAgent.h"
@@ -58,7 +59,6 @@
 #include "JSDOMWindow.h"
 #include "JSDOMWindowCustom.h"
 #include "JSMainThreadExecState.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PageConsoleAgent.h"
 #include "PageDebuggerAgent.h"
index 6aa57949cd7e68746b0b376dce42bb9755b8d437..49657480032f83f224dc5894b42d68937d519340 100644 (file)
 #include "DOMWrapperWorld.h"
 #include "Document.h"
 #include "FloatRect.h"
+#include "Frame.h"
 #include "FrameLoadRequest.h"
 #include "FrameLoader.h"
 #include "FrameView.h"
 #include "InspectorController.h"
 #include "InspectorFrontendHost.h"
 #include "InspectorPageAgent.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "ScriptController.h"
 #include "ScriptState.h"
index 6d28e1e13f279f18940efcc9050065420e8ff87f..eb0f525a7a9bda4465a52c19fa5bdd19cb9c0143 100644 (file)
@@ -39,6 +39,7 @@
 #include "Editor.h"
 #include "Event.h"
 #include "FocusController.h"
+#include "Frame.h"
 #include "HitTestResult.h"
 #include "InspectorController.h"
 #include "InspectorFrontendClient.h"
@@ -46,7 +47,6 @@
 #include "JSDOMExceptionHandling.h"
 #include "JSInspectorFrontendHost.h"
 #include "JSMainThreadExecState.h"
-#include "MainFrame.h"
 #include "MouseEvent.h"
 #include "Node.h"
 #include "Page.h"
index ff8cacceb882d41181d72d197baca8732a372406..3bd4bc0a48fa8b6f75f29a10de457ed0e19689cc 100644 (file)
@@ -38,6 +38,7 @@
 #include "Database.h"
 #include "DocumentLoader.h"
 #include "Event.h"
+#include "Frame.h"
 #include "InspectorApplicationCacheAgent.h"
 #include "InspectorCSSAgent.h"
 #include "InspectorCanvasAgent.h"
@@ -53,7 +54,6 @@
 #include "InspectorWorkerAgent.h"
 #include "InstrumentingAgents.h"
 #include "LoaderStrategy.h"
-#include "MainFrame.h"
 #include "PageDebuggerAgent.h"
 #include "PageHeapAgent.h"
 #include "PageRuntimeAgent.h"
index 32b29a15a941dc85f4b71861cf50c1a2a36ddf3f..9384d0821249026fd5b70078eb1e5b71b0a4b448 100644 (file)
 #include "EditorClient.h"
 #include "Element.h"
 #include "EmptyClients.h"
+#include "Frame.h"
 #include "FrameView.h"
 #include "GraphicsContext.h"
 #include "InspectorClient.h"
 #include "InspectorOverlayPage.h"
 #include "LibWebRTCProvider.h"
-#include "MainFrame.h"
 #include "Node.h"
 #include "Page.h"
 #include "PageConfiguration.h"
index 02bcb4a74a597bcb9284c095396a1211acd5221c..7ec42cf0a82bd2bc82dccc414b8f236d57a1a3b8 100644 (file)
 #include "CommonVM.h"
 #include "Document.h"
 #include "EventLoop.h"
+#include "Frame.h"
 #include "FrameView.h"
 #include "InspectorController.h"
 #include "InspectorFrontendClient.h"
 #include "JSDOMExceptionHandling.h"
 #include "JSDOMWindowCustom.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PageGroup.h"
 #include "PluginViewBase.h"
index 8fae7dd7f42aa6bf6ec17c67466de41ad990cecf..19af4e95021f4ec1ace12539901307f3a7a585f9 100644 (file)
@@ -33,7 +33,6 @@
 #include "InspectorPageAgent.h"
 #include "InstrumentingAgents.h"
 #include "LoaderStrategy.h"
-#include "MainFrame.h"
 #include "PlatformStrategies.h"
 #include <wtf/text/StringBuilder.h>
 
index a7fec81b52152d02b40aec5bb0384278ca309f49..ed021687b7ee120ea4e05ade9fcad0dce0ad8ece 100644 (file)
@@ -37,7 +37,6 @@
 #include "JSCanvasRenderingContext2D.h"
 #include "JSImageBitmapRenderingContext.h"
 #include "JSMainThreadExecState.h"
-#include "MainFrame.h"
 #include "OffscreenCanvas.h"
 #include "ScriptState.h"
 #include "StringAdaptors.h"
index 13dbbad8ad365470816d095cca9923a0a98b5051..6c87b56956ab6bfb70e25094628ce2e5b557ef0e 100644 (file)
@@ -56,6 +56,7 @@
 #include "Element.h"
 #include "Event.h"
 #include "EventListener.h"
+#include "Frame.h"
 #include "FrameTree.h"
 #include "HTMLElement.h"
 #include "HTMLFrameOwnerElement.h"
@@ -76,7 +77,6 @@
 #include "JSDOMBindingSecurity.h"
 #include "JSEventListener.h"
 #include "JSNode.h"
-#include "MainFrame.h"
 #include "MutationEvent.h"
 #include "Node.h"
 #include "NodeList.h"
index eb3457592f0b8116ec332258c65eed6b05079be5..7e926aeb7a722c598bc2944779f23eafe46e5feb 100644 (file)
@@ -52,7 +52,6 @@
 #include "InspectorOverlay.h"
 #include "InstrumentingAgents.h"
 #include "MIMETypeRegistry.h"
-#include "MainFrame.h"
 #include "MemoryCache.h"
 #include "Page.h"
 #include "RenderObject.h"
@@ -582,7 +581,7 @@ void InspectorPageAgent::frameDetached(Frame& frame)
     m_identifierToFrame.remove(identifier);
 }
 
-MainFrame& InspectorPageAgent::mainFrame()
+Frame& InspectorPageAgent::mainFrame()
 {
     return m_page.mainFrame();
 }
index 8ae10bb68ed5cfee5c2bc98b5962e2b1cc641ca9..10296b38c7db2b9e9ce13cd384a108e9fe909bd7 100644 (file)
@@ -46,7 +46,6 @@ class DocumentLoader;
 class Frame;
 class InspectorClient;
 class InspectorOverlay;
-class MainFrame;
 class Page;
 class RenderObject;
 class SharedBuffer;
@@ -128,7 +127,7 @@ public:
 
     // Cross-agents API
     Page& page() { return m_page; }
-    MainFrame& mainFrame();
+    Frame& mainFrame();
     Frame* frameForId(const String& frameId);
     WEBCORE_EXPORT String frameId(Frame*);
     bool hasIdForFrame(Frame*) const;
index 570cdf0b54fe4b41bdc09600ddee8efb303ae69e..29cdda29ee4c0d4f9cb07a4085d2b1add56b628e 100644 (file)
 #include "Document.h"
 #include "EventListener.h"
 #include "EventTarget.h"
+#include "Frame.h"
 #include "InspectorOverlay.h"
 #include "InspectorPageAgent.h"
 #include "InstrumentingAgents.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PageConsoleClient.h"
 #include "PageScriptDebugServer.h"
index 945b0c6c3fdd3307bba12cf7f58018a66cd383da..cc0390cd51643334b9e8404bbf0f8cafb10ed7ca 100644 (file)
@@ -37,7 +37,6 @@
 #include "InspectorPageAgent.h"
 #include "InstrumentingAgents.h"
 #include "JSDOMWindowBase.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PageConsoleClient.h"
 #include "ScriptController.h"
index bc992b0789c689ee693cd531594b8352b2467065..376d56a886e0dccae1492ca2eb5dddc55bde5f21 100644 (file)
@@ -47,6 +47,7 @@
 #include "EventNames.h"
 #include "ExtensionStyleSheets.h"
 #include "FormState.h"
+#include "Frame.h"
 #include "FrameLoader.h"
 #include "FrameLoaderClient.h"
 #include "FrameTree.h"
@@ -60,7 +61,6 @@
 #include "LinkIconCollector.h"
 #include "LinkIconType.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "MemoryCache.h"
 #include "NetworkLoadMetrics.h"
 #include "Page.h"
index a54afb0ccca7bc62305b212a399607eabba6160e..d9437a01699a1a6ba0aed80cc0a2e6dd8de13f17 100644 (file)
@@ -39,7 +39,6 @@
 #include "FrameLoaderStateMachine.h"
 #include "FrameView.h"
 #include "MIMETypeRegistry.h"
-#include "MainFrame.h"
 #include "PluginDocument.h"
 #include "RawDataDocumentParser.h"
 #include "ScriptController.h"
index b5f833697ce9ba6deb60bf675a8d22be22c81d79..d55d0a2bf94d2bb0b561cb24e0b66bba034730b6 100644 (file)
@@ -61,6 +61,7 @@
 #include "FloatRect.h"
 #include "FormState.h"
 #include "FormSubmission.h"
+#include "Frame.h"
 #include "FrameLoadRequest.h"
 #include "FrameLoaderClient.h"
 #include "FrameNetworkingContext.h"
@@ -83,7 +84,6 @@
 #include "LoadTiming.h"
 #include "LoaderStrategy.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "MemoryCache.h"
 #include "MemoryRelease.h"
 #include "NavigationDisabler.h"
@@ -1494,9 +1494,10 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t
 
     // Log main frame navigation types.
     if (m_frame.isMainFrame()) {
-        if (auto* page = m_frame.page())
+        if (auto* page = m_frame.page()) {
             page->mainFrameLoadStarted(newURL, type);
-        static_cast<MainFrame&>(m_frame).performanceLogging().didReachPointOfInterest(PerformanceLogging::MainFrameLoadStarted);
+            page->performanceLogging().didReachPointOfInterest(PerformanceLogging::MainFrameLoadStarted);
+        }
     }
 
     policyChecker().setLoadType(type);
@@ -1856,7 +1857,7 @@ void FrameLoader::setState(FrameState newState)
         if (m_documentLoader)
             m_documentLoader->stopRecordingResponses();
         if (m_frame.isMainFrame() && oldState != newState)
-            static_cast<MainFrame&>(m_frame).didCompleteLoad();
+            m_frame.page()->performanceLogging().didReachPointOfInterest(PerformanceLogging::MainFrameLoadCompleted);
     }
 }
 
index ea2567b638004d7b80660ad61679ff9cd1cdad15..aef7b780e21fd830fe8e75ad48c60aadaba3ebe2 100644 (file)
@@ -35,6 +35,7 @@
 #include "CachedPage.h"
 #include "Document.h"
 #include "DocumentLoader.h"
+#include "Frame.h"
 #include "FrameLoader.h"
 #include "FrameLoaderClient.h"
 #include "FrameLoaderStateMachine.h"
@@ -42,7 +43,6 @@
 #include "FrameView.h"
 #include "HistoryItem.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "NavigationPolicyCheck.h"
 #include "Page.h"
 #include "PageCache.h"
index ef1e50e5c927cf18a2cfd7b4a21969f7b172b244..02cc7d120ca4bcff3525c8f749cc4180fe6d45e2 100644 (file)
@@ -25,7 +25,7 @@
 
 #pragma once
 
-#include "MainFrame.h"
+#include "Frame.h"
 
 namespace WebCore {
 
index f1886bc8841f65546a16caab7db6a452aac730df..5ee3ab9a0a2995ee87e55d8a8e70c83b926ced1a 100644 (file)
@@ -33,7 +33,6 @@
 #include "FrameLoaderClient.h"
 #include "InspectorInstrumentation.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "ProgressTrackerClient.h"
 #include "ResourceResponse.h"
 #include <wtf/text/CString.h>
index 3c8fb5326e4e67612936ca793f949858cebd127e..f5f5ef8bf6bb3857aea88c9b842a9672285b5a3b 100644 (file)
@@ -32,7 +32,6 @@
 #include "FrameLoader.h"
 #include "HTMLFrameOwnerElement.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "ResourceLoadStatistics.h"
 #include "ResourceRequest.h"
index a84cbaea6333c48645d0234da55d49a286a7b5b3..807809b6666dc25f6205f4737bc283f589804929 100644 (file)
@@ -41,7 +41,6 @@
 #include "FrameLoaderClient.h"
 #include "InspectorInstrumentation.h"
 #include "LoaderStrategy.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PlatformStrategies.h"
 #include "ProgressTracker.h"
index 05c914bd6afb14593bc73efb52a9ec7fef04284d..98359d36accf6782b42394e5e65f92e043ffd983 100644 (file)
@@ -45,7 +45,6 @@
 #include "HTMLNames.h"
 #include "HTMLObjectElement.h"
 #include "MIMETypeRegistry.h"
-#include "MainFrame.h"
 #include "NavigationScheduler.h"
 #include "Page.h"
 #include "PluginData.h"
index 45206a2c54488bfb4a50b10afb016fcc21ecf747..36d65b3f91a5b6377dec329370ed3a32456cf474 100644 (file)
@@ -41,7 +41,6 @@
 #include "HTTPParsers.h"
 #include "LinkLoader.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "MemoryCache.h"
 #include "Page.h"
 #include "ResourceLoadObserver.h"
index 8a346db67cdbb676ab16717d67db177d8315a128..07005cf4e1bce6fd828cd2d76a2814b534a97482 100644 (file)
@@ -38,7 +38,6 @@
 #include "FrameLoader.h"
 #include "FrameLoaderClient.h"
 #include "InspectorInstrumentation.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "ProgressEvent.h"
 #include "ResourceHandle.h"
index d558b529bca793c90511a8027fd266aa2a203eef..705c6dc8b90ed8800417cf2b9640bdc6b035f4a8 100644 (file)
@@ -35,9 +35,9 @@
 #include "MHTMLArchive.h"
 
 #include "Document.h"
+#include "Frame.h"
 #include "MHTMLParser.h"
 #include "MIMETypeRegistry.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PageSerializer.h"
 #include "QuotedPrintable.h"
index 81ad0b40e285713c934d0597ed97072b646020dd..b38d6bdf82dff615d9c58dccd5c97c46866b1271 100644 (file)
 #include "DiagnosticLoggingKeys.h"
 #include "Document.h"
 #include "DocumentLoader.h"
+#include "Frame.h"
 #include "FrameLoader.h"
 #include "FrameLoaderClient.h"
 #include "HTTPHeaderNames.h"
 #include "InspectorInstrumentation.h"
 #include "LoaderStrategy.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "MemoryCache.h"
 #include "PlatformStrategies.h"
 #include "ProgressTracker.h"
index ee619dc9d55be8f9bd87a04a484563825e56e938..6cd8311a6ee90018bb1b7235f50c6eb024ac7282 100644 (file)
@@ -55,7 +55,6 @@
 #include "LoaderStrategy.h"
 #include "LocalizedStrings.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "MemoryCache.h"
 #include "Page.h"
 #include "PingLoader.h"
index fa9bbcacef03f306368491860ba8e55b59fc1ec6..cfbbfaa9f3c0897cbe0520b90c2b80056d325c8e 100644 (file)
@@ -29,9 +29,9 @@
 #include "AutoscrollController.h"
 
 #include "EventHandler.h"
+#include "Frame.h"
 #include "FrameView.h"
 #include "HitTestResult.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "RenderBox.h"
 #include "RenderView.h"
index 0667491978660e7e9c1a5d7f2b7ca137f2167bd8..a404963cd3bca566463b2d3f3904ba5a5b8a9ba2 100644 (file)
@@ -30,6 +30,7 @@
 #include "FileIconLoader.h"
 #include "FileList.h"
 #include "FloatRect.h"
+#include "Frame.h"
 #include "FrameLoaderClient.h"
 #include "FrameTree.h"
 #include "Geolocation.h"
@@ -39,7 +40,6 @@
 #include "HitTestResult.h"
 #include "Icon.h"
 #include "InspectorInstrumentation.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PageGroupLoadDeferrer.h"
 #include "PopupOpeningObserver.h"
index 68be91ec0171f15bce475cee35eea54a88a6eaf9..36ef79fec2c2a848510e390cf217c1566fe8ac05 100644 (file)
@@ -43,6 +43,7 @@
 #include "Event.h"
 #include "EventHandler.h"
 #include "FormState.h"
+#include "Frame.h"
 #include "FrameLoadRequest.h"
 #include "FrameLoader.h"
 #include "FrameLoaderClient.h"
@@ -53,7 +54,6 @@
 #include "HitTestResult.h"
 #include "InspectorController.h"
 #include "LocalizedStrings.h"
-#include "MainFrame.h"
 #include "MouseEvent.h"
 #include "NavigationAction.h"
 #include "Node.h"
index d5e9d4955f1c38d7e8378502a32ece72ee9eb89a..90c3e8e5a7838dd0bf8bc40e9f9e7b1e384ac801 100644 (file)
@@ -57,6 +57,7 @@
 #include "EventNames.h"
 #include "FloatRect.h"
 #include "FocusController.h"
+#include "Frame.h"
 #include "FrameLoadRequest.h"
 #include "FrameLoader.h"
 #include "FrameLoaderClient.h"
@@ -67,7 +68,6 @@
 #include "JSDOMWindowBase.h"
 #include "JSMainThreadExecState.h"
 #include "Location.h"
-#include "MainFrame.h"
 #include "MediaQueryList.h"
 #include "MediaQueryMatcher.h"
 #include "MessageEvent.h"
index 09296566e46e99b97f2a48e454689cd6f467bfb4..f70e7cc84efe38ceb17ab80b1461c84c94152036 100644 (file)
@@ -29,7 +29,6 @@
 #include "ElementIterator.h"
 #include "FrameView.h"
 #include "GraphicsContext.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PageOverlay.h"
 #include "PageOverlayController.h"
@@ -43,14 +42,14 @@ DebugPageOverlays* DebugPageOverlays::sharedDebugOverlays;
 
 class RegionOverlay : public RefCounted<RegionOverlay>, public PageOverlay::Client {
 public:
-    static Ref<RegionOverlay> create(MainFrame&, DebugPageOverlays::RegionType);
+    static Ref<RegionOverlay> create(Page&, DebugPageOverlays::RegionType);
     virtual ~RegionOverlay();
 
     void recomputeRegion();
     PageOverlay& overlay() { return *m_overlay; }
 
 protected:
-    RegionOverlay(MainFrame&, Color);
+    RegionOverlay(Page&, Color);
 
 private:
     void willMoveToPage(PageOverlay&, Page*) final;
@@ -64,7 +63,7 @@ protected:
     virtual bool updateRegion() = 0;
     void drawRegion(GraphicsContext&, const Region&, const Color&, const IntRect& dirtyRect);
     
-    MainFrame& m_frame;
+    Page& m_page;
     RefPtr<PageOverlay> m_overlay;
     std::unique_ptr<Region> m_region;
     Color m_color;
@@ -72,14 +71,14 @@ protected:
 
 class MouseWheelRegionOverlay final : public RegionOverlay {
 public:
-    static Ref<MouseWheelRegionOverlay> create(MainFrame& frame)
+    static Ref<MouseWheelRegionOverlay> create(Page& page)
     {
-        return adoptRef(*new MouseWheelRegionOverlay(frame));
+        return adoptRef(*new MouseWheelRegionOverlay(page));
     }
 
 private:
-    explicit MouseWheelRegionOverlay(MainFrame& frame)
-        : RegionOverlay(frame, Color(0.5f, 0.0f, 0.0f, 0.4f))
+    explicit MouseWheelRegionOverlay(Page& page)
+        : RegionOverlay(page, Color(0.5f, 0.0f, 0.0f, 0.4f))
     {
     }
 
@@ -90,7 +89,7 @@ bool MouseWheelRegionOverlay::updateRegion()
 {
     auto region = std::make_unique<Region>();
     
-    for (const Frame* frame = &m_frame; frame; frame = frame->tree().traverseNext()) {
+    for (const Frame* frame = &m_page.mainFrame(); frame; frame = frame->tree().traverseNext()) {
         if (!frame->view() || !frame->document())
             continue;
 
@@ -108,14 +107,14 @@ bool MouseWheelRegionOverlay::updateRegion()
 
 class NonFastScrollableRegionOverlay final : public RegionOverlay {
 public:
-    static Ref<NonFastScrollableRegionOverlay> create(MainFrame& frame)
+    static Ref<NonFastScrollableRegionOverlay> create(Page& page)
     {
-        return adoptRef(*new NonFastScrollableRegionOverlay(frame));
+        return adoptRef(*new NonFastScrollableRegionOverlay(page));
     }
 
 private:
-    explicit NonFastScrollableRegionOverlay(MainFrame& frame)
-        : RegionOverlay(frame, Color(1.0f, 0.5f, 0.0f, 0.4f))
+    explicit NonFastScrollableRegionOverlay(Page& page)
+        : RegionOverlay(page, Color(1.0f, 0.5f, 0.0f, 0.4f))
     {
     }
 
@@ -129,14 +128,12 @@ bool NonFastScrollableRegionOverlay::updateRegion()
 {
     bool regionChanged = false;
 
-    if (Page* page = m_frame.page()) {
-        if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) {
-            EventTrackingRegions eventTrackingRegions = scrollingCoordinator->absoluteEventTrackingRegions();
+    if (ScrollingCoordinator* scrollingCoordinator = m_page.scrollingCoordinator()) {
+        EventTrackingRegions eventTrackingRegions = scrollingCoordinator->absoluteEventTrackingRegions();
 
-            if (eventTrackingRegions != m_eventTrackingRegions) {
-                m_eventTrackingRegions = eventTrackingRegions;
-                regionChanged = true;
-            }
+        if (eventTrackingRegions != m_eventTrackingRegions) {
+            m_eventTrackingRegions = eventTrackingRegions;
+            regionChanged = true;
         }
     }
 
@@ -234,20 +231,20 @@ void NonFastScrollableRegionOverlay::drawRect(PageOverlay& pageOverlay, Graphics
     drawRegion(context, m_eventTrackingRegions.asynchronousDispatchRegion, m_color, bounds);
 }
 
-Ref<RegionOverlay> RegionOverlay::create(MainFrame& frame, DebugPageOverlays::RegionType regionType)
+Ref<RegionOverlay> RegionOverlay::create(Page& page, DebugPageOverlays::RegionType regionType)
 {
     switch (regionType) {
     case DebugPageOverlays::RegionType::WheelEventHandlers:
-        return MouseWheelRegionOverlay::create(frame);
+        return MouseWheelRegionOverlay::create(page);
     case DebugPageOverlays::RegionType::NonFastScrollableRegion:
-        return NonFastScrollableRegionOverlay::create(frame);
+        return NonFastScrollableRegionOverlay::create(page);
     }
     ASSERT_NOT_REACHED();
-    return MouseWheelRegionOverlay::create(frame);
+    return MouseWheelRegionOverlay::create(page);
 }
 
-RegionOverlay::RegionOverlay(MainFrame& frame, Color regionColor)
-    : m_frame(frame)
+RegionOverlay::RegionOverlay(Page& page, Color regionColor)
+    : m_page(page)
     , m_overlay(PageOverlay::create(*this, PageOverlay::OverlayType::Document))
     , m_color(regionColor)
 {
@@ -256,7 +253,7 @@ RegionOverlay::RegionOverlay(MainFrame& frame, Color regionColor)
 RegionOverlay::~RegionOverlay()
 {
     if (m_overlay)
-        m_frame.pageOverlayController().uninstallPageOverlay(*m_overlay, PageOverlay::FadeMode::DoNotFade);
+        m_page.pageOverlayController().uninstallPageOverlay(*m_overlay, PageOverlay::FadeMode::DoNotFade);
 }
 
 void RegionOverlay::willMoveToPage(PageOverlay&, Page* page)
@@ -319,75 +316,79 @@ static inline size_t indexOf(DebugPageOverlays::RegionType regionType)
     return static_cast<size_t>(regionType);
 }
 
-RegionOverlay& DebugPageOverlays::ensureRegionOverlayForFrame(MainFrame& frame, RegionType regionType)
+RegionOverlay& DebugPageOverlays::ensureRegionOverlayForPage(Page& page, RegionType regionType)
 {
-    auto it = m_frameRegionOverlays.find(&frame);
-    if (it != m_frameRegionOverlays.end()) {
+    auto it = m_pageRegionOverlays.find(&page);
+    if (it != m_pageRegionOverlays.end()) {
         auto& visualizer = it->value[indexOf(regionType)];
         if (!visualizer)
-            visualizer = RegionOverlay::create(frame, regionType);
+            visualizer = RegionOverlay::create(page, regionType);
         return *visualizer;
     }
 
     Vector<RefPtr<RegionOverlay>> visualizers(NumberOfRegionTypes);
-    auto visualizer = RegionOverlay::create(frame, regionType);
+    auto visualizer = RegionOverlay::create(page, regionType);
     visualizers[indexOf(regionType)] = visualizer.copyRef();
-    m_frameRegionOverlays.add(&frame, WTFMove(visualizers));
+    m_pageRegionOverlays.add(&page, WTFMove(visualizers));
     return visualizer;
 }
 
-void DebugPageOverlays::showRegionOverlay(MainFrame& frame, RegionType regionType)
+void DebugPageOverlays::showRegionOverlay(Page& page, RegionType regionType)
 {
-    auto& visualizer = ensureRegionOverlayForFrame(frame, regionType);
-    frame.pageOverlayController().installPageOverlay(visualizer.overlay(), PageOverlay::FadeMode::DoNotFade);
+    auto& visualizer = ensureRegionOverlayForPage(page, regionType);
+    page.pageOverlayController().installPageOverlay(visualizer.overlay(), PageOverlay::FadeMode::DoNotFade);
 }
 
-void DebugPageOverlays::hideRegionOverlay(MainFrame& frame, RegionType regionType)
+void DebugPageOverlays::hideRegionOverlay(Page& page, RegionType regionType)
 {
-    auto it = m_frameRegionOverlays.find(&frame);
-    if (it == m_frameRegionOverlays.end())
+    auto it = m_pageRegionOverlays.find(&page);
+    if (it == m_pageRegionOverlays.end())
         return;
     auto& visualizer = it->value[indexOf(regionType)];
     if (!visualizer)
         return;
-    frame.pageOverlayController().uninstallPageOverlay(visualizer->overlay(), PageOverlay::FadeMode::DoNotFade);
+    page.pageOverlayController().uninstallPageOverlay(visualizer->overlay(), PageOverlay::FadeMode::DoNotFade);
     visualizer = nullptr;
 }
 
 void DebugPageOverlays::regionChanged(Frame& frame, RegionType regionType)
 {
-    if (auto* visualizer = regionOverlayForFrame(frame.mainFrame(), regionType))
+    auto* page = frame.page();
+    if (!page)
+        return;
+
+    if (auto* visualizer = regionOverlayForPage(*page, regionType))
         visualizer->recomputeRegion();
 }
 
-RegionOverlay* DebugPageOverlays::regionOverlayForFrame(MainFrame& frame, RegionType regionType) const
+RegionOverlay* DebugPageOverlays::regionOverlayForPage(Page& page, RegionType regionType) const
 {
-    auto it = m_frameRegionOverlays.find(&frame);
-    if (it == m_frameRegionOverlays.end())
+    auto it = m_pageRegionOverlays.find(&page);
+    if (it == m_pageRegionOverlays.end())
         return nullptr;
     return it->value.at(indexOf(regionType)).get();
 }
 
-void DebugPageOverlays::updateOverlayRegionVisibility(MainFrame& frame, DebugOverlayRegions visibleRegions)
+void DebugPageOverlays::updateOverlayRegionVisibility(Page& page, DebugOverlayRegions visibleRegions)
 {
     if (visibleRegions & NonFastScrollableRegion)
-        showRegionOverlay(frame, RegionType::NonFastScrollableRegion);
+        showRegionOverlay(page, RegionType::NonFastScrollableRegion);
     else
-        hideRegionOverlay(frame, RegionType::NonFastScrollableRegion);
+        hideRegionOverlay(page, RegionType::NonFastScrollableRegion);
 
     if (visibleRegions & WheelEventHandlerRegion)
-        showRegionOverlay(frame, RegionType::WheelEventHandlers);
+        showRegionOverlay(page, RegionType::WheelEventHandlers);
     else
-        hideRegionOverlay(frame, RegionType::WheelEventHandlers);
+        hideRegionOverlay(page, RegionType::WheelEventHandlers);
 }
 
-void DebugPageOverlays::settingsChanged(MainFrame& frame)
+void DebugPageOverlays::settingsChanged(Page& page)
 {
-    DebugOverlayRegions activeOverlayRegions = frame.settings().visibleDebugOverlayRegions();
-    if (!activeOverlayRegions && !hasOverlays(frame))
+    DebugOverlayRegions activeOverlayRegions = page.settings().visibleDebugOverlayRegions();
+    if (!activeOverlayRegions && !hasOverlays(page))
         return;
 
-    DebugPageOverlays::singleton().updateOverlayRegionVisibility(frame, activeOverlayRegions);
+    DebugPageOverlays::singleton().updateOverlayRegionVisibility(page, activeOverlayRegions);
 }
 
 }
index e1744c0e6b11f8e3fc69af8cff692eb19f96a3e0..3f68bc6bf685730509dcb80e417ccc37af362c5d 100644 (file)
@@ -32,7 +32,7 @@
 
 namespace WebCore {
 
-class MainFrame;
+class Page;
 class RegionOverlay;
 
 class DebugPageOverlays {
@@ -48,44 +48,44 @@ public:
     static void didLayout(Frame&);
     static void didChangeEventHandlers(Frame&);
 
-    WEBCORE_EXPORT static void settingsChanged(MainFrame&);
+    WEBCORE_EXPORT static void settingsChanged(Page&);
 
 private:
-    static bool hasOverlays(MainFrame&);
+    static bool hasOverlays(Page&);
 
-    void showRegionOverlay(MainFrame&, RegionType);
-    void hideRegionOverlay(MainFrame&, RegionType);
+    void showRegionOverlay(Page&, RegionType);
+    void hideRegionOverlay(Page&, RegionType);
 
     void regionChanged(Frame&, RegionType);
 
-    bool hasOverlaysForFrame(MainFrame& frame) const
+    bool hasOverlaysForPage(Page& page) const
     {
-        return m_frameRegionOverlays.contains(&frame);
+        return m_pageRegionOverlays.contains(&page);
     }
     
-    void updateOverlayRegionVisibility(MainFrame&, DebugOverlayRegions);
+    void updateOverlayRegionVisibility(Page&, DebugOverlayRegions);
 
-    RegionOverlay* regionOverlayForFrame(MainFrame&, RegionType) const;
-    RegionOverlay& ensureRegionOverlayForFrame(MainFrame&, RegionType);
+    RegionOverlay* regionOverlayForPage(Page&, RegionType) const;
+    RegionOverlay& ensureRegionOverlayForPage(Page&, RegionType);
 
-    HashMap<MainFrame*, Vector<RefPtr<RegionOverlay>>> m_frameRegionOverlays;
+    HashMap<Page*, Vector<RefPtr<RegionOverlay>>> m_pageRegionOverlays;
 
     static DebugPageOverlays* sharedDebugOverlays;
 };
 
-#define FAST_RETURN_IF_NO_OVERLAYS(frame) if (LIKELY(!hasOverlays(frame))) return;
+#define FAST_RETURN_IF_NO_OVERLAYS(page) if (LIKELY(!page || !hasOverlays(*page))) return;
 
-inline bool DebugPageOverlays::hasOverlays(MainFrame& frame)
+inline bool DebugPageOverlays::hasOverlays(Page& page)
 {
     if (!sharedDebugOverlays)
         return false;
 
-    return sharedDebugOverlays->hasOverlaysForFrame(frame);
+    return sharedDebugOverlays->hasOverlaysForPage(page);
 }
 
 inline void DebugPageOverlays::didLayout(Frame& frame)
 {
-    FAST_RETURN_IF_NO_OVERLAYS(frame.mainFrame());
+    FAST_RETURN_IF_NO_OVERLAYS(frame.page());
 
     sharedDebugOverlays->regionChanged(frame, RegionType::WheelEventHandlers);
     sharedDebugOverlays->regionChanged(frame, RegionType::NonFastScrollableRegion);
@@ -93,7 +93,7 @@ inline void DebugPageOverlays::didLayout(Frame& frame)
 
 inline void DebugPageOverlays::didChangeEventHandlers(Frame& frame)
 {
-    FAST_RETURN_IF_NO_OVERLAYS(frame.mainFrame());
+    FAST_RETURN_IF_NO_OVERLAYS(frame.page());
 
     sharedDebugOverlays->regionChanged(frame, RegionType::WheelEventHandlers);
     sharedDebugOverlays->regionChanged(frame, RegionType::NonFastScrollableRegion);
index 5275425c4f4e7e4ec453eab4eb808ce38b1232c8..9174afd53216c112c4b5e0d57587c86d1fc9c5a1 100644 (file)
@@ -48,6 +48,7 @@
 #include "File.h"
 #include "FloatRect.h"
 #include "FocusController.h"
+#include "Frame.h"
 #include "FrameLoadRequest.h"
 #include "FrameLoader.h"
 #include "FrameSelection.h"
@@ -61,7 +62,6 @@
 #include "HitTestResult.h"
 #include "Image.h"
 #include "ImageOrientation.h"
-#include "MainFrame.h"
 #include "MoveSelectionCommand.h"
 #include "Page.h"
 #include "Pasteboard.h"
@@ -261,7 +261,7 @@ bool DragController::performDragOperation(const DragData& dragData)
 
     if ((m_dragDestinationAction & DragDestinationActionDHTML) && dragIsHandledByDocument(m_dragHandlingMethod)) {
         m_client.willPerformDragDestinationAction(DragDestinationActionDHTML, dragData);
-        Ref<MainFrame> mainFrame(m_page.mainFrame());
+        Ref<Frame> mainFrame(m_page.mainFrame());
         bool preventedDefault = false;
         if (mainFrame->view())
             preventedDefault = mainFrame->eventHandler().performDragAndDrop(createMouseEvent(dragData), Pasteboard::createForDragAndDrop(dragData), dragData.draggingSourceOperationMask(), dragData.containsFiles());
@@ -685,7 +685,7 @@ static DragOperation defaultOperationForDrag(DragOperation srcOpMask)
 bool DragController::tryDHTMLDrag(const DragData& dragData, DragOperation& operation)
 {
     ASSERT(m_documentUnderMouse);
-    Ref<MainFrame> mainFrame(m_page.mainFrame());
+    Ref<Frame> mainFrame(m_page.mainFrame());
     RefPtr<FrameView> viewProtector = mainFrame->view();
     if (!viewProtector)
         return false;
@@ -1193,7 +1193,7 @@ void DragController::beginDrag(DragItem dragItem, Frame& frame, const IntPoint&
     m_dragInitiator = frame.document();
 
     // Protect this frame and view, as a load may occur mid drag and attempt to unload this frame
-    Ref<MainFrame> mainFrameProtector(m_page.mainFrame());
+    Ref<Frame> mainFrameProtector(m_page.mainFrame());
     RefPtr<FrameView> viewProtector = mainFrameProtector->view();
 
     auto mouseDownPointInRootViewCoordinates = viewProtector->rootViewToContents(frame.view()->contentsToRootView(mouseDownPoint));
@@ -1214,7 +1214,7 @@ void DragController::doSystemDrag(DragImage image, const IntPoint& dragLoc, cons
     m_didInitiateDrag = true;
     m_dragInitiator = frame.document();
     // Protect this frame and view, as a load may occur mid drag and attempt to unload this frame
-    Ref<MainFrame> frameProtector(m_page.mainFrame());
+    Ref<Frame> frameProtector(m_page.mainFrame());
     RefPtr<FrameView> viewProtector = frameProtector->view();
 
     DragItem item;
index 44e844343cad9e8dca36ff0767dec30c33c5c7c0..a60d4ca416f85299c12f90e9a3c9d310c1641565 100644 (file)
@@ -45,6 +45,7 @@
 #include "FloatPoint.h"
 #include "FloatRect.h"
 #include "FocusController.h"
+#include "Frame.h"
 #include "FrameLoader.h"
 #include "FrameSelection.h"
 #include "FrameTree.h"
@@ -61,7 +62,6 @@
 #include "InspectorInstrumentation.h"
 #include "KeyboardEvent.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "MouseEvent.h"
 #include "MouseEventWithHitTestResults.h"
 #include "Page.h"
@@ -1636,7 +1636,7 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& platformMouse
     }
 #endif
 
-    if (m_frame.mainFrame().pageOverlayController().handleMouseEvent(platformMouseEvent))
+    if (m_frame.page()->pageOverlayController().handleMouseEvent(platformMouseEvent))
         return true;
 
 #if ENABLE(TOUCH_EVENTS)
@@ -1837,7 +1837,7 @@ bool EventHandler::mouseMoved(const PlatformMouseEvent& event)
     RefPtr<FrameView> protector(m_frame.view());
     MaximumDurationTracker maxDurationTracker(&m_maxMouseMovedDuration);
 
-    if (m_frame.mainFrame().pageOverlayController().handleMouseEvent(event))
+    if (m_frame.page() && m_frame.page()->pageOverlayController().handleMouseEvent(event))
         return true;
 
     HitTestResult hoveredNode = HitTestResult(LayoutPoint());
@@ -2035,7 +2035,7 @@ bool EventHandler::handleMouseReleaseEvent(const PlatformMouseEvent& platformMou
     }
 #endif
 
-    if (m_frame.mainFrame().pageOverlayController().handleMouseEvent(platformMouseEvent))
+    if (m_frame.page()->pageOverlayController().handleMouseEvent(platformMouseEvent))
         return true;
 
 #if ENABLE(TOUCH_EVENTS)
@@ -2653,7 +2653,8 @@ void EventHandler::platformPrepareForWheelEvents(const PlatformWheelEvent&, cons
 
 void EventHandler::platformRecordWheelEvent(const PlatformWheelEvent& event)
 {
-    m_frame.mainFrame().wheelEventDeltaFilter()->updateFromDelta(FloatSize(event.deltaX(), event.deltaY()));
+    if (auto* page = m_frame.page())
+        page->wheelEventDeltaFilter()->updateFromDelta(FloatSize(event.deltaX(), event.deltaY()));
 }
 
 bool EventHandler::platformCompleteWheelEvent(const PlatformWheelEvent& event, ContainerNode*, const WeakPtr<ScrollableArea>&)
@@ -2776,8 +2777,8 @@ bool EventHandler::handleWheelEvent(const PlatformWheelEvent& event)
     platformPrepareForWheelEvents(event, result, element, scrollableContainer, scrollableArea, isOverWidget);
 
 #if PLATFORM(MAC)
-    if (event.phase() == PlatformWheelEventPhaseNone && event.momentumPhase() == PlatformWheelEventPhaseNone)
-        m_frame.mainFrame().resetLatchingState();
+    if (event.phase() == PlatformWheelEventPhaseNone && event.momentumPhase() == PlatformWheelEventPhaseNone && m_frame.page())
+        m_frame.page()->resetLatchingState();
 #endif
 
     // FIXME: It should not be necessary to do this mutation here.
@@ -2816,10 +2817,14 @@ bool EventHandler::handleWheelEvent(const PlatformWheelEvent& event)
 
 void EventHandler::clearLatchedState()
 {
+    auto* page = m_frame.page();
+    if (!page)
+        return;
+
 #if PLATFORM(MAC)
-    m_frame.mainFrame().resetLatchingState();
+    page->resetLatchingState();
 #endif
-    if (auto filter = m_frame.mainFrame().wheelEventDeltaFilter())
+    if (auto filter = page->wheelEventDeltaFilter())
         filter->endFilteringDeltas();
 }
 
@@ -2838,12 +2843,12 @@ void EventHandler::defaultWheelEventHandler(Node* startNode, WheelEvent& wheelEv
     }
 
 #if PLATFORM(MAC)
-    ScrollLatchingState* latchedState = m_frame.mainFrame().latchingState();
+    ScrollLatchingState* latchedState = m_frame.page() ? m_frame.page()->latchingState() : nullptr;
     Element* stopElement = latchedState ? latchedState->previousWheelScrolledElement() : nullptr;
 
-    if (m_frame.mainFrame().wheelEventDeltaFilter()->isFilteringDeltas()) {
-        filteredPlatformDelta = m_frame.mainFrame().wheelEventDeltaFilter()->filteredDelta();
-        filteredVelocity = m_frame.mainFrame().wheelEventDeltaFilter()->filteredVelocity();
+    if (m_frame.page() && m_frame.page()->wheelEventDeltaFilter()->isFilteringDeltas()) {
+        filteredPlatformDelta = m_frame.page()->wheelEventDeltaFilter()->filteredDelta();
+        filteredVelocity = m_frame.page()->wheelEventDeltaFilter()->filteredVelocity();
     }
 #else
     Element* stopElement = nullptr;
index 1691a075be819b37a22e1ce7ae25eb951371f0cd..919f7d0a239cfc74bc77174547e4ca705141fb07 100644 (file)
@@ -38,6 +38,7 @@
 #include "Event.h"
 #include "EventHandler.h"
 #include "EventNames.h"
+#include "Frame.h"
 #include "FrameSelection.h"
 #include "FrameTree.h"
 #include "FrameView.h"
@@ -50,7 +51,6 @@
 #include "HTMLTextAreaElement.h"
 #include "HitTestResult.h"
 #include "KeyboardEvent.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "Range.h"
 #include "RenderWidget.h"
index 8512649d795e82d75651dbaf9e2bc8fd2096e0e2..2ee375dd0b27f19aaa026e3487d4ccdf73332e66 100644 (file)
@@ -68,7 +68,6 @@
 #include "InspectorInstrumentation.h"
 #include "JSDOMWindowProxy.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "MathMLNames.h"
 #include "MediaFeatureNames.h"
 #include "NavigationScheduler.h"
@@ -151,7 +150,7 @@ static inline float parentTextZoomFactor(Frame* frame)
 }
 
 Frame::Frame(Page& page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient& frameLoaderClient)
-    : m_mainFrame(ownerElement ? page.mainFrame() : static_cast<MainFrame&>(*this))
+    : m_mainFrame(ownerElement ? page.mainFrame() : *this)
     , m_page(&page)
     , m_settings(&page.settings())
     , m_treeNode(*this, parentFromOwnerElement(ownerElement))
@@ -1089,4 +1088,33 @@ bool Frame::isAlwaysOnLoggingAllowed() const
     return page() && page()->isAlwaysOnLoggingAllowed();
 }
 
+void Frame::dropChildren()
+{
+    ASSERT(isMainFrame());
+    while (Frame* child = tree().firstChild())
+        tree().removeChild(*child);
+}
+
+void Frame::selfOnlyRef()
+{
+    ASSERT(isMainFrame());
+    if (m_selfOnlyRefCount++)
+        return;
+
+    ref();
+}
+
+void Frame::selfOnlyDeref()
+{
+    ASSERT(isMainFrame());
+    ASSERT(m_selfOnlyRefCount);
+    if (--m_selfOnlyRefCount)
+        return;
+
+    if (hasOneRef())
+        dropChildren();
+
+    deref();
+}
+
 } // namespace WebCore
index 481fdda6f3ecc1d5a63c4e98f1fb69cea58fe636..b35b8fd0755f638303839cf1c9be8822b85f2a00 100644 (file)
@@ -78,7 +78,6 @@ class ImageBuffer;
 class IntPoint;
 class IntRect;
 class IntSize;
-class MainFrame;
 class NavigationScheduler;
 class Node;
 class Page;
@@ -118,7 +117,7 @@ enum {
 };
 typedef unsigned LayerTreeFlags;
 
-class Frame : public ThreadSafeRefCounted<Frame> {
+class Frame final : public ThreadSafeRefCounted<Frame> {
 public:
     WEBCORE_EXPORT static Ref<Frame> create(Page*, HTMLFrameOwnerElement*, FrameLoaderClient*);
 
@@ -133,7 +132,7 @@ public:
         bool useFixedLayout = false, ScrollbarMode = ScrollbarAuto, bool horizontalLock = false,
         ScrollbarMode = ScrollbarAuto, bool verticalLock = false);
 
-    WEBCORE_EXPORT virtual ~Frame();
+    WEBCORE_EXPORT ~Frame();
 
     void addDestructionObserver(FrameDestructionObserver*);
     void removeDestructionObserver(FrameDestructionObserver*);
@@ -142,7 +141,7 @@ public:
     void detachFromPage();
     void disconnectOwnerElement();
 
-    MainFrame& mainFrame() const;
+    Frame& mainFrame() const;
     bool isMainFrame() const { return this == static_cast<void*>(&m_mainFrame); }
 
     Page* page() const;
@@ -282,14 +281,19 @@ public:
 
 // ========
 
-protected:
-    Frame(Page&, HTMLFrameOwnerElement*, FrameLoaderClient&);
-    void setMainFrameWasDestroyed();
+    void selfOnlyRef();
+    void selfOnlyDeref();
 
 private:
+    friend class NavigationDisabler;
+
+    Frame(Page&, HTMLFrameOwnerElement*, FrameLoaderClient&);
+
+    void dropChildren();
+
     HashSet<FrameDestructionObserver*> m_destructionObservers;
 
-    MainFrame& m_mainFrame;
+    Frame& m_mainFrame;
     Page* m_page;
     const RefPtr<Settings> m_settings;
     mutable FrameTree m_treeNode;
@@ -332,8 +336,9 @@ private:
     float m_textZoomFactor;
 
     int m_activeDOMObjectsAndAnimationsSuspendedCount;
-    bool m_mainFrameWasDestroyed { false };
     bool m_documentIsBeingReplaced { false };
+    unsigned m_navigationDisableCount { 0 };
+    unsigned m_selfOnlyRefCount { 0 };
 
 protected:
     UniqueRef<EventHandler> m_eventHandler;
@@ -379,15 +384,9 @@ inline void Frame::detachFromPage()
     m_page = nullptr;
 }
 
-inline MainFrame& Frame::mainFrame() const
+inline Frame& Frame::mainFrame() const
 {
-    ASSERT_WITH_SECURITY_IMPLICATION(!m_mainFrameWasDestroyed);
     return m_mainFrame;
 }
 
-inline void Frame::setMainFrameWasDestroyed()
-{
-    m_mainFrameWasDestroyed = false;
-}
-
 } // namespace WebCore
index 303c51a3be97db5f256c548a2e78d8e4fd008a80..26ccc7a4e6de106a541b2b8b7ef8ac78df1a024f 100644 (file)
@@ -22,9 +22,9 @@
 #include "FrameTree.h"
 
 #include "Document.h"
+#include "Frame.h"
 #include "FrameView.h"
 #include "HTMLFrameOwnerElement.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PageGroup.h"
 #include <stdarg.h>
index 0e21dd6debde8191fbd817e1cbe4fc7f13acd19e..773bb79010b5684e8bb18b2aea3e56707417dd77 100644 (file)
@@ -42,6 +42,7 @@
 #include "EventNames.h"
 #include "FloatRect.h"
 #include "FocusController.h"
+#include "Frame.h"
 #include "FrameLoader.h"
 #include "FrameLoaderClient.h"
 #include "FrameSelection.h"
@@ -62,7 +63,6 @@
 #include "InspectorController.h"
 #include "InspectorInstrumentation.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "MemoryCache.h"
 #include "OverflowEvent.h"
 #include "Page.h"
@@ -460,8 +460,8 @@ void FrameView::setFrameRect(const IntRect& newRect)
             renderView->compositor().frameViewDidChangeSize();
     }
 
-    if (frame().isMainFrame())
-        frame().mainFrame().pageOverlayController().didChangeViewSize();
+    if (frame().isMainFrame() && frame().page())
+        frame().page()->pageOverlayController().didChangeViewSize();
 
     viewportContentsChanged();
 }
@@ -614,7 +614,7 @@ void FrameView::setContentsSize(const IntSize& size)
     page->chrome().contentsSizeChanged(frame(), size); // Notify only.
 
     if (frame().isMainFrame()) {
-        frame().mainFrame().pageOverlayController().didChangeDocumentSize();
+        page->pageOverlayController().didChangeDocumentSize();
         PageCache::singleton().markPagesForContentsSizeChanged(*page);
     }
     layoutContext().enableSetNeedsLayout();
@@ -2363,7 +2363,8 @@ void FrameView::setViewportConstrainedObjectsNeedLayout()
 
 void FrameView::didChangeScrollOffset()
 {
-    frame().mainFrame().pageOverlayController().didScrollFrame(frame());
+    if (auto* page = frame().page())
+        page->pageOverlayController().didScrollFrame(frame());
     frame().loader().client().didChangeScrollOffset();
 }
 
@@ -5045,7 +5046,8 @@ void FrameView::setViewExposedRect(std::optional<FloatRect> viewExposedRect)
     if (auto* view = renderView())
         view->compositor().scheduleLayerFlush(false /* canThrottle */);
 
-    frame().mainFrame().pageOverlayController().didChangeViewExposedRect();
+    if (auto* page = frame().page())
+        page->pageOverlayController().didChangeViewExposedRect();
 }
     
 void FrameView::setViewportSizeForCSSViewportUnits(IntSize size)
index ae2047c040300392b8b3570caebb6a72f7b24901..12598743ab00b5b6da385e223ef38ef3c8ed19e9 100644 (file)
@@ -34,7 +34,6 @@
 #include "HistoryController.h"
 #include "HistoryItem.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "NavigationScheduler.h"
 #include "Page.h"
 #include "ScriptController.h"
diff --git a/Source/WebCore/page/MainFrame.cpp b/Source/WebCore/page/MainFrame.cpp
deleted file mode 100644 (file)
index 30a22a8..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (C) 2013-2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "MainFrame.h"
-
-#include "Element.h"
-#include "PageConfiguration.h"
-#include "PageOverlayController.h"
-#include "PaymentCoordinator.h"
-#include "PerformanceLogging.h"
-#include "ScrollLatchingState.h"
-#include "WheelEventDeltaFilter.h"
-
-#if PLATFORM(MAC)
-#include "ServicesOverlayController.h"
-#endif
-
-namespace WebCore {
-
-inline MainFrame::MainFrame(Page& page, PageConfiguration& configuration)
-    : Frame(page, nullptr, *configuration.loaderClientForMainFrame)
-    , m_selfOnlyRefCount(0)
-#if PLATFORM(MAC) && (ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION))
-    , m_servicesOverlayController(std::make_unique<ServicesOverlayController>(*this))
-#endif
-    , m_recentWheelEventDeltaFilter(WheelEventDeltaFilter::create())
-    , m_pageOverlayController(std::make_unique<PageOverlayController>(*this))
-#if ENABLE(APPLE_PAY)
-    , m_paymentCoordinator(std::make_unique<PaymentCoordinator>(*configuration.paymentCoordinatorClient))
-#endif
-#if ENABLE(APPLICATION_MANIFEST)
-    , m_applicationManifest(configuration.applicationManifest)
-#endif
-    , m_performanceLogging(std::make_unique<PerformanceLogging>(*this))
-{
-}
-
-MainFrame::~MainFrame()
-{
-    m_recentWheelEventDeltaFilter = nullptr;
-
-    setMainFrameWasDestroyed();
-}
-
-Ref<MainFrame> MainFrame::create(Page& page, PageConfiguration& configuration)
-{
-    return adoptRef(*new MainFrame(page, configuration));
-}
-
-void MainFrame::selfOnlyRef()
-{
-    if (m_selfOnlyRefCount++)
-        return;
-
-    ref();
-}
-
-void MainFrame::selfOnlyDeref()
-{
-    ASSERT(m_selfOnlyRefCount);
-    if (--m_selfOnlyRefCount)
-        return;
-
-    if (hasOneRef())
-        dropChildren();
-
-    deref();
-}
-
-void MainFrame::dropChildren()
-{
-    while (Frame* child = tree().firstChild())
-        tree().removeChild(*child);
-}
-
-void MainFrame::didCompleteLoad()
-{
-    performanceLogging().didReachPointOfInterest(PerformanceLogging::MainFrameLoadCompleted);
-}
-
-#if PLATFORM(MAC)
-ScrollLatchingState* MainFrame::latchingState()
-{
-    if (m_latchingState.isEmpty())
-        return nullptr;
-
-    return &m_latchingState.last();
-}
-
-void MainFrame::pushNewLatchingState()
-{
-    m_latchingState.append(ScrollLatchingState());
-}
-
-void MainFrame::resetLatchingState()
-{
-    m_latchingState.clear();
-}
-    
-void MainFrame::popLatchingState()
-{
-    m_latchingState.removeLast();
-}
-
-void MainFrame::removeLatchingStateForTarget(Element& targetNode)
-{
-    if (m_latchingState.isEmpty())
-        return;
-
-    m_latchingState.removeAllMatching([&targetNode] (ScrollLatchingState& state) {
-        auto* wheelElement = state.wheelEventElement();
-        if (!wheelElement)
-            return false;
-
-        return targetNode.isEqualNode(wheelElement);
-    });
-}
-#endif
-
-#if ENABLE(APPLE_PAY)
-void MainFrame::setPaymentCoordinator(std::unique_ptr<PaymentCoordinator>&& paymentCoordinator)
-{
-    m_paymentCoordinator = WTFMove(paymentCoordinator);
-}
-#endif
-
-}
diff --git a/Source/WebCore/page/MainFrame.h b/Source/WebCore/page/MainFrame.h
deleted file mode 100644 (file)
index 2e45405..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "Frame.h"
-#include <wtf/Optional.h>
-#include <wtf/Vector.h>
-
-#if ENABLE(APPLICATION_MANIFEST)
-#include "ApplicationManifest.h"
-#endif
-
-namespace WebCore {
-
-class PageConfiguration;
-class PageOverlayController;
-class PaymentCoordinator;
-class PerformanceLogging;
-class ScrollLatchingState;
-class ServicesOverlayController;
-class WheelEventDeltaFilter;
-
-class MainFrame final : public Frame {
-public:
-    static Ref<MainFrame> create(Page&, PageConfiguration&);
-
-    virtual ~MainFrame();
-
-    void selfOnlyRef();
-    void selfOnlyDeref();
-
-    WheelEventDeltaFilter* wheelEventDeltaFilter() { return m_recentWheelEventDeltaFilter.get(); }
-    PageOverlayController& pageOverlayController() { return *m_pageOverlayController; }
-
-#if PLATFORM(MAC)
-#if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION)
-    ServicesOverlayController& servicesOverlayController() { return *m_servicesOverlayController; }
-#endif // ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION)
-
-    ScrollLatchingState* latchingState();
-    void pushNewLatchingState();
-    void popLatchingState();
-    void resetLatchingState();
-    void removeLatchingStateForTarget(Element&);
-#endif // PLATFORM(MAC)
-
-#if ENABLE(APPLE_PAY)
-    PaymentCoordinator& paymentCoordinator() const { return *m_paymentCoordinator; }
-    WEBCORE_EXPORT void setPaymentCoordinator(std::unique_ptr<PaymentCoordinator>&&);
-#endif
-
-#if ENABLE(APPLICATION_MANIFEST)
-    const std::optional<ApplicationManifest>& applicationManifest() const { return m_applicationManifest; }
-#endif
-
-    PerformanceLogging& performanceLogging() const { return *m_performanceLogging; }
-
-    void didCompleteLoad();
-
-private:
-    MainFrame(Page&, PageConfiguration&);
-
-    void dropChildren();
-
-    unsigned m_selfOnlyRefCount;
-
-#if PLATFORM(MAC)
-    Vector<ScrollLatchingState> m_latchingState;
-#if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION)
-    std::unique_ptr<ServicesOverlayController> m_servicesOverlayController;
-#endif
-#endif
-
-    std::unique_ptr<WheelEventDeltaFilter> m_recentWheelEventDeltaFilter;
-    std::unique_ptr<PageOverlayController> m_pageOverlayController;
-
-#if ENABLE(APPLE_PAY)
-    std::unique_ptr<PaymentCoordinator> m_paymentCoordinator;
-#endif
-
-#if ENABLE(APPLICATION_MANIFEST)
-    std::optional<ApplicationManifest> m_applicationManifest;
-#endif
-
-    std::unique_ptr<PerformanceLogging> m_performanceLogging;
-
-    unsigned m_navigationDisableCount { 0 };
-    friend class NavigationDisabler;
-};
-
-} // namespace WebCore
index 8a9416e1ec2500f38755a92421cdf8c7c3d93c97..70385ae16a9d0831bd7354404c0f447342cc1ce4 100644 (file)
 #include "CommonVM.h"
 #include "Document.h"
 #include "FontCache.h"
+#include "Frame.h"
 #include "GCController.h"
 #include "HTMLMediaElement.h"
 #include "InlineStyleSheetOwner.h"
 #include "InspectorInstrumentation.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "MemoryCache.h"
 #include "Page.h"
 #include "PageCache.h"
index 977374e44ba34474839d1e1fda4accd4ed229828..4f28fd1b2e226aa052991ef0e39e9d170e91b436 100644 (file)
@@ -64,7 +64,6 @@
 #include "LoaderStrategy.h"
 #include "Logging.h"
 #include "LowPowerModeNotifier.h"
-#include "MainFrame.h"
 #include "MediaCanStartListener.h"
 #include "Navigator.h"
 #include "PageCache.h"
@@ -73,6 +72,8 @@
 #include "PageDebuggable.h"
 #include "PageGroup.h"
 #include "PageOverlayController.h"
+#include "PaymentCoordinator.h"
+#include "PerformanceLogging.h"
 #include "PerformanceLoggingClient.h"
 #include "PerformanceMonitor.h"
 #include "PlatformMediaSessionManager.h"
@@ -94,6 +95,7 @@
 #include "SchemeRegistry.h"
 #include "ScriptController.h"
 #include "ScriptedAnimationController.h"
+#include "ScrollLatchingState.h"
 #include "ScrollingCoordinator.h"
 #include "Settings.h"
 #include "SharedBuffer.h"
 #include "VisitedLinkStore.h"
 #include "VoidCallback.h"
 #include "WebGLStateTracker.h"
+#include "WheelEventDeltaFilter.h"
 #include "Widget.h"
 #include <wtf/RefCountedLeakCounter.h>
 #include <wtf/StdLibExtras.h>
 #include "MediaPlaybackTarget.h"
 #endif
 
+#if PLATFORM(MAC)
+#include "ServicesOverlayController.h"
+#endif
+
 #if ENABLE(MEDIA_SESSION)
 #include "MediaSessionManager.h"
 #endif
@@ -204,7 +211,7 @@ Page::Page(PageConfiguration&& pageConfiguration)
     , m_settings(Settings::create(this))
     , m_progress(std::make_unique<ProgressTracker>(*pageConfiguration.progressTrackerClient))
     , m_backForwardController(std::make_unique<BackForwardController>(*this, *WTFMove(pageConfiguration.backForwardClient)))
-    , m_mainFrame(MainFrame::create(*this, pageConfiguration))
+    , m_mainFrame(Frame::create(this, nullptr, pageConfiguration.loaderClientForMainFrame))
     , m_editorClient(WTFMove(pageConfiguration.editorClient))
     , m_plugInClient(pageConfiguration.plugInClient)
     , m_validationMessageClient(WTFMove(pageConfiguration.validationMessageClient))
@@ -234,6 +241,18 @@ Page::Page(PageConfiguration&& pageConfiguration)
     , m_isUtilityPage(isUtilityPageChromeClient(chrome().client()))
     , m_performanceMonitor(isUtilityPage() ? nullptr : std::make_unique<PerformanceMonitor>(*this))
     , m_lowPowerModeNotifier(std::make_unique<LowPowerModeNotifier>([this](bool isLowPowerModeEnabled) { handleLowModePowerChange(isLowPowerModeEnabled); }))
+    , m_performanceLogging(std::make_unique<PerformanceLogging>(*this))
+#if PLATFORM(MAC) && (ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION))
+    , m_servicesOverlayController(std::make_unique<ServicesOverlayController>(*this))
+#endif
+    , m_recentWheelEventDeltaFilter(WheelEventDeltaFilter::create())
+    , m_pageOverlayController(std::make_unique<PageOverlayController>(*this))
+#if ENABLE(APPLE_PAY)
+    , m_paymentCoordinator(std::make_unique<PaymentCoordinator>(*pageConfiguration.paymentCoordinatorClient))
+#endif
+#if ENABLE(APPLICATION_MANIFEST)
+    , m_applicationManifest(pageConfiguration.applicationManifest)
+#endif
 {
     updateTimerThrottlingState();
 
@@ -895,7 +914,7 @@ void Page::setDeviceScaleFactor(float scaleFactor)
 
     GraphicsContext::updateDocumentMarkerResources();
 
-    mainFrame().pageOverlayController().didChangeDeviceScaleFactor();
+    pageOverlayController().didChangeDeviceScaleFactor();
 }
 
 void Page::setUserInterfaceLayoutDirection(UserInterfaceLayoutDirection userInterfaceLayoutDirection)
@@ -2406,4 +2425,50 @@ void Page::applicationDidBecomeActive()
     });
 }
 
+#if PLATFORM(MAC)
+ScrollLatchingState* Page::latchingState()
+{
+    if (m_latchingState.isEmpty())
+        return nullptr;
+
+    return &m_latchingState.last();
+}
+
+void Page::pushNewLatchingState()
+{
+    m_latchingState.append(ScrollLatchingState());
+}
+
+void Page::resetLatchingState()
+{
+    m_latchingState.clear();
+}
+
+void Page::popLatchingState()
+{
+    m_latchingState.removeLast();
+}
+
+void Page::removeLatchingStateForTarget(Element& targetNode)
+{
+    if (m_latchingState.isEmpty())
+        return;
+
+    m_latchingState.removeAllMatching([&targetNode] (ScrollLatchingState& state) {
+        auto* wheelElement = state.wheelEventElement();
+        if (!wheelElement)
+            return false;
+
+        return targetNode.isEqualNode(wheelElement);
+    });
+}
+#endif // PLATFORM(MAC)
+
+#if ENABLE(APPLE_PAY)
+void Page::setPaymentCoordinator(std::unique_ptr<PaymentCoordinator>&& paymentCoordinator)
+{
+    m_paymentCoordinator = WTFMove(paymentCoordinator);
+}
+#endif
+
 } // namespace WebCore
index 9079d8aafd28095fe4bd34411814a806393ba7a2..762faa9a70ee58972387893adf420cb4f77e49cf 100644 (file)
 #include <wtf/SchedulePair.h>
 #endif
 
+#if ENABLE(APPLICATION_MANIFEST)
+#include "ApplicationManifest.h"
+#endif
+
 #if ENABLE(MEDIA_SESSION)
 #include "MediaSessionEvents.h"
 #endif
@@ -87,6 +91,7 @@ class DragCaretController;
 class DragClient;
 class DragController;
 class EditorClient;
+class Element;
 class FocusController;
 class Frame;
 class FrameLoaderClient;
@@ -97,13 +102,15 @@ class InspectorClient;
 class InspectorController;
 class LibWebRTCProvider;
 class LowPowerModeNotifier;
-class MainFrame;
 class MediaCanStartListener;
 class MediaPlaybackTarget;
 class PageConfiguration;
 class PageConsoleClient;
 class PageDebuggable;
 class PageGroup;
+class PageOverlayController;
+class PaymentCoordinator;
+class PerformanceLogging;
 class PerformanceLoggingClient;
 class PerformanceMonitor;
 class PlugInClient;
@@ -118,8 +125,10 @@ class RenderObject;
 class RenderTheme;
 class ResourceUsageOverlay;
 class VisibleSelection;
+class ScrollLatchingState;
 class ScrollableArea;
 class ScrollingCoordinator;
+class ServicesOverlayController;
 class Settings;
 class SocketProvider;
 class StorageNamespace;
@@ -130,6 +139,7 @@ class ValidationMessageClient;
 class ActivityStateChangeObserver;
 class VisitedLinkStore;
 class WebGLStateTracker;
+class WheelEventDeltaFilter;
 
 typedef uint64_t SharedStringHash;
 
@@ -175,8 +185,8 @@ public:
     EditorClient& editorClient() { return m_editorClient.get(); }
     PlugInClient* plugInClient() const { return m_plugInClient; }
 
-    MainFrame& mainFrame() { return m_mainFrame.get(); }
-    const MainFrame& mainFrame() const { return m_mainFrame.get(); }
+    Frame& mainFrame() { return m_mainFrame.get(); }
+    const Frame& mainFrame() const { return m_mainFrame.get(); }
 
     bool openedByDOM() const;
     void setOpenedByDOM();
@@ -367,6 +377,29 @@ public:
 
     PerformanceLoggingClient* performanceLoggingClient() const { return m_performanceLoggingClient.get(); }
 
+    WheelEventDeltaFilter* wheelEventDeltaFilter() { return m_recentWheelEventDeltaFilter.get(); }
+    PageOverlayController& pageOverlayController() { return *m_pageOverlayController; }
+
+#if PLATFORM(MAC)
+#if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION)
+    ServicesOverlayController& servicesOverlayController() { return *m_servicesOverlayController; }
+#endif // ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION)
+    ScrollLatchingState* latchingState();
+    void pushNewLatchingState();
+    void popLatchingState();
+    void resetLatchingState();
+    void removeLatchingStateForTarget(Element&);
+#endif // PLATFORM(MAC)
+
+#if ENABLE(APPLE_PAY)
+    PaymentCoordinator& paymentCoordinator() const { return *m_paymentCoordinator; }
+    WEBCORE_EXPORT void setPaymentCoordinator(std::unique_ptr<PaymentCoordinator>&&);
+#endif
+
+#if ENABLE(APPLICATION_MANIFEST)
+    const std::optional<ApplicationManifest>& applicationManifest() const { return m_applicationManifest; }
+#endif
+
     // Notifications when the Page starts and stops being presented via a native window.
     WEBCORE_EXPORT void setActivityState(ActivityState::Flags);
     ActivityState::Flags activityState() const { return m_activityState; }
@@ -606,6 +639,8 @@ public:
     WEBCORE_EXPORT void applicationWillEnterForeground();
     WEBCORE_EXPORT void applicationDidBecomeActive();
 
+    PerformanceLogging& performanceLogging() const { return *m_performanceLogging; }
+
 private:
     struct Navigation {
         String domain;
@@ -666,7 +701,7 @@ private:
     const std::unique_ptr<ProgressTracker> m_progress;
 
     const std::unique_ptr<BackForwardController> m_backForwardController;
-    Ref<MainFrame> m_mainFrame;
+    Ref<Frame> m_mainFrame;
 
     RefPtr<PluginData> m_pluginData;
 
@@ -825,6 +860,25 @@ private:
 
     std::optional<Navigation> m_navigationToLogWhenVisible;
 
+    std::unique_ptr<PerformanceLogging> m_performanceLogging;
+#if PLATFORM(MAC)
+    Vector<ScrollLatchingState> m_latchingState;
+#if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION)
+    std::unique_ptr<ServicesOverlayController> m_servicesOverlayController;
+#endif
+#endif
+
+    std::unique_ptr<WheelEventDeltaFilter> m_recentWheelEventDeltaFilter;
+    std::unique_ptr<PageOverlayController> m_pageOverlayController;
+
+#if ENABLE(APPLE_PAY)
+    std::unique_ptr<PaymentCoordinator> m_paymentCoordinator;
+#endif
+
+#if ENABLE(APPLICATION_MANIFEST)
+    std::optional<ApplicationManifest> m_applicationManifest;
+#endif
+
     bool m_isRunningUserScripts { false };
     bool m_shouldEnableICECandidateFilteringByDefault { true };
 };
index 703ce11ba091be54fba043a985024598c5c47816..1c350cdeca6ec5bb1129e9c49cd84d8ac8ad4b45 100644 (file)
@@ -41,7 +41,6 @@
 #include "JSHTMLCanvasElement.h"
 #include "JSMainThreadExecState.h"
 #include "JSOffscreenCanvas.h"
-#include "MainFrame.h"
 #include "OffscreenCanvas.h"
 #include "Page.h"
 #include "ScriptableDocumentParser.h"
index 5b86cdd771796899c1159ef24d7bbf5b924f0a8d..ad80892d9e0768438ad550d10c6192f2632af055 100644 (file)
@@ -29,8 +29,8 @@
 #if ENABLE(REMOTE_INSPECTOR)
 
 #include "Document.h"
+#include "Frame.h"
 #include "InspectorController.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "Settings.h"
 #include <JavaScriptCore/InspectorAgentBase.h>
index fbbdc85aa6509f043e7c141eac85807fe3966fb9..1d09ad9b766c26430b5263796f6caaaf6c67dce0 100644 (file)
@@ -28,7 +28,7 @@
 
 #include "DOMWrapperWorld.h"
 #include "Document.h"
-#include "MainFrame.h"
+#include "Frame.h"
 #include "Page.h"
 #include "PageCache.h"
 #include "StorageNamespace.h"
index ed69c876dd5b00e51c3865768cf2fbd31e005f97..1d9e997f2d49620355347e1bc3711afad69ea33c 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "Document.h"
 #include "DocumentParser.h"
-#include "MainFrame.h"
+#include "Frame.h"
 #include "Page.h"
 #include "PageGroup.h"
 #include "ScriptRunner.h"
index 6607002d0d39249c9e8172dd721ee88d945941c1..e2f97cc65f25ad4eeb4a9e74ab86a68120c0faaa 100644 (file)
@@ -26,9 +26,9 @@
 #include "config.h"
 #include "PageOverlay.h"
 
+#include "Frame.h"
 #include "FrameView.h"
 #include "GraphicsContext.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PageOverlayController.h"
 #include "PlatformMouseEvent.h"
@@ -66,7 +66,7 @@ PageOverlayController* PageOverlay::controller() const
 {
     if (!m_page)
         return nullptr;
-    return &m_page->mainFrame().pageOverlayController();
+    return &m_page->pageOverlayController();
 }
 
 IntRect PageOverlay::bounds() const
index 6ffce20949e818db4953fa79d276310f62cba760..4856ff6e744ddc496d1130143e0a66481d34fabb 100644 (file)
@@ -32,7 +32,6 @@
 #include "FrameView.h"
 #include "GraphicsContext.h"
 #include "GraphicsLayer.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PageOverlay.h"
 #include "ScrollingCoordinator.h"
@@ -43,9 +42,9 @@
 
 namespace WebCore {
 
-PageOverlayController::PageOverlayController(MainFrame& mainFrame)
+PageOverlayController::PageOverlayController(Page& page)
     : m_initialized(false)
-    , m_mainFrame(mainFrame)
+    , m_page(page)
 {
 }
 
@@ -61,8 +60,8 @@ void PageOverlayController::createRootLayersIfNeeded()
     ASSERT(!m_documentOverlayRootLayer);
     ASSERT(!m_viewOverlayRootLayer);
 
-    m_documentOverlayRootLayer = GraphicsLayer::create(m_mainFrame.page()->chrome().client().graphicsLayerFactory(), *this);
-    m_viewOverlayRootLayer = GraphicsLayer::create(m_mainFrame.page()->chrome().client().graphicsLayerFactory(), *this);
+    m_documentOverlayRootLayer = GraphicsLayer::create(m_page.chrome().client().graphicsLayerFactory(), *this);
+    m_viewOverlayRootLayer = GraphicsLayer::create(m_page.chrome().client().graphicsLayerFactory(), *this);
     m_documentOverlayRootLayer->setName("Document overlay Container");
     m_viewOverlayRootLayer->setName("View overlay container");
 }
@@ -92,7 +91,7 @@ GraphicsLayer& PageOverlayController::layerWithDocumentOverlays()
 {
     createRootLayersIfNeeded();
 
-    bool inWindow = m_mainFrame.page() ? m_mainFrame.page()->isInWindow() : false;
+    bool inWindow = m_page.isInWindow();
 
     for (auto& overlayAndLayer : m_overlayGraphicsLayers) {
         PageOverlay& overlay = *overlayAndLayer.key;
@@ -116,7 +115,7 @@ GraphicsLayer& PageOverlayController::layerWithViewOverlays()
 {
     createRootLayersIfNeeded();
 
-    bool inWindow = m_mainFrame.page() ? m_mainFrame.page()->isInWindow() : false;
+    bool inWindow = m_page.isInWindow();
 
     for (auto& overlayAndLayer : m_overlayGraphicsLayers) {
         PageOverlay& overlay = *overlayAndLayer.key;
@@ -145,7 +144,7 @@ void PageOverlayController::installPageOverlay(PageOverlay& overlay, PageOverlay
 
     m_pageOverlays.append(&overlay);
 
-    std::unique_ptr<GraphicsLayer> layer = GraphicsLayer::create(m_mainFrame.page()->chrome().client().graphicsLayerFactory(), *this);
+    std::unique_ptr<GraphicsLayer> layer = GraphicsLayer::create(m_page.chrome().client().graphicsLayerFactory(), *this);
     layer->setAnchorPoint(FloatPoint3D());
     layer->setBackgroundColor(overlay.backgroundColor());
     layer->setName("Overlay content");
@@ -166,9 +165,9 @@ void PageOverlayController::installPageOverlay(PageOverlay& overlay, PageOverlay
 
     updateForceSynchronousScrollLayerPositionUpdates();
 
-    overlay.setPage(m_mainFrame.page());
+    overlay.setPage(&m_page);
 
-    if (FrameView* frameView = m_mainFrame.view())
+    if (FrameView* frameView = m_page.mainFrame().view())
         frameView->enterCompositingMode();
 
     updateOverlayGeometry(overlay, rawLayer);
@@ -204,7 +203,7 @@ void PageOverlayController::updateForceSynchronousScrollLayerPositionUpdates()
             forceSynchronousScrollLayerPositionUpdates = true;
     }
 
-    if (ScrollingCoordinator* scrollingCoordinator = m_mainFrame.page()->scrollingCoordinator())
+    if (ScrollingCoordinator* scrollingCoordinator = m_page.scrollingCoordinator())
         scrollingCoordinator->setForceSynchronousScrollLayerPositionUpdates(forceSynchronousScrollLayerPositionUpdates);
 #endif
 }
@@ -284,7 +283,7 @@ void PageOverlayController::didChangeDeviceScaleFactor()
 
 void PageOverlayController::didChangeViewExposedRect()
 {
-    m_mainFrame.page()->chrome().client().scheduleCompositingLayerFlush();
+    m_page.chrome().client().scheduleCompositingLayerFlush();
 }
 
 void PageOverlayController::didScrollFrame(Frame& frame)
@@ -298,7 +297,7 @@ void PageOverlayController::didScrollFrame(Frame& frame)
 
 void PageOverlayController::updateSettingsForLayer(GraphicsLayer& layer)
 {
-    Settings& settings = m_mainFrame.settings();
+    Settings& settings = m_page.settings();
     layer.setAcceleratesDrawing(settings.acceleratedDrawingEnabled());
     layer.setShowDebugBorder(settings.showDebugBorders());
     layer.setShowRepaintCounter(settings.showRepaintCounter());
@@ -373,15 +372,12 @@ void PageOverlayController::paintContents(const WebCore::GraphicsLayer* graphics
 
 float PageOverlayController::deviceScaleFactor() const
 {
-    if (Page* page = m_mainFrame.page())
-        return page->deviceScaleFactor();
-    return 1;
+    return m_page.deviceScaleFactor();
 }
 
 void PageOverlayController::notifyFlushRequired(const WebCore::GraphicsLayer*)
 {
-    if (Page* page = m_mainFrame.page())
-        page->chrome().client().scheduleCompositingLayerFlush();
+    m_page.chrome().client().scheduleCompositingLayerFlush();
 }
 
 void PageOverlayController::didChangeOverlayFrame(PageOverlay& overlay)
@@ -404,7 +400,7 @@ bool PageOverlayController::shouldSkipLayerInDump(const GraphicsLayer*, LayerTre
 void PageOverlayController::tiledBackingUsageChanged(const GraphicsLayer* graphicsLayer, bool usingTiledBacking)
 {
     if (usingTiledBacking)
-        graphicsLayer->tiledBacking()->setIsInWindow(m_mainFrame.page()->isInWindow());
+        graphicsLayer->tiledBacking()->setIsInWindow(m_page.isInWindow());
 }
 
 } // namespace WebKit
index af8516aad30eaf193e73b323d6811f2510b03b08..763a7e2166b1fffe2e4f0ff01d09bec51781a213 100644 (file)
 namespace WebCore {
 
 class Frame;
-class MainFrame;
 class Page;
 class PlatformMouseEvent;
 
 class PageOverlayController final : public GraphicsLayerClient {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    PageOverlayController(MainFrame&);
+    PageOverlayController(Page&);
     virtual ~PageOverlayController();
 
     GraphicsLayer& layerWithDocumentOverlays();
@@ -99,7 +98,7 @@ private:
 
     HashMap<PageOverlay*, std::unique_ptr<GraphicsLayer>> m_overlayGraphicsLayers;
     Vector<RefPtr<PageOverlay>> m_pageOverlays;
-    MainFrame& m_mainFrame;
+    Page& m_page;
 };
 
 } // namespace WebKit
index 71ea270f53884d9f35ba842af6724b688612bf26..5f64224c93a5c1ce7fe66e7aa77670931fe8bf69 100644 (file)
@@ -38,6 +38,7 @@
 #include "CachedImage.h"
 #include "Document.h"
 #include "Element.h"
+#include "Frame.h"
 #include "HTMLFrameOwnerElement.h"
 #include "HTMLHeadElement.h"
 #include "HTMLImageElement.h"
@@ -48,7 +49,6 @@
 #include "HTMLStyleElement.h"
 #include "HTTPParsers.h"
 #include "Image.h"
-#include "MainFrame.h"
 #include "MarkupAccumulator.h"
 #include "Page.h"
 #include "RenderElement.h"
index 24f039603417ce9ab08602e12d9325462243afb2..a875fdb71ddee87149efc886a520667e57793dcf 100644 (file)
 #include "CommonVM.h"
 #include "DOMWindow.h"
 #include "Document.h"
+#include "Frame.h"
 #include "FrameLoader.h"
 #include "FrameLoaderClient.h"
 #include "JSDOMWindow.h"
 #include "Logging.h"
-#include "MainFrame.h"
+#include "Page.h"
 #include "PageCache.h"
 
 namespace WebCore {
@@ -79,8 +80,8 @@ HashCountedSet<const char*> PerformanceLogging::javaScriptObjectCounts()
     return WTFMove(*commonVM().heap.objectTypeCounts());
 }
 
-PerformanceLogging::PerformanceLogging(MainFrame& mainFrame)
-    : m_mainFrame(mainFrame)
+PerformanceLogging::PerformanceLogging(Page& page)
+    : m_page(page)
 {
 }
 
@@ -90,7 +91,7 @@ void PerformanceLogging::didReachPointOfInterest(PointOfInterest poi)
     UNUSED_PARAM(poi);
 #else
     // Ignore synthetic main frames used internally by SVG and web inspector.
-    if (m_mainFrame.loader().client().isEmptyFrameLoaderClient())
+    if (m_page.mainFrame().loader().client().isEmptyFrameLoaderClient())
         return;
 
     auto stats = memoryUsageStatistics(ShouldIncludeExpensiveComputations::No);
index 9287a298c265bb355ebef2f8f133cdd01380d3f7..32b4c0e9a1e121829dab6fbcec089cabdd699904 100644 (file)
@@ -30,7 +30,7 @@
 
 namespace WebCore {
 
-class MainFrame;
+class Page;
 
 enum class ShouldIncludeExpensiveComputations { No, Yes };
 
@@ -38,7 +38,7 @@ class PerformanceLogging {
     WTF_MAKE_FAST_ALLOCATED;
     WTF_MAKE_NONCOPYABLE(PerformanceLogging);
 public:
-    explicit PerformanceLogging(MainFrame&);
+    explicit PerformanceLogging(Page&);
 
     enum PointOfInterest {
         MainFrameLoadStarted,
@@ -54,7 +54,7 @@ public:
 private:
     static void getPlatformMemoryUsageStatistics(HashMap<const char*, size_t>&);
 
-    MainFrame& m_mainFrame;
+    Page& m_page;
 };
 
 }
index 5cbdf738ba9769626a19f8c4ca1fde68806a02d4..aaa7d5c575ea254c202d99e3ef27c78ef3f8fe64 100644 (file)
@@ -31,8 +31,8 @@
 #include "DeprecatedGlobalSettings.h"
 #include "DiagnosticLoggingClient.h"
 #include "DiagnosticLoggingKeys.h"
+#include "Frame.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PerformanceLogging.h"
 #include "PublicSuffix.h"
index d7ba6f2399814ddd22718ce5d60ead6e7a399b51..3da8c603d382650f2a15bf172283d950567498c6 100644 (file)
@@ -29,8 +29,8 @@
 
 #include "ResourceUsageOverlay.h"
 
+#include "Frame.h"
 #include "FrameView.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PageOverlayController.h"
 #include "PlatformMouseEvent.h"
@@ -54,7 +54,7 @@ ResourceUsageOverlay::~ResourceUsageOverlay()
 
     // FIXME: This is a hack so we don't try to uninstall the PageOverlay during Page destruction.
     if (m_page.mainFrame().page())
-        m_page.mainFrame().pageOverlayController().uninstallPageOverlay(*m_overlay, PageOverlay::FadeMode::DoNotFade);
+        m_page.pageOverlayController().uninstallPageOverlay(*m_overlay, PageOverlay::FadeMode::DoNotFade);
 }
 
 void ResourceUsageOverlay::initialize()
@@ -72,7 +72,7 @@ void ResourceUsageOverlay::initialize()
 #endif
 
     m_overlay->setFrame(initialRect);
-    m_page.mainFrame().pageOverlayController().installPageOverlay(*m_overlay, PageOverlay::FadeMode::DoNotFade);
+    m_page.pageOverlayController().installPageOverlay(*m_overlay, PageOverlay::FadeMode::DoNotFade);
     platformInitialize();
 }
 
index 1c5c038a562e973637cda70f3fc37e5b2eda27de..c646e77aece7c80964018cc5492e4073e3b97625 100644 (file)
 #include "Document.h"
 #include "FontCascade.h"
 #include "FontGenericFamilies.h"
+#include "Frame.h"
 #include "FrameTree.h"
 #include "FrameView.h"
 #include "HistoryItem.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PageCache.h"
 #include "RenderWidget.h"
index b73f46f4aee7e9f08806c5dc00bb6fd058a0c01f..465c35b79e347789918bd1ab01d6d5539814f40c 100644 (file)
@@ -29,6 +29,7 @@
 #include "config.h"
 #include "SpatialNavigation.h"
 
+#include "Frame.h"
 #include "FrameTree.h"
 #include "FrameView.h"
 #include "HTMLAreaElement.h"
@@ -36,7 +37,6 @@
 #include "HTMLMapElement.h"
 #include "HTMLSelectElement.h"
 #include "IntRect.h"
-#include "MainFrame.h"
 #include "Node.h"
 #include "Page.h"
 #include "RenderInline.h"
index c874d1f43bb6b88182adec5a9ada0fb6c25c847e..97511d0dad83150f414e1c1d9162e3e84253c324 100644 (file)
@@ -28,8 +28,8 @@
 
 #include "Document.h"
 #include "DocumentLoader.h"
+#include "Frame.h"
 #include "FrameLoader.h"
-#include "MainFrame.h"
 #include "Page.h"
 
 #if ENABLE(CONTENT_EXTENSIONS)
index 605a9215d0a65d93ae6dfb9c770f4c30b0db955b..e1b01853f20770a4d7e74f74241552f2846f73c1 100644 (file)
@@ -48,7 +48,6 @@
 #import "HitTestRequest.h"
 #import "HitTestResult.h"
 #import "Logging.h"
-#import "MainFrame.h"
 #import "NodeRenderStyle.h"
 #import "NodeTraversal.h"
 #import "Page.h"
index c20c3dc93308c3a833230c9420c3909239399a22..55f2134065c854c06dcbccbf9376f8461626e876 100644 (file)
@@ -37,9 +37,9 @@
 #import "EditorClient.h"
 #import "Element.h"
 #import "File.h"
+#import "Frame.h"
 #import "FrameView.h"
 #import "HTMLAttachmentElement.h"
-#import "MainFrame.h"
 #import "Page.h"
 #import "Pasteboard.h"
 #import "PasteboardStrategy.h"
index 0f5c47db972464ba27d852b2d5557dfde0108dde..ba26e57b1ffa50b3e823e04cdc84e98fecd135b4 100644 (file)
@@ -45,7 +45,6 @@
 #include "HTMLHtmlElement.h"
 #include "HTMLIFrameElement.h"
 #include "KeyboardEvent.h"
-#include "MainFrame.h"
 #include "MouseEventWithHitTestResults.h"
 #include "Page.h"
 #include "Pasteboard.h"
@@ -854,7 +853,11 @@ static bool eventTargetIsPlatformWidget(Element* eventTarget)
 
 static bool latchingIsLockedToPlatformFrame(const Frame& frame)
 {
-    ScrollLatchingState* latchedState = frame.mainFrame().latchingState();
+    auto* page = frame.page();
+    if (!page)
+        return false;
+
+    ScrollLatchingState* latchedState = page->latchingState();
     if (!latchedState)
         return false;
 
@@ -866,7 +869,11 @@ static bool latchingIsLockedToPlatformFrame(const Frame& frame)
 
 static bool latchingIsLockedToAncestorOfThisFrame(const Frame& frame)
 {
-    ScrollLatchingState* latchedState = frame.mainFrame().latchingState();
+    auto* page = frame.page();
+    if (!page)
+        return false;
+
+    ScrollLatchingState* latchedState = page->latchingState();
     if (!latchedState || !latchedState->frame())
         return false;
 
@@ -915,7 +922,8 @@ void EventHandler::clearOrScheduleClearingLatchedStateIfNeeded(const PlatformWhe
     } else {
         // If another wheel event scrolling starts, stop the timer manually, and reset the latched state immediately.
         if (event.shouldConsiderLatching()) {
-            m_frame.mainFrame().resetLatchingState();
+            if (auto* page = m_frame.page())
+                page->resetLatchingState();
             m_pendingMomentumWheelEventsTimer.stop();
         } else if (event.isTransitioningToMomentumScroll()) {
             // Wheel events machinary is transitioning to momenthum scrolling, so no need to reset latched state. Stop the timer.
@@ -951,13 +959,13 @@ void EventHandler::platformPrepareForWheelEvents(const PlatformWheelEvent& wheel
     if (scrollableArea && page && page->expectsWheelEventTriggers())
         scrollableArea->scrollAnimator().setWheelEventTestTrigger(page->testTrigger());
 
-    ScrollLatchingState* latchingState = m_frame.mainFrame().latchingState();
+    ScrollLatchingState* latchingState = page ? page->latchingState() : nullptr;
     if (wheelEvent.shouldConsiderLatching()) {
-        if (scrollableContainer && scrollableArea) {
+        if (scrollableContainer && scrollableArea && page) {
             bool startingAtScrollLimit = scrolledToEdgeInDominantDirection(*scrollableContainer, *scrollableArea.get(), wheelEvent.deltaX(), wheelEvent.deltaY());
             if (!startingAtScrollLimit) {
-                m_frame.mainFrame().pushNewLatchingState();
-                latchingState = m_frame.mainFrame().latchingState();
+                page->pushNewLatchingState();
+                latchingState = page->latchingState();
                 latchingState->setStartedGestureAtScrollLimit(false);
                 latchingState->setWheelEventElement(wheelEventTarget.get());
                 latchingState->setFrame(&m_frame);
@@ -965,7 +973,7 @@ void EventHandler::platformPrepareForWheelEvents(const PlatformWheelEvent& wheel
                 latchingState->setScrollableContainer(scrollableContainer.get());
                 latchingState->setWidgetIsLatched(result.isOverWidget());
                 isOverWidget = latchingState->widgetIsLatched();
-                m_frame.mainFrame().wheelEventDeltaFilter()->beginFilteringDeltas();
+                page->wheelEventDeltaFilter()->beginFilteringDeltas();
             }
         }
     } else if (wheelEvent.shouldResetLatching())
@@ -991,17 +999,21 @@ void EventHandler::platformPrepareForWheelEvents(const PlatformWheelEvent& wheel
 
 void EventHandler::platformRecordWheelEvent(const PlatformWheelEvent& wheelEvent)
 {
+    auto* page = m_frame.page();
+    if (!page)
+        return;
+
     switch (wheelEvent.phase()) {
         case PlatformWheelEventPhaseBegan:
-            m_frame.mainFrame().wheelEventDeltaFilter()->beginFilteringDeltas();
+            page->wheelEventDeltaFilter()->beginFilteringDeltas();
             break;
         case PlatformWheelEventPhaseEnded:
-            m_frame.mainFrame().wheelEventDeltaFilter()->endFilteringDeltas();
+            page->wheelEventDeltaFilter()->endFilteringDeltas();
             break;
         default:
             break;
     }
-    m_frame.mainFrame().wheelEventDeltaFilter()->updateFromDelta(FloatSize(wheelEvent.deltaX(), wheelEvent.deltaY()));
+    page->wheelEventDeltaFilter()->updateFromDelta(FloatSize(wheelEvent.deltaX(), wheelEvent.deltaY()));
 }
 
 static FrameView* frameViewForLatchingState(Frame& frame, ScrollLatchingState* latchingState)
@@ -1021,7 +1033,7 @@ bool EventHandler::platformCompleteWheelEvent(const PlatformWheelEvent& wheelEve
     if (!view)
         return false;
 
-    ScrollLatchingState* latchingState = m_frame.mainFrame().latchingState();
+    ScrollLatchingState* latchingState = m_frame.page() ? m_frame.page()->latchingState() : nullptr;
     if (wheelEvent.useLatchedEventElement() && !latchingIsLockedToAncestorOfThisFrame(m_frame) && latchingState && latchingState->scrollableContainer()) {
 
         m_isHandlingWheelEvent = false;
@@ -1062,7 +1074,7 @@ bool EventHandler::platformCompletePlatformWidgetWheelEvent(const PlatformWheelE
     if (frameHasPlatformWidget(m_frame) && widget.isFrameView())
         return true;
 
-    ScrollLatchingState* latchingState = m_frame.mainFrame().latchingState();
+    ScrollLatchingState* latchingState = m_frame.page() ? m_frame.page()->latchingState() : nullptr;
     if (!latchingState)
         return false;
 
index 4807e7b61d114c5da7dce7cf1ce30b3dbe0ce015..aa030c54617ff0eb3a81324dc9451d29cf2e5922 100644 (file)
 #import "Page.h"
 
 #import "DocumentLoader.h"
+#import "Frame.h"
 #import "FrameLoader.h"
 #import "FrameTree.h"
 #import "Logging.h"
-#import "MainFrame.h"
 #import "RenderObject.h"
 #import <pal/Logging.h>
 
index 0fd4abf1c7fa5e1633025a7528fc57cb29b403cb..fad43a85f524549862af9a0e716369c44ad3fbd1 100644 (file)
@@ -38,14 +38,14 @@ typedef struct __DDHighlight *DDHighlightRef;
 namespace WebCore {
     
 class LayoutRect;
-class MainFrame;
+class Page;
 
 struct GapRects;
 
 class ServicesOverlayController : private PageOverlay::Client {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    explicit ServicesOverlayController(MainFrame&);
+    explicit ServicesOverlayController(Page&);
     ~ServicesOverlayController();
 
     void selectedTelephoneNumberRangesChanged();
@@ -134,9 +134,10 @@ private:
     void willDestroyHighlight(Highlight*);
     void didFinishFadingOutHighlight(Highlight*);
 
-    MainFrame& mainFrame() const { return m_mainFrame; }
+    Frame& mainFrame() const;
+    Page& page() const { return m_page; }
 
-    MainFrame& m_mainFrame;
+    Page& m_page;
     PageOverlay* m_servicesOverlay { nullptr };
 
     RefPtr<Highlight> m_activeHighlight;
index f8e366bc8bff4eebbbe75f837d7dc3ab644e378e..e09fdd6746368efe2e1995e29eed3f8f46e186a4 100644 (file)
@@ -35,6 +35,7 @@
 #import "EventHandler.h"
 #import "FloatQuad.h"
 #import "FocusController.h"
+#import "Frame.h"
 #import "FrameSelection.h"
 #import "FrameView.h"
 #import "GapRects.h"
@@ -42,7 +43,6 @@
 #import "GraphicsLayer.h"
 #import "GraphicsLayerCA.h"
 #import "Logging.h"
-#import "MainFrame.h"
 #import "Page.h"
 #import "PageOverlayController.h"
 #import "PlatformCAAnimationCocoa.h"
@@ -72,8 +72,8 @@ ServicesOverlayController::Highlight::Highlight(ServicesOverlayController& contr
 {
     ASSERT(ddHighlight);
 
-    Page* page = controller.mainFrame().page();
-    m_graphicsLayer = GraphicsLayer::create(page ? page->chrome().client().graphicsLayerFactory() : nullptr, *this);
+    auto& page = controller.page();
+    m_graphicsLayer = GraphicsLayer::create(page.chrome().client().graphicsLayerFactory(), *this);
     m_graphicsLayer->setDrawsContent(true);
 
     setDDHighlight(ddHighlight.get());
@@ -122,11 +122,7 @@ void ServicesOverlayController::Highlight::notifyFlushRequired(const GraphicsLay
     if (!m_controller)
         return;
 
-    Page* page = m_controller->mainFrame().page();
-    if (!page)
-        return;
-
-    page->chrome().client().scheduleCompositingLayerFlush();
+    m_controller->page().chrome().client().scheduleCompositingLayerFlush();
 }
 
 void ServicesOverlayController::Highlight::paintContents(const GraphicsLayer*, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const FloatRect&, GraphicsLayerPaintBehavior)
@@ -148,11 +144,7 @@ float ServicesOverlayController::Highlight::deviceScaleFactor() const
     if (!m_controller)
         return 1;
 
-    Page* page = m_controller->mainFrame().page();
-    if (!page)
-        return 1;
-
-    return page->deviceScaleFactor();
+    return m_controller->page().deviceScaleFactor();
 }
 
 void ServicesOverlayController::Highlight::fadeIn()
@@ -207,8 +199,8 @@ static IntRect textQuadsToBoundingRectForRange(Range& range)
     return enclosingIntRect(boundingRect);
 }
 
-ServicesOverlayController::ServicesOverlayController(MainFrame& mainFrame)
-    : m_mainFrame(mainFrame)
+ServicesOverlayController::ServicesOverlayController(Page& page)
+    : m_page(page)
     , m_determineActiveHighlightTimer(*this, &ServicesOverlayController::determineActiveHighlightTimerFired)
     , m_buildHighlightsTimer(*this, &ServicesOverlayController::buildPotentialHighlightsIfNeeded)
 {
@@ -386,7 +378,7 @@ void ServicesOverlayController::selectedTelephoneNumberRangesChanged()
 
 void ServicesOverlayController::invalidateHighlightsOfType(Highlight::Type type)
 {
-    if (!m_mainFrame.settings().serviceControlsEnabled())
+    if (!m_page.settings().serviceControlsEnabled())
         return;
 
     m_dirtyHighlightTypes |= type;
@@ -408,7 +400,7 @@ void ServicesOverlayController::buildPotentialHighlightsIfNeeded()
 
     if (m_potentialHighlights.isEmpty()) {
         if (m_servicesOverlay)
-            m_mainFrame.pageOverlayController().uninstallPageOverlay(*m_servicesOverlay, PageOverlay::FadeMode::DoNotFade);
+            m_page.pageOverlayController().uninstallPageOverlay(*m_servicesOverlay, PageOverlay::FadeMode::DoNotFade);
         return;
     }
 
@@ -438,11 +430,10 @@ Seconds ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown(High
         return 0_s;
 
     Seconds minimumTimeUntilHighlightShouldBeShown = 200_ms;
-    Page* page = m_mainFrame.page();
-    if (page && page->focusController().focusedOrMainFrame().selection().selection().isContentEditable())
+    if (m_page.focusController().focusedOrMainFrame().selection().selection().isContentEditable())
         minimumTimeUntilHighlightShouldBeShown = 1_s;
 
-    bool mousePressed = m_mainFrame.eventHandler().mousePressed();
+    bool mousePressed = mainFrame().eventHandler().mousePressed();
 
     // Highlight hysteresis is only for selection services, because telephone number highlights are already much more stable
     // by virtue of being expanded to include the entire telephone number. However, we will still avoid highlighting
@@ -493,7 +484,7 @@ void ServicesOverlayController::removeAllPotentialHighlightsOfType(Highlight::Ty
 void ServicesOverlayController::buildPhoneNumberHighlights()
 {
     Vector<RefPtr<Range>> phoneNumberRanges;
-    for (Frame* frame = &m_mainFrame; frame; frame = frame->tree().traverseNext())
+    for (Frame* frame = &mainFrame(); frame; frame = frame->tree().traverseNext())
         phoneNumberRanges.appendVector(frame->editor().detectedTelephoneNumberRanges());
 
     if (phoneNumberRanges.isEmpty()) {
@@ -506,7 +497,7 @@ void ServicesOverlayController::buildPhoneNumberHighlights()
 
     HashSet<RefPtr<Highlight>> newPotentialHighlights;
 
-    FrameView& mainFrameView = *m_mainFrame.view();
+    FrameView& mainFrameView = *mainFrame().view();
 
     for (auto& range : phoneNumberRanges) {
         // FIXME: This will choke if the range wraps around the edge of the view.
@@ -538,10 +529,6 @@ void ServicesOverlayController::buildSelectionHighlight()
         return;
     }
 
-    Page* page = m_mainFrame.page();
-    if (!page)
-        return;
-
     if (!DataDetectorsLibrary())
         return;
 
@@ -550,9 +537,9 @@ void ServicesOverlayController::buildSelectionHighlight()
     Vector<CGRect> cgRects;
     cgRects.reserveCapacity(m_currentSelectionRects.size());
 
-    RefPtr<Range> selectionRange = page->selection().firstRange();
+    RefPtr<Range> selectionRange = m_page.selection().firstRange();
     if (selectionRange) {
-        FrameView* mainFrameView = m_mainFrame.view();
+        FrameView* mainFrameView = mainFrame().view();
         if (!mainFrameView)
             return;
 
@@ -605,9 +592,7 @@ void ServicesOverlayController::replaceHighlightsOfTypePreservingEquivalentHighl
 
 bool ServicesOverlayController::hasRelevantSelectionServices()
 {
-    if (Page* page = m_mainFrame.page())
-        return page->chrome().client().hasRelevantSelectionServices(m_isTextOnly);
-    return false;
+    return m_page.chrome().client().hasRelevantSelectionServices(m_isTextOnly);
 }
 
 void ServicesOverlayController::createOverlayIfNeeded()
@@ -615,21 +600,17 @@ void ServicesOverlayController::createOverlayIfNeeded()
     if (m_servicesOverlay)
         return;
 
-    if (!m_mainFrame.settings().serviceControlsEnabled())
+    if (!m_page.settings().serviceControlsEnabled())
         return;
 
     auto overlay = PageOverlay::create(*this, PageOverlay::OverlayType::Document);
     m_servicesOverlay = overlay.ptr();
-    m_mainFrame.pageOverlayController().installPageOverlay(WTFMove(overlay), PageOverlay::FadeMode::DoNotFade);
+    m_page.pageOverlayController().installPageOverlay(WTFMove(overlay), PageOverlay::FadeMode::DoNotFade);
 }
 
 Vector<RefPtr<Range>> ServicesOverlayController::telephoneNumberRangesForFocusedFrame()
 {
-    Page* page = m_mainFrame.page();
-    if (!page)
-        return { };
-
-    return page->focusController().focusedOrMainFrame().editor().detectedTelephoneNumberRanges();
+    return m_page.focusController().focusedOrMainFrame().editor().detectedTelephoneNumberRanges();
 }
 
 bool ServicesOverlayController::highlightsAreEquivalent(const Highlight* a, const Highlight* b)
@@ -646,11 +627,7 @@ ServicesOverlayController::Highlight* ServicesOverlayController::findTelephoneNu
     if (selectionHighlight.type() != Highlight::SelectionType)
         return nullptr;
 
-    Page* page = m_mainFrame.page();
-    if (!page)
-        return nullptr;
-
-    const VisibleSelection& selection = page->selection();
+    const VisibleSelection& selection = m_page.selection();
     if (!selection.isRange())
         return nullptr;
 
@@ -743,7 +720,7 @@ void ServicesOverlayController::determineActiveHighlight(bool& mouseIsOverActive
 
 bool ServicesOverlayController::mouseEvent(PageOverlay&, const PlatformMouseEvent& event)
 {
-    m_mousePosition = m_mainFrame.view()->windowToContents(event.position());
+    m_mousePosition = mainFrame().view()->windowToContents(event.position());
 
     bool mouseIsOverActiveHighlightButton = false;
     determineActiveHighlight(mouseIsOverActiveHighlightButton);
@@ -806,14 +783,10 @@ void ServicesOverlayController::didScrollFrame(PageOverlay&, Frame& frame)
 
 void ServicesOverlayController::handleClick(const IntPoint& clickPoint, Highlight& highlight)
 {
-    FrameView* frameView = m_mainFrame.view();
+    FrameView* frameView = mainFrame().view();
     if (!frameView)
         return;
 
-    Page* page = m_mainFrame.page();
-    if (!page)
-        return;
-
     IntPoint windowPoint = frameView->contentsToWindow(clickPoint);
 
     if (highlight.type() == Highlight::SelectionType) {
@@ -823,9 +796,14 @@ void ServicesOverlayController::handleClick(const IntPoint& clickPoint, Highligh
         for (auto& range : telephoneNumberRanges)
             selectedTelephoneNumbers.append(range->text());
 
-        page->chrome().client().handleSelectionServiceClick(page->focusController().focusedOrMainFrame().selection(), selectedTelephoneNumbers, windowPoint);
+        m_page.chrome().client().handleSelectionServiceClick(m_page.focusController().focusedOrMainFrame().selection(), selectedTelephoneNumbers, windowPoint);
     } else if (highlight.type() == Highlight::TelephoneNumberType)
-        page->chrome().client().handleTelephoneNumberClick(highlight.range().text(), windowPoint);
+        m_page.chrome().client().handleTelephoneNumberClick(highlight.range().text(), windowPoint);
+}
+
+Frame& ServicesOverlayController::mainFrame() const
+{
+    return m_page.mainFrame();
 }
 
 void ServicesOverlayController::didCreateHighlight(Highlight* highlight)
index c5e5c0a03d0be51eafd8effd3249eddc4cadd90e..e2ecd5a2ff9a7bb18ee8656c0bb1e4a2e8ab8baf 100644 (file)
@@ -35,7 +35,6 @@
 #include "FrameView.h"
 #include "GraphicsLayer.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PerformanceLoggingClient.h"
 #include "ScrollAnimator.h"
index 1dd35c1209d945d31cc13fb964ab39b6e29d0d5f..592be36dd1ee6bb48e8680829c5b7a9570a30379 100644 (file)
@@ -29,9 +29,9 @@
 
 #include "Document.h"
 #include "EventNames.h"
+#include "Frame.h"
 #include "FrameView.h"
 #include "GraphicsLayer.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PlatformWheelEvent.h"
 #include "PluginViewBase.h"
index c69a14004ad011360d6b3309dc98174a8354ba01..200dfdafe57a632d0f7476dbe64410531c803f8b 100644 (file)
@@ -29,8 +29,8 @@
 
 #import "ScrollingCoordinatorIOS.h"
 
+#include "Frame.h"
 #include "FrameView.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "Region.h"
 #include "ScrollingStateTree.h"
index a99bf7d73e9fbd0508d71f71a61b2004f6d2e35b..572e427b161039bd2a3356af884a339e9d73d9a3 100644 (file)
@@ -29,9 +29,9 @@
 
 #import "ScrollingCoordinatorMac.h"
 
+#include "Frame.h"
 #include "FrameView.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PlatformWheelEvent.h"
 #include "Region.h"
index bae5ace20423adc2247d7452c03ae8b4d4022b36..2a9d91ae1c78d1d735ce491b3ada9aa80f67443e 100644 (file)
 #include "CACFLayerTreeHostClient.h"
 #include "DebugPageOverlays.h"
 #include "DefWndProcWindowClass.h"
+#include "Frame.h"
 #include "FrameView.h"
 #include "LayerChangesFlusher.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "PlatformCALayerWin.h"
 #include "PlatformLayer.h"
 #include "TiledBacking.h"
index ef437167fa9e113007d02170fcfb4ef4daf4e9fe..1b2d752d2ed06702379632ed8abe084ca716fb83 100644 (file)
@@ -20,8 +20,8 @@
 #include "DOMMimeType.h"
 
 #include "DOMPlugin.h"
+#include "Frame.h"
 #include "FrameLoader.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PluginData.h"
 #include "SubframeLoader.h"
index dd13d6f20f3b79402b231375f136e9a8436b1350..862c98a2883a83a86e17c5d2e5cd2eb42251543c 100644 (file)
@@ -26,8 +26,8 @@
 #include "config.h"
 #include "PluginInfoProvider.h"
 
+#include "Frame.h"
 #include "FrameLoader.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "SubframeLoader.h"
 
@@ -42,7 +42,7 @@ void PluginInfoProvider::refresh(bool reloadPages)
 {
     refreshPlugins();
 
-    Vector<Ref<MainFrame>> framesNeedingReload;
+    Vector<Ref<Frame>> framesNeedingReload;
 
     for (auto& page : m_pages) {
         page->clearPluginData();
index a0e504d1de4df8ccc98ed85facdbdacf545b7c47..ba5b258e5dd90070cf32b553b073f69ef4abc959 100644 (file)
@@ -48,7 +48,6 @@
 #include "HitTestResult.h"
 #include "InlineElementBox.h"
 #include "LayoutState.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PaintInfo.h"
 #include "RenderBoxFragmentInfo.h"
index 1100b2362d7156c59c43e833a2d0aee29fe7d410..6d76fe08a234c9d1e9a16b552980a03844ad4fd7 100644 (file)
@@ -81,7 +81,6 @@
 #include "HitTestResult.h"
 #include "HitTestingTransformState.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "OverflowEvent.h"
 #include "OverlapTestRequestClient.h"
 #include "Page.h"
index b5bbf3e639ac68f3a40adcfc2c18077a91336e75..5e29692915c939ca536bdaaf2c5c2c8b589a695f 100644 (file)
@@ -33,6 +33,7 @@
 #include "CachedImage.h"
 #include "Chrome.h"
 #include "FilterEffectRenderer.h"
+#include "Frame.h"
 #include "FrameView.h"
 #include "GraphicsContext.h"
 #include "GraphicsLayer.h"
@@ -45,7 +46,6 @@
 #include "InspectorInstrumentation.h"
 #include "KeyframeList.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PerformanceLoggingClient.h"
 #include "PluginViewBase.h"
index 5c06c45a2c9f4f3a9897d061cdb0af410aa2a002..9af2e4d671e2c8782e07c51e17e29ba42d52d7fe 100644 (file)
@@ -42,7 +42,6 @@
 #include "HitTestResult.h"
 #include "InspectorInstrumentation.h"
 #include "Logging.h"
-#include "MainFrame.h"
 #include "NodeList.h"
 #include "Page.h"
 #include "PageOverlayController.h"
@@ -627,7 +626,7 @@ void RenderLayerCompositor::updateCompositingLayersTimerFired()
 
 bool RenderLayerCompositor::hasAnyAdditionalCompositedLayers(const RenderLayer& rootLayer) const
 {
-    int layerCount = m_compositedLayerCount + m_renderView.frame().mainFrame().pageOverlayController().overlayCount();
+    int layerCount = m_compositedLayerCount + page().pageOverlayController().overlayCount();
     return layerCount > (rootLayer.isComposited() ? 1 : 0);
 }
 
@@ -655,7 +654,7 @@ bool RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update
     if (m_renderView.needsLayout())
         return false;
 
-    if (!m_compositing && (m_forceCompositingMode || (isMainFrameCompositor() && m_renderView.frame().mainFrame().pageOverlayController().overlayCount())))
+    if (!m_compositing && (m_forceCompositingMode || (isMainFrameCompositor() && page().pageOverlayController().overlayCount())))
         enableCompositingMode(true);
 
     if (!m_reevaluateCompositingAfterLayout && !m_compositing)
@@ -780,8 +779,7 @@ void RenderLayerCompositor::appendDocumentOverlayLayers(Vector<GraphicsLayer*>&
     if (!isMainFrameCompositor() || !m_compositing)
         return;
 
-    auto& frame = m_renderView.frameView().frame();
-    childList.append(&frame.mainFrame().pageOverlayController().layerWithDocumentOverlays());
+    childList.append(&page().pageOverlayController().layerWithDocumentOverlays());
 }
 
 void RenderLayerCompositor::layerBecameNonComposited(const RenderLayer& layer)
@@ -3387,7 +3385,7 @@ void RenderLayerCompositor::attachRootLayer(RootLayerAttachment attachment)
             auto& frame = m_renderView.frameView().frame();
             page().chrome().client().attachRootGraphicsLayer(frame, rootGraphicsLayer());
             if (frame.isMainFrame())
-                page().chrome().client().attachViewOverlayGraphicsLayer(frame, &frame.mainFrame().pageOverlayController().layerWithViewOverlays());
+                page().chrome().client().attachViewOverlayGraphicsLayer(frame, &page().pageOverlayController().layerWithViewOverlays());
             break;
         }
         case RootLayerAttachedViaEnclosingFrame: {
@@ -3431,7 +3429,7 @@ void RenderLayerCompositor::detachRootLayer()
         page().chrome().client().attachRootGraphicsLayer(frame, nullptr);
         if (frame.isMainFrame()) {
             page().chrome().client().attachViewOverlayGraphicsLayer(frame, nullptr);
-            frame.mainFrame().pageOverlayController().willDetachRootLayer();
+            page().pageOverlayController().willDetachRootLayer();
         }
     }
     break;
@@ -3467,7 +3465,7 @@ void RenderLayerCompositor::rootLayerAttachmentChanged()
     if (!frame.isMainFrame())
         return;
 
-    m_rootContentLayer->addChild(&frame.mainFrame().pageOverlayController().layerWithDocumentOverlays());
+    m_rootContentLayer->addChild(&page().pageOverlayController().layerWithDocumentOverlays());
 }
 
 void RenderLayerCompositor::notifyIFramesOfCompositingChange()
index 0555b1e712f31d331b6422688af0d0482266161c..7f3d46b7dd88e6628c5085c993dd49fe85ee3dc3 100644 (file)
@@ -31,6 +31,7 @@
 #include "CSSAnimationController.h"
 #include "Editing.h"
 #include "FloatQuad.h"
+#include "Frame.h"
 #include "FrameSelection.h"
 #include "FrameView.h"
 #include "GeometryUtilities.h"
@@ -41,7 +42,6 @@
 #include "HTMLTableElement.h"
 #include "HitTestResult.h"
 #include "LogicalSelectionOffsetCaches.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PseudoElement.h"
 #include "RenderChildIterator.h"
index 1d37ef60c3c4f8f0c2a763a6e5eaa69d669d5086..66e4517f9a718f0dce18e07c5f06809caeba5bee 100644 (file)
@@ -33,7 +33,6 @@
 #include "Frame.h"
 #include "FrameLoadRequest.h"
 #include "FrameLoader.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PlatformKeyboardEvent.h"
 #include "PlatformMouseEvent.h"
index 9ee0fb5d4a46793eb3414addc28b9f0a4a11689a..921427493498547216c8af327ab84b56d069008d 100644 (file)
@@ -29,8 +29,8 @@
 #include "Document.h"
 #include "DOMWindow.h"
 #include "EventNames.h"
+#include "Frame.h"
 #include "InspectorInstrumentation.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PageGroup.h"
 #include "SecurityOrigin.h"
index f71ef611d3339a9fdc5b6613f0767ef7a38e49a8..b8e4cf0e6d508fc9b86b6dc7f87db4a7a893d668 100644 (file)
 #include "ComposedTreeIterator.h"
 #include "DocumentTimeline.h"
 #include "ElementIterator.h"
+#include "Frame.h"
 #include "HTMLBodyElement.h"
 #include "HTMLMeterElement.h"
 #include "HTMLNames.h"
 #include "HTMLProgressElement.h"
 #include "HTMLSlotElement.h"
 #include "LoaderStrategy.h"
-#include "MainFrame.h"
 #include "NodeRenderStyle.h"
 #include "Page.h"
 #include "PlatformStrategies.h"
@@ -594,7 +594,7 @@ static void suspendMemoryCacheClientCalls(Document& document)
 
     page->setMemoryCacheClientCallsEnabled(false);
 
-    postResolutionCallbackQueue().append([protectedMainFrame = Ref<MainFrame>(page->mainFrame())] {
+    postResolutionCallbackQueue().append([protectedMainFrame = makeRef(page->mainFrame())] {
         if (Page* page = protectedMainFrame->page())
             page->setMemoryCacheClientCallsEnabled(true);
     });
index bfa025c752119b7143433cb4d59141fb0d747f10..e84865c9d4a4c2c500c375551e976311e3e4328e 100644 (file)
@@ -27,8 +27,8 @@
 #include "DOMWrapperWorld.h"
 #include "ElementIterator.h"
 #include "EventNames.h"
+#include "Frame.h"
 #include "FrameSelection.h"
-#include "MainFrame.h"
 #include "RenderSVGResource.h"
 #include "RenderSVGRoot.h"
 #include "RenderSVGViewportContainer.h"
index cf5324e21d923c980f4e2b6c388b459d52811f65..58c25c66c88b574f991e46bc3aa2d4d153c572c0 100644 (file)
@@ -35,6 +35,7 @@
 #include "DocumentLoader.h"
 #include "EditorClient.h"
 #include "ElementIterator.h"
+#include "Frame.h"
 #include "FrameLoader.h"
 #include "FrameView.h"
 #include "ImageBuffer.h"
@@ -42,7 +43,6 @@
 #include "IntRect.h"
 #include "JSDOMWindowBase.h"
 #include "LibWebRTCProvider.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PageConfiguration.h"
 #include "RenderSVGRoot.h"
index 1cfb7a6b325af868317ce1c9a234e8331651c704..5175da12c9718057803a4c47d6f180583a35bd8e 100644 (file)
@@ -31,9 +31,9 @@
 #include "DeprecatedGlobalSettings.h"
 #include "Document.h"
 #include "FontCache.h"
+#include "Frame.h"
 #include "FrameView.h"
 #include "LocaleToScriptMapping.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PageGroup.h"
 #include "RenderTheme.h"
index 978596b0e6dd518c8b7f7d4ebe0f7395a8687d7b..93bdca09da02f5f168ceeaec77b7d3d71291e967 100644 (file)
@@ -66,6 +66,7 @@
 #include "File.h"
 #include "FontCache.h"
 #include "FormController.h"
+#include "Frame.h"
 #include "FrameLoader.h"
 #include "FrameView.h"
 #include "GCObservation.h"
@@ -93,7 +94,6 @@
 #include "InternalSettings.h"
 #include "JSImageData.h"
 #include "LibWebRTCProvider.h"
-#include "MainFrame.h"
 #include "MallocStatistics.h"
 #include "MediaPlayer.h"
 #include "MediaProducer.h"
@@ -523,9 +523,9 @@ Internals::Internals(Document& document)
 
 #if ENABLE(APPLE_PAY)
     auto* frame = document.frame();
-    if (frame && frame->isMainFrame()) {
-        m_mockPaymentCoordinator = new MockPaymentCoordinator(frame->mainFrame());
-        frame->mainFrame().setPaymentCoordinator(std::make_unique<PaymentCoordinator>(*m_mockPaymentCoordinator));
+    if (frame && frame->page()) {
+        m_mockPaymentCoordinator = new MockPaymentCoordinator(*frame->page());
+        frame->page()->setPaymentCoordinator(std::make_unique<PaymentCoordinator>(*m_mockPaymentCoordinator));
     }
 #endif
 
@@ -3675,21 +3675,21 @@ ExceptionOr<void> Internals::setMockMediaPlaybackTargetPickerState(const String&
 ExceptionOr<Ref<MockPageOverlay>> Internals::installMockPageOverlay(PageOverlayType type)
 {
     Document* document = contextDocument();
-    if (!document || !document->frame())
+    if (!document || !document->page())
         return Exception { InvalidAccessError };
 
-    return MockPageOverlayClient::singleton().installOverlay(document->frame()->mainFrame(), type == PageOverlayType::View ? PageOverlay::OverlayType::View : PageOverlay::OverlayType::Document);
+    return MockPageOverlayClient::singleton().installOverlay(*document->page(), type == PageOverlayType::View ? PageOverlay::OverlayType::View : PageOverlay::OverlayType::Document);
 }
 
 ExceptionOr<String> Internals::pageOverlayLayerTreeAsText(unsigned short flags) const
 {
     Document* document = contextDocument();
-    if (!document || !document->frame())
+    if (!document || !document->page())
         return Exception { InvalidAccessError };
 
     document->updateLayoutIgnorePendingStylesheets();
 
-    return MockPageOverlayClient::singleton().layerTreeAsText(document->frame()->mainFrame(), toLayerTreeFlags(flags));
+    return MockPageOverlayClient::singleton().layerTreeAsText(*document->page(), toLayerTreeFlags(flags));
 }
 
 void Internals::setPageMuted(StringView statesString)
index 3bfa6d9a7401427819b8061c0230e3c69f5b5202..d376bc5195b3b30cb775bc3cec9c048cbdf18b0f 100644 (file)
@@ -27,9 +27,9 @@
 #include "MockPageOverlay.h"
 
 #include "Document.h"
+#include "Frame.h"
 #include "GraphicsContext.h"
 #include "GraphicsLayer.h"
-#include "MainFrame.h"
 #include "PageOverlayController.h"
 #include "PlatformMouseEvent.h"
 
index 21956e0388601c2fc0eb33418e025e37d9d340a2..2ea6cdac70aacc76a221ceb4ff1f34ea437718b0 100644 (file)
@@ -29,8 +29,6 @@
 
 namespace WebCore {
 
-class MainFrame;
-
 class MockPageOverlay : public RefCounted<MockPageOverlay> {
 public:
     static Ref<MockPageOverlay> create(PageOverlay*);
index 879fde282fb12897bcf6965bc9108467cdf85b1a..e5a6cfe0b6ef324d9a580aafa1c74df42f4077c6 100644 (file)
@@ -27,9 +27,9 @@
 #include "MockPageOverlayClient.h"
 
 #include "Document.h"
+#include "Frame.h"
 #include "GraphicsContext.h"
 #include "GraphicsLayer.h"
-#include "MainFrame.h"
 #include "Page.h"
 #include "PageOverlayController.h"
 #include "PlatformMouseEvent.h"
@@ -46,10 +46,10 @@ MockPageOverlayClient& MockPageOverlayClient::singleton()
 
 MockPageOverlayClient::MockPageOverlayClient() = default;
 
-Ref<MockPageOverlay> MockPageOverlayClient::installOverlay(MainFrame& mainFrame, PageOverlay::OverlayType overlayType)
+Ref<MockPageOverlay> MockPageOverlayClient::installOverlay(Page& page, PageOverlay::OverlayType overlayType)
 {
     auto overlay = PageOverlay::create(*this, overlayType);
-    mainFrame.pageOverlayController().installPageOverlay(overlay, PageOverlay::FadeMode::DoNotFade);
+    page.pageOverlayController().installPageOverlay(overlay, PageOverlay::FadeMode::DoNotFade);
 
     auto mockOverlay = MockPageOverlay::create(overlay.ptr());
     m_overlays.add(mockOverlay.ptr());
@@ -67,10 +67,10 @@ void MockPageOverlayClient::uninstallAllOverlays()
     }
 }
 
-String MockPageOverlayClient::layerTreeAsText(MainFrame& mainFrame, LayerTreeFlags flags)
+String MockPageOverlayClient::layerTreeAsText(Page& page, LayerTreeFlags flags)
 {
-    GraphicsLayer* viewOverlayRoot = mainFrame.pageOverlayController().viewOverlayRootLayer();
-    GraphicsLayer* documentOverlayRoot = mainFrame.pageOverlayController().documentOverlayRootLayer();
+    GraphicsLayer* viewOverlayRoot = page.pageOverlayController().viewOverlayRootLayer();
+    GraphicsLayer* documentOverlayRoot = page.pageOverlayController().documentOverlayRootLayer();
     
     return "View-relative:\n" + (viewOverlayRoot ? viewOverlayRoot->layerTreeAsText(flags | LayerTreeAsTextIncludePageOverlayLayers) : "(no view-relative overlay root)")
         + "\n\nDocument-relative:\n" + (documentOverlayRoot ? documentOverlayRoot->layerTreeAsText(flags | LayerTreeAsTextIncludePageOverlayLayers) : "(no document-relative overlay root)");
index fa0e37f7333c09cddbde6d4d1d81a6a5f1ceda19..46687ceb3d80565a28eba587bb0b7aa2e751ddb6 100644 (file)
@@ -32,7 +32,7 @@
 
 namespace WebCore {
 
-class MainFrame;
+class Page;
 
 class MockPageOverlayClient final : public PageOverlay::Client {
     friend class NeverDestroyed<MockPageOverlayClient>;
@@ -41,10 +41,10 @@ public:
 
     explicit MockPageOverlayClient();
 
-    Ref<MockPageOverlay> installOverlay(MainFrame&, PageOverlay::OverlayType);
+    Ref<MockPageOverlay> installOverlay(Page&, PageOverlay::OverlayType);
     void uninstallAllOverlays();
 
-    String layerTreeAsText(MainFrame&, LayerTreeFlags);
+    String layerTreeAsText(Page&, LayerTreeFlags);
 
     virtual ~MockPageOverlayClient() = default;
 
index 13d02b04726263c3d57dd13647e96a0f6f6c0c84..d405495b5c25c83dbae960c2c4846714d59f20ec 100644 (file)
 
 #if ENABLE(APPLE_PAY)
 
-#include "MainFrame.h"
 #include "MockPayment.h"
 #include "MockPaymentContact.h"
 #include "MockPaymentMethod.h"
+#include "Page.h"
 #include "PaymentCoordinator.h"
 #include "URL.h"
 #include <wtf/RunLoop.h>
 
 namespace WebCore {
 
-MockPaymentCoordinator::MockPaymentCoordinator(MainFrame& mainFrame)
-    : m_mainFrame { mainFrame }
+MockPaymentCoordinator::MockPaymentCoordinator(Page& page)
+    : m_page { page }
 {
     m_availablePaymentNetworks.add("amex");
     m_availablePaymentNetworks.add("carteBancaire");
@@ -111,16 +111,16 @@ bool MockPaymentCoordinator::showPaymentUI(const URL&, const Vector<URL>&, const
 
     ASSERT(showCount == hideCount);
     ++showCount;
-    dispatchIfShowing([mainFrame = makeRef(m_mainFrame)]() {
-        mainFrame->paymentCoordinator().validateMerchant({ URL(), ASCIILiteral("https://webkit.org/") });
+    dispatchIfShowing([page = &m_page]() {
+        page->paymentCoordinator().validateMerchant({ URL(), ASCIILiteral("https://webkit.org/") });
     });
     return true;
 }
 
 void MockPaymentCoordinator::completeMerchantValidation(const PaymentMerchantSession&)
 {
-    dispatchIfShowing([mainFrame = makeRef(m_mainFrame), shippingAddress = m_shippingAddress]() mutable {
-        mainFrame->paymentCoordinator().didSelectShippingContact(MockPaymentContact { WTFMove(shippingAddress) });
+    dispatchIfShowing([page = &m_page, shippingAddress = m_shippingAddress]() mutable {
+        page->paymentCoordinator().didSelectShippingContact(MockPaymentContact { WTFMove(shippingAddress) });
     });
 }
 
@@ -161,33 +161,33 @@ void MockPaymentCoordinator::completePaymentMethodSelection(std::optional<Paymen
 
 void MockPaymentCoordinator::changeShippingOption(String&& shippingOption)
 {
-    dispatchIfShowing([mainFrame = makeRef(m_mainFrame), shippingOption = WTFMove(shippingOption)]() mutable {
+    dispatchIfShowing([page = &m_page, shippingOption = WTFMove(shippingOption)]() mutable {
         ApplePaySessionPaymentRequest::ShippingMethod shippingMethod;
         shippingMethod.identifier = WTFMove(shippingOption);
-        mainFrame->paymentCoordinator().didSelectShippingMethod(shippingMethod);
+        page->paymentCoordinator().didSelectShippingMethod(shippingMethod);
     });
 }
 
 void MockPaymentCoordinator::changePaymentMethod(ApplePayPaymentMethod&& paymentMethod)
 {
-    dispatchIfShowing([mainFrame = makeRef(m_mainFrame), paymentMethod = WTFMove(paymentMethod)]() mutable {
-        mainFrame->paymentCoordinator().didSelectPaymentMethod(MockPaymentMethod { WTFMove(paymentMethod) });
+    dispatchIfShowing([page = &m_page, paymentMethod = WTFMove(paymentMethod)]() mutable {
+        page->paymentCoordinator().didSelectPaymentMethod(MockPaymentMethod { WTFMove(paymentMethod) });
     });
 }
 
 void MockPaymentCoordinator::acceptPayment()
 {
-    dispatchIfShowing([mainFrame = makeRef(m_mainFrame), shippingAddress = m_shippingAddress]() mutable {
+    dispatchIfShowing([page = &m_page, shippingAddress = m_shippingAddress]() mutable {
         ApplePayPayment payment;
         payment.shippingContact = WTFMove(shippingAddress);
-        mainFrame->paymentCoordinator().didAuthorizePayment(MockPayment { WTFMove(payment) });
+        page->paymentCoordinator().didAuthorizePayment(MockPayment { WTFMove(payment) });
     });
 }
 
 void MockPaymentCoordinator::cancelPayment()
 {
-    dispatchIfShowing([mainFrame = makeRef(m_mainFrame)] {
-        mainFrame->paymentCoordinator().didCancelPaymentSession();
+    dispatchIfShowing([page = &m_page] {
+        page->paymentCoordinator().didCancelPaymentSession();
         ++hideCount;
         ASSERT(showCount == hideCount);
     });
index a369a8d7bfaa395ed50cd637894e5f404bc62cae..1f7d068d1cc09ef4d5c3e5bf1609b400216317cf 100644 (file)
 
 namespace WebCore {
 
-class MainFrame;
+class Page;
 struct ApplePayPaymentMethod;
 
 class MockPaymentCoordinator final : public PaymentCoordinatorClient {
 public:
-    explicit MockPaymentCoordinator(MainFrame&);
+    explicit MockPaymentCoordinator(Page&);
 
     void setShippingAddress(MockPaymentAddress&& shippingAddress) { m_shippingAddress = WTFMove(shippingAddress); }
     void changeShippingOption(String&& shippingOption);
@@ -72,7 +72,7 @@ private:
 
     void updateTotalAndLineItems(const ApplePaySessionPaymentRequest::TotalAndLineItems&);
 
-    MainFrame& m_mainFrame;
+    Page& m_page;
     ApplePayPaymentContact m_shippingAddress;
     ApplePayLineItem m_total;
     Vector<ApplePayLineItem> m_lineItems;
index b4372ce2553dc033b8af47bd10a8b40dcd937896..668657077e9ef9d35a11a3888361fce2c8c27880 100644 (file)
@@ -29,9 +29,9 @@
 #if ENABLE(SERVICE_WORKER)
 
 #include "CacheStorageProvider.h"
+#include "Frame.h"
 #include "FrameLoader.h"
 #include "LoaderStrategy.h"
-#include "MainFrame.h"
 #include "PlatformStrategies.h"
 #include "Settings.h"
 #include <pal/SessionID.h>
index a85d3b075a4e88ec62b174521ce02345015c09bf..78678f50616ca67586b82080e656a6f1b2f0952a 100644 (file)
@@ -1,3 +1,81 @@
+2018-04-03  Chris Dumez  <cdumez@apple.com>
+
+        Drop MainFrame class
+        https://bugs.webkit.org/show_bug.cgi?id=184191
+
+        Reviewed by Darin Adler.
+
+        Drop MainFrame class and move contents into Page / Frame since there is a 1:1
+        relationship between the Page and the MainFrame.
+
+        This is ground work for introducing LocalFrame / RemoteFrame concepts.
+
+        * Shared/WebRenderLayer.cpp:
+        * Shared/WebRenderObject.cpp:
+        * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
+        (WebKit::WebPaymentCoordinator::paymentCoordinator):
+        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
+        * WebProcess/FullScreen/WebFullScreenManager.cpp:
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+        (WKBundlePageInstallPageOverlay):
+        (WKBundlePageUninstallPageOverlay):
+        (WKBundlePageInstallPageOverlayWithAnimation):
+        (WKBundlePageUninstallPageOverlayWithAnimation):
+        * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
+        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        * WebProcess/Plugins/PDF/PDFPlugin.mm:
+        * WebProcess/Plugins/PluginView.cpp:
+        * WebProcess/Plugins/WebPluginInfoProvider.cpp:
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
+        (WebKit::WebInspectorClient::~WebInspectorClient):
+        (WebKit::WebInspectorClient::highlight):
+        (WebKit::WebInspectorClient::hideHighlight):
+        (WebKit::WebInspectorClient::showPaintRect):
+        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
+        * WebProcess/WebCoreSupport/WebProgressTrackerClient.cpp:
+        * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
+        * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
+        * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
+        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
+        * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
+        * WebProcess/WebPage/FindController.cpp:
+        (WebKit::FindController::updateFindUIAfterPageScroll):
+        (WebKit::FindController::hideFindUI):
+        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
+        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
+        (WebKit::RemoteLayerTreeDrawingArea::updatePreferences):
+        * WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm:
+        * WebProcess/WebPage/WebBackForwardListProxy.cpp:
+        * WebProcess/WebPage/WebFrame.cpp:
+        * WebProcess/WebPage/WebInspector.cpp:
+        * WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.cpp:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::mainFrame const):
+        (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
+        (WebKit::WebPage::plugInIntersectsSearchRect):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp:
+        * WebProcess/WebPage/ios/FindControllerIOS.mm:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::updatePreferences):
+        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
+        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
+        (-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
+        (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        (WebKit::WebPage::performImmediateActionHitTestAtLocation):
+        (WebKit::WebPage::dataDetectorsDidPresentUI):
+        (WebKit::WebPage::dataDetectorsDidChangeUI):
+        (WebKit::WebPage::dataDetectorsDidHideUI):
+        * WebProcess/WebProcess.cpp:
+        * WebProcess/WebStorage/StorageAreaMap.cpp:
+
 2018-04-03  Youenn Fablet  <youenn@apple.com>
 
         Make NetworkProcess get ContentBlocker information from UIProcess
index a7b4f4655566335c066ab169960e81fcea9b0dbe..9ffeaf8b47c509931c4942a4e91b2f5d74092a0a 100644 (file)
@@ -32,7 +32,6 @@
 #include <WebCore/Frame.h>
 #include <WebCore/FrameLoader.h>
 #include <WebCore/FrameLoaderClient.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/RenderLayer.h>
 #include <WebCore/RenderLayerBacking.h>
 #include <WebCore/RenderView.h>
index 5922b000098b40e65d361c8400fa76354176fb6e..1e2aab20df0dad8d10353c5db1171d67e435fa47 100644 (file)
@@ -32,7 +32,6 @@
 #include <WebCore/Frame.h>
 #include <WebCore/FrameLoader.h>
 #include <WebCore/FrameLoaderClient.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/RenderInline.h>
 #include <WebCore/RenderText.h>
 #include <WebCore/RenderView.h>
index 83827e8ee263e8f6dc45704067d8317df0dd6275..791511cf4bc722bc90fc332108fd95b28b882b44 100644 (file)
@@ -34,7 +34,7 @@
 #include "WebPaymentCoordinatorMessages.h"
 #include "WebPaymentCoordinatorProxyMessages.h"
 #include "WebProcess.h"
-#include <WebCore/MainFrame.h>
+#include <WebCore/Frame.h>
 #include <WebCore/PaymentCoordinator.h>
 #include <WebCore/URL.h>
 
@@ -226,7 +226,7 @@ void WebPaymentCoordinator::openPaymentSetupReply(uint64_t requestID, bool resul
 
 WebCore::PaymentCoordinator& WebPaymentCoordinator::paymentCoordinator()
 {
-    return m_webPage.mainFrame()->paymentCoordinator();
+    return m_webPage.corePage()->paymentCoordinator();
 }
 
 }
index ea8a43eed2920a4f61f9bc991535038aa05203cf..b4221647f5aecd72ea4cce27603b28587f81aa2a 100644 (file)
@@ -53,7 +53,6 @@
 #include <WebCore/HTMLOptionElement.h>
 #include <WebCore/HTMLSelectElement.h>
 #include <WebCore/JSElement.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/RenderElement.h>
 #include <wtf/UUID.h>
 
index 8853c017ab2dad0b213baeca49b84a5a7a3ae2a7..963f1b9d5f666a1ce51d7a73568f1881c5ab225a 100644 (file)
@@ -34,9 +34,9 @@
 #include "WebPage.h"
 #include <WebCore/Color.h>
 #include <WebCore/Element.h>
+#include <WebCore/Frame.h>
 #include <WebCore/FrameView.h>
 #include <WebCore/HTMLVideoElement.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/Page.h>
 #include <WebCore/RenderLayer.h>
 #include <WebCore/RenderLayerBacking.h>
index 8f5d61bf71c72226a7b091e3db39478bfd3af3bc..5e8f117d8252fbfe47f577e2db008e4b28e2cd48 100644 (file)
@@ -59,7 +59,7 @@
 #include <WebCore/AXObjectCache.h>
 #include <WebCore/AccessibilityObject.h>
 #include <WebCore/ApplicationCacheStorage.h>
-#include <WebCore/MainFrame.h>
+#include <WebCore/Frame.h>
 #include <WebCore/Page.h>
 #include <WebCore/PageOverlay.h>
 #include <WebCore/PageOverlayController.h>
@@ -371,22 +371,22 @@ WKBundleBackForwardListRef WKBundlePageGetBackForwardList(WKBundlePageRef pageRe
 
 void WKBundlePageInstallPageOverlay(WKBundlePageRef pageRef, WKBundlePageOverlayRef pageOverlayRef)
 {
-    toImpl(pageRef)->mainFrame()->pageOverlayController().installPageOverlay(*toImpl(pageOverlayRef)->coreOverlay(), WebCore::PageOverlay::FadeMode::DoNotFade);
+    toImpl(pageRef)->corePage()->pageOverlayController().installPageOverlay(*toImpl(pageOverlayRef)->coreOverlay(), WebCore::PageOverlay::FadeMode::DoNotFade);
 }
 
 void WKBundlePageUninstallPageOverlay(WKBundlePageRef pageRef, WKBundlePageOverlayRef pageOverlayRef)
 {
-    toImpl(pageRef)->mainFrame()->pageOverlayController().uninstallPageOverlay(*toImpl(pageOverlayRef)->coreOverlay(), WebCore::PageOverlay::FadeMode::DoNotFade);
+    toImpl(pageRef)->corePage()->pageOverlayController().uninstallPageOverlay(*toImpl(pageOverlayRef)->coreOverlay(), WebCore::PageOverlay::FadeMode::DoNotFade);
 }
 
 void WKBundlePageInstallPageOverlayWithAnimation(WKBundlePageRef pageRef, WKBundlePageOverlayRef pageOverlayRef)
 {
-    toImpl(pageRef)->mainFrame()->pageOverlayController().installPageOverlay(*toImpl(pageOverlayRef)->coreOverlay(), WebCore::PageOverlay::FadeMode::Fade);
+    toImpl(pageRef)->corePage()->pageOverlayController().installPageOverlay(*toImpl(pageOverlayRef)->coreOverlay(), WebCore::PageOverlay::FadeMode::Fade);
 }
 
 void WKBundlePageUninstallPageOverlayWithAnimation(WKBundlePageRef pageRef, WKBundlePageOverlayRef pageOverlayRef)
 {
-    toImpl(pageRef)->mainFrame()->pageOverlayController().uninstallPageOverlay(*toImpl(pageOverlayRef)->coreOverlay(), WebCore::PageOverlay::FadeMode::Fade);
+    toImpl(pageRef)->corePage()->pageOverlayController().uninstallPageOverlay(*toImpl(pageOverlayRef)->coreOverlay(), WebCore::PageOverlay::FadeMode::Fade);
 }
 
 void WKBundlePageSetTopOverhangImage(WKBundlePageRef pageRef, WKImageRef imageRef)
index 5642f16076e7aee1d26045aea581c5cf320861b9..667cd81aff76df8034518757b1a2b1819f160a8b 100644 (file)
@@ -53,7 +53,6 @@
 #include <WebCore/FrameLoader.h>
 #include <WebCore/FrameView.h>
 #include <WebCore/HTMLFormElement.h>
-#include <WebCore/MainFrame.h>
 #include <glib/gi18n-lib.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/glib/WTFGType.h>
index 294c20930465dd3c8c2658d579f414004a114cc6..98796e9fa16447d048a0e94fc44a22681f50129b 100644 (file)
@@ -64,7 +64,6 @@
 #import <WebCore/Frame.h>
 #import <WebCore/HTMLFormElement.h>
 #import <WebCore/HTMLInputElement.h>
-#import <WebCore/MainFrame.h>
 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>
 
 using namespace WebCore;
index 1b9b0c8c9f1f3f3afbfe5a14f01492bd641141f2..490e342eb61eeede88d5aea38d5926f5b13e58ab 100644 (file)
@@ -53,6 +53,7 @@
 #include <WebCore/ApplicationCache.h>
 #include <WebCore/ApplicationCacheStorage.h>
 #include <WebCore/CommonVM.h>
+#include <WebCore/Frame.h>
 #include <WebCore/FrameLoader.h>
 #include <WebCore/FrameView.h>
 #include <WebCore/GCController.h>
@@ -63,7 +64,6 @@
 #include <WebCore/JSDOMExceptionHandling.h>
 #include <WebCore/JSDOMWindow.h>
 #include <WebCore/JSNotification.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/Page.h>
 #include <WebCore/PageGroup.h>
 #include <WebCore/PrintContext.h>
index e76a8a9a949395b1b938e408745a58f675be2979..48166768f14158f02203e2b0b925d072cf533804 100644 (file)
@@ -69,7 +69,6 @@
 #import <WebCore/HTMLPlugInElement.h>
 #import <WebCore/LegacyNSPasteboardTypes.h>
 #import <WebCore/LocalizedStrings.h>
-#import <WebCore/MainFrame.h>
 #import <WebCore/MouseEvent.h>
 #import <WebCore/PDFDocumentImage.h>
 #import <WebCore/Page.h>
index 3f10e75b2233eac11b99575d7ad426229abca83f..e182c010be1741df436948c9e32cc1f7133947b2 100644 (file)
@@ -44,6 +44,7 @@
 #include <WebCore/EventHandler.h>
 #include <WebCore/EventNames.h>
 #include <WebCore/FocusController.h>
+#include <WebCore/Frame.h>
 #include <WebCore/FrameLoadRequest.h>
 #include <WebCore/FrameLoader.h>
 #include <WebCore/FrameLoaderClient.h>
@@ -54,7 +55,6 @@
 #include <WebCore/HTTPHeaderNames.h>
 #include <WebCore/HostWindow.h>
 #include <WebCore/MIMETypeRegistry.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/MouseEvent.h>
 #include <WebCore/NetscapePlugInStreamLoader.h>
 #include <WebCore/Page.h>
index 44889a08800b402345c7ed2de2bb734870525f22..18f0312ed2f1d16b0509ef6ca2822ba9afb542bd 100644 (file)
@@ -32,8 +32,8 @@
 #include "WebProcessProxyMessages.h"
 #include <WebCore/Document.h>
 #include <WebCore/DocumentLoader.h>
+#include <WebCore/Frame.h>
 #include <WebCore/FrameLoader.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/Page.h>
 #include <WebCore/SubframeLoader.h>
 #include <wtf/text/StringHash.h>
index b1398bdb3a0c58c7f9ce878d02195cab2dc90319..4b757c81548a2522de68124cc8972a9eb3285794 100644 (file)
@@ -61,6 +61,7 @@
 #include <WebCore/DocumentLoader.h>
 #include <WebCore/FileChooser.h>
 #include <WebCore/FileIconLoader.h>
+#include <WebCore/Frame.h>
 #include <WebCore/FrameLoadRequest.h>
 #include <WebCore/FrameLoader.h>
 #include <WebCore/FrameView.h>
@@ -69,7 +70,6 @@
 #include <WebCore/HTMLParserIdioms.h>
 #include <WebCore/HTMLPlugInImageElement.h>
 #include <WebCore/Icon.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/NotImplemented.h>
 #include <WebCore/Page.h>
 #include <WebCore/ScriptController.h>
index 301b0b9f744aaef0011dae7153327acccedf1b97..ce5ac2850a686e5bed5094109ac52fe2e6d33f66 100644 (file)
@@ -35,8 +35,8 @@
 #include <WebCore/ContextMenu.h>
 #include <WebCore/Editor.h>
 #include <WebCore/Event.h>
+#include <WebCore/Frame.h>
 #include <WebCore/FrameLoader.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/NotImplemented.h>
 #include <WebCore/Page.h>
 #include <WebCore/UserGestureIndicator.h>
index fcbdd757b21c5f25ca19e599c947746827087eb3..1e2a92fcccd97716481497e5b29a87c5cb206948 100644 (file)
@@ -66,6 +66,7 @@
 #include <WebCore/DOMWrapperWorld.h>
 #include <WebCore/DocumentLoader.h>
 #include <WebCore/FormState.h>
+#include <WebCore/Frame.h>
 #include <WebCore/FrameLoadRequest.h>
 #include <WebCore/FrameLoader.h>
 #include <WebCore/FrameView.h>
@@ -74,7 +75,6 @@
 #include <WebCore/HistoryController.h>
 #include <WebCore/HistoryItem.h>
 #include <WebCore/MIMETypeRegistry.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/MouseEvent.h>
 #include <WebCore/NotImplemented.h>
 #include <WebCore/Page.h>
index 5bc862c0070dd3d12566733c86925ae9cf26a46d..d5c90e535c7156bfd9b247c80275718b8a202c26 100644 (file)
@@ -29,8 +29,8 @@
 #include "DrawingArea.h"
 #include "WebInspector.h"
 #include "WebPage.h"
+#include <WebCore/Frame.h>
 #include <WebCore/InspectorController.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/Page.h>
 #include <WebCore/PageOverlayController.h>
 #include <WebCore/Settings.h>
@@ -72,8 +72,8 @@ WebInspectorClient::~WebInspectorClient()
         delete layer;
     }
 
-    if (m_paintRectOverlay && m_page->mainFrame())
-        m_page->mainFrame()->pageOverlayController().uninstallPageOverlay(*m_paintRectOverlay, PageOverlay::FadeMode::Fade);
+    if (m_paintRectOverlay)
+        m_page->corePage()->pageOverlayController().uninstallPageOverlay(*m_paintRectOverlay, PageOverlay::FadeMode::Fade);
 }
 
 void WebInspectorClient::inspectedPageDestroyed()
@@ -112,7 +112,7 @@ void WebInspectorClient::highlight()
     if (!m_highlightOverlay) {
         auto highlightOverlay = PageOverlay::create(*this);
         m_highlightOverlay = highlightOverlay.ptr();
-        m_page->mainFrame()->pageOverlayController().installPageOverlay(WTFMove(highlightOverlay), PageOverlay::FadeMode::Fade);
+        m_page->corePage()->pageOverlayController().installPageOverlay(WTFMove(highlightOverlay), PageOverlay::FadeMode::Fade);
         m_highlightOverlay->setNeedsDisplay();
     } else {
         m_highlightOverlay->stopFadeOutAnimation();
@@ -128,8 +128,8 @@ void WebInspectorClient::highlight()
 void WebInspectorClient::hideHighlight()
 {
 #if !PLATFORM(IOS)
-    if (m_highlightOverlay && m_page->mainFrame())
-        m_page->mainFrame()->pageOverlayController().uninstallPageOverlay(*m_highlightOverlay, PageOverlay::FadeMode::Fade);
+    if (m_highlightOverlay)
+        m_page->corePage()->pageOverlayController().uninstallPageOverlay(*m_highlightOverlay, PageOverlay::FadeMode::Fade);
 #else
     m_page->hideInspectorHighlight();
 #endif
@@ -142,7 +142,7 @@ void WebInspectorClient::showPaintRect(const FloatRect& rect)
 
     if (!m_paintRectOverlay) {
         m_paintRectOverlay = PageOverlay::create(*this, PageOverlay::OverlayType::Document);
-        m_page->mainFrame()->pageOverlayController().installPageOverlay(*m_paintRectOverlay, PageOverlay::FadeMode::DoNotFade);
+        m_page->corePage()->pageOverlayController().installPageOverlay(*m_paintRectOverlay, PageOverlay::FadeMode::DoNotFade);
     }
 
     if (!m_paintIndicatorLayerClient)
index e81e49a3c39cdd2a735323cae970e223bd018a2f..d287320d6011e96551beb7e1d96e71d91074e770 100644 (file)
@@ -48,8 +48,8 @@
 #include <WebCore/Color.h>
 #include <WebCore/Document.h>
 #include <WebCore/DocumentLoader.h>
+#include <WebCore/Frame.h>
 #include <WebCore/LoaderStrategy.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/NetworkStorageSession.h>
 #include <WebCore/Page.h>
 #include <WebCore/PageGroup.h>
index c4cc534df4716631dbedf54bad04bec07eb8257c..3043ab73efc84395184d4361e663f376b4e10fc4 100644 (file)
@@ -29,7 +29,6 @@
 #include "WebPage.h"
 #include "WebPageProxyMessages.h"
 #include <WebCore/Frame.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/Page.h>
 #include <WebCore/ProgressTracker.h>
 
index 7525aed70c673398caa6accd2d0b604ef021dc7f..0681254e8cccbc33f20106a2f6495624e636e7ae 100644 (file)
@@ -33,8 +33,8 @@
 #import "WebPageProxyMessages.h"
 #import <WebCore/DictionaryLookup.h>
 #import <WebCore/Editor.h>
+#import <WebCore/Frame.h>
 #import <WebCore/FrameView.h>
-#import <WebCore/MainFrame.h>
 #import <WebCore/Page.h>
 #import <WebCore/TextIndicator.h>
 #import <wtf/text/WTFString.h>
index 65292d166fc78a9c5bd847a797dbb8c460962d06..f65cb24c625c12e64ce5da7cdd42e608de8086b3 100644 (file)
@@ -43,7 +43,6 @@
 #import <WebCore/FrameView.h>
 #import <WebCore/GraphicsContextCG.h>
 #import <WebCore/LegacyWebArchive.h>
-#import <WebCore/MainFrame.h>
 #import <WebCore/NotImplemented.h>
 #import <WebCore/Page.h>
 #import <WebCore/Pasteboard.h>
index 44518d44a16215e827da785b6d5957c004c4a575..5ced8be0e7ffe328f13ef1e3917ab29e4b3bbc06 100644 (file)
@@ -33,7 +33,7 @@
 #include "WebPage.h"
 #include "WebPageCreationParameters.h"
 #include "WebPreferencesKeys.h"
-#include <WebCore/MainFrame.h>
+#include <WebCore/Frame.h>
 #include <WebCore/Page.h>
 #include <WebCore/PageOverlayController.h>
 #include <WebCore/Settings.h>
index 1918244941133211f1fee339656681da4b06bb25..9dd5909397d03bacec007038eb07f2e0e5a9c000 100644 (file)
 
 #include <WebCore/DOMWindow.h>
 #include <WebCore/Document.h>
+#include <WebCore/Frame.h>
 #include <WebCore/FrameView.h>
 #include <WebCore/GraphicsContext.h>
 #include <WebCore/InspectorController.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/NicosiaPaintingEngine.h>
 #include <WebCore/Page.h>
 #include <wtf/MemoryPressureHandler.h>
index 092aa385c903df4b64508663e5bb321c52480f4f..89ee3140bed0e8ad5e741b73ed0b13e02dba95f9 100644 (file)
@@ -33,8 +33,8 @@
 #include "DrawingArea.h"
 #include "WebPage.h"
 #include "WebPageProxyMessages.h"
+#include <WebCore/Frame.h>
 #include <WebCore/FrameView.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/PageOverlayController.h>
 
 #if USE(GLIB_EVENT_LOOP)
@@ -212,7 +212,7 @@ void CoordinatedLayerTreeHost::commitSceneState(const CoordinatedGraphicsState&
 void CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged()
 {
     m_coordinator.deviceOrPageScaleFactorChanged();
-    m_webPage.mainFrame()->pageOverlayController().didChangeDeviceScaleFactor();
+    m_webPage.corePage()->pageOverlayController().didChangeDeviceScaleFactor();
 }
 
 void CoordinatedLayerTreeHost::pageBackgroundTransparencyChanged()
index d0c4c26a784dcec2e077c63011a3f77be74b30e0..cd38a4e8c0e0db4401a7e9e3f9f71efb10feae12 100644 (file)
@@ -33,8 +33,8 @@
 
 #include "AcceleratedSurface.h"
 #include "WebPage.h"
+#include <WebCore/Frame.h>
 #include <WebCore/FrameView.h>
-#include <WebCore/MainFrame.h>
 
 namespace WebKit {
 using namespace WebCore;
index e19962fdcdc187b45bf4f9b1a027b4688967be23..15e6422f25b73378becbb473315e019e68375e78 100644 (file)
 #include <WebCore/DocumentMarkerController.h>
 #include <WebCore/FloatQuad.h>
 #include <WebCore/FocusController.h>
+#include <WebCore/Frame.h>
 #include <WebCore/FrameSelection.h>
 #include <WebCore/FrameView.h>
 #include <WebCore/GraphicsContext.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/Page.h>
 #include <WebCore/PageOverlayController.h>
 #include <WebCore/PlatformMouseEvent.h>
@@ -184,12 +184,12 @@ void FindController::updateFindUIAfterPageScroll(bool found, const String& strin
 
     if (!shouldShowOverlay) {
         if (m_findPageOverlay)
-            m_webPage->mainFrame()->pageOverlayController().uninstallPageOverlay(*m_findPageOverlay, PageOverlay::FadeMode::Fade);
+            m_webPage->corePage()->pageOverlayController().uninstallPageOverlay(*m_findPageOverlay, PageOverlay::FadeMode::Fade);
     } else {
         if (!m_findPageOverlay) {
             auto findPageOverlay = PageOverlay::create(*this, PageOverlay::OverlayType::Document);
             m_findPageOverlay = findPageOverlay.ptr();
-            m_webPage->mainFrame()->pageOverlayController().installPageOverlay(WTFMove(findPageOverlay), PageOverlay::FadeMode::Fade);
+            m_webPage->corePage()->pageOverlayController().installPageOverlay(WTFMove(findPageOverlay), PageOverlay::FadeMode::Fade);
         }
         m_findPageOverlay->setNeedsDisplay();
     }
@@ -308,7 +308,7 @@ void FindController::hideFindUI()
 {
     m_findMatches.clear();
     if (m_findPageOverlay)
-        m_webPage->mainFrame()->pageOverlayController().uninstallPageOverlay(*m_findPageOverlay, PageOverlay::FadeMode::Fade);
+        m_webPage->corePage()->pageOverlayController().uninstallPageOverlay(*m_findPageOverlay, PageOverlay::FadeMode::Fade);
 
     if (auto* pluginView = WebPage::pluginViewForFrame(m_webPage->mainFrame()))
         pluginView->findString(emptyString(), { }, 0);
index aa996cb6b68f32d3f208644e53384360b6274e75..84babde12974434c5a91c20275342baf479f2077 100644 (file)
@@ -32,8 +32,8 @@
 #import "RemoteLayerBackingStoreCollection.h"
 #import "RemoteLayerTreeTransaction.h"
 #import "WebPage.h"
+#import <WebCore/Frame.h>
 #import <WebCore/FrameView.h>
-#import <WebCore/MainFrame.h>
 #import <WebCore/Page.h>
 #import <wtf/SetForScope.h>
 #import <wtf/SystemTracing.h>
index d800555881b9a78bba690b65d3558eb9536d8b56..09c92f1e61b602128a7a8847647be7f5380cdffa 100644 (file)
@@ -42,7 +42,6 @@
 #import <WebCore/Frame.h>
 #import <WebCore/FrameView.h>
 #import <WebCore/InspectorController.h>
-#import <WebCore/MainFrame.h>
 #import <WebCore/PageOverlayController.h>
 #import <WebCore/RenderLayerCompositor.h>
 #import <WebCore/RenderView.h>
@@ -168,8 +167,7 @@ void RemoteLayerTreeDrawingArea::updatePreferences(const WebPreferencesStore&)
 
     m_rootLayer->setShowDebugBorder(settings.showDebugBorders());
 
-    if (MainFrame* mainFrame = m_webPage.mainFrame())
-        DebugPageOverlays::settingsChanged(*mainFrame);
+    DebugPageOverlays::settingsChanged(*m_webPage.corePage());
 }
 
 #if PLATFORM(IOS)
index 9f2dfb03b736ae4859552747773be0e9a94291d6..d2162e734f9302248ffe91277d0eb17bcc4352e0 100644 (file)
@@ -30,8 +30,8 @@
 
 #import "WebFrame.h"
 #import "WebPage.h"
+#import <WebCore/Frame.h>
 #import <WebCore/IntPoint.h>
-#import <WebCore/MainFrame.h>
 #import <WebCore/FrameView.h>
 #import <WebCore/Page.h>
 #import <WebCore/WAKAppKitStubs.h>
index 7f4e1277ccd740276f7de09fa3480ca212dd2ede..7c10c78e3fef2b179371da5ba483252261de7935 100644 (file)
@@ -33,9 +33,9 @@
 #include "WebPageProxyMessages.h"
 #include "WebProcess.h"
 #include "WebProcessProxyMessages.h"
+#include <WebCore/Frame.h>
 #include <WebCore/HistoryController.h>
 #include <WebCore/HistoryItem.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/PageCache.h>
 #include <wtf/HashMap.h>
 #include <wtf/NeverDestroyed.h>
index 67e1317b2e75ea5948db9eb397ff6ab08e4910da..16abe5571dc817cbff9b1b04ade1076c517ca38f 100644 (file)
@@ -71,7 +71,6 @@
 #include <WebCore/JSElement.h>
 #include <WebCore/JSFile.h>
 #include <WebCore/JSRange.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/NodeTraversal.h>
 #include <WebCore/Page.h>
 #include <WebCore/PluginDocument.h>
index 558330854044ec3c297fe5559e664ab82206dfb2..bbe5be561efca8976b7a8444b2c3976352995034 100644 (file)
 #include "WebProcess.h"
 #include <WebCore/Chrome.h>
 #include <WebCore/Document.h>
+#include <WebCore/Frame.h>
 #include <WebCore/FrameLoadRequest.h>
 #include <WebCore/FrameLoader.h>
 #include <WebCore/FrameView.h>
 #include <WebCore/InspectorController.h>
 #include <WebCore/InspectorFrontendClient.h>
 #include <WebCore/InspectorPageAgent.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/NavigationAction.h>
 #include <WebCore/NotImplemented.h>
 #include <WebCore/Page.h>
index 5257731eacc40ce34a1fc4dea9223bb7e2f718aa..908e39afdb0c889cfe5652b39adc470c3a09a9a2 100644 (file)
@@ -27,7 +27,7 @@
 #include "WebInspectorFrontendAPIDispatcher.h"
 
 #include "WebPage.h"
-#include <WebCore/MainFrame.h>
+#include <WebCore/Frame.h>
 #include <WebCore/ScriptController.h>
 #include <WebCore/ScriptState.h>
 
index cd2e0ad655266aa7380339629b5b5772488b5f6f..1490a8ee9a9ed5b1af8fd1c43df29e3607e65fab 100644 (file)
 #include <WebCore/File.h>
 #include <WebCore/FocusController.h>
 #include <WebCore/FormState.h>
+#include <WebCore/Frame.h>
 #include <WebCore/FrameLoadRequest.h>
 #include <WebCore/FrameLoaderTypes.h>
 #include <WebCore/FrameView.h>
 #include <WebCore/JSDOMWindow.h>
 #include <WebCore/KeyboardEvent.h>
 #include <WebCore/MIMETypeRegistry.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/MouseEvent.h>
 #include <WebCore/NotImplemented.h>
 #include <WebCore/Page.h>
@@ -4530,7 +4530,7 @@ void WebPage::recomputeShortCircuitHorizontalWheelEventsState()
     send(Messages::WebPageProxy::SetCanShortCircuitHorizontalWheelEvents(m_canShortCircuitHorizontalWheelEvents));
 }
 
-MainFrame* WebPage::mainFrame() const
+Frame* WebPage::mainFrame() const
 {
     return m_page ? &m_page->mainFrame() : nullptr;
 }
@@ -5302,7 +5302,7 @@ void WebPage::determinePrimarySnapshottedPlugIn()
 
     layoutIfNeeded();
 
-    MainFrame& mainFrame = corePage()->mainFrame();
+    auto& mainFrame = corePage()->mainFrame();
     if (!mainFrame.view())
         return;
     if (!mainFrame.view()->renderView())
@@ -5401,7 +5401,7 @@ bool WebPage::matchesPrimaryPlugIn(const String& pageOrigin, const String& plugi
 
 bool WebPage::plugInIntersectsSearchRect(HTMLPlugInImageElement& plugInImageElement)
 {
-    MainFrame& mainFrame = corePage()->mainFrame();
+    auto& mainFrame = corePage()->mainFrame();
     if (!mainFrame.view())
         return false;
     if (!mainFrame.view()->renderView())
index 38e910ab053c64ebc2e8d366ecec8ab3b5848606..b27474bbc2ce3235eb4357f6ad3c5d8aa8513d0c 100644 (file)
@@ -385,7 +385,7 @@ public:
 
     WebFrame* mainWebFrame() const { return m_mainFrame.get(); }
 
-    WebCore::MainFrame* mainFrame() const; // May return nullptr.
+    WebCore::Frame* mainFrame() const; // May return nullptr.
     WebCore::FrameView* mainFrameView() const; // May return nullptr.
 
     RefPtr<WebCore::Range> currentSelectionAsRange();
index 421fb8dddfbee5d7cb83825b6d3f83979585b051..327fc21f9b1bd9063d1c24f993d238e841661b33 100644 (file)
@@ -31,7 +31,7 @@
 #include "WebPage.h"
 #include <WebCore/AXObjectCache.h>
 #include <WebCore/Document.h>
-#include <WebCore/MainFrame.h>
+#include <WebCore/Frame.h>
 #include <WebCore/Page.h>
 
 using namespace WebKit;
index 21886b8650b77860e71aeaffb5c5417c26d625f2..4973d9617ae7d38255fc9d7bfc97b71a72a71e8c 100644 (file)
@@ -35,9 +35,9 @@
 #import "WebPageProxyMessages.h"
 #import <WebCore/Editor.h>
 #import <WebCore/FocusController.h>
+#import <WebCore/Frame.h>
 #import <WebCore/FrameView.h>
 #import <WebCore/GraphicsContext.h>
-#import <WebCore/MainFrame.h>
 #import <WebCore/Page.h>
 #import <WebCore/PageOverlayController.h>
 #import <WebCore/PathUtilities.h>
@@ -90,7 +90,7 @@ void FindIndicatorOverlayClientIOS::drawRect(PageOverlay& overlay, GraphicsConte
 bool FindController::updateFindIndicator(Frame& selectedFrame, bool isShowingOverlay, bool shouldAnimate)
 {
     if (m_findIndicatorOverlay) {
-        m_webPage->mainFrame()->pageOverlayController().uninstallPageOverlay(*m_findIndicatorOverlay, PageOverlay::FadeMode::DoNotFade);
+        m_webPage->corePage()->pageOverlayController().uninstallPageOverlay(*m_findIndicatorOverlay, PageOverlay::FadeMode::DoNotFade);
         m_findIndicatorOverlay = nullptr;
         m_isShowingFindIndicator = false;
     }
@@ -101,7 +101,7 @@ bool FindController::updateFindIndicator(Frame& selectedFrame, bool isShowingOve
 
     m_findIndicatorOverlayClient = std::make_unique<FindIndicatorOverlayClientIOS>(selectedFrame, textIndicator.get());
     m_findIndicatorOverlay = PageOverlay::create(*m_findIndicatorOverlayClient, PageOverlay::OverlayType::Document);
-    m_webPage->mainFrame()->pageOverlayController().installPageOverlay(*m_findIndicatorOverlay, PageOverlay::FadeMode::DoNotFade);
+    m_webPage->corePage()->pageOverlayController().installPageOverlay(*m_findIndicatorOverlay, PageOverlay::FadeMode::DoNotFade);
 
     m_findIndicatorOverlay->setFrame(enclosingIntRect(textIndicator->textBoundingRectInRootViewCoordinates()));
     m_findIndicatorOverlay->setNeedsDisplay();
@@ -128,7 +128,7 @@ void FindController::hideFindIndicator()
     if (!m_isShowingFindIndicator)
         return;
 
-    m_webPage->mainFrame()->pageOverlayController().uninstallPageOverlay(*m_findIndicatorOverlay, PageOverlay::FadeMode::DoNotFade);
+    m_webPage->corePage()->pageOverlayController().uninstallPageOverlay(*m_findIndicatorOverlay, PageOverlay::FadeMode::DoNotFade);
     m_findIndicatorOverlay = nullptr;
     m_isShowingFindIndicator = false;
     m_foundStringMatchIndex = -1;
index 5629db17d597b546d7d308223fc7f1c1d6c25669..f7065f5e0bcd24d5a2820a76a90b02324df8bdd1 100644 (file)
@@ -88,7 +88,6 @@
 #import <WebCore/HitTestResult.h>
 #import <WebCore/KeyboardEvent.h>
 #import <WebCore/LibWebRTCProvider.h>
-#import <WebCore/MainFrame.h>
 #import <WebCore/MediaSessionManagerIOS.h>
 #import <WebCore/Node.h>
 #import <WebCore/NodeList.h>
index a77221c8fd2272bcdd50f75b7fdc15d3a0361fdf..54d5c9d3e8e6d9eb59fba6bf4b7ec1c03980aff0 100644 (file)
 #import "WebProcess.h"
 #import <QuartzCore/QuartzCore.h>
 #import <WebCore/DebugPageOverlays.h>
+#import <WebCore/Frame.h>
 #import <WebCore/FrameView.h>
 #import <WebCore/GraphicsContext.h>
 #import <WebCore/GraphicsLayerCA.h>
 #import <WebCore/InspectorController.h>
 #import <WebCore/MachSendRight.h>
-#import <WebCore/MainFrame.h>
 #import <WebCore/Page.h>
 #import <WebCore/PlatformCAAnimationCocoa.h>
 #import <WebCore/RenderLayerBacking.h>
@@ -205,8 +205,7 @@ void TiledCoreAnimationDrawingArea::updatePreferences(const WebPreferencesStore&
     // in order to be scrolled by the ScrollingCoordinator.
     settings.setAcceleratedCompositingForFixedPositionEnabled(true);
 
-    if (MainFrame* mainFrame = m_webPage.mainFrame())
-        DebugPageOverlays::settingsChanged(*mainFrame);
+    DebugPageOverlays::settingsChanged(*m_webPage.corePage());
 
     bool showTiledScrollingIndicator = settings.showTiledScrollingIndicator();
     if (showTiledScrollingIndicator == !!m_debugInfoLayer)
index 4ebd0cf6bf3863fc87e030e6a4b4b275f6ea0e11..58d162c144e0e6b060210def6a274485f8c74b08 100644 (file)
@@ -36,8 +36,8 @@
 #import "WKStringCF.h"
 #import <WebCore/AXObjectCache.h>
 #import <WebCore/Document.h>
+#import <WebCore/Frame.h>
 #import <WebCore/FrameView.h>
-#import <WebCore/MainFrame.h>
 #import <WebCore/Page.h>
 #import <WebCore/ScrollView.h>
 #import <WebCore/Scrollbar.h>
index f39cae56f86cae29a9d6a4f234551eb6e602294f..6414cfedb3dfe8612377167dda23c0a078a3fa77 100644 (file)
@@ -38,8 +38,8 @@
 #import "WKString.h"
 #import "WKStringCF.h"
 #import <WebCore/AXObjectCache.h>
+#import <WebCore/Frame.h>
 #import <WebCore/FrameView.h>
-#import <WebCore/MainFrame.h>
 #import <WebCore/Page.h>
 #import <WebCore/PageOverlayController.h>
 #import <WebCore/ScrollView.h>
@@ -77,7 +77,7 @@ using namespace WebKit;
 
 - (NSArray *)accessibilityParameterizedAttributeNames
 {
-    Vector<String> result = m_page->mainFrame()->pageOverlayController().copyAccessibilityAttributesNames(true);
+    Vector<String> result = m_page->corePage()->pageOverlayController().copyAccessibilityAttributesNames(true);
     if (result.isEmpty())
         return nil;
     
@@ -168,14 +168,14 @@ using namespace WebKit;
 
     if ([attribute isEqualToString:@"AXDataDetectorExistsAtPoint"] || [attribute isEqualToString:@"AXDidShowDataDetectorMenuAtPoint"]) {
         bool value;
-        if (!m_page->mainFrame()->pageOverlayController().copyAccessibilityAttributeBoolValueForPoint(attribute, pageOverlayPoint, value))
+        if (!m_page->corePage()->pageOverlayController().copyAccessibilityAttributeBoolValueForPoint(attribute, pageOverlayPoint, value))
             return nil;
         return [NSNumber numberWithBool:value];
     }
 
     if ([attribute isEqualToString:@"AXDataDetectorTypeAtPoint"]) {
         String value;
-        if (!m_page->mainFrame()->pageOverlayController().copyAccessibilityAttributeStringValueForPoint(attribute, pageOverlayPoint, value))
+        if (!m_page->corePage()->pageOverlayController().copyAccessibilityAttributeStringValueForPoint(attribute, pageOverlayPoint, value))
             return nil;
         return [NSString stringWithString:value];
     }
index b1a77e0a5e5eb30596dae9cab2e52a4e5fdd53c0..4aa316b6d6e46ddda034c8a5ca46e885437c4115 100644 (file)
@@ -63,6 +63,7 @@
 #import <WebCore/Editor.h>
 #import <WebCore/EventHandler.h>
 #import <WebCore/FocusController.h>
+#import <WebCore/Frame.h>
 #import <WebCore/FrameLoader.h>
 #import <WebCore/FrameView.h>
 #import <WebCore/GraphicsContext.h>
@@ -72,7 +73,6 @@
 #import <WebCore/HitTestResult.h>
 #import <WebCore/KeyboardEvent.h>
 #import <WebCore/MIMETypeRegistry.h>
-#import <WebCore/MainFrame.h>
 #import <WebCore/NetworkStorageSession.h>
 #import <WebCore/NodeRenderStyle.h>
 #import <WebCore/Page.h>
@@ -978,7 +978,7 @@ void WebPage::performImmediateActionHitTestAtLocation(WebCore::FloatPoint locati
 {
     layoutIfNeeded();
 
-    MainFrame& mainFrame = corePage()->mainFrame();
+    auto& mainFrame = corePage()->mainFrame();
     if (!mainFrame.view() || !mainFrame.view()->renderView()) {
         send(Messages::WebPageProxy::DidPerformImmediateActionHitTest(WebHitTestResultData(), false, UserData()));
         return;
@@ -1015,7 +1015,7 @@ void WebPage::performImmediateActionHitTestAtLocation(WebCore::FloatPoint locati
     }
 
     bool pageOverlayDidOverrideDataDetectors = false;
-    for (const auto& overlay : mainFrame.pageOverlayController().pageOverlays()) {
+    for (const auto& overlay : corePage()->pageOverlayController().pageOverlays()) {
         WebPageOverlay* webOverlay = WebPageOverlay::fromCoreOverlay(*overlay);
         if (!webOverlay)
             continue;
@@ -1120,8 +1120,7 @@ void WebPage::immediateActionDidComplete()
 
 void WebPage::dataDetectorsDidPresentUI(PageOverlay::PageOverlayID overlayID)
 {
-    MainFrame& mainFrame = corePage()->mainFrame();
-    for (const auto& overlay : mainFrame.pageOverlayController().pageOverlays()) {
+    for (const auto& overlay : corePage()->pageOverlayController().pageOverlays()) {
         if (overlay->pageOverlayID() == overlayID) {
             if (WebPageOverlay* webOverlay = WebPageOverlay::fromCoreOverlay(*overlay))
                 webOverlay->dataDetectorsDidPresentUI();
@@ -1132,8 +1131,7 @@ void WebPage::dataDetectorsDidPresentUI(PageOverlay::PageOverlayID overlayID)
 
 void WebPage::dataDetectorsDidChangeUI(PageOverlay::PageOverlayID overlayID)
 {
-    MainFrame& mainFrame = corePage()->mainFrame();
-    for (const auto& overlay : mainFrame.pageOverlayController().pageOverlays()) {
+    for (const auto& overlay : corePage()->pageOverlayController().pageOverlays()) {
         if (overlay->pageOverlayID() == overlayID) {
             if (WebPageOverlay* webOverlay = WebPageOverlay::fromCoreOverlay(*overlay))
                 webOverlay->dataDetectorsDidChangeUI();
@@ -1144,12 +1142,12 @@ void WebPage::dataDetectorsDidChangeUI(PageOverlay::PageOverlayID overlayID)
 
 void WebPage::dataDetectorsDidHideUI(PageOverlay::PageOverlayID overlayID)
 {
-    MainFrame& mainFrame = corePage()->mainFrame();
+    auto& mainFrame = corePage()->mainFrame();
 
     // Dispatching a fake mouse event will allow clients to display any UI that is normally displayed on hover.
     mainFrame.eventHandler().dispatchFakeMouseMoveEventSoon();
 
-    for (const auto& overlay : mainFrame.pageOverlayController().pageOverlays()) {
+    for (const auto& overlay : corePage()->pageOverlayController().pageOverlays()) {
         if (overlay->pageOverlayID() == overlayID) {
             if (WebPageOverlay* webOverlay = WebPageOverlay::fromCoreOverlay(*overlay))
                 webOverlay->dataDetectorsDidHideUI();
index 4495444a7883838c1794fa330dacf6ce8a3ac9e7..746f7226dc9d20a7fd0b84ef3125635a8cf9aab3 100644 (file)
@@ -98,7 +98,6 @@
 #include <WebCore/GlyphPage.h>
 #include <WebCore/HTMLMediaElement.h>
 #include <WebCore/JSDOMWindow.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/MemoryCache.h>
 #include <WebCore/MemoryRelease.h>
 #include <WebCore/MessagePort.h>
index 4713ac4b7e1c78e1322f49f2b55fc839265b810d..9a0cda2faa498fbd6c98420b039d746751ca28a1 100644 (file)
@@ -35,7 +35,7 @@
 #include "WebProcess.h"
 #include <WebCore/DOMWindow.h>
 #include <WebCore/Document.h>
-#include <WebCore/MainFrame.h>
+#include <WebCore/Frame.h>
 #include <WebCore/Page.h>
 #include <WebCore/PageGroup.h>
 #include <WebCore/SecurityOriginData.h>
index f616a81ed7cbbe464925377191aceb252933d0f2..5fb5bf54ef18d2371344cd4eff1094a090882e1f 100644 (file)
@@ -1,3 +1,25 @@
+2018-04-03  Chris Dumez  <cdumez@apple.com>
+
+        Drop MainFrame class
+        https://bugs.webkit.org/show_bug.cgi?id=184191
+
+        Reviewed by Darin Adler.
+
+        Drop MainFrame class and move contents into Page / Frame since there is a 1:1
+        relationship between the Page and the MainFrame.
+
+        This is ground work for introducing LocalFrame / RemoteFrame concepts.
+
+        * WebCoreSupport/WebDragClient.mm:
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        * WebCoreSupport/WebInspectorClient.mm:
+        * WebCoreSupport/WebPlatformStrategies.mm:
+        * WebCoreSupport/WebPluginInfoProvider.mm:
+        * WebView/WebFrame.mm:
+        * WebView/WebFrameView.mm:
+        * WebView/WebHTMLView.mm:
+        * WebView/WebView.mm:
+
 2018-04-02  Jer Noble  <jer.noble@apple.com>
 
         Enable Legacy EME for all WebKit & WebKitLegacy clients
index f4cf380c840248b7e57abc77acd52adb7b92fe76..a5924f47e0672ce6a544198814057a6f7d68dce2 100644 (file)
@@ -51,9 +51,9 @@
 #import <WebCore/EditorClient.h>
 #import <WebCore/EventHandler.h>
 #import <WebCore/FloatPoint.h>
+#import <WebCore/Frame.h>
 #import <WebCore/FrameView.h>
 #import <WebCore/Image.h>
-#import <WebCore/MainFrame.h>
 #import <WebCore/Page.h>
 #import <WebCore/Pasteboard.h>
 #import <WebCore/PasteboardWriter.h>
index b0ca5154bab0adf23d5f6a09001ecdf949f34afe..bbcda784ba1d8c503b83b0033eef9cb5ab216226 100644 (file)
@@ -86,6 +86,7 @@
 #import <WebCore/EventNames.h>
 #import <WebCore/FocusController.h>
 #import <WebCore/FormState.h>
+#import <WebCore/Frame.h>
 #import <WebCore/FrameLoader.h>
 #import <WebCore/FrameLoaderStateMachine.h>
 #import <WebCore/FrameLoaderTypes.h>
 #import <WebCore/HitTestResult.h>
 #import <WebCore/LoaderNSURLExtras.h>
 #import <WebCore/MIMETypeRegistry.h>
-#import <WebCore/MainFrame.h>
 #import <WebCore/MouseEvent.h>
 #import <WebCore/Page.h>
 #import <WebCore/PluginBlacklist.h>
index 30f53d6ecda9576008d993bba2e8a92c013824e4..97a696109224a62f19e8d1481cd4220b885bf2c3 100644 (file)
@@ -43,9 +43,9 @@
 #import "WebUIDelegatePrivate.h"
 #import "WebViewInternal.h"
 #import <JavaScriptCore/InspectorAgentBase.h>
+#import <WebCore/Frame.h>
 #import <WebCore/InspectorController.h>
 #import <WebCore/InspectorFrontendClient.h>
-#import <WebCore/MainFrame.h>
 #import <WebCore/Page.h>
 #import <WebCore/ScriptController.h>
 #import <WebKitLegacy/DOMExtensions.h>
index ed7f7f5ff26bad6a63b6438c7247cebfc51d41b3..227e48829f3cdfe9dbd1c3f98bda5f8684ce4b8d 100644 (file)
@@ -30,7 +30,7 @@
 #import "WebResourceLoadScheduler.h"
 #import <WebCore/BlobRegistryImpl.h>
 #import <WebCore/Color.h>
-#import <WebCore/MainFrame.h>
+#import <WebCore/Frame.h>
 #import <WebCore/NetworkStorageSession.h>
 #import <WebCore/PasteboardItemInfo.h>
 #import <WebCore/PlatformCookieJar.h>
index cd58f8215a864917e6a7ce2b74b728df3000a3f6..9d2a7dbb4c24176aee42f3ccfcc77a24b673bbba 100644 (file)
@@ -27,8 +27,8 @@
 
 #import "WebPluginDatabase.h"
 #import "WebPluginPackage.h"
+#import <WebCore/Frame.h>
 #import <WebCore/FrameLoader.h>
-#import <WebCore/MainFrame.h>
 #import <WebCore/Page.h>
 #import <WebCore/SubframeLoader.h>
 #import <wtf/BlockObjCExceptions.h>
index c2c48d299f3377026e50e9bbd72c52cb042bb183..ba9162c1ad51603273cc0281339f6771da3f3ee8 100644 (file)
@@ -72,6 +72,7 @@
 #import <WebCore/Editor.h>
 #import <WebCore/EventHandler.h>
 #import <WebCore/EventNames.h>
+#import <WebCore/Frame.h>
 #import <WebCore/FrameLoadRequest.h>
 #import <WebCore/FrameLoader.h>
 #import <WebCore/FrameLoaderStateMachine.h>
@@ -84,7 +85,6 @@
 #import <WebCore/JSNode.h>
 #import <WebCore/LegacyWebArchive.h>
 #import <WebCore/MIMETypeRegistry.h>
-#import <WebCore/MainFrame.h>
 #import <WebCore/Page.h>
 #import <WebCore/PlatformEventFactoryMac.h>
 #import <WebCore/PluginData.h>
index 83dd49ae0f2dc828043fad85b3c51b85be7ac99c..bdda81573a903c552dffa8e0351aa8b6010b0684 100644 (file)
@@ -72,7 +72,6 @@
 #import <Foundation/NSURLRequest.h>
 #import <WebCore/GraphicsContext.h>
 #import <WebCore/KeyEventCodesIOS.h>
-#import <WebCore/MainFrame.h>
 #import <WebCore/WAKClipView.h>
 #import <WebCore/WAKScrollView.h>
 #import <WebCore/WAKWindow.h>
index a061e02cc4428a036a4f1dfa1a0c13e9bbe43d85..2b7b9e379c1b888e1c3e124c5db3f2d730b76ee7 100644 (file)
 #import <WebCore/LegacyWebArchive.h>
 #import <WebCore/LocalizedStrings.h>
 #import <WebCore/MIMETypeRegistry.h>
-#import <WebCore/MainFrame.h>
 #import <WebCore/Page.h>
 #import <WebCore/PrintContext.h>
 #import <WebCore/Range.h>
index ba9c79c0a03d86a81b17919ddfafbe5a077b6e75..dba1c63d6e09a51bc4c498a700188dfeea30cc48 100644 (file)
 #import <WebCore/FileSystem.h>
 #import <WebCore/FocusController.h>
 #import <WebCore/FontCache.h>
+#import <WebCore/Frame.h>
 #import <WebCore/FrameLoader.h>
 #import <WebCore/FrameSelection.h>
 #import <WebCore/FrameTree.h>
 #import <WebCore/LocalizedStrings.h>
 #import <WebCore/LogInitialization.h>
 #import <WebCore/MIMETypeRegistry.h>
-#import <WebCore/MainFrame.h>
 #import <WebCore/MemoryCache.h>
 #import <WebCore/MemoryRelease.h>
 #import <WebCore/NavigationPolicyCheck.h>
index d96cde628dc3a8b34524e8eaeb591e305ee5930d..6e365e9e6d740ea23a268e509eb0ace6c1a04b0f 100644 (file)
@@ -1,3 +1,22 @@
+2018-04-03  Chris Dumez  <cdumez@apple.com>
+
+        Drop MainFrame class
+        https://bugs.webkit.org/show_bug.cgi?id=184191
+
+        Reviewed by Darin Adler.
+
+        Drop MainFrame class and move contents into Page / Frame since there is a 1:1
+        relationship between the Page and the MainFrame.
+
+        This is ground work for introducing LocalFrame / RemoteFrame concepts.
+
+        * WebCoreSupport/AcceleratedCompositingContext.cpp:
+        * WebCoreSupport/WebContextMenuClient.cpp:
+        * WebCoreSupport/WebDragClient.cpp:
+        * WebDropSource.cpp:
+        * WebFrame.cpp:
+        * WebView.cpp:
+
 2018-03-26  Chris Dumez  <cdumez@apple.com>
 
         Use SecurityOriginData more consistently in Service Worker code
index 499b179ecc67420222c151d2e2a492bf2b22fa5a..18d5c5c4e334d0785c93fe9990105419478c6242 100644 (file)
@@ -35,7 +35,6 @@
 #include <WebCore/FrameView.h>
 #include <WebCore/GraphicsLayerTextureMapper.h>
 #include <WebCore/HWndDC.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/Page.h>
 #include <WebCore/Settings.h>
 #include <WebCore/SystemInfo.h>
index 023b28a006cd72460acbe21967f5fba2e7a4cce6..498d036f13e2dc6bb4e19efc50ab8c18299b3e7f 100644 (file)
@@ -31,8 +31,8 @@
 #include <WebCore/ContextMenuController.h>
 #include <WebCore/Editor.h>
 #include <WebCore/Event.h>
+#include <WebCore/Frame.h>
 #include <WebCore/FrameLoader.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/NotImplemented.h>
 #include <WebCore/Page.h>
 #include <WebCore/ResourceRequest.h>
index ae462bd2fd16c1c506548fd7af6732162a1625b4..f60091faa45f47043b99f37de687c95dbc8a4599 100644 (file)
@@ -33,9 +33,9 @@
 #include <WebCore/DragData.h>
 #include <WebCore/DragItem.h>
 #include <WebCore/EventHandler.h>
+#include <WebCore/Frame.h>
 #include <WebCore/FrameView.h>
 #include <WebCore/GraphicsContext.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/Page.h>
 #include <WebCore/Pasteboard.h>
 #include <WebCore/PlatformMouseEvent.h>
index 06cebfaa6056dc857f9db8193dd62603ec053732..6babf90b89fa3c9d6995cdc7b9b78ce7527e6690 100644 (file)
@@ -31,8 +31,8 @@
 #include <WebCore/Cursor.h>
 #include <WebCore/DragActions.h>
 #include <WebCore/EventHandler.h>
+#include <WebCore/Frame.h>
 #include <WebCore/FrameView.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/Page.h>
 #include <WebCore/PlatformMouseEvent.h>
 
index 87dc90b5c0f972aab7dfbe9ef426ae72ed744569..04e44f8cc04b7886d555743f374d91a160a0c67f 100644 (file)
@@ -67,6 +67,7 @@
 #include <WebCore/Event.h>
 #include <WebCore/EventHandler.h>
 #include <WebCore/FormState.h>
+#include <WebCore/Frame.h>
 #include <WebCore/FrameLoadRequest.h>
 #include <WebCore/FrameLoader.h>
 #include <WebCore/FrameTree.h>
@@ -86,7 +87,6 @@
 #include <WebCore/JSDOMWindow.h>
 #include <WebCore/KeyboardEvent.h>
 #include <WebCore/MIMETypeRegistry.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/MemoryCache.h>
 #include <WebCore/MouseRelatedEvent.h>
 #include <WebCore/NotImplemented.h>
index 49cd7bdc228733078dfb508569263910e3ec4d7d..d81c831fe2eb75675564da493f44070d7ef1a3d4 100644 (file)
@@ -98,6 +98,7 @@
 #include <WebCore/FloatQuad.h>
 #include <WebCore/FocusController.h>
 #include <WebCore/Font.h>
+#include <WebCore/Frame.h>
 #include <WebCore/FrameLoader.h>
 #include <WebCore/FrameSelection.h>
 #include <WebCore/FrameTree.h>
 #include <WebCore/LogInitialization.h>
 #include <WebCore/Logging.h>
 #include <WebCore/MIMETypeRegistry.h>
-#include <WebCore/MainFrame.h>
 #include <WebCore/MemoryCache.h>
 #include <WebCore/MemoryRelease.h>
 #include <WebCore/NavigationPolicyCheck.h>
index 75774ca6ae9b145e6a513bbe1941a5450a5ff91e..84d4bdd1c59edcc7dc0943b33f224da6cfddd0a9 100644 (file)
@@ -1,3 +1,12 @@
+2018-04-03  Chris Dumez  <cdumez@apple.com>
+
+        Drop MainFrame class
+        https://bugs.webkit.org/show_bug.cgi?id=184191
+
+        Reviewed by Darin Adler.
+
+        * TestWebKitAPI/Tests/WebCore/cocoa/WebCoreNSURLSession.mm:
+
 2018-04-03  Charlie Turner  <cturner@igalia.com>
 
         [WPE] Add WPE port to garden-o-matic
index d7c3e3307b6c195aff9c91558961bb1d85d46f60..b8711f043ea4231bd9726b6954a3d619acb27e98 100644 (file)
@@ -29,9 +29,8 @@
 
 #import "PlatformUtilities.h"
 #import <JavaScriptCore/InitializeThreading.h>
-#import <WebKit/WebView.h>
+#import <WebCore/Frame.h>
 #import <WebCore/FrameLoadRequest.h>
-#import <WebCore/MainFrame.h>
 #import <WebCore/Page.h>
 #import <WebCore/PageConfiguration.h>
 #import <WebCore/Document.h>
@@ -42,6 +41,7 @@
 #import <WebCore/SubresourceLoader.h>
 #import <WebCore/WebCoreNSURLSession.h>
 #import <WebCore/ResourceLoader.h>
+#import <WebKit/WebView.h>
 #import <wtf/SchedulePair.h>
 
 static bool didLoadMainResource;