2014-04-08 23:09:52 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2014 Apple Inc. All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. 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.
|
|
|
|
*/
|
|
|
|
|
2016-10-31 22:07:53 +00:00
|
|
|
#pragma once
|
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
|
|
|
#include "GraphicsLayerClient.h"
|
2014-04-08 23:09:52 +00:00
|
|
|
#include "PageOverlay.h"
|
|
|
|
#include <wtf/HashMap.h>
|
|
|
|
#include <wtf/RefPtr.h>
|
|
|
|
#include <wtf/Vector.h>
|
|
|
|
|
2014-04-11 21:41:28 +00:00
|
|
|
namespace WebCore {
|
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
|
|
|
class Frame;
|
|
|
|
class Page;
|
|
|
|
class PlatformMouseEvent;
|
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
|
|
|
class PageOverlayController final : public GraphicsLayerClient {
|
|
|
|
WTF_MAKE_FAST_ALLOCATED;
|
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
|
|
|
friend class MockPageOverlayClient;
|
2014-04-08 23:09:52 +00:00
|
|
|
public:
|
2018-04-03 18:01:41 +00:00
|
|
|
PageOverlayController(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
|
|
|
virtual ~PageOverlayController();
|
2014-04-08 23:09:52 +00:00
|
|
|
|
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 hasDocumentOverlays() const;
|
|
|
|
bool hasViewOverlays() const;
|
|
|
|
|
2017-02-05 19:18:16 +00:00
|
|
|
GraphicsLayer& layerWithDocumentOverlays();
|
|
|
|
GraphicsLayer& layerWithViewOverlays();
|
|
|
|
|
2014-11-05 01:39:47 +00:00
|
|
|
const Vector<RefPtr<PageOverlay>>& pageOverlays() const { return m_pageOverlays; }
|
|
|
|
|
2017-01-23 06:24:18 +00:00
|
|
|
WEBCORE_EXPORT void installPageOverlay(PageOverlay&, PageOverlay::FadeMode);
|
|
|
|
WEBCORE_EXPORT void uninstallPageOverlay(PageOverlay&, PageOverlay::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
|
|
|
void setPageOverlayNeedsDisplay(PageOverlay&, const IntRect&);
|
2014-04-14 08:10:22 +00:00
|
|
|
void setPageOverlayOpacity(PageOverlay&, float);
|
|
|
|
void clearPageOverlay(PageOverlay&);
|
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& layerForOverlay(PageOverlay&) const;
|
|
|
|
|
2014-04-08 23:09:52 +00:00
|
|
|
void didChangeViewSize();
|
2014-04-11 21:41:28 +00:00
|
|
|
void didChangeDocumentSize();
|
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 didChangeSettings();
|
2018-01-09 21:17:20 +00:00
|
|
|
WEBCORE_EXPORT void didChangeDeviceScaleFactor();
|
2016-04-06 19:22:57 +00:00
|
|
|
void didChangeViewExposedRect();
|
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 didScrollFrame(Frame&);
|
2014-04-14 08:10:22 +00:00
|
|
|
|
|
|
|
void didChangeOverlayFrame(PageOverlay&);
|
|
|
|
void didChangeOverlayBackgroundColor(PageOverlay&);
|
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
|
|
|
int overlayCount() const { return m_overlayGraphicsLayers.size(); }
|
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 handleMouseEvent(const PlatformMouseEvent&);
|
2014-04-08 23:09:52 +00:00
|
|
|
|
2014-12-25 21:25:15 +00:00
|
|
|
WEBCORE_EXPORT bool copyAccessibilityAttributeStringValueForPoint(String attribute, FloatPoint, String& value);
|
|
|
|
WEBCORE_EXPORT bool copyAccessibilityAttributeBoolValueForPoint(String attribute, FloatPoint, bool& value);
|
|
|
|
WEBCORE_EXPORT Vector<String> copyAccessibilityAttributesNames(bool parameterizedNames);
|
2014-04-08 23:09:52 +00:00
|
|
|
|
|
|
|
private:
|
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 createRootLayersIfNeeded();
|
|
|
|
|
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
|
|
|
WEBCORE_EXPORT GraphicsLayer* documentOverlayRootLayer() const;
|
|
|
|
WEBCORE_EXPORT GraphicsLayer* viewOverlayRootLayer() const;
|
|
|
|
|
2019-02-23 02:38:02 +00:00
|
|
|
void installedPageOverlaysChanged();
|
|
|
|
void attachViewOverlayLayers();
|
|
|
|
void detachViewOverlayLayers();
|
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
|
|
|
|
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 updateSettingsForLayer(GraphicsLayer&);
|
2014-04-11 21:41:28 +00:00
|
|
|
void updateForceSynchronousScrollLayerPositionUpdates();
|
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
|
|
|
// GraphicsLayerClient
|
2020-02-26 13:37:58 +00:00
|
|
|
void notifyFlushRequired(const GraphicsLayer*) override;
|
2019-09-04 04:54:55 +00:00
|
|
|
void paintContents(const GraphicsLayer*, GraphicsContext&, const FloatRect& clipRect, GraphicsLayerPaintBehavior) override;
|
2016-03-04 16:47:55 +00:00
|
|
|
float deviceScaleFactor() const override;
|
2021-08-19 15:47:35 +00:00
|
|
|
bool shouldSkipLayerInDump(const GraphicsLayer*, OptionSet<LayerTreeAsTextOptions>) const override;
|
2017-02-05 19:18:16 +00:00
|
|
|
void tiledBackingUsageChanged(const GraphicsLayer*, bool) override;
|
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-09-14 19:49:46 +00:00
|
|
|
Page& m_page;
|
|
|
|
RefPtr<GraphicsLayer> m_documentOverlayRootLayer;
|
|
|
|
RefPtr<GraphicsLayer> m_viewOverlayRootLayer;
|
2014-04-08 23:09:52 +00:00
|
|
|
|
2018-09-14 19:49:46 +00:00
|
|
|
HashMap<PageOverlay*, Ref<GraphicsLayer>> m_overlayGraphicsLayers;
|
2014-04-08 23:09:52 +00:00
|
|
|
Vector<RefPtr<PageOverlay>> m_pageOverlays;
|
2018-09-14 19:49:46 +00:00
|
|
|
bool m_initialized { false };
|
2014-04-08 23:09:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace WebKit
|