chromium/third_party/blink/web_tests/svg/filters/feMorphology-invalid-radius.svg

<html xmlns="http://www.w3.org/1999/xhtml">
  <body>
    This test is to ensure that we do not crash when loading a SVG image with an invalid feMorphology filter radius.
    <div id="log">
      <span style='color: red;'>FAIL:</span> Did not complete test
    </div>
    <svg xmlns="http://www.w3.org/2000/svg" version="1.1">
      <!-- Simple negative value. -->
      <filter id="f1">
	      <feMorphology operator="erode" radius="-1"/>
      </filter>
      <filter id="f2">
	      <feMorphology operator="erode" radius="-1 1"/>
      </filter>
      <filter id="f3">
	      <feMorphology operator="erode" radius="1 -1"/>
      </filter>
      
      <!-- Produces MIN_INT after converted from float to int.  -->
      <filter id="f4">
	      <feMorphology operator="erode" radius="2147483647"/>
      </filter>
      <filter id="f5">
	      <feMorphology operator="erode" radius="2147483647 1"/>
      </filter>
      <filter id="f6">
	      <feMorphology operator="erode" radius="1 2147483647"/>
      </filter>
      
      <!-- Wraps when added to canvas dimensions. -->
      <filter id="f7">
	      <feMorphology operator="erode" radius="2147483500"/>
      </filter>
      <filter id="f8">
	      <feMorphology operator="erode" radius="2147483500 1"/>
      </filter>
      <filter id="f9">
	      <feMorphology operator="erode" radius="1 2147483500"/>
      </filter>

      <g id="morphology">
	      <rect x="0" y="0" height="252" width="256" fill="green" />
	      <rect x="0" y="0" height="28" width="256" fill="red" filter="url(#f1)" />
	      <rect x="0" y="10" height="28" width="256" fill="red" filter="url(#f2)" />
	      <rect x="0" y="20" height="28" width="256" fill="red" filter="url(#f3)" />
	      <rect x="0" y="30" height="28" width="256" fill="red" filter="url(#f4)" />
	      <rect x="0" y="40" height="28" width="256" fill="red" filter="url(#f5)" />
	      <rect x="0" y="50" height="28" width="256" fill="red" filter="url(#f6)" />
	      <rect x="0" y="60" height="28" width="256" fill="red" filter="url(#f7)" />
	      <rect x="0" y="70" height="28" width="256" fill="red" filter="url(#f8)" />
	      <rect x="0" y="80" height="28" width="256" fill="red" filter="url(#f9)" />
      </g>
    </svg>
    <script>
      <![CDATA[
        if (window.testRunner)
            testRunner.dumpAsText();

        var log = document.getElementById("log");
        while (log.childNodes.length)
            log.removeChild(log.firstChild);
        var msg = document.createElementNS("http://www.w3.org/1999/xhtml", "span");
        msg.style.color = "green";
        msg.appendChild(document.createTextNode("PASS:"));
        log.appendChild(msg);
        log.appendChild(document.createTextNode(" Did not crash when rendering the SVG image."));
    ]]>
    </script>
  </body>
</html>