haikuwebkit/LayoutTests/compositing/tiling/coverage-adjustment-seconda...

93 lines
2.4 KiB
HTML
Raw Permalink Normal View History

Content disappears on CSS parallax example https://bugs.webkit.org/show_bug.cgi?id=210732 Source/WebCore: <rdar://problem/61997636> Reviewed by Darin Adler. If scrolling affects the computation of coverage rect of a TiledBacking, we plumb that expanded coverage back into TransformState which is maintained during GraphicsLayer flushing, and it's used to compute coverage rect for descendants. It's passed into TransformState::setLastPlanarSecondaryQuad(), which has to map it back into the coordinate system of the last flattening ancestor. However, TransformState::mapQuad() had a missing return and the quad mapping was wrong. The new code is now the same as TransformState::mappedPoint() (you can see where the copy/paste error came from). Test: compositing/tiling/coverage-adjustment-secondary-quad-mapping.html * platform/graphics/transforms/TransformState.cpp: (WebCore::TransformState::mapQuad const): (WebCore::TransformState::flattenWithTransform): LayoutTests: Reviewed by Darin Adler. * compositing/tiling/coverage-adjustment-secondary-quad-mapping-expected.txt: Added. * compositing/tiling/coverage-adjustment-secondary-quad-mapping.html: Added. * platform/ios-wk2/compositing/tiling/coverage-adjustment-secondary-quad-mapping-expected.txt: Added. * platform/mac-wk1/compositing/tiling/coverage-adjustment-secondary-quad-mapping-expected.txt: Added. Canonical link: https://commits.webkit.org/223629@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260371 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-20 17:14:51 +00:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
* {
box-sizing: border-box;
}
body {
transform: translateZ(0px);
}
.scroller {
position: relative;
margin: 20px;
width: 600px;
height: 580px;
overflow-x: hidden;
overflow-y: auto;
perspective-origin: right bottom;
perspective: 1px;
border: 1px solid black;
}
.preserve3d {
transform-origin: top left;
transform-style: preserve-3d;
}
.box {
height: 12000px;
background-color: rgba(0, 0, 0, 0.2);
}
.parallax {
background-size: cover;
box-sizing: border-box;
width: 80%;
margin-left: 20px;
height: 1300px;;
/* Since the parallax elements still consume space, we set the margin to undo
the height of this parallax element making it essentially consume 0 space.
*/
margin-bottom: -1300px;
}
.tester {
position: relative;
z-index: 1;
background-color: green;
margin-top: 200px;
height: 600px;
width: 100%;
will-change: transform;
}
.filler {
background-color: silver;
}
</style>
<script>
if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
}
window.addEventListener('load', () => {
setTimeout(() => {
let scroller = document.querySelector('.scroller');
scroller.scrollTop = 400;
if (window.internals)
document.getElementById('layers').innerText = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_BACKING_STORE_ATTACHED);
if (window.testRunner)
testRunner.notifyDone();
}, 0);
}, false);
</script>
</head>
<body>
<div class="scroller">
<div class="preserve3d">
<div class="parallax" style="transform: translate3d(0px, -220px, -2px);"></div>
<div class="box tester">&nbsp;</div>
<div class="box filler"></div>
</div>
</div>
<pre id="layers"></pre>
</body>
</html>