2014-04-08 23:09:52 +00:00
|
|
|
/*
|
2017-01-23 06:24:18 +00:00
|
|
|
* Copyright (C) 2014-2017 Apple Inc. All rights reserved.
|
2014-04-08 23:09:52 +00:00
|
|
|
*
|
|
|
|
* 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. AND ITS CONTRIBUTORS ``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 ITS 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.
|
|
|
|
*/
|
|
|
|
|
2014-04-09 06:25:37 +00:00
|
|
|
#include "config.h"
|
|
|
|
#include "PageOverlayController.h"
|
|
|
|
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
#include "Chrome.h"
|
|
|
|
#include "ChromeClient.h"
|
|
|
|
#include "Frame.h"
|
|
|
|
#include "FrameView.h"
|
|
|
|
#include "GraphicsContext.h"
|
|
|
|
#include "GraphicsLayer.h"
|
|
|
|
#include "Page.h"
|
2014-04-09 06:25:37 +00:00
|
|
|
#include "PageOverlay.h"
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
#include "ScrollingCoordinator.h"
|
|
|
|
#include "Settings.h"
|
|
|
|
#include "TiledBacking.h"
|
|
|
|
|
|
|
|
// FIXME: Someone needs to call didChangeSettings() if we want dynamic updates of layer border/repaint counter settings.
|
|
|
|
|
|
|
|
namespace WebCore {
|
|
|
|
|
2018-04-03 18:01:41 +00:00
|
|
|
PageOverlayController::PageOverlayController(Page& page)
|
2018-09-14 19:49:46 +00:00
|
|
|
: m_page(page)
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2017-10-19 23:48:45 +00:00
|
|
|
PageOverlayController::~PageOverlayController() = default;
|
2014-04-08 23:09:52 +00:00
|
|
|
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
void PageOverlayController::createRootLayersIfNeeded()
|
2014-04-08 23:09:52 +00:00
|
|
|
{
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
if (m_initialized)
|
|
|
|
return;
|
|
|
|
|
|
|
|
m_initialized = true;
|
|
|
|
|
2014-04-11 21:41:28 +00:00
|
|
|
ASSERT(!m_documentOverlayRootLayer);
|
|
|
|
ASSERT(!m_viewOverlayRootLayer);
|
2014-04-08 23:09:52 +00:00
|
|
|
|
2018-04-03 18:01:41 +00:00
|
|
|
m_documentOverlayRootLayer = GraphicsLayer::create(m_page.chrome().client().graphicsLayerFactory(), *this);
|
|
|
|
m_viewOverlayRootLayer = GraphicsLayer::create(m_page.chrome().client().graphicsLayerFactory(), *this);
|
2021-05-20 17:08:30 +00:00
|
|
|
m_documentOverlayRootLayer->setName(MAKE_STATIC_STRING_IMPL("Document overlay Container"));
|
|
|
|
m_viewOverlayRootLayer->setName(MAKE_STATIC_STRING_IMPL("View overlay container"));
|
2014-04-08 23:09:52 +00:00
|
|
|
}
|
|
|
|
|
2019-02-23 02:38:02 +00:00
|
|
|
void PageOverlayController::installedPageOverlaysChanged()
|
|
|
|
{
|
|
|
|
if (hasViewOverlays())
|
|
|
|
attachViewOverlayLayers();
|
|
|
|
else
|
|
|
|
detachViewOverlayLayers();
|
|
|
|
|
|
|
|
if (auto* frameView = m_page.mainFrame().view())
|
|
|
|
frameView->setNeedsCompositingConfigurationUpdate();
|
|
|
|
|
|
|
|
updateForceSynchronousScrollLayerPositionUpdates();
|
|
|
|
}
|
|
|
|
|
PageOverlayController's layers should be created lazily
https://bugs.webkit.org/show_bug.cgi?id=194199
Source/WebCore:
Reviewed by Tim Horton.
Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays()
and use them to only parent the overlay-hosting layers when necessary.
For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can
simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(),
which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer
compositing updates that parents the layerWithDocumentOverlays().
View overlays are added to the layer tree via the DrawingArea. When we go between having
none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer()
on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a
compositing flush (this has to be done manually because view overlay layers are outside the
subtree managed by RenderLayerCompositor).
Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer;
there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view
overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without
having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer().
* loader/EmptyClients.h:
* page/ChromeClient.h:
* page/FrameView.cpp:
(WebCore::FrameView::setNeedsCompositingConfigurationUpdate): These functions need to schedule a compositing flush
because there may be nothing else that does.
(WebCore::FrameView::setNeedsCompositingGeometryUpdate):
* page/Page.cpp:
(WebCore::Page::installedPageOverlaysChanged):
* page/Page.h:
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::hasDocumentOverlays const):
(WebCore::PageOverlayController::hasViewOverlays const):
(WebCore::PageOverlayController::attachViewOverlayLayers): PageOverlayController has the Page so it
might as well be the one to call through the ChromeClient.
(WebCore::PageOverlayController::detachViewOverlayLayers):
(WebCore::PageOverlayController::installPageOverlay):
(WebCore::PageOverlayController::uninstallPageOverlay):
* page/PageOverlayController.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers): isFullUpdate is always true; remove it.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Source/WebKit:
rdar://problem/46571593
Reviewed by Tim Horton.
Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays()
and use them to only parent the overlay-hosting layers when necessary.
For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can
simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(),
which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer
compositing updates that parents the layerWithDocumentOverlays().
View overlays are added to the layer tree via the DrawingArea. When we go between having
none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer()
on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a
compositing flush (this has to be done manually because view overlay layers are outside the
subtree managed by RenderLayerCompositor).
Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer;
there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view
overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without
having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer().
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::attachViewOverlayGraphicsLayer):
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
Source/WebKitLegacy/mac:
rdar://problem/46571593
Reviewed by Tim Horton.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Source/WebKitLegacy/win:
rdar://problem/46571593
Reviewed by Tim Horton.
Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays()
and use them to only parent the overlay-hosting layers when necessary.
For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can
simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(),
which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer
compositing updates that parents the layerWithDocumentOverlays().
View overlays are added to the layer tree via the DrawingArea. When we go between having
none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer()
on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a
compositing flush (this has to be done manually because view overlay layers are outside the
subtree managed by RenderLayerCompositor).
Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer;
there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view
overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without
having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer().
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
LayoutTests:
rdar://problem/46571593
Reviewed by Tim Horton.
* pageoverlay/overlay-remove-reinsert-view-expected.txt: We no longer unparent the overlays
on view removal, so new results.
* platform/ios-wk2/TestExpectations: Unskip some iOS tests.
* platform/ios-wk2/pageoverlay/overlay-installation-expected.txt: Added.
* platform/ios-wk2/pageoverlay/overlay-large-document-expected.txt: Added.
* platform/ios-wk2/pageoverlay/overlay-large-document-scrolled-expected.txt: Added.
* platform/ios/TestExpectations: Unskip some iOS tests.
Canonical link: https://commits.webkit.org/208700@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240940 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-02-04 21:16:22 +00:00
|
|
|
bool PageOverlayController::hasDocumentOverlays() const
|
|
|
|
{
|
|
|
|
for (const auto& overlay : m_pageOverlays) {
|
|
|
|
if (overlay->overlayType() == PageOverlay::OverlayType::Document)
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool PageOverlayController::hasViewOverlays() const
|
|
|
|
{
|
|
|
|
for (const auto& overlay : m_pageOverlays) {
|
|
|
|
if (overlay->overlayType() == PageOverlay::OverlayType::View)
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void PageOverlayController::attachViewOverlayLayers()
|
|
|
|
{
|
|
|
|
if (hasViewOverlays())
|
|
|
|
m_page.chrome().client().attachViewOverlayGraphicsLayer(&layerWithViewOverlays());
|
|
|
|
}
|
|
|
|
|
|
|
|
void PageOverlayController::detachViewOverlayLayers()
|
|
|
|
{
|
|
|
|
m_page.chrome().client().attachViewOverlayGraphicsLayer(nullptr);
|
|
|
|
}
|
|
|
|
|
2017-02-05 19:18:16 +00:00
|
|
|
GraphicsLayer* PageOverlayController::documentOverlayRootLayer() const
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
{
|
2017-02-05 19:18:16 +00:00
|
|
|
return m_documentOverlayRootLayer.get();
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
}
|
|
|
|
|
2017-02-05 19:18:16 +00:00
|
|
|
GraphicsLayer* PageOverlayController::viewOverlayRootLayer() const
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
{
|
2017-02-05 19:18:16 +00:00
|
|
|
return m_viewOverlayRootLayer.get();
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
}
|
|
|
|
|
2014-04-14 08:10:22 +00:00
|
|
|
static void updateOverlayGeometry(PageOverlay& overlay, GraphicsLayer& graphicsLayer)
|
|
|
|
{
|
|
|
|
IntRect overlayFrame = overlay.frame();
|
|
|
|
|
|
|
|
if (overlayFrame.location() == graphicsLayer.position() && overlayFrame.size() == graphicsLayer.size())
|
|
|
|
return;
|
|
|
|
|
|
|
|
graphicsLayer.setPosition(overlayFrame.location());
|
|
|
|
graphicsLayer.setSize(overlayFrame.size());
|
|
|
|
}
|
|
|
|
|
2017-02-05 19:18:16 +00:00
|
|
|
GraphicsLayer& PageOverlayController::layerWithDocumentOverlays()
|
|
|
|
{
|
|
|
|
createRootLayersIfNeeded();
|
|
|
|
|
2018-04-03 18:01:41 +00:00
|
|
|
bool inWindow = m_page.isInWindow();
|
2017-02-05 19:18:16 +00:00
|
|
|
|
|
|
|
for (auto& overlayAndLayer : m_overlayGraphicsLayers) {
|
|
|
|
PageOverlay& overlay = *overlayAndLayer.key;
|
|
|
|
if (overlay.overlayType() != PageOverlay::OverlayType::Document)
|
|
|
|
continue;
|
|
|
|
|
2018-09-14 19:49:46 +00:00
|
|
|
auto& layer = overlayAndLayer.value;
|
|
|
|
GraphicsLayer::traverse(layer.get(), [inWindow](GraphicsLayer& layer) {
|
2017-02-10 23:02:36 +00:00
|
|
|
layer.setIsInWindow(inWindow);
|
|
|
|
});
|
2018-09-14 19:49:46 +00:00
|
|
|
updateOverlayGeometry(overlay, layer.get());
|
2017-02-05 19:18:16 +00:00
|
|
|
|
2018-09-14 19:49:46 +00:00
|
|
|
if (!layer->parent())
|
|
|
|
m_documentOverlayRootLayer->addChild(layer.copyRef());
|
2017-02-05 19:18:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return *m_documentOverlayRootLayer;
|
|
|
|
}
|
|
|
|
|
|
|
|
GraphicsLayer& PageOverlayController::layerWithViewOverlays()
|
|
|
|
{
|
|
|
|
createRootLayersIfNeeded();
|
|
|
|
|
2018-04-03 18:01:41 +00:00
|
|
|
bool inWindow = m_page.isInWindow();
|
2017-02-05 19:18:16 +00:00
|
|
|
|
|
|
|
for (auto& overlayAndLayer : m_overlayGraphicsLayers) {
|
|
|
|
PageOverlay& overlay = *overlayAndLayer.key;
|
|
|
|
if (overlay.overlayType() != PageOverlay::OverlayType::View)
|
|
|
|
continue;
|
|
|
|
|
2018-09-14 19:49:46 +00:00
|
|
|
auto& layer = overlayAndLayer.value;
|
|
|
|
GraphicsLayer::traverse(layer.get(), [inWindow](GraphicsLayer& layer) {
|
2017-02-10 23:02:36 +00:00
|
|
|
layer.setIsInWindow(inWindow);
|
|
|
|
});
|
2018-09-14 19:49:46 +00:00
|
|
|
updateOverlayGeometry(overlay, layer.get());
|
2017-02-05 19:18:16 +00:00
|
|
|
|
2018-09-14 19:49:46 +00:00
|
|
|
if (!layer->parent())
|
|
|
|
m_viewOverlayRootLayer->addChild(layer.copyRef());
|
2017-02-05 19:18:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return *m_viewOverlayRootLayer;
|
|
|
|
}
|
|
|
|
|
2017-01-23 06:24:18 +00:00
|
|
|
void PageOverlayController::installPageOverlay(PageOverlay& overlay, PageOverlay::FadeMode fadeMode)
|
2014-04-08 23:09:52 +00:00
|
|
|
{
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
createRootLayersIfNeeded();
|
2014-04-08 23:09:52 +00:00
|
|
|
|
2017-01-23 06:24:18 +00:00
|
|
|
if (m_pageOverlays.contains(&overlay))
|
2014-04-08 23:09:52 +00:00
|
|
|
return;
|
|
|
|
|
2017-01-23 06:24:18 +00:00
|
|
|
m_pageOverlays.append(&overlay);
|
2014-04-08 23:09:52 +00:00
|
|
|
|
2018-09-14 19:49:46 +00:00
|
|
|
auto layer = GraphicsLayer::create(m_page.chrome().client().graphicsLayerFactory(), *this);
|
PageOverlayController's layers should be created lazily
https://bugs.webkit.org/show_bug.cgi?id=194199
Source/WebCore:
Reviewed by Tim Horton.
Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays()
and use them to only parent the overlay-hosting layers when necessary.
For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can
simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(),
which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer
compositing updates that parents the layerWithDocumentOverlays().
View overlays are added to the layer tree via the DrawingArea. When we go between having
none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer()
on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a
compositing flush (this has to be done manually because view overlay layers are outside the
subtree managed by RenderLayerCompositor).
Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer;
there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view
overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without
having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer().
* loader/EmptyClients.h:
* page/ChromeClient.h:
* page/FrameView.cpp:
(WebCore::FrameView::setNeedsCompositingConfigurationUpdate): These functions need to schedule a compositing flush
because there may be nothing else that does.
(WebCore::FrameView::setNeedsCompositingGeometryUpdate):
* page/Page.cpp:
(WebCore::Page::installedPageOverlaysChanged):
* page/Page.h:
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::hasDocumentOverlays const):
(WebCore::PageOverlayController::hasViewOverlays const):
(WebCore::PageOverlayController::attachViewOverlayLayers): PageOverlayController has the Page so it
might as well be the one to call through the ChromeClient.
(WebCore::PageOverlayController::detachViewOverlayLayers):
(WebCore::PageOverlayController::installPageOverlay):
(WebCore::PageOverlayController::uninstallPageOverlay):
* page/PageOverlayController.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers): isFullUpdate is always true; remove it.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Source/WebKit:
rdar://problem/46571593
Reviewed by Tim Horton.
Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays()
and use them to only parent the overlay-hosting layers when necessary.
For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can
simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(),
which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer
compositing updates that parents the layerWithDocumentOverlays().
View overlays are added to the layer tree via the DrawingArea. When we go between having
none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer()
on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a
compositing flush (this has to be done manually because view overlay layers are outside the
subtree managed by RenderLayerCompositor).
Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer;
there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view
overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without
having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer().
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::attachViewOverlayGraphicsLayer):
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
Source/WebKitLegacy/mac:
rdar://problem/46571593
Reviewed by Tim Horton.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Source/WebKitLegacy/win:
rdar://problem/46571593
Reviewed by Tim Horton.
Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays()
and use them to only parent the overlay-hosting layers when necessary.
For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can
simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(),
which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer
compositing updates that parents the layerWithDocumentOverlays().
View overlays are added to the layer tree via the DrawingArea. When we go between having
none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer()
on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a
compositing flush (this has to be done manually because view overlay layers are outside the
subtree managed by RenderLayerCompositor).
Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer;
there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view
overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without
having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer().
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
LayoutTests:
rdar://problem/46571593
Reviewed by Tim Horton.
* pageoverlay/overlay-remove-reinsert-view-expected.txt: We no longer unparent the overlays
on view removal, so new results.
* platform/ios-wk2/TestExpectations: Unskip some iOS tests.
* platform/ios-wk2/pageoverlay/overlay-installation-expected.txt: Added.
* platform/ios-wk2/pageoverlay/overlay-large-document-expected.txt: Added.
* platform/ios-wk2/pageoverlay/overlay-large-document-scrolled-expected.txt: Added.
* platform/ios/TestExpectations: Unskip some iOS tests.
Canonical link: https://commits.webkit.org/208700@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240940 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-02-04 21:16:22 +00:00
|
|
|
layer->setAnchorPoint({ });
|
2017-01-23 06:24:18 +00:00
|
|
|
layer->setBackgroundColor(overlay.backgroundColor());
|
2021-05-20 17:08:30 +00:00
|
|
|
layer->setName(MAKE_STATIC_STRING_IMPL("Overlay content"));
|
2014-04-08 23:09:52 +00:00
|
|
|
|
2018-09-14 19:49:46 +00:00
|
|
|
updateSettingsForLayer(layer.get());
|
2014-04-08 23:09:52 +00:00
|
|
|
|
2017-01-23 06:24:18 +00:00
|
|
|
switch (overlay.overlayType()) {
|
2014-04-11 21:41:28 +00:00
|
|
|
case PageOverlay::OverlayType::View:
|
|
|
|
m_viewOverlayRootLayer->addChild(layer.get());
|
|
|
|
break;
|
|
|
|
case PageOverlay::OverlayType::Document:
|
|
|
|
m_documentOverlayRootLayer->addChild(layer.get());
|
|
|
|
break;
|
2014-04-08 23:09:52 +00:00
|
|
|
}
|
2014-04-11 21:41:28 +00:00
|
|
|
|
2018-09-14 19:49:46 +00:00
|
|
|
auto& rawLayer = layer.get();
|
2017-01-23 06:24:18 +00:00
|
|
|
m_overlayGraphicsLayers.set(&overlay, WTFMove(layer));
|
2014-04-11 21:41:28 +00:00
|
|
|
|
2018-04-03 18:01:41 +00:00
|
|
|
overlay.setPage(&m_page);
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
|
2018-04-03 18:01:41 +00:00
|
|
|
if (FrameView* frameView = m_page.mainFrame().view())
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
frameView->enterCompositingMode();
|
|
|
|
|
2017-01-23 06:24:18 +00:00
|
|
|
updateOverlayGeometry(overlay, rawLayer);
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
|
|
|
|
if (fadeMode == PageOverlay::FadeMode::Fade)
|
2017-01-23 06:24:18 +00:00
|
|
|
overlay.startFadeInAnimation();
|
PageOverlayController's layers should be created lazily
https://bugs.webkit.org/show_bug.cgi?id=194199
Source/WebCore:
Reviewed by Tim Horton.
Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays()
and use them to only parent the overlay-hosting layers when necessary.
For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can
simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(),
which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer
compositing updates that parents the layerWithDocumentOverlays().
View overlays are added to the layer tree via the DrawingArea. When we go between having
none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer()
on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a
compositing flush (this has to be done manually because view overlay layers are outside the
subtree managed by RenderLayerCompositor).
Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer;
there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view
overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without
having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer().
* loader/EmptyClients.h:
* page/ChromeClient.h:
* page/FrameView.cpp:
(WebCore::FrameView::setNeedsCompositingConfigurationUpdate): These functions need to schedule a compositing flush
because there may be nothing else that does.
(WebCore::FrameView::setNeedsCompositingGeometryUpdate):
* page/Page.cpp:
(WebCore::Page::installedPageOverlaysChanged):
* page/Page.h:
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::hasDocumentOverlays const):
(WebCore::PageOverlayController::hasViewOverlays const):
(WebCore::PageOverlayController::attachViewOverlayLayers): PageOverlayController has the Page so it
might as well be the one to call through the ChromeClient.
(WebCore::PageOverlayController::detachViewOverlayLayers):
(WebCore::PageOverlayController::installPageOverlay):
(WebCore::PageOverlayController::uninstallPageOverlay):
* page/PageOverlayController.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers): isFullUpdate is always true; remove it.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Source/WebKit:
rdar://problem/46571593
Reviewed by Tim Horton.
Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays()
and use them to only parent the overlay-hosting layers when necessary.
For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can
simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(),
which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer
compositing updates that parents the layerWithDocumentOverlays().
View overlays are added to the layer tree via the DrawingArea. When we go between having
none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer()
on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a
compositing flush (this has to be done manually because view overlay layers are outside the
subtree managed by RenderLayerCompositor).
Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer;
there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view
overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without
having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer().
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::attachViewOverlayGraphicsLayer):
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
Source/WebKitLegacy/mac:
rdar://problem/46571593
Reviewed by Tim Horton.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Source/WebKitLegacy/win:
rdar://problem/46571593
Reviewed by Tim Horton.
Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays()
and use them to only parent the overlay-hosting layers when necessary.
For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can
simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(),
which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer
compositing updates that parents the layerWithDocumentOverlays().
View overlays are added to the layer tree via the DrawingArea. When we go between having
none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer()
on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a
compositing flush (this has to be done manually because view overlay layers are outside the
subtree managed by RenderLayerCompositor).
Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer;
there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view
overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without
having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer().
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
LayoutTests:
rdar://problem/46571593
Reviewed by Tim Horton.
* pageoverlay/overlay-remove-reinsert-view-expected.txt: We no longer unparent the overlays
on view removal, so new results.
* platform/ios-wk2/TestExpectations: Unskip some iOS tests.
* platform/ios-wk2/pageoverlay/overlay-installation-expected.txt: Added.
* platform/ios-wk2/pageoverlay/overlay-large-document-expected.txt: Added.
* platform/ios-wk2/pageoverlay/overlay-large-document-scrolled-expected.txt: Added.
* platform/ios/TestExpectations: Unskip some iOS tests.
Canonical link: https://commits.webkit.org/208700@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240940 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-02-04 21:16:22 +00:00
|
|
|
|
2019-02-23 02:38:02 +00:00
|
|
|
installedPageOverlaysChanged();
|
2014-04-08 23:09:52 +00:00
|
|
|
}
|
|
|
|
|
2017-01-23 06:24:18 +00:00
|
|
|
void PageOverlayController::uninstallPageOverlay(PageOverlay& overlay, PageOverlay::FadeMode fadeMode)
|
2014-04-08 23:09:52 +00:00
|
|
|
{
|
|
|
|
if (fadeMode == PageOverlay::FadeMode::Fade) {
|
2017-01-23 06:24:18 +00:00
|
|
|
overlay.startFadeOutAnimation();
|
2014-04-08 23:09:52 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-01-23 06:24:18 +00:00
|
|
|
overlay.setPage(nullptr);
|
2014-04-08 23:09:52 +00:00
|
|
|
|
2018-09-14 19:49:46 +00:00
|
|
|
if (auto optionalLayer = m_overlayGraphicsLayers.take(&overlay))
|
2020-08-26 02:25:04 +00:00
|
|
|
optionalLayer->removeFromParent();
|
2014-04-08 23:09:52 +00:00
|
|
|
|
2017-01-23 06:24:18 +00:00
|
|
|
bool removed = m_pageOverlays.removeFirst(&overlay);
|
2015-02-04 08:39:20 +00:00
|
|
|
ASSERT_UNUSED(removed, removed);
|
2014-04-08 23:09:52 +00:00
|
|
|
|
2019-02-23 02:38:02 +00:00
|
|
|
installedPageOverlaysChanged();
|
2014-04-11 21:41:28 +00:00
|
|
|
}
|
2014-04-08 23:40:43 +00:00
|
|
|
|
2014-04-11 21:41:28 +00:00
|
|
|
void PageOverlayController::updateForceSynchronousScrollLayerPositionUpdates()
|
|
|
|
{
|
2014-04-08 23:09:52 +00:00
|
|
|
#if ENABLE(ASYNC_SCROLLING)
|
2014-04-11 21:41:28 +00:00
|
|
|
bool forceSynchronousScrollLayerPositionUpdates = false;
|
|
|
|
|
|
|
|
for (auto& overlay : m_pageOverlays) {
|
2015-11-03 00:25:04 +00:00
|
|
|
if (overlay->needsSynchronousScrolling())
|
2014-04-11 21:41:28 +00:00
|
|
|
forceSynchronousScrollLayerPositionUpdates = true;
|
|
|
|
}
|
|
|
|
|
2018-04-03 18:01:41 +00:00
|
|
|
if (ScrollingCoordinator* scrollingCoordinator = m_page.scrollingCoordinator())
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
scrollingCoordinator->setForceSynchronousScrollLayerPositionUpdates(forceSynchronousScrollLayerPositionUpdates);
|
2014-04-08 23:09:52 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2019-05-31 05:50:50 +00:00
|
|
|
void PageOverlayController::setPageOverlayNeedsDisplay(PageOverlay& overlay, const IntRect& dirtyRect)
|
2014-04-11 21:41:28 +00:00
|
|
|
{
|
2014-04-14 08:10:22 +00:00
|
|
|
ASSERT(m_pageOverlays.contains(&overlay));
|
2018-09-14 19:49:46 +00:00
|
|
|
auto* graphicsLayer = m_overlayGraphicsLayers.get(&overlay);
|
2014-04-11 21:41:28 +00:00
|
|
|
|
2018-09-14 19:49:46 +00:00
|
|
|
if (!graphicsLayer->drawsContent()) {
|
|
|
|
graphicsLayer->setDrawsContent(true);
|
|
|
|
updateOverlayGeometry(overlay, *graphicsLayer);
|
2014-04-08 23:09:52 +00:00
|
|
|
}
|
2014-04-11 21:41:28 +00:00
|
|
|
|
2018-09-14 19:49:46 +00:00
|
|
|
graphicsLayer->setNeedsDisplayInRect(dirtyRect);
|
2014-04-08 23:09:52 +00:00
|
|
|
}
|
|
|
|
|
2014-04-14 08:10:22 +00:00
|
|
|
void PageOverlayController::setPageOverlayOpacity(PageOverlay& overlay, float opacity)
|
2014-04-08 23:09:52 +00:00
|
|
|
{
|
2014-04-14 08:10:22 +00:00
|
|
|
ASSERT(m_pageOverlays.contains(&overlay));
|
|
|
|
m_overlayGraphicsLayers.get(&overlay)->setOpacity(opacity);
|
2014-04-08 23:09:52 +00:00
|
|
|
}
|
|
|
|
|
2014-04-14 08:10:22 +00:00
|
|
|
void PageOverlayController::clearPageOverlay(PageOverlay& overlay)
|
2014-04-08 23:09:52 +00:00
|
|
|
{
|
2014-04-14 08:10:22 +00:00
|
|
|
ASSERT(m_pageOverlays.contains(&overlay));
|
|
|
|
m_overlayGraphicsLayers.get(&overlay)->setDrawsContent(false);
|
2014-04-08 23:09:52 +00:00
|
|
|
}
|
|
|
|
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
GraphicsLayer& PageOverlayController::layerForOverlay(PageOverlay& overlay) const
|
Add a fade transition to services highlights
https://bugs.webkit.org/show_bug.cgi?id=135829
<rdar://problem/17935736>
Reviewed by Enrica Casucci.
Add a smooth fade to highlight installation and uninstallation.
To do so, we make each highlight paint into its own small layer.
* WebProcess/WebPage/PageOverlay.cpp:
(WebKit::PageOverlay::layer):
* WebProcess/WebPage/PageOverlay.h:
* WebProcess/WebPage/PageOverlayController.cpp:
(WebKit::PageOverlayController::layerForOverlay):
* WebProcess/WebPage/PageOverlayController.h:
Expose the GraphicsLayer on PageOverlay.
* WebProcess/WebPage/ServicesOverlayController.h:
(WebKit::ServicesOverlayController::Highlight::layer):
(WebKit::ServicesOverlayController::activeHighlight):
(WebKit::ServicesOverlayController::webPage):
(WebKit::ServicesOverlayController::Highlight::Highlight): Deleted.
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
(WebKit::ServicesOverlayController::Highlight::createForSelection):
(WebKit::ServicesOverlayController::Highlight::createForTelephoneNumber):
(WebKit::ServicesOverlayController::Highlight::Highlight):
Highlights now own a GraphicsLayer, which are later installed
as sublayers of the ServicesOverlayController's PageOverlay layer.
These layers are sized and positioned according to the DDHighlight's bounds.
(WebKit::ServicesOverlayController::Highlight::~Highlight):
(WebKit::ServicesOverlayController::Highlight::invalidate):
ServicesOverlayController will invalidate any remaining highlights
when it is torn down, so they can clear their backpointers.
(WebKit::ServicesOverlayController::Highlight::notifyFlushRequired):
Forward flush notifications to the DrawingArea.
(WebKit::ServicesOverlayController::Highlight::paintContents):
Paint the DDHighlight into the layer. Translation is done by the layer position,
so we zero the bounds origin when painting.
(WebKit::ServicesOverlayController::Highlight::deviceScaleFactor):
Forward the deviceScaleFactor so that things are painted at the right scale.
(WebKit::ServicesOverlayController::Highlight::fadeIn):
(WebKit::ServicesOverlayController::Highlight::fadeOut):
Apply a fade animation to the layer.
(WebKit::ServicesOverlayController::Highlight::didFinishFadeOutAnimation):
When the fade completes, unparent the layer, unless it has become active again.
(WebKit::ServicesOverlayController::ServicesOverlayController):
(WebKit::ServicesOverlayController::~ServicesOverlayController):
Invalidate all highlights, so they can clear their backpointers.
(WebKit::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown):
Make remainingTimeUntilHighlightShouldBeShown act upon a particular highlight
instead of always the active highlight.
(WebKit::ServicesOverlayController::determineActiveHighlightTimerFired): Rename.
(WebKit::ServicesOverlayController::drawRect):
drawRect is no longer called and will no longer do anything; all of the
painting is done in sublayers.
(WebKit::ServicesOverlayController::buildPhoneNumberHighlights):
Ensure that phone number Highlights stay stable even while the selection
changes, by comparing the underlying Ranges and keeping around old Highlights
that match the new ones. This enables us to e.g. fade in while changing
the selection within a phone number.
(WebKit::ServicesOverlayController::buildSelectionHighlight):
(WebKit::ServicesOverlayController::didRebuildPotentialHighlights):
(WebKit::ServicesOverlayController::createOverlayIfNeeded):
Don't call setNeedsDisplay; the overlay doesn't have backing store.
Instead, call determineActiveHighlight, which will install/uninstall
highlights as necessary.
(WebKit::ServicesOverlayController::determineActiveHighlight):
Apply fade in/fade out to the overlays.
Keep track of which highlight we're going to activate, until the hysteresis
delay is up, then actually make it active/parent it/fade it in.
We now will have no active highlight between the fade out of the previous one
and the fade in of the new one (during the hysteresis delay).
(WebKit::ServicesOverlayController::mouseEvent):
The overlay now will not become active until the delay is up, so we don't
need to check it again here.
(WebKit::ServicesOverlayController::handleClick):
(WebKit::ServicesOverlayController::didCreateHighlight):
(WebKit::ServicesOverlayController::willDestroyHighlight):
(WebKit::ServicesOverlayController::repaintHighlightTimerFired): Deleted.
(WebKit::ServicesOverlayController::drawHighlight): Deleted.
Canonical link: https://commits.webkit.org/153722@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@172483 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-08-12 19:31:04 +00:00
|
|
|
{
|
|
|
|
ASSERT(m_pageOverlays.contains(&overlay));
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
return *m_overlayGraphicsLayers.get(&overlay);
|
|
|
|
}
|
|
|
|
|
2014-04-08 23:09:52 +00:00
|
|
|
void PageOverlayController::didChangeViewSize()
|
|
|
|
{
|
2014-04-11 21:41:28 +00:00
|
|
|
for (auto& overlayAndLayer : m_overlayGraphicsLayers) {
|
|
|
|
if (overlayAndLayer.key->overlayType() == PageOverlay::OverlayType::View)
|
2018-09-14 19:49:46 +00:00
|
|
|
updateOverlayGeometry(*overlayAndLayer.key, overlayAndLayer.value.get());
|
2014-04-11 21:41:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void PageOverlayController::didChangeDocumentSize()
|
|
|
|
{
|
|
|
|
for (auto& overlayAndLayer : m_overlayGraphicsLayers) {
|
|
|
|
if (overlayAndLayer.key->overlayType() == PageOverlay::OverlayType::Document)
|
2018-09-14 19:49:46 +00:00
|
|
|
updateOverlayGeometry(*overlayAndLayer.key, overlayAndLayer.value.get());
|
2014-04-08 23:09:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
void PageOverlayController::didChangeSettings()
|
2014-04-08 23:09:52 +00:00
|
|
|
{
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
// FIXME: We should apply these settings to all overlay sublayers recursively.
|
2014-04-08 23:09:52 +00:00
|
|
|
for (auto& graphicsLayer : m_overlayGraphicsLayers.values())
|
2018-09-14 19:49:46 +00:00
|
|
|
updateSettingsForLayer(graphicsLayer.get());
|
2014-04-08 23:09:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void PageOverlayController::didChangeDeviceScaleFactor()
|
|
|
|
{
|
2017-02-13 13:42:04 +00:00
|
|
|
if (!m_initialized)
|
|
|
|
return;
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
|
2014-04-11 21:41:28 +00:00
|
|
|
m_documentOverlayRootLayer->noteDeviceOrPageScaleFactorChangedIncludingDescendants();
|
|
|
|
m_viewOverlayRootLayer->noteDeviceOrPageScaleFactorChangedIncludingDescendants();
|
|
|
|
|
|
|
|
for (auto& graphicsLayer : m_overlayGraphicsLayers.values())
|
|
|
|
graphicsLayer->setNeedsDisplay();
|
2014-04-08 23:09:52 +00:00
|
|
|
}
|
|
|
|
|
2016-04-06 19:22:57 +00:00
|
|
|
void PageOverlayController::didChangeViewExposedRect()
|
2014-04-08 23:09:52 +00:00
|
|
|
{
|
2020-10-06 21:33:42 +00:00
|
|
|
m_page.scheduleRenderingUpdate(RenderingUpdateStep::LayerFlush);
|
2014-04-08 23:09:52 +00:00
|
|
|
}
|
|
|
|
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
void PageOverlayController::didScrollFrame(Frame& frame)
|
2014-04-08 23:09:52 +00:00
|
|
|
{
|
2014-04-11 21:41:28 +00:00
|
|
|
for (auto& overlayAndLayer : m_overlayGraphicsLayers) {
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
if (overlayAndLayer.key->overlayType() == PageOverlay::OverlayType::View || !frame.isMainFrame())
|
2014-04-11 21:41:28 +00:00
|
|
|
overlayAndLayer.value->setNeedsDisplay();
|
2014-08-15 18:47:51 +00:00
|
|
|
overlayAndLayer.key->didScrollFrame(frame);
|
2014-04-11 21:41:28 +00:00
|
|
|
}
|
2014-04-08 23:09:52 +00:00
|
|
|
}
|
|
|
|
|
2014-04-14 08:10:22 +00:00
|
|
|
void PageOverlayController::updateSettingsForLayer(GraphicsLayer& layer)
|
2014-04-08 23:09:52 +00:00
|
|
|
{
|
2018-04-03 18:01:41 +00:00
|
|
|
Settings& settings = m_page.settings();
|
2014-04-14 08:10:22 +00:00
|
|
|
layer.setAcceleratesDrawing(settings.acceleratedDrawingEnabled());
|
|
|
|
layer.setShowDebugBorder(settings.showDebugBorders());
|
|
|
|
layer.setShowRepaintCounter(settings.showRepaintCounter());
|
2014-04-08 23:09:52 +00:00
|
|
|
}
|
|
|
|
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
bool PageOverlayController::handleMouseEvent(const PlatformMouseEvent& mouseEvent)
|
2014-04-08 23:09:52 +00:00
|
|
|
{
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
if (m_pageOverlays.isEmpty())
|
2014-04-08 23:09:52 +00:00
|
|
|
return false;
|
|
|
|
|
|
|
|
for (auto it = m_pageOverlays.rbegin(), end = m_pageOverlays.rend(); it != end; ++it) {
|
|
|
|
if ((*it)->mouseEvent(mouseEvent))
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
bool PageOverlayController::copyAccessibilityAttributeStringValueForPoint(String attribute, FloatPoint parameter, String& value)
|
2014-04-08 23:09:52 +00:00
|
|
|
{
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
if (m_pageOverlays.isEmpty())
|
|
|
|
return false;
|
2014-04-08 23:09:52 +00:00
|
|
|
|
|
|
|
for (auto it = m_pageOverlays.rbegin(), end = m_pageOverlays.rend(); it != end; ++it) {
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
if ((*it)->copyAccessibilityAttributeStringValueForPoint(attribute, parameter, value))
|
|
|
|
return true;
|
2014-04-08 23:09:52 +00:00
|
|
|
}
|
|
|
|
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool PageOverlayController::copyAccessibilityAttributeBoolValueForPoint(String attribute, FloatPoint parameter, bool& value)
|
|
|
|
{
|
|
|
|
if (m_pageOverlays.isEmpty())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
for (auto it = m_pageOverlays.rbegin(), end = m_pageOverlays.rend(); it != end; ++it) {
|
|
|
|
if ((*it)->copyAccessibilityAttributeBoolValueForPoint(attribute, parameter, value))
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2014-04-08 23:09:52 +00:00
|
|
|
}
|
|
|
|
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
Vector<String> PageOverlayController::copyAccessibilityAttributesNames(bool parameterizedNames)
|
2014-04-08 23:09:52 +00:00
|
|
|
{
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
if (m_pageOverlays.isEmpty())
|
|
|
|
return { };
|
2014-04-08 23:09:52 +00:00
|
|
|
|
|
|
|
for (auto it = m_pageOverlays.rbegin(), end = m_pageOverlays.rend(); it != end; ++it) {
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
Vector<String> names = (*it)->copyAccessibilityAttributeNames(parameterizedNames);
|
|
|
|
if (!names.isEmpty())
|
|
|
|
return names;
|
2014-04-08 23:09:52 +00:00
|
|
|
}
|
|
|
|
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
return { };
|
2014-04-08 23:09:52 +00:00
|
|
|
}
|
|
|
|
|
2019-09-04 04:54:55 +00:00
|
|
|
void PageOverlayController::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, const FloatRect& clipRect, GraphicsLayerPaintBehavior)
|
2014-04-08 23:09:52 +00:00
|
|
|
{
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
for (auto& overlayAndGraphicsLayer : m_overlayGraphicsLayers) {
|
2018-09-14 19:49:46 +00:00
|
|
|
if (overlayAndGraphicsLayer.value.ptr() != graphicsLayer)
|
2014-04-08 23:09:52 +00:00
|
|
|
continue;
|
|
|
|
|
|
|
|
GraphicsContextStateSaver stateSaver(graphicsContext);
|
|
|
|
graphicsContext.clip(clipRect);
|
Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
<rdar://problem/18508258>
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.
Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.
(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.
(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.
* page/FrameView.h:
Add didChangeScrollOffset.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.
(WebCore::Page::setSessionID):
Remove a blank line.
* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.
(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
variants, because we don't have anything like WKTypeRef here.
* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.
* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
- references instead of pointers in many places
- WebCore types instead of WebKit2 types everywhere
Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.
(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.
(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.
* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.
(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -> appendDocumentOverlayLayers.
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().
* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.
(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.
Canonical link: https://commits.webkit.org/155152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-02 21:06:14 +00:00
|
|
|
overlayAndGraphicsLayer.key->drawRect(graphicsContext, enclosingIntRect(clipRect));
|
2014-04-08 23:09:52 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
float PageOverlayController::deviceScaleFactor() const
|
|
|
|
{
|
2018-04-03 18:01:41 +00:00
|
|
|
return m_page.deviceScaleFactor();
|
2014-04-08 23:09:52 +00:00
|
|
|
}
|
|
|
|
|
2020-02-26 13:37:58 +00:00
|
|
|
void PageOverlayController::notifyFlushRequired(const GraphicsLayer*)
|
2014-04-08 23:09:52 +00:00
|
|
|
{
|
2020-10-06 21:33:42 +00:00
|
|
|
m_page.scheduleRenderingUpdate(RenderingUpdateStep::LayerFlush);
|
2014-04-08 23:09:52 +00:00
|
|
|
}
|
|
|
|
|
2014-04-14 08:10:22 +00:00
|
|
|
void PageOverlayController::didChangeOverlayFrame(PageOverlay& overlay)
|
2014-04-11 21:41:28 +00:00
|
|
|
{
|
2014-04-14 08:10:22 +00:00
|
|
|
ASSERT(m_pageOverlays.contains(&overlay));
|
2018-09-14 19:49:46 +00:00
|
|
|
if (auto* layer = m_overlayGraphicsLayers.get(&overlay))
|
|
|
|
updateOverlayGeometry(overlay, *layer);
|
2014-04-14 08:10:22 +00:00
|
|
|
}
|
2014-04-11 21:41:28 +00:00
|
|
|
|
2014-04-14 08:10:22 +00:00
|
|
|
void PageOverlayController::didChangeOverlayBackgroundColor(PageOverlay& overlay)
|
|
|
|
{
|
|
|
|
ASSERT(m_pageOverlays.contains(&overlay));
|
2018-09-14 19:49:46 +00:00
|
|
|
if (auto* layer = m_overlayGraphicsLayers.get(&overlay))
|
|
|
|
layer->setBackgroundColor(overlay.backgroundColor());
|
2014-04-11 21:41:28 +00:00
|
|
|
}
|
|
|
|
|
2021-08-19 15:47:35 +00:00
|
|
|
bool PageOverlayController::shouldSkipLayerInDump(const GraphicsLayer*, OptionSet<LayerTreeAsTextOptions> options) const
|
Make it possible to test page overlays
https://bugs.webkit.org/show_bug.cgi?id=137339
Reviewed by Dan Bernstein.
Tests: pageoverlay/overlay-installation.html
pageoverlay/overlay-large-document-scrolled.html
pageoverlay/overlay-large-document.html
Do some initial work to make page overlays testable.
There are many more tests to be written, but this lays the groundwork.
* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
* WebCore.vcxproj/WebCoreTestSupport.vcxproj:
* WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters:
* CMakeLists.txt:
Add MockPageOverlayClient.
* platform/graphics/GraphicsLayer.h:
* page/PageOverlayController.h:
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::shouldSkipLayerInDump):
Don't skip PageOverlayController-owned layers in the layer tree dump if the
layerTreeAsText behavior says that we should include them.
* platform/graphics/GraphicsLayer.cpp:
(WebCore::dumpChildren):
* platform/graphics/GraphicsLayerClient.h:
(WebCore::GraphicsLayerClient::shouldSkipLayerInDump):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::shouldSkipLayerInDump):
* rendering/RenderLayerBacking.h:
Pass the LayerTreeAsTextBehavior through shouldSkipLayerInDump.
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
Uninstall all page overlays when resetting to a consistent state.
(WebCore::Internals::installMockPageOverlay):
(WebCore::Internals::pageOverlayLayerTreeAsText):
Expose two new internals functions.
installMockPageOverlay takes "view" or "document", allowing script
to choose the appropriate overlay type.
pageOverlayLayerTreeAsText dumps both view and document-relative
overlays, from each overlay container layer.
* testing/Internals.h:
* testing/Internals.idl:
Fix some typos.
* testing/MockPageOverlayClient.cpp: Added.
(WebCore::MockPageOverlayClient::shared):
(WebCore::MockPageOverlayClient::MockPageOverlayClient):
(WebCore::MockPageOverlayClient::installOverlay):
(WebCore::MockPageOverlayClient::uninstallAllOverlays):
(WebCore::MockPageOverlayClient::layerTreeAsText):
(WebCore::MockPageOverlayClient::pageOverlayDestroyed):
(WebCore::MockPageOverlayClient::willMoveToPage):
(WebCore::MockPageOverlayClient::didMoveToPage):
When the overlay is parented, mark it as needing repaint.
Future tests might want to test overlays without content,
but for now this is a reasonable default behavior.
(WebCore::MockPageOverlayClient::drawRect):
Paint the overlay rects as described in the LayoutTests ChangeLog.
(WebCore::MockPageOverlayClient::mouseEvent):
(WebCore::MockPageOverlayClient::didScrollFrame):
(WebCore::MockPageOverlayClient::copyAccessibilityAttributeStringValueForPoint):
(WebCore::MockPageOverlayClient::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::MockPageOverlayClient::copyAccessibilityAttributeNames):
* testing/MockPageOverlayClient.h: Added.
* pageoverlay/overlay-installation.html: Added.
Add a test which just installs one view-relative and one document-relative
overlay, and dumps the layer tree and pixel results. The mock overlay
strokes a blue rectangle (inset a little from the overlay bounds) for
view-relative overlays, and a green rectangle (inset a bit more) for
document-relative overlays.
* pageoverlay/overlay-large-document.html: Added.
* pageoverlay/overlay-large-document-scrolled.html: Added.
Tests that do the same as the -installation test, but with a larger document;
the view-relative overlay should be the same size (or slightly smaller,
because we have scrollbars now), but the document-relative overlay should
be the size of the document. The second test scrolls to maxX, maxY, and
the document-relative overlay should scroll along with it, while the
view-relative overlay should remain fixed.
* pageoverlay/overlay-installation-expected.txt: Added.
* pageoverlay/overlay-large-document-expected.txt: Added.
* pageoverlay/overlay-large-document-scrolled-expected.txt: Added.
"Normal" layer tree expectations.
* platform/mac-wk1/pageoverlay/overlay-installation-expected.png: Added.
* platform/mac-wk1/pageoverlay/overlay-installation-expected.txt: Added.
* platform/mac-wk1/pageoverlay/overlay-large-document-expected.png: Added.
* platform/mac-wk1/pageoverlay/overlay-large-document-expected.txt: Added.
* platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.png: Added.
* platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.txt: Added.
Expected results for WebKit1 differ for view-relative overlays, because
we don't currently hook up view-relative overlays for WebKit1.
* platform/mac/pageoverlay/overlay-installation-expected.png: Added.
* platform/mac/pageoverlay/overlay-large-document-expected.png: Added.
* platform/mac/pageoverlay/overlay-large-document-scrolled-expected.png: Added.
"Normal" pixel dump expectations.
Canonical link: https://commits.webkit.org/155229@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 08:47:04 +00:00
|
|
|
{
|
2021-08-19 15:47:35 +00:00
|
|
|
return !options.contains(LayerTreeAsTextOptions::IncludePageOverlayLayers);
|
Make it possible to test page overlays
https://bugs.webkit.org/show_bug.cgi?id=137339
Reviewed by Dan Bernstein.
Tests: pageoverlay/overlay-installation.html
pageoverlay/overlay-large-document-scrolled.html
pageoverlay/overlay-large-document.html
Do some initial work to make page overlays testable.
There are many more tests to be written, but this lays the groundwork.
* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
* WebCore.vcxproj/WebCoreTestSupport.vcxproj:
* WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters:
* CMakeLists.txt:
Add MockPageOverlayClient.
* platform/graphics/GraphicsLayer.h:
* page/PageOverlayController.h:
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::shouldSkipLayerInDump):
Don't skip PageOverlayController-owned layers in the layer tree dump if the
layerTreeAsText behavior says that we should include them.
* platform/graphics/GraphicsLayer.cpp:
(WebCore::dumpChildren):
* platform/graphics/GraphicsLayerClient.h:
(WebCore::GraphicsLayerClient::shouldSkipLayerInDump):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::shouldSkipLayerInDump):
* rendering/RenderLayerBacking.h:
Pass the LayerTreeAsTextBehavior through shouldSkipLayerInDump.
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
Uninstall all page overlays when resetting to a consistent state.
(WebCore::Internals::installMockPageOverlay):
(WebCore::Internals::pageOverlayLayerTreeAsText):
Expose two new internals functions.
installMockPageOverlay takes "view" or "document", allowing script
to choose the appropriate overlay type.
pageOverlayLayerTreeAsText dumps both view and document-relative
overlays, from each overlay container layer.
* testing/Internals.h:
* testing/Internals.idl:
Fix some typos.
* testing/MockPageOverlayClient.cpp: Added.
(WebCore::MockPageOverlayClient::shared):
(WebCore::MockPageOverlayClient::MockPageOverlayClient):
(WebCore::MockPageOverlayClient::installOverlay):
(WebCore::MockPageOverlayClient::uninstallAllOverlays):
(WebCore::MockPageOverlayClient::layerTreeAsText):
(WebCore::MockPageOverlayClient::pageOverlayDestroyed):
(WebCore::MockPageOverlayClient::willMoveToPage):
(WebCore::MockPageOverlayClient::didMoveToPage):
When the overlay is parented, mark it as needing repaint.
Future tests might want to test overlays without content,
but for now this is a reasonable default behavior.
(WebCore::MockPageOverlayClient::drawRect):
Paint the overlay rects as described in the LayoutTests ChangeLog.
(WebCore::MockPageOverlayClient::mouseEvent):
(WebCore::MockPageOverlayClient::didScrollFrame):
(WebCore::MockPageOverlayClient::copyAccessibilityAttributeStringValueForPoint):
(WebCore::MockPageOverlayClient::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::MockPageOverlayClient::copyAccessibilityAttributeNames):
* testing/MockPageOverlayClient.h: Added.
* pageoverlay/overlay-installation.html: Added.
Add a test which just installs one view-relative and one document-relative
overlay, and dumps the layer tree and pixel results. The mock overlay
strokes a blue rectangle (inset a little from the overlay bounds) for
view-relative overlays, and a green rectangle (inset a bit more) for
document-relative overlays.
* pageoverlay/overlay-large-document.html: Added.
* pageoverlay/overlay-large-document-scrolled.html: Added.
Tests that do the same as the -installation test, but with a larger document;
the view-relative overlay should be the same size (or slightly smaller,
because we have scrollbars now), but the document-relative overlay should
be the size of the document. The second test scrolls to maxX, maxY, and
the document-relative overlay should scroll along with it, while the
view-relative overlay should remain fixed.
* pageoverlay/overlay-installation-expected.txt: Added.
* pageoverlay/overlay-large-document-expected.txt: Added.
* pageoverlay/overlay-large-document-scrolled-expected.txt: Added.
"Normal" layer tree expectations.
* platform/mac-wk1/pageoverlay/overlay-installation-expected.png: Added.
* platform/mac-wk1/pageoverlay/overlay-installation-expected.txt: Added.
* platform/mac-wk1/pageoverlay/overlay-large-document-expected.png: Added.
* platform/mac-wk1/pageoverlay/overlay-large-document-expected.txt: Added.
* platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.png: Added.
* platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.txt: Added.
Expected results for WebKit1 differ for view-relative overlays, because
we don't currently hook up view-relative overlays for WebKit1.
* platform/mac/pageoverlay/overlay-installation-expected.png: Added.
* platform/mac/pageoverlay/overlay-large-document-expected.png: Added.
* platform/mac/pageoverlay/overlay-large-document-scrolled-expected.png: Added.
"Normal" pixel dump expectations.
Canonical link: https://commits.webkit.org/155229@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 08:47:04 +00:00
|
|
|
}
|
|
|
|
|
2017-02-05 19:18:16 +00:00
|
|
|
void PageOverlayController::tiledBackingUsageChanged(const GraphicsLayer* graphicsLayer, bool usingTiledBacking)
|
|
|
|
{
|
|
|
|
if (usingTiledBacking)
|
2018-04-03 18:01:41 +00:00
|
|
|
graphicsLayer->tiledBacking()->setIsInWindow(m_page.isInWindow());
|
2017-02-05 19:18:16 +00:00
|
|
|
}
|
|
|
|
|
2014-04-08 23:09:52 +00:00
|
|
|
} // namespace WebKit
|