blob: 4f27a02d9645ddb72f49ea985dca9b7d44e73a07 [file] [log] [blame]
<!DOCTYPE html> <!-- webkit-test-runner [ AsyncOverflowScrollingEnabled=true ] -->
<html>
<head>
<title>Test repainting with layer sharing</title>
<style>
.container {
position: relative;
width: 200px;
height: 200px;
margin: 50px;
border: 1px solid black;
overflow: hidden;
box-shadow: 0 0 14px gray;
}
.box {
width: 100px;
height: 100px;
background-color: blue;
margin: 10px;
}
.box.changed {
background-color: orange;
}
.trigger {
position: absolute;
left: 20px;
top: 10px;
width: 50px;
height: 50px;
background-color: gray;
transform: translateZ(0);
}
.relative {
position: relative;
top: 50px;
left: 120px;
border: 5px solid green;
}
</style>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
window.addEventListener('load', () => {
setTimeout(() => {
document.body.offsetTop;
if (window.internals)
window.internals.startTrackingRepaints();
document.getElementById('target').classList.add('changed');
if (window.internals)
document.getElementById('layers').textContent = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
if (window.testRunner)
testRunner.notifyDone();
}, 0);
}, false);
</script>
</head>
<body>
<div class="trigger"></div>
<div class="container">
<div id="target" class="relative box">
</div>
</div>
<pre id="layers"></pre>
</body>
</html>