diff options
Diffstat (limited to 'layout/reftests/svg/filters/css-svg-filter-chains')
9 files changed, 283 insertions, 0 deletions
diff --git a/layout/reftests/svg/filters/css-svg-filter-chains/clip-input-css-filter-ref.html b/layout/reftests/svg/filters/css-svg-filter-chains/clip-input-css-filter-ref.html new file mode 100644 index 0000000000..8c2a796d3c --- /dev/null +++ b/layout/reftests/svg/filters/css-svg-filter-chains/clip-input-css-filter-ref.html @@ -0,0 +1,32 @@ +<!-- + Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ +--> +<!DOCTYPE html> +<html> +<head> + <title>CSS and SVG Filter Chains: Clip Input CSS Filter with Following SVG Filter's Filter Region</title> + <link rel="author" title="Max Vujovic" href="mailto:mvujovic@adobe.com"> + <style type="text/css"> + #target { + filter: url(#blur) url(#clip-and-red-to-green); + background-color: #f00; + width: 100px; + height: 100px; + } + </style> +</head> +<body> + <p>You should see a blurred green square.</p> + <div id="target"></div> + <svg width="0" height="0"> + <filter id="blur" x="-50" y="-50" width="200" height="200"> + <feGaussianBlur stdDeviation="3" color-interpolation-filters="sRGB"/> + </filter> + <!-- Use a small filter region that clips the blur extents. --> + <filter id="clip-and-red-to-green" x="0" y="0" width="100" height="100" filterUnits="userSpaceOnUse"> + <feColorMatrix type="hueRotate" values="90" color-interpolation-filters="sRGB"/> + </filter> + </svg> +</body> +</html> diff --git a/layout/reftests/svg/filters/css-svg-filter-chains/clip-input-css-filter.html b/layout/reftests/svg/filters/css-svg-filter-chains/clip-input-css-filter.html new file mode 100644 index 0000000000..2fcb027818 --- /dev/null +++ b/layout/reftests/svg/filters/css-svg-filter-chains/clip-input-css-filter.html @@ -0,0 +1,34 @@ +<!-- + Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ +--> +<!DOCTYPE html> +<html> +<head> + <title>CSS and SVG Filter Chains: Clip Input CSS Filter with Following SVG Filter's Filter Region</title> + <link rel="author" title="Max Vujovic" href="mailto:mvujovic@adobe.com"> + <link rel="help" href="http://www.w3.org/TR/filter-effects-1/#FilterEffectsRegion"> + <link rel="match" href="css-filter-first-ref.html"> + <meta name="assert" + content="An SVG filter's filter region should clip the input from a CSS + filter function."> + <style type="text/css"> + #target { + filter: blur(3px) url(#clip-and-red-to-green); + background-color: #f00; + width: 100px; + height: 100px; + } + </style> +</head> +<body> + <p>You should see a blurred green square.</p> + <div id="target"></div> + <svg width="0" height="0"> + <!-- Use a small filter region that clips the blur extents. --> + <filter id="clip-and-red-to-green" x="0" y="0" width="100" height="100" filterUnits="userSpaceOnUse"> + <feColorMatrix type="hueRotate" values="90" color-interpolation-filters="sRGB"/> + </filter> + </svg> +</body> +</html> diff --git a/layout/reftests/svg/filters/css-svg-filter-chains/css-filter-first-ref.html b/layout/reftests/svg/filters/css-svg-filter-chains/css-filter-first-ref.html new file mode 100644 index 0000000000..838eeaf4b9 --- /dev/null +++ b/layout/reftests/svg/filters/css-svg-filter-chains/css-filter-first-ref.html @@ -0,0 +1,31 @@ +<!-- + Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ +--> +<!DOCTYPE html> +<html> +<head> + <title>CSS and SVG Filter Chains: CSS Filter as First Filter</title> + <link rel="author" title="Max Vujovic" href="mailto:mvujovic@adobe.com"> + <style type="text/css"> + #target { + filter: url(#blur-and-red-to-green); + background-color: #f00; + width: 100px; + height: 100px; + } + </style> +</head> +<body> + <p>You should see a blurred green square.</p> + <div id="target"></div> + <svg width="0" height="0"> + <filter id="blur-and-red-to-green" x="-50" y="-50" width="200" height="200" filterUnits="userSpaceOnUse"> + <!-- Blur the red square. --> + <feGaussianBlur stdDeviation="3" color-interpolation-filters="sRGB"/> + <!-- Turn the red square into a green square. --> + <feColorMatrix type="hueRotate" values="90" color-interpolation-filters="sRGB"/> + </filter> + </svg> +</body> +</html> diff --git a/layout/reftests/svg/filters/css-svg-filter-chains/css-filter-first.html b/layout/reftests/svg/filters/css-svg-filter-chains/css-filter-first.html new file mode 100644 index 0000000000..d2e208dd6c --- /dev/null +++ b/layout/reftests/svg/filters/css-svg-filter-chains/css-filter-first.html @@ -0,0 +1,33 @@ +<!-- + Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ +--> +<!DOCTYPE html> +<html> +<head> + <title>CSS and SVG Filter Chains: CSS Filter as First Filter</title> + <link rel="author" title="Max Vujovic" href="mailto:mvujovic@adobe.com"> + <link rel="help" href="http://www.w3.org/TR/filter-effects-1/#FilterProperty"> + <link rel="match" href="css-filter-first-ref.html"> + <meta name="assert" + content="A filter chain starting with a CSS filter function followed by + an SVG reference filter should render correctly."> + <style type="text/css"> + #target { + filter: blur(3px) url(#red-to-green); + background-color: #f00; + width: 100px; + height: 100px; + } + </style> +</head> +<body> + <p>You should see a blurred green square.</p> + <div id="target"></div> + <svg width="0" height="0"> + <filter id="red-to-green" x="-50" y="-50" width="200" height="200" filterUnits="userSpaceOnUse"> + <feColorMatrix type="hueRotate" values="90" color-interpolation-filters="sRGB"/> + </filter> + </svg> +</body> +</html> diff --git a/layout/reftests/svg/filters/css-svg-filter-chains/css-filter-last-ref.html b/layout/reftests/svg/filters/css-svg-filter-chains/css-filter-last-ref.html new file mode 100644 index 0000000000..c335d1683e --- /dev/null +++ b/layout/reftests/svg/filters/css-svg-filter-chains/css-filter-last-ref.html @@ -0,0 +1,31 @@ +<!-- + Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ +--> +<!DOCTYPE html> +<html> +<head> + <title>CSS and SVG Filter Chains: CSS Filter as Last Filter</title> + <link rel="author" title="Max Vujovic" href="mailto:mvujovic@adobe.com"> + <style type="text/css"> + #target { + filter: url(#red-to-green-and-blur); + background-color: #f00; + width: 100px; + height: 100px; + } + </style> +</head> +<body> + <p>You should see a blurred green square.</p> + <div id="target"></div> + <svg width="0" height="0"> + <filter id="red-to-green-and-blur" x="-50" y="-50" width="200" height="200" filterUnits="userSpaceOnUse"> + <!-- Turn the red square into a green square. --> + <feColorMatrix type="hueRotate" values="90" color-interpolation-filters="sRGB"/> + <!-- Blur the red square. --> + <feGaussianBlur stdDeviation="3" color-interpolation-filters="sRGB"/> + </filter> + </svg> +</body> +</html> diff --git a/layout/reftests/svg/filters/css-svg-filter-chains/css-filter-last.html b/layout/reftests/svg/filters/css-svg-filter-chains/css-filter-last.html new file mode 100644 index 0000000000..d4e00fb30e --- /dev/null +++ b/layout/reftests/svg/filters/css-svg-filter-chains/css-filter-last.html @@ -0,0 +1,34 @@ +<!-- + Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ +--> +<!DOCTYPE html> +<html> +<head> + <title>CSS and SVG Filter Chains: CSS Filter as Last Filter</title> + <link rel="author" title="Max Vujovic" href="mailto:mvujovic@adobe.com"> + <link rel="help" href="http://www.w3.org/TR/filter-effects-1/#FilterProperty"> + <link rel="match" href="css-filter-last-ref.html"> + <meta name="assert" + content="A filter chain starting with an SVG reference filter followed + by a CSS filter function should render correctly."> + <style type="text/css"> + #target { + filter: url(#red-to-green) blur(3px); + background-color: #f00; + width: 100px; + height: 100px; + } + </style> +</head> +<body> + <p>You should see a blurred green square.</p> + <div id="target"></div> + <svg width="0" height="0"> + <filter id="red-to-green" x="-50" y="-50" width="200" height="200" filterUnits="userSpaceOnUse"> + <!-- Turn the red square into a green square. --> + <feColorMatrix type="hueRotate" values="90" color-interpolation-filters="sRGB"/> + </filter> + </svg> +</body> +</html> diff --git a/layout/reftests/svg/filters/css-svg-filter-chains/css-filter-middle-ref.html b/layout/reftests/svg/filters/css-svg-filter-chains/css-filter-middle-ref.html new file mode 100644 index 0000000000..9340231a24 --- /dev/null +++ b/layout/reftests/svg/filters/css-svg-filter-chains/css-filter-middle-ref.html @@ -0,0 +1,38 @@ +<!-- + Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ +--> +<!DOCTYPE html> +<html> +<head> + <title>CSS and SVG Filter Chains: CSS Filter as Last Filter</title> + <link rel="author" title="Max Vujovic" href="mailto:mvujovic@adobe.com"> + <style type="text/css"> + #target { + filter: url(#magenta-to-green-and-blur); + background-color: #f0f; + width: 100px; + height: 100px; + } + </style> +</head> +<body> + <p>You should see a blurred green square.</p> + <div id="target"></div> + <svg width="0" height="0"> + <filter id="magenta-to-green-and-blur" x="-50" y="-50" width="200" height="200" filterUnits="userSpaceOnUse"> + <!-- Turn the magenta square into a red square. --> + <feComponentTransfer color-interpolation-filters="sRGB"> + <feFuncR type="identity"/> + <feFuncG type="table" tableValues="0 0"/> + <feFuncB type="table" tableValues="0 0"/> + <feFuncA type="identity"/> + </feComponentTransfer> + <!-- Blur the red square. --> + <feGaussianBlur stdDeviation="3" color-interpolation-filters="sRGB"/> + <!-- Turn the blurred red square into a blurred green square. --> + <feColorMatrix type="hueRotate" values="90" color-interpolation-filters="sRGB"/> + </filter> + </svg> +</body> +</html> diff --git a/layout/reftests/svg/filters/css-svg-filter-chains/css-filter-middle.html b/layout/reftests/svg/filters/css-svg-filter-chains/css-filter-middle.html new file mode 100644 index 0000000000..89020a641c --- /dev/null +++ b/layout/reftests/svg/filters/css-svg-filter-chains/css-filter-middle.html @@ -0,0 +1,42 @@ +<!-- + Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ +--> +<!DOCTYPE html> +<html> +<head> + <title>CSS and SVG Filter Chains: CSS Filter as Middle Filter</title> + <link rel="author" title="Max Vujovic" href="mailto:mvujovic@adobe.com"> + <link rel="help" href="http://www.w3.org/TR/filter-effects-1/#FilterProperty"> + <link rel="match" href="css-filter-middle-ref.html"> + <meta name="assert" + content="A filter chain starting with an SVG reference filter, followed + by a CSS filter function, and followed by an SVG reference + filter should render correctly."> + <style type="text/css"> + #target { + filter: url(#magenta-to-red) blur(3px) url(#red-to-green); + background-color: #f0f; + width: 100px; + height: 100px; + } + </style> +</head> +<body> + <p>You should see a blurred green square.</p> + <div id="target"></div> + <svg width="0" height="0"> + <filter id="magenta-to-red" color-interpolation-filters="sRGB"> + <feComponentTransfer> + <feFuncR type="identity"/> + <feFuncG type="table" tableValues="0 0"/> + <feFuncB type="table" tableValues="0 0"/> + <feFuncA type="identity"/> + </feComponentTransfer> + </filter> + <filter id="red-to-green" x="-50" y="-50" width="200" height="200" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> + <feColorMatrix type="hueRotate" values="90"/> + </filter> + </svg> +</body> +</html> diff --git a/layout/reftests/svg/filters/css-svg-filter-chains/reftest.list b/layout/reftests/svg/filters/css-svg-filter-chains/reftest.list new file mode 100644 index 0000000000..ac3ee0dc0b --- /dev/null +++ b/layout/reftests/svg/filters/css-svg-filter-chains/reftest.list @@ -0,0 +1,8 @@ +# These tests verify that filter chains of combined CSS and SVG filters behave +# properly. +# e.g. filter: url(#f1) blur(3px) url(#2) grayscale(0.5); + +== clip-input-css-filter.html clip-input-css-filter-ref.html +fuzzy(0-1,0-288) == css-filter-first.html css-filter-first-ref.html +== css-filter-last.html css-filter-last-ref.html +== css-filter-middle.html css-filter-middle-ref.html |