wpt / css / filter-effects / backdrop-filter-svg-blur.html

Status: PASS | Duration: 8ms | Subtests: 1/1 | Open test on wpt.live | Open ref on wpt.live | wpt.fyi

/css/filter-effects/backdrop-filter-svg-blur.html

<!DOCTYPE html>
<meta charset="utf-8">
<meta name=fuzzy content="maxDifference=0-20;totalPixels=0-10000">
<title>backdrop-filter: Correctly apply backdrop-filter with an SVG filter</title>
<link rel="help" href="https://drafts.fxtf.org/filter-effects-2/#BackdropFilterProperty">
<link rel="match"  href="reference/backdrop-filter-svg-blur-ref.html">

<p>The green box should filter the blue box.</p>

<svg width="200" height="200">
  <rect width="50" height="50" fill="blue"></rect>
  <rect x="20" y="20" width="50" height="50" fill="green" opacity="0.5" style="backdrop-filter: blur(10px);"></rect>
</svg>

/css/filter-effects/reference/backdrop-filter-svg-blur-ref.html

<!DOCTYPE html>
<meta charset="utf-8">
<title>backdrop-filter: Correctly apply backdrop-filter with an SVG filter</title>
<link rel="help" href="https://drafts.fxtf.org/filter-effects-2/#BackdropFilterProperty">
<script src="../support/simulate-backdrop-blur.js"></script>
<style>
  .container {
    position: relative;
    width: 200px;
    height: 200px;
    contain: paint;
  }
  .container .box {
    width: 50px;
    height: 50px;
    position: absolute;
  }
  div.blue { background: blue;}
  .green { background: green;}
  .green {
    left: 20px;
    top: 20px;
    opacity: 0.5;
  }
</style>

<p>The green box should filter the blue box.</p>

<div class="container">
  <div class="blue box"></div>
  <div class="green box"></div>
</div>

<script>
simulateBackdropBlur(document.querySelector('.green'), [document.querySelector('.blue')], 10);
</script>