servo/tests/wpt/css-tests/compositing-1_dev/html/mix-blend-mode-parent-with-3D-transform-and-transition.htm

65 lines
No EOL
2.4 KiB
HTML

<!DOCTYPE html>
<html><head>
<meta charset="utf-8">
<title>CSS Test: blending between an element having 3D transitions and its child</title>
<link href="mailto:mbudaes@adobe.com" rel="author" title="Mirela Budăeș">
<link href="mailto:rosca@adobe.com" rel="author" title="Ion Roșca">
<link href="mailto:mitica@adobe.com" rel="reviewer" title="Mihai Țică">
<link href="https://drafts.fxtf.org/compositing-1/#mix-blend-mode" rel="help">
<meta content="dom" name="flags">
<meta content="Test checks that an element having mix-blend-mode blends with its parent element having 3D transform and transition" name="assert">
<style type="text/css">
.parent {
background: yellow;
width: 140px;
height: 140px;
position:relative;
z-index: 1;
margin: 10px;
float: left;
transition: transform 2s;
}
.rotated {
transform: rotateX(60deg) rotateZ(10deg) rotateY(180deg);
}
.blended {
background: red;
width: 140px;
height: 140px;
mix-blend-mode: difference;
}
.ref {
background: none;
}
.ref .blended {
background: lime;
mix-blend-mode: normal;
}
</style>
</head>
<body>
<p>Test passes if you can see two rotating lime rectangles, both identical.</p>
<div>
<div id="parent" class="parent">
<div class="blended"></div>
</div>
<div id="parentref" class="parent ref">
<div class="blended"></div>
</div>
</div>
<script type="text/javascript">
var parent = document.getElementById('parent');
var parentref = document.getElementById('parentref');
function rotate (el, cl) {
if (el.className === cl + ' rotated')
el.className = cl;
else
el.className = cl + ' rotated';
}
setTimeout(function () { rotate(parent, 'parent'); rotate(parentref, 'parent ref'); }, 0);
setInterval(function () { rotate(parent, 'parent'); rotate(parentref, 'parent ref'); }, 2000);
</script>
</body></html>