haikuwebkit/LayoutTests/compositing/tiling/tiled-mask-inwindow.html

75 lines
1.8 KiB
HTML
Raw Permalink Normal View History

Make sure the "inwindow" flag propagates to TiledBackings for masks and reflections https://bugs.webkit.org/show_bug.cgi?id=168127 rdar://problem/30467120 Reviewed by Tim Horton. Source/WebCore: Replace the special-case, but wrong, GraphicsLayer traversal in setIsInWindowIncludingDescendants() which forgot to hit masks and replica layers with a generic traverse() function, which is then used for setting 'inWindow' as well as resetting tracked repaints. Tests: compositing/tiling/tiled-mask-inwindow.html compositing/tiling/tiled-reflection-inwindow.html * page/PageOverlayController.cpp: (WebCore::PageOverlayController::layerWithDocumentOverlays): (WebCore::PageOverlayController::layerWithViewOverlays): * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::setIsInWindow): (WebCore::GraphicsLayer::setReplicatedByLayer): (WebCore::GraphicsLayer::traverse): (WebCore::GraphicsLayer::setIsInWindowIncludingDescendants): Deleted. * platform/graphics/GraphicsLayer.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::setIsInWindow): (WebCore::RenderLayerCompositor::resetTrackedRepaintRects): (WebCore::resetTrackedRepaintRectsRecursive): Deleted. Tools: Reparent the web view before we try to fetch it via: [[[window contentView] subviews] objectAtIndex:0]; which would throw an exception if the test unparented it. * DumpRenderTree/mac/DumpRenderTree.mm: (resetWebViewToConsistentStateBeforeTesting): (runTest): LayoutTests: * compositing/tiling/tiled-mask-inwindow-expected.txt: Added. * compositing/tiling/tiled-mask-inwindow.html: Added. * compositing/tiling/tiled-reflection-inwindow-expected.txt: Added. * compositing/tiling/tiled-reflection-inwindow.html: Added. * platform/ios-simulator-wk1/compositing/tiling/tiled-mask-inwindow-expected.txt: Added. * platform/ios-simulator-wk1/compositing/tiling/tiled-reflection-inwindow-expected.txt: Added. * platform/ios-simulator-wk2/compositing/tiling/tiled-mask-inwindow-expected.txt: Added. * platform/ios-simulator-wk2/compositing/tiling/tiled-reflection-inwindow-expected.txt: Added. * platform/mac-wk1/compositing/tiling/tiled-mask-inwindow-expected.txt: Added. * platform/mac-wk1/compositing/tiling/tiled-reflection-inwindow-expected.txt: Added. Canonical link: https://commits.webkit.org/185194@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212153 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-10 23:02:36 +00:00
<!DOCTYPE html>
<html>
<head>
<style>
.container {
height: 300px;
width: 400px;
border: 2px solid black;
overflow: hidden;
}
.box {
height: 300px;
width: 2800px;
border: 1px solid black;
background-color: gray;
}
.composited {
transform: translateZ(0);
}
.masked {
-webkit-mask-image: url(../resources/alpha-gradient.png);
-webkit-mask-repeat: repeat-x;
}
</style>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function getUIScript()
{
return `
(function() {
uiController.removeViewFromWindow(function() {
uiController.uiScriptComplete('');
});
})();`
}
function dumpTiles(outputId)
{
if (window.internals)
document.getElementById(outputId).innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_TILE_CACHES);
}
function doTest()
{
if (!testRunner.runUIScript)
return;
dumpTiles('before-layers');
testRunner.runUIScript(getUIScript(), function(result) {
dumpTiles('after-layers');
if (window.testRunner)
testRunner.notifyDone();
});
}
window.addEventListener('load', doTest, false);
</script>
</head>
<body>
<div class="composited container">
<div class="composited masked box"></div>
</div>
<pre id="before-layers">Layer tree goes here</pre>
<pre id="after-layers">Layer tree goes here</pre>
</body>
</html>