diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/css/css-masking/mask-svg-content | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-masking/mask-svg-content')
10 files changed, 186 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-masking/mask-svg-content/mask-empty-container-with-filter.svg b/testing/web-platform/tests/css/css-masking/mask-svg-content/mask-empty-container-with-filter.svg new file mode 100644 index 0000000000..ebe7e7e4d1 --- /dev/null +++ b/testing/web-platform/tests/css/css-masking/mask-svg-content/mask-empty-container-with-filter.svg @@ -0,0 +1,23 @@ +<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml"> + <title>mask with only an empty container with a filter</title> + <h:link rel="help" href="https://drafts.fxtf.org/css-masking-1/#svg-masks"/> + <h:link rel="match" href="reference/mask-green-square-001-ref.svg"/> + + <filter id="double" x="0" y="0" width="200" height="200" filterUnits="userSpaceOnUse"> + <feOffset dy="100"/> + <feMerge> + <feMergeNode/> + <feMergeNode in="SourceGraphic"/> + </feMerge> + </filter> + <filter id="f" x="0" y="0" width="200" height="200" filterUnits="userSpaceOnUse"> + <feFlood flood-color="#fff"/> + </filter> + <mask id="m" x="50" y="50" width="100" height="100" maskUnits="userSpaceOnUse"> + <g filter="url(#f)"/> + </mask> + + <rect width="100" height="200" fill="green" mask="url(#m)"/> + <rect width="100" height="100" x="100" fill="green" mask="url(#m)" + filter="url(#double)"/> +</svg> diff --git a/testing/web-platform/tests/css/css-masking/mask-svg-content/mask-negative-scale.svg b/testing/web-platform/tests/css/css-masking/mask-svg-content/mask-negative-scale.svg new file mode 100644 index 0000000000..36b7abb42e --- /dev/null +++ b/testing/web-platform/tests/css/css-masking/mask-svg-content/mask-negative-scale.svg @@ -0,0 +1,40 @@ +<svg xmlns="http://www.w3.org/2000/svg" xmlns:html="http://www.w3.org/1999/xhtml" + xmlns:xlink="http://www.w3.org/1999/xlink"> +<g id="testmeta"> + <title>CSS Masking: mask with negative scale target</title> + <html:link rel="author" title="Dirk Schulze" href="mailto:dschulze@adobe.com"/> + <html:link rel="help" href="http://www.w3.org/TR/css-masking-1/#svg-masks"/> + <html:link rel="help" href="http://www.w3.org/TR/css-masking-1/#MaskElement"/> + <html:link rel="match" href="reference/mask-negative-scale-001-ref.svg"/> + <metadata class="flags">svg</metadata> + <desc class="assert">The masked target elements get scaled with negative + factors. Check if that influences masking. You should see 4 green + rectangles with smaller blue rectangles in it in various rotations.</desc> +</g> +<defs> +<g id="img" transform="translate(10,10)"> + <rect width="200" height="200" fill="red"/> + <rect width="100" height="100" fill="green"/> + <rect width="50" height="50" fill="blue"/> +</g> +</defs> + +<mask id="mask"> + <rect x="10" y="10" width="90" height="90" fill="white"/> +</mask> + +<g transform="translate(200, 200)"> +<g transform="matrix(1 0 0 1 -100 -100)" mask="url(#mask)"> + <use xlink:href="#img"/> +</g> +<g transform="matrix(-1 0 0 -1 -100 -100)" mask="url(#mask)"> + <use xlink:href="#img"/> +</g> +<g transform="matrix(-1 0 0 1 -100 -100)" mask="url(#mask)"> + <use xlink:href="#img"/> +</g> +<g transform="matrix(1 0 0 -1 -100 -100)" mask="url(#mask)"> + <use xlink:href="#img"/> +</g> +</g> +</svg> diff --git a/testing/web-platform/tests/css/css-masking/mask-svg-content/mask-text-001.svg b/testing/web-platform/tests/css/css-masking/mask-svg-content/mask-text-001.svg new file mode 100644 index 0000000000..1dd5c546af --- /dev/null +++ b/testing/web-platform/tests/css/css-masking/mask-svg-content/mask-text-001.svg @@ -0,0 +1,18 @@ +<svg xmlns="http://www.w3.org/2000/svg" xmlns:html="http://www.w3.org/1999/xhtml" + xmlns:xlink="http://www.w3.org/1999/xlink" width="100px" height="100px"> +<g id="testmeta"> + <title>CSS Masking: mask with transformed text content</title> + <html:link rel="author" title="Dirk Schulze" href="mailto:dschulze@adobe.com"/> + <html:link rel="help" href="http://www.w3.org/TR/css-masking-1/#svg-masks"/> + <html:link rel="help" href="http://www.w3.org/TR/css-masking-1/#MaskElement"/> + <html:link rel="match" href="reference/mask-text-001-ref.svg"/> + <metadata class="flags">svg</metadata> + <desc class="assert">The masked target elements get scaled with negative + factors. Check if that influences masking. You should see 4 green + rectangles with smaller blue rectangles in it in various rotations.</desc> +</g> +<mask id="mask"> + <text fill="#fff" font-family="Ahem" font-size="12px" transform="rotate(90 50 50)" x="50%" y="50%">foobar</text> +</mask> +<rect width="100%" height="100%" x="0" y="0" mask="url(#mask)"/> +</svg>
\ No newline at end of file diff --git a/testing/web-platform/tests/css/css-masking/mask-svg-content/mask-type-001.svg b/testing/web-platform/tests/css/css-masking/mask-svg-content/mask-type-001.svg new file mode 100644 index 0000000000..9bcc40d55b --- /dev/null +++ b/testing/web-platform/tests/css/css-masking/mask-svg-content/mask-type-001.svg @@ -0,0 +1,19 @@ +<svg xmlns="http://www.w3.org/2000/svg" xmlns:html="http://www.w3.org/1999/xhtml"> +<g id="testmeta"> + <title>CSS Masking: mask without mask-type alpha</title> + <html:link rel="author" title="Dirk Schulze" href="mailto:dschulze@adobe.com"/> + <html:link rel="help" href="http://www.w3.org/TR/css-masking-1/#svg-masks"/> + <html:link rel="help" href="http://www.w3.org/TR/css-masking-1/#MaskElement"/> + <html:link rel="help" href="http://www.w3.org/TR/css-masking-1/#the-mask-type"/> + <html:link rel="match" href="reference/mask-green-square-001-ref.svg"/> + <metadata class="flags">svg</metadata> + <desc class="assert">The mask type "alpha" is applied to the mask element. + The mask should take the alpha channel of the content to mask. You should + see a green square.</desc> +</g> +<mask id="mask" mask-type="alpha"> + <rect width="200" height="200" fill="black" opacity="0"/> + <rect x="50" y="50" width="100" height="100" fill="black"/> +</mask> +<rect width="200" height="200" fill="green" mask="url(#mask)"/> +</svg> diff --git a/testing/web-platform/tests/css/css-masking/mask-svg-content/mask-type-002.svg b/testing/web-platform/tests/css/css-masking/mask-svg-content/mask-type-002.svg new file mode 100644 index 0000000000..c298297329 --- /dev/null +++ b/testing/web-platform/tests/css/css-masking/mask-svg-content/mask-type-002.svg @@ -0,0 +1,19 @@ +<svg xmlns="http://www.w3.org/2000/svg" xmlns:html="http://www.w3.org/1999/xhtml"> +<g id="testmeta"> + <title>CSS Masking: mask without mask-type luminance</title> + <html:link rel="author" title="Dirk Schulze" href="mailto:dschulze@adobe.com"/> + <html:link rel="help" href="http://www.w3.org/TR/css-masking-1/#svg-masks"/> + <html:link rel="help" href="http://www.w3.org/TR/css-masking-1/#MaskElement"/> + <html:link rel="help" href="http://www.w3.org/TR/css-masking-1/#the-mask-type"/> + <html:link rel="match" href="reference/mask-green-square-001-ref.svg"/> + <metadata class="flags">svg</metadata> + <desc class="assert">The mask type "alpha" is applied to the mask element. + The mask should take the luminocity of the content to mask. You should + see a green square.</desc> +</g> +<mask id="mask" mask-type="luminance"> + <rect width="200" height="200" fill="black"/> + <rect x="50" y="50" width="100" height="100" fill="white"/> +</mask> +<rect width="200" height="200" fill="green" mask="url(#mask)"/> +</svg> diff --git a/testing/web-platform/tests/css/css-masking/mask-svg-content/mask-type-003.svg b/testing/web-platform/tests/css/css-masking/mask-svg-content/mask-type-003.svg new file mode 100644 index 0000000000..891405dc46 --- /dev/null +++ b/testing/web-platform/tests/css/css-masking/mask-svg-content/mask-type-003.svg @@ -0,0 +1,19 @@ +<svg xmlns="http://www.w3.org/2000/svg" xmlns:html="http://www.w3.org/1999/xhtml"> +<g id="testmeta"> + <title>CSS Masking: mask without specified mask-type</title> + <html:link rel="author" title="Dirk Schulze" href="mailto:dschulze@adobe.com"/> + <html:link rel="help" href="http://www.w3.org/TR/css-masking-1/#svg-masks"/> + <html:link rel="help" href="http://www.w3.org/TR/css-masking-1/#MaskElement"/> + <html:link rel="help" href="http://www.w3.org/TR/css-masking-1/#the-mask-type"/> + <html:link rel="match" href="reference/mask-green-square-001-ref.svg"/> + <metadata class="flags">svg</metadata> + <desc class="assert">No mask type was specified the mask element should + take the luminocity of the content to mask. You should see a green square. + </desc> +</g> +<mask id="mask"> + <rect width="200" height="200" fill="black"/> + <rect x="50" y="50" width="100" height="100" fill="white"/> +</mask> +<rect width="200" height="200" fill="green" mask="url(#mask)"/> +</svg> diff --git a/testing/web-platform/tests/css/css-masking/mask-svg-content/mask-with-rotation.svg b/testing/web-platform/tests/css/css-masking/mask-svg-content/mask-with-rotation.svg new file mode 100644 index 0000000000..9964fd524a --- /dev/null +++ b/testing/web-platform/tests/css/css-masking/mask-svg-content/mask-with-rotation.svg @@ -0,0 +1,16 @@ +<svg xmlns="http://www.w3.org/2000/svg" xmlns:html="http://www.w3.org/1999/xhtml"> +<g id="testmeta"> + <title>CSS Masking: mask with rotation transform</title> + <html:link rel="help" href="http://www.w3.org/TR/css-masking-1/#svg-masks"/> + <html:link rel="help" href="http://www.w3.org/TR/css-masking-1/#MaskElement"/> + <html:link rel="match" href="reference/mask-green-square-001-ref.svg"/> + <metadata class="flags">svg</metadata> +</g> +<mask id="mask"> + <rect x="50" y="50" width="100" height="100" fill="white"/> +</mask> +<g transform="rotate(0.0001)" mask="url(#mask)"> + <rect transform="rotate(0.0001)" style="will-change: transform" + width="200" height="200" fill="green"/> +</g> +</svg> diff --git a/testing/web-platform/tests/css/css-masking/mask-svg-content/reference/mask-green-square-001-ref.svg b/testing/web-platform/tests/css/css-masking/mask-svg-content/reference/mask-green-square-001-ref.svg new file mode 100644 index 0000000000..c83ec87e7b --- /dev/null +++ b/testing/web-platform/tests/css/css-masking/mask-svg-content/reference/mask-green-square-001-ref.svg @@ -0,0 +1,8 @@ +<svg xmlns="http://www.w3.org/2000/svg" xmlns:html="http://www.w3.org/1999/xhtml"> +<g id="testmeta"> + <title>CSS Masking: Reftest reference</title> + <html:link rel="author" title="Dirk Schulze" href="mailto:dschulze@adobe.com"/> + <metadata class="flags">svg</metadata> +</g> +<rect x="50" y="50" width="100" height="100" fill="green"/> +</svg> diff --git a/testing/web-platform/tests/css/css-masking/mask-svg-content/reference/mask-negative-scale-001-ref.svg b/testing/web-platform/tests/css/css-masking/mask-svg-content/reference/mask-negative-scale-001-ref.svg new file mode 100644 index 0000000000..1ed0513327 --- /dev/null +++ b/testing/web-platform/tests/css/css-masking/mask-svg-content/reference/mask-negative-scale-001-ref.svg @@ -0,0 +1,15 @@ +<svg xmlns="http://www.w3.org/2000/svg" xmlns:html="http://www.w3.org/1999/xhtml"> +<g id="testmeta"> + <title>CSS Masking: Reftest reference</title> + <html:link rel="author" title="Dirk Schulze" href="mailto:dschulze@adobe.com"/> + <metadata class="flags">svg</metadata> +</g> +<rect width="90" height="90" fill="green"/> +<rect x="40" y="40" width="50" height="50" fill="blue"/> +<rect x="110" width="90" height="90" fill="green"/> +<rect x="110" y="40" width="50" height="50" fill="blue"/> +<rect y="110" width="90" height="90" fill="green"/> +<rect x="40" y="110" width="50" height="50" fill="blue"/> +<rect x="110" y="110" width="90" height="90" fill="green"/> +<rect x="110" y="110" width="50" height="50" fill="blue"/> +</svg> diff --git a/testing/web-platform/tests/css/css-masking/mask-svg-content/reference/mask-text-001-ref.svg b/testing/web-platform/tests/css/css-masking/mask-svg-content/reference/mask-text-001-ref.svg new file mode 100644 index 0000000000..3fabeb01d7 --- /dev/null +++ b/testing/web-platform/tests/css/css-masking/mask-svg-content/reference/mask-text-001-ref.svg @@ -0,0 +1,9 @@ +<svg xmlns="http://www.w3.org/2000/svg" xmlns:html="http://www.w3.org/1999/xhtml" + width="100px" height="100px"> +<g id="testmeta"> + <title>CSS Masking: Reftest reference</title> + <html:link rel="author" title="Dirk Schulze" href="mailto:dschulze@adobe.com"/> + <metadata class="flags">svg</metadata> +</g> +<text fill="#000" font-family="Ahem" font-size="12px" transform="rotate(90 50 50)" x="50" y="50">foobar</text> +</svg> |