blob: b51fa230c184d197dcc47155f4bccdc47953a617 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 100px;
height: 100px;
background-color: yellow;
}
#squashed {
background-color: blue;
z-index: 2;
position:relative;
}
#host {
position: absolute;
background-color: green;
top: 100px;
z-index: 1;
will-change: transform;
}
#background {
will-change: transform;
z-index: 0;
position: absolute;
top: 50px;
}
</style>
<script>
if (window.testRunner)
testRunner.dumpAsText();
function doTest() {
if (window.internals)
internals.forceCompositingUpdate(document);
document.getElementById('host').style.left = '100px';
document.getElementById('console').textContent = internals.layerTreeAsText(document);
}
</script>
</head>
<body onload='doTest()'>
<div id='background'></div>
<div id='squashed'></div>
<div id='host'></div>
<p style='position: relative; top: 200px;' style='display:none'>
This tests that squashed layers' offset from renderer is updated properly. If not properly updated,
the two divs will appear to be aligned vertically in the pixel results, while really the blue div
('squashed') should be offset 100px left of the green ('host').
</p>
<pre id='console' style='position: relative; top: 200px;'></pre>
</body>
</html>