[CoordinatedGraphics] Use ScrollingCoordinator to track fixed layers
https://bugs.webkit.org/show_bug.cgi?id=108990
.:
Reviewed by Noam Rosenthal.
Add a new test that allow us to remove the fixed positioning of a layer but still keeping
it compositing. Coordinated Graphics had a bug where the CoordinatedSceneGraph would still
count this layer as fixed position.
* ManualTests/remove-fixed-position-but-keep-compositing.html: Added.
Source/WebCore:
Reviewed by Noam Rosenthal.
WebCore keeps ScrollingCoordinator up-to-date about whether layers are fixed or not, so we
don't need to traverse the tree every frame to get this information.
The function ScrollingCoordinator::setLayerIsFixedToContainerLayer() is called when
RenderLayerBacking is updating its graphics layers.
The new code also works in new situations where the previous was broken: if a layer changed
from being fixed to not fixed (but still kept as a layer for other reasons), the layer will
be correctly updated. Previous implementation only had logic to mark layers as fixed, but
not the other way round. A manual test was added to illustrate the solved problem.
Testing was done with the existing manual tests that make use of "position:fixed". Automatic
tests are mostly not affected by this because usage of this information affects only the
UseFixedLayout mode, not used by default in WebKitTestRunner. Work to improve this situation
will be tracked in bug https://bugs.webkit.org/show_bug.cgi?id=109175.
* CMakeLists.txt:
* Target.pri:
* WebCore.pri:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::create): create specific version of ScrollingCoordinator.
* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp: Added.
(WebCore):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::setLayerIsFixedToContainerLayer):
update layer information using existing hook in ScrollingCoordinator.
* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h: Added.
(WebCore):
(ScrollingCoordinatorCoordinatedGraphics):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::setFixedToViewport): now that setting viewport is not
embedded in the synchronization work, we need to mark the layer so it is updated in the
next frame.
(WebCore):
(WebCore::CoordinatedGraphicsLayer::flushCompositingState): remove call to syncFixedLayers().
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
(CoordinatedGraphicsLayerClient): remove now unused syncFixedLayers() from client.
(CoordinatedGraphicsLayer):
Source/WebKit2:
Reviewed by Noam Rosenthal.
Signed off for WebKit2 by Simon Fraser.
WebCore keeps ScrollingCoordinator up-to-date about whether layers are fixed or not, so we
don't need to traverse the tree every frame to get this information.
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: remove
syncFixedLayers() and its helper functions. Those were used to identify the fixed layers
and are not needed anymore.
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::DrawingAreaImpl): enable the scrolling coordinator usage for
Coordinated Graphics.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142112 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed