Clean up how GraphicsLayer's "inWindow" state is set, and fix some issues with Page...
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 5 Feb 2017 19:18:16 +0000 (19:18 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 5 Feb 2017 19:18:16 +0000 (19:18 +0000)
commitab643ae10cfb57b6792ea09496b4d66609b23411
treea016545ada74048b387f3effd77fe2f50b0cd610
parentc9c170d0f9f2c4117039a221370ca6d52d7de5c3
Clean up how GraphicsLayer's "inWindow" state is set, and fix some issues with Page Overlays
https://bugs.webkit.org/show_bug.cgi?id=167850

Reviewed by Tim Horton.
Source/WebCore:

RenderLayerCompositor::setIsInWindowForLayerIncludingDescendants() walked the RenderLayer
tree to set the GraphicsLayer's "inWindow" state. This had the problem of skipping non-primary
GraphicsLayers. We also never did this work for page overlay layers.

Fix by giving GraphicsLayers a recursive function that sets the inWindow state, and call that
from RenderLayerCompositor::setIsInWindow() and PageOverlayController.

PageOverlayController also needs to implement tiledBackingUsageChanged so that tiled backings
created dynamically get the correct in-window state.

Page overlays also had some serious issues in MiniBrowser, in that they disappeared on reload,
and on hide/show web view. This was because the overlay root layers were re-parented, but
addChild() for each overlay's layer wasn't called. Clean up by replacing willAttachRootLayer() followed
by viewOverlayRootLayer()/documentOverlayRootLayer() with single calls that set up the layers,
update the inWindow state, and return the layer.

Make it possible to dump tile caches in page overlay tests.

Make showGraphicsLayers() always dump page overlay layers (source of much confusion).

Test: pageoverlay/overlay-remove-reinsert-view.html

* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::documentOverlayRootLayer):
(WebCore::PageOverlayController::viewOverlayRootLayer):
(WebCore::PageOverlayController::layerWithDocumentOverlays):
(WebCore::PageOverlayController::layerWithViewOverlays):
(WebCore::PageOverlayController::tiledBackingUsageChanged):
(WebCore::PageOverlayController::willAttachRootLayer): Deleted.
* page/PageOverlayController.h:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::setIsInWindowIncludingDescendants):
(WebCore::dumpChildren):
* platform/graphics/GraphicsLayer.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
(WebCore::RenderLayerCompositor::setIsInWindow):
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
(WebCore::RenderLayerCompositor::setIsInWindowForLayerIncludingDescendants): Deleted.
* rendering/RenderLayerCompositor.h:
* testing/Internals.cpp:
(WebCore::toLayerTreeFlags):
(WebCore::Internals::layerTreeAsText):
(WebCore::Internals::pageOverlayLayerTreeAsText):
* testing/Internals.h:
* testing/Internals.idl:
* testing/MockPageOverlayClient.cpp:
(WebCore::MockPageOverlayClient::layerTreeAsText):
* testing/MockPageOverlayClient.h:

Tools:

* DumpRenderTree/TestRunner.cpp:
(TestRunner::uiScriptDidComplete): Fix an assertion that fires for non-16-bit strings.

LayoutTests:

* pageoverlay/overlay-large-document-expected.txt:
* pageoverlay/overlay-large-document-scrolled-expected.txt:
* pageoverlay/overlay-remove-reinsert-view-expected.txt: Added.
* pageoverlay/overlay-remove-reinsert-view.html: Added.
* platform/ios-simulator-wk2/pageoverlay/overlay-remove-reinsert-view-expected.txt: Added.
* platform/mac-wk1/pageoverlay/overlay-remove-reinsert-view-expected.txt: Added.
* tiled-drawing/tiled-backing-in-window-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211683 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
LayoutTests/ChangeLog
LayoutTests/pageoverlay/overlay-large-document-expected.txt
LayoutTests/pageoverlay/overlay-large-document-scrolled-expected.txt
LayoutTests/pageoverlay/overlay-remove-reinsert-view-expected.txt [new file with mode: 0644]
LayoutTests/pageoverlay/overlay-remove-reinsert-view.html [new file with mode: 0644]
LayoutTests/platform/ios-simulator-wk2/pageoverlay/overlay-remove-reinsert-view-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-wk1/TestExpectations
LayoutTests/platform/mac-wk1/pageoverlay/overlay-remove-reinsert-view-expected.txt [new file with mode: 0644]
LayoutTests/tiled-drawing/tiled-backing-in-window-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/page/PageOverlayController.cpp
Source/WebCore/page/PageOverlayController.h
Source/WebCore/platform/graphics/GraphicsLayer.cpp
Source/WebCore/platform/graphics/GraphicsLayer.h
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Source/WebCore/testing/MockPageOverlayClient.cpp
Source/WebCore/testing/MockPageOverlayClient.h
Tools/ChangeLog
Tools/DumpRenderTree/TestRunner.cpp