wpt / css / css-color / canvas-change-opacity.html

Status: FAIL | Duration: 14ms | Subtests: 0/1 | Open test on wpt.live | Open ref on wpt.live | wpt.fyi

/css/css-color/canvas-change-opacity.html

<!DOCTYPE html>
<html class="reftest-wait">
<link rel="help" href="http://www.w3.org/TR/css3-color/#transparency">
<link rel="help" href="http://crbug.com/1296899">
<link rel="match" href="greensquare-ref.html">
<script src="/common/rendering-utils.js"></script>
<script src="/common/reftest-wait.js"></script>
<p>Test passes if you see a green square, and no red.</p>
<div style="position: absolute; width: 12em; height: 12em; background: red"></div>
<canvas id="canvas" style="position: relative; width: 12em; height: 12em; opacity: 0.2"></canvas>
<script>
  const ctx = canvas.getContext("2d");
  ctx.fillStyle = "green";
  ctx.fillRect(0, 0, canvas.width, canvas.height);
  waitForAtLeastOneFrame().then(() => {
    canvas.style.opacity = 1;
    takeScreenshot();
  });
</script>
</html>

/css/css-color/greensquare-ref.html

<!DOCTYPE html>
<meta charset="utf-8">
<title>Green square reference</title>
<style>
    .test { background-color: #008000; width: 12em; height: 12em;}
</style>
<body>
    <p>Test passes if you see a green square, and no red.</p>
    <div class="test"></div>
</body>