wpt / css / filter-effects / feconvolve-divisor.html

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

/css/filter-effects/feconvolve-divisor.html

<!doctype html>
<title>Filter primitive (feConvolveMatrix) with zero divisor</title>
<link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#FilterProperty">
<link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#feConvolveMatrixElement">
<link rel="match" href="reference/feconvolve-divisor-ref.html">
<svg xmlns="http://www.w3.org/2000/svg"
     width="800" height="250">
  <defs>
    <!-- Setting the divisor to 0 should result in the default value being
         used instead.
    -->
    <filter id="f1" filterUnits="userSpaceOnUse"
            x="100" y="100" width="100" height="100">
      <feConvolveMatrix kernelMatrix="1 1 1  1 1 1  1 1 1"
                        divisor="0" preserveAlpha="false" bias=".5" />
    </filter>
  </defs>

  <rect x="100" y="100" width="100" height="100" fill="red"/>
  <rect x="100" y="100" width="100" height="100" fill="lime"
        filter="url(#f1)" />
</svg>

/css/filter-effects/reference/feconvolve-divisor-ref.html

<!doctype html>
<svg xmlns="http://www.w3.org/2000/svg"
     width="800" height="250">
  <defs>
    <filter id="f1" filterUnits="userSpaceOnUse"
            x="100" y="100" width="100" height="100">
      <feConvolveMatrix kernelMatrix="1 1 1  1 1 1  1 1 1"
                        preserveAlpha="false" bias=".5" />
    </filter>
  </defs>

  <rect x="100" y="100" width="100" height="100" fill="lime"
        filter="url(#f1)" />
</svg>