blob: 03d6b12e6196ab4c1b6de95738d83683c56522c6 [file] [edit]
<!DOCTYPE html>
<html>
<head>
<style>
.clipping {
position: absolute;
top: 20px;
left: 20px;
overflow: hidden;
height: 300px;
width: 300px;
margin: 10px;
border: 1px solid black;
}
.sharing {
position: relative;
top: 50px;
left: 50px;
width: 180px;
height: 180px;
background-color: green;
}
.trigger {
transform: translateZ(0);
width: 50px;
height: 50px;
background-color: silver;
}
</style>
</head>
<body>
<div class="trigger"></div>
<div class="clipping">
<img class="sharing" width="150" height="150">
</div>
<pre id="layers">Layer tree goes here</pre>
<script>
if (window.internals && window.testRunner) {
internals.clearMemoryCache();
internals.setScreenContentsFormatsForTesting(["RGBA8", "RGBA16F"]);
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
let image = new Image;
image.onload = (() => {
if (window.internals)
internals.setHasHDRContentForTesting(image);
const elements = document.querySelectorAll("img");
elements.forEach((element) => {
element.src = image.src;
});
if (window.testRunner) {
document.getElementById("layers").textContent = internals.layerTreeAsText(document);
testRunner.notifyDone();
}
});
image.src = "../../fast/images/resources/green-400x400.png";
</script>
</body>
</html>