diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /testing/web-platform/tests/svg/pservers | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/svg/pservers')
40 files changed, 1389 insertions, 0 deletions
diff --git a/testing/web-platform/tests/svg/pservers/inheritance.svg b/testing/web-platform/tests/svg/pservers/inheritance.svg new file mode 100644 index 0000000000..e08b93da83 --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/inheritance.svg @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg xmlns="http://www.w3.org/2000/svg" + xmlns:h="http://www.w3.org/1999/xhtml" + width="800px" height="8000px"> + <title>Inheritance of SVG paint server properties</title> + <metadata> + <h:link rel="help" href="https://svgwg.org/svg2-draft/pservers.html"/> + <h:meta name="assert" content="properties inherit according to the spec."/> + <h:meta name="assert" content="properties have expected initial values."/> + </metadata> + <g id="container"> + <g id="target"></g> + </g> + <h:script src="/resources/testharness.js"/> + <h:script src="/resources/testharnessreport.js"/> + <h:script src="/css/support/inheritance-testcommon.js"/> + <script><![CDATA[ +assert_not_inherited('stop-color', 'rgb(0, 0, 0)', 'rgb(42, 53, 64)'); +assert_not_inherited('stop-opacity', '1', '0.5'); + ]]></script> +</svg> diff --git a/testing/web-platform/tests/svg/pservers/parsing/stop-color-computed.svg b/testing/web-platform/tests/svg/pservers/parsing/stop-color-computed.svg new file mode 100644 index 0000000000..b05a69f10b --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/parsing/stop-color-computed.svg @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml"> + <title>SVG Paint Servers: getComputedStyle().stopColor</title> + <metadata> + <h:link rel="help" href="https://svgwg.org/svg2-draft/pservers.html#StopColorProperty"/> + <h:link rel="help" href="https://drafts.csswg.org/css-color/#resolve-color-values"/> + <h:link rel="help" href="https://drafts.csswg.org/cssom/#serializing-css-values"/> + </metadata> + <g id="target" style="color: blue"></g> + <h:script src="/resources/testharness.js"/> + <h:script src="/resources/testharnessreport.js"/> + <h:script src="/css/support/computed-testcommon.js"/> + <script><![CDATA[ + +test_computed_value("stop-color", "currentcolor", "rgb(0, 0, 255)"); +test_computed_value("stop-color", "white", "rgb(255, 255, 255)"); +test_computed_value("stop-color", "transparent", "rgba(0, 0, 0, 0)"); +test_computed_value("stop-color", "rgb(255, 255, 255)"); +test_computed_value("stop-color", "#ffffff", "rgb(255, 255, 255)"); +test_computed_value("stop-color", "rgba(255, 255, 255, 1.0)", "rgb(255, 255, 255)"); +test_computed_value("stop-color", "rgba(255, 255, 255, 0.4)"); +test_computed_value("stop-color", "hsl(0deg, 100%, 100%)", "rgb(255, 255, 255)"); +test_computed_value("stop-color", "hsla(0deg, 100%, 100%, 1.0)", "rgb(255, 255, 255)"); +test_computed_value("stop-color", "hsla(0deg, 100%, 100%, 0.4)", "rgba(255, 255, 255, 0.4)"); + + ]]></script> +</svg> diff --git a/testing/web-platform/tests/svg/pservers/parsing/stop-color-invalid.svg b/testing/web-platform/tests/svg/pservers/parsing/stop-color-invalid.svg new file mode 100644 index 0000000000..4eee544486 --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/parsing/stop-color-invalid.svg @@ -0,0 +1,24 @@ +<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml"> + <title>SVG Paint Servers: parsing stop-color with invalid values</title> + <metadata> + <h:link rel="help" href="https://svgwg.org/svg2-draft/pservers.html#StopColorProperty"/> + </metadata> + <g id="target" style="color: blue"></g> + <h:script src="/resources/testharness.js"/> + <h:script src="/resources/testharnessreport.js"/> + <h:script src="/css/support/parsing-testcommon.js"/> + <script><![CDATA[ + +test_invalid_value("stop-color", "auto"); +test_invalid_value("stop-color", "123"); +test_invalid_value("stop-color", "#12"); +test_invalid_value("stop-color", "#123456789"); +test_invalid_value("stop-color", "rgb"); +test_invalid_value("stop-color", "rgb(1)"); +test_invalid_value("stop-color", "rgb(1,2,3,4,5)"); +test_invalid_value("stop-color", "hsla(1,2,3,4,5)"); +test_invalid_value("stop-color", "rgb(10%, 20, 30%)"); +test_invalid_value("stop-color", "rgba(-2, 300, 400%, -0.5)"); + + ]]></script> +</svg> diff --git a/testing/web-platform/tests/svg/pservers/parsing/stop-color-valid.svg b/testing/web-platform/tests/svg/pservers/parsing/stop-color-valid.svg new file mode 100644 index 0000000000..80d6c23b83 --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/parsing/stop-color-valid.svg @@ -0,0 +1,24 @@ +<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml"> + <title>SVG Paint Servers: parsing stop-color with valid values</title> + <metadata> + <h:link rel="help" href="https://svgwg.org/svg2-draft/pservers.html#StopColorProperty"/> + </metadata> + <g id="target" style="color: blue"></g> + <h:script src="/resources/testharness.js"/> + <h:script src="/resources/testharnessreport.js"/> + <h:script src="/css/support/parsing-testcommon.js"/> + <script><![CDATA[ + +test_valid_value("stop-color", "currentcolor"); +test_valid_value("stop-color", "white"); +test_valid_value("stop-color", "transparent"); +test_valid_value("stop-color", "rgb(255, 255, 255)"); +test_valid_value("stop-color", "#ffffff", "rgb(255, 255, 255)"); +test_valid_value("stop-color", "rgba(255, 255, 255, 1.0)", "rgb(255, 255, 255)"); +test_valid_value("stop-color", "rgba(255, 255, 255, 0.4)"); +test_valid_value("stop-color", "hsl(0deg, 100%, 100%)", "rgb(255, 255, 255)"); +test_valid_value("stop-color", "hsla(0deg, 100%, 100%, 1.0)", "rgb(255, 255, 255)"); +test_valid_value("stop-color", "hsla(0deg, 100%, 100%, 0.4)", "rgba(255, 255, 255, 0.4)"); + + ]]></script> +</svg> diff --git a/testing/web-platform/tests/svg/pservers/parsing/stop-opacity-computed.svg b/testing/web-platform/tests/svg/pservers/parsing/stop-opacity-computed.svg new file mode 100644 index 0000000000..1ad1e98c5a --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/parsing/stop-opacity-computed.svg @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg xmlns="http://www.w3.org/2000/svg" + xmlns:h="http://www.w3.org/1999/xhtml" + width="800px" height="800px"> + <title>SVG Paint Servers: getComputedStyle().stopOpacity</title> + <metadata> + <h:link rel="help" href="https://svgwg.org/svg2-draft/pservers.html#StopOpacityProperty"/> + <h:meta name="assert" content="stop-opacity computed value is clamped to the range [0,1]."/> + </metadata> + <g id="target"></g> + <h:script src="/resources/testharness.js"/> + <h:script src="/resources/testharnessreport.js"/> + <h:script src="/css/support/computed-testcommon.js"/> + <script><![CDATA[ + +test_computed_value("stop-opacity", "-1", "0"); +test_computed_value("stop-opacity", "0.5"); +test_computed_value("stop-opacity", "3", "1"); +test_computed_value("stop-opacity", "-100%", "0"); +test_computed_value("stop-opacity", "50%", "0.5"); +test_computed_value("stop-opacity", "300%", "1"); + + ]]></script> +</svg> diff --git a/testing/web-platform/tests/svg/pservers/parsing/stop-opacity-invalid.svg b/testing/web-platform/tests/svg/pservers/parsing/stop-opacity-invalid.svg new file mode 100644 index 0000000000..eae9343d14 --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/parsing/stop-opacity-invalid.svg @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg xmlns="http://www.w3.org/2000/svg" + xmlns:h="http://www.w3.org/1999/xhtml" + width="800px" height="800px"> + <title>SVG Paint Servers: parsing stop-opacity with invalid values</title> + <metadata> + <h:link rel="help" href="https://svgwg.org/svg2-draft/pservers.html#StopOpacityProperty"/> + <h:meta name="assert" content="stop-opacity supports only the grammar 'alpha-value'."/> + </metadata> + <g id="target"></g> + <h:script src="/resources/testharness.js"/> + <h:script src="/resources/testharnessreport.js"/> + <h:script src="/css/support/parsing-testcommon.js"/> + <script><![CDATA[ + +test_invalid_value("stop-opacity", "1."); +test_invalid_value("stop-opacity", "2 3"); + + ]]></script> +</svg> diff --git a/testing/web-platform/tests/svg/pservers/parsing/stop-opacity-valid.svg b/testing/web-platform/tests/svg/pservers/parsing/stop-opacity-valid.svg new file mode 100644 index 0000000000..28b60038a4 --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/parsing/stop-opacity-valid.svg @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg xmlns="http://www.w3.org/2000/svg" + xmlns:h="http://www.w3.org/1999/xhtml" + width="800px" height="800px"> + <title>SVG Paint Servers: parsing stop-opacity with valid values</title> + <metadata> + <h:link rel="help" href="https://svgwg.org/svg2-draft/pservers.html#StopOpacityProperty"/> + <h:meta name="assert" content="stop-opacity supports the full grammar 'alpha-value'."/> + </metadata> + <g id="target"></g> + <h:script src="/resources/testharness.js"/> + <h:script src="/resources/testharnessreport.js"/> + <h:script src="/css/support/parsing-testcommon.js"/> + <script><![CDATA[ + +test_valid_value("stop-opacity", "-1"); +test_valid_value("stop-opacity", "0.5"); +test_valid_value("stop-opacity", "3"); +test_valid_value("stop-opacity", "-100%", "-1"); +test_valid_value("stop-opacity", "50%", "0.5"); +test_valid_value("stop-opacity", "300%", "3"); + + ]]></script> +</svg> diff --git a/testing/web-platform/tests/svg/pservers/pattern-with-invalid-base-cloned-thcrash.html b/testing/web-platform/tests/svg/pservers/pattern-with-invalid-base-cloned-thcrash.html new file mode 100644 index 0000000000..04a453545f --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/pattern-with-invalid-base-cloned-thcrash.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<base id="base" href="invalid:"> +<svg id="svg"> + <pattern id="pat" xlink:href="#pat"/> +</svg> +<script> + async_test(t => { + onload = t.step_func_done(() => { + let pattern = document.getElementById("pat"); + base.href = ""; + document.body.insertBefore(document.getElementById("svg").cloneNode(true), + document.body.firstChild); + document.body.offsetTop; + pattern.setAttribute("clip-rule", "evenodd"); + document.body.offsetTop; + pattern.setAttribute("width", "0"); + document.getElementById("svg").setAttribute("systemLanguage", "x-nonexistent"); + document.body.offsetTop; + }); + }); +</script> diff --git a/testing/web-platform/tests/svg/pservers/reftests/gradient-inheritance-not-in-rendertree-01.tentative.svg b/testing/web-platform/tests/svg/pservers/reftests/gradient-inheritance-not-in-rendertree-01.tentative.svg new file mode 100644 index 0000000000..8f80b2d944 --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/gradient-inheritance-not-in-rendertree-01.tentative.svg @@ -0,0 +1,15 @@ +<svg xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:h="http:/www.w3.org/1999/xhtml"> + <title><linearGradient> (without content) inheriting from a <linearGradient> in an invalid context</title> + <h:link rel="help" href="https://svgwg.org/svg2-draft/pservers.html#StopNotes"/> + <h:link rel="match" href="reference/green-100x100.svg"/> + <linearGradient id="linearGradient1" xlink:href="#linearGradient0"/> + <rect width="100" height="100" fill="green"/> + <rect width="100" height="100" fill="url(#linearGradient1) yellow"/> + <text> + <linearGradient id="linearGradient0"> + <stop stop-color="orange"/> + </linearGradient> + </text> +</svg> diff --git a/testing/web-platform/tests/svg/pservers/reftests/gradient-inheritance-not-in-rendertree-02.tentative.svg b/testing/web-platform/tests/svg/pservers/reftests/gradient-inheritance-not-in-rendertree-02.tentative.svg new file mode 100644 index 0000000000..5b230f1d31 --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/gradient-inheritance-not-in-rendertree-02.tentative.svg @@ -0,0 +1,16 @@ +<svg xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:h="http:/www.w3.org/1999/xhtml"> + <title><linearGradient> (with content) inheriting from a <linearGradient> in an invalid context</title> + <h:link rel="help" href="https://svgwg.org/svg2-draft/pservers.html#StopNotes"/> + <h:link rel="match" href="reference/green-100x100.svg"/> + <linearGradient id="linearGradient1" xlink:href="#linearGradient0"> + <stop stop-color="green"/> + </linearGradient> + <rect width="100" height="100" fill="url(#linearGradient1) yellow"/> + <text> + <linearGradient id="linearGradient0"> + <stop stop-color="orange"/> + </linearGradient> + </text> +</svg> diff --git a/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-001-ref.png b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-001-ref.png Binary files differnew file mode 100644 index 0000000000..691bff6244 --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-001-ref.png diff --git a/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-001.svg b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-001.svg new file mode 100644 index 0000000000..24290d40d6 --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-001.svg @@ -0,0 +1,63 @@ +<svg id="svg-root" + width="480" height="360" viewBox="0 0 480 360" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:html="http://www.w3.org/1999/xhtml"> + <g id="testmeta"> + <title>Mesh gradient: Single 1x1 patch (userSpaceOnUse).</title> + <html:link rel="author" + title="Tavmjong Bah" + href="http://tavmjong.free.fr"/> + <html:link rel="help" + href="https://www.w3.org/TR/SVG2/pservers.html#MeshGradients"/> + <html:link rel="match" href="meshgradient-basic-001-ref.png" /> + </g> + + <style id="test-font" type="text/css"> + /* Standard Font (if needed). */ + @font-face { + font-family: FreeSans; + src: url("../fonts/FreeSans.woff") format("woff"); + } + text { + font-family: FreeSans, sans-serif; + text-anchor: middle; + fill: black; + } + #title { + font-size: 24px; + } + .label { + font-size: 18px; + } + </style> + + <defs> + <meshgradient id="LinearMesh" x="20" y="140" gradientUnits="userSpaceOnUse"> + <meshrow> + <meshpatch> + <stop style="stop-color:#0000ff" path="l 200,0" /> + <stop style="stop-color:#00ff00" path="l 0,200" /> + <stop style="stop-color:#ffff00" path="l -200,0" /> + <stop style="stop-color:#00ff00" path="l 0,-200" /> + </meshpatch> + </meshrow> + </meshgradient> + <meshgradient id="BezierMesh" x="260" y="140" gradientUnits="userSpaceOnUse"> + <meshrow> + <meshpatch> + <stop style="stop-color:#0000ff" path="c 66.6667,0 133.333,0 200,0" /> + <stop style="stop-color:#00ff00" path="c 0,66.6667 0,133.333 0,200" /> + <stop style="stop-color:#ffff00" path="c -66.6667,0 -133.333,0 -200,0" /> + <stop style="stop-color:#00ff00" path="c 0,-66.6667 0,-133.333 0,-200" /> + </meshpatch> + </meshrow> + </meshgradient> + </defs> + + <g id="test-body-content"> + <rect x="20" y="140" width="200" height="200" style="fill:url(#LinearMesh)" /> + <rect x="260" y="140" width="200" height="200" style="fill:url(#BezierMesh)" /> + </g> + +</svg> diff --git a/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-002-ref.png b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-002-ref.png Binary files differnew file mode 100644 index 0000000000..691bff6244 --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-002-ref.png diff --git a/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-002.svg b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-002.svg new file mode 100644 index 0000000000..2391135200 --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-002.svg @@ -0,0 +1,63 @@ +<svg id="svg-root" + width="480" height="360" viewBox="0 0 480 360" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:html="http://www.w3.org/1999/xhtml"> + <g id="testmeta"> + <title>Mesh gradient: Single 1x1 patch (objectBoundingBox)</title> + <html:link rel="author" + title="Tavmjong Bah" + href="http://tavmjong.free.fr"/> + <html:link rel="help" + href="https://www.w3.org/TR/SVG2/pservers.html#MeshGradients"/> + <html:link rel="match" href="meshgradient-basic-002-ref.png" /> + </g> + + <style id="test-font" type="text/css"> + /* Standard Font (if needed). */ + @font-face { + font-family: FreeSans; + src: url("../fonts/FreeSans.woff") format("woff"); + } + text { + font-family: FreeSans, sans-serif; + text-anchor: middle; + fill: black; + } + #title { + font-size: 24px; + } + .label { + font-size: 18px; + } + </style> + + <defs> + <meshgradient id="LinearMesh" x="0" y="0" gradientUnits="objectBoundingBox"> + <meshrow> + <meshpatch> + <stop style="stop-color:#0000ff" path="l 1,0" /> + <stop style="stop-color:#00ff00" path="l 0,1" /> + <stop style="stop-color:#ffff00" path="l -1,0" /> + <stop style="stop-color:#00ff00" path="l 0,-1" /> + </meshpatch> + </meshrow> + </meshgradient> + <meshgradient id="BezierMesh" x="0" y="0" gradientUnits="objectBoundingBox"> + <meshrow> + <meshpatch> + <stop style="stop-color:#0000ff" path="c 0.3333,0 0.6667,0 1,0" /> + <stop style="stop-color:#00ff00" path="c 0,0.3333 0,0.6667 0,1" /> + <stop style="stop-color:#ffff00" path="c -0.3333,0 -0.6667,0 -1,0" /> + <stop style="stop-color:#00ff00" path="c 0,-0.3333 0,-0.6667 0,-1" /> + </meshpatch> + </meshrow> + </meshgradient> + </defs> + + <g id="test-body-content"> + <rect x="20" y="140" width="200" height="200" style="fill:url(#LinearMesh)" /> + <rect x="260" y="140" width="200" height="200" style="fill:url(#BezierMesh)" /> + </g> + +</svg> diff --git a/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-003-ref.png b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-003-ref.png Binary files differnew file mode 100644 index 0000000000..39c36a150f --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-003-ref.png diff --git a/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-003.svg b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-003.svg new file mode 100644 index 0000000000..84db2ea126 --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-003.svg @@ -0,0 +1,103 @@ +<svg id="svg-root" + width="480" height="360" viewBox="0 0 480 360" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:html="http://www.w3.org/1999/xhtml"> + <g id="testmeta"> + <title>Mesh gradient: Simple 2x2 patch mesh (userSpaceOnUse).</title> + <html:link rel="author" + title="Tavmjong Bah" + href="http://tavmjong.free.fr"/> + <html:link rel="help" + href="https://www.w3.org/TR/SVG2/pservers.html#MeshGradients"/> + <html:link rel="match" href="meshgradient-basic-003-ref.png" /> + </g> + + <style id="test-font" type="text/css"> + /* Standard Font (if needed). */ + @font-face { + font-family: FreeSans; + src: url("../fonts/FreeSans.woff") format("woff"); + } + text { + font-family: FreeSans, sans-serif; + text-anchor: middle; + fill: black; + } + #title { + font-size: 24px; + } + .label { + font-size: 18px; + } + </style> + + <defs> + <meshgradient id="LinearMesh" x="20" y="140" gradientUnits="userSpaceOnUse"> + <meshrow> + <meshpatch> + <stop style="stop-color:#0000ff" path="l 100,0" /> + <stop style="stop-color:#00ff00" path="l 0,100" /> + <stop style="stop-color:#ffff00" path="l -100,0" /> + <stop style="stop-color:#00ff00" path="l 0,-100" /> + </meshpatch> + <meshpatch> + <stop path="l 100,0" /> + <stop style="stop-color:#ffff00" path="l 0,100" /> + <stop style="stop-color:#0000ff" path="l -100,0" /> + <!-- No final stop --> + </meshpatch> + </meshrow> + <meshrow> + <meshpatch> + <!-- No initial stop --> + <stop path="l 0,100" /> + <stop style="stop-color:#0000ff" path="l -100,0" /> + <stop style="stop-color:#ffff00" path="l 0,-100" /> + </meshpatch> + <meshpatch> + <!-- No initial stop --> + <stop path="l 0,100" /> + <stop style="stop-color:#00ff00" path="l -100,0" /> + <!-- No final stop --> + </meshpatch> + </meshrow> + </meshgradient> + <meshgradient id="BezierMesh" x="260" y="140" gradientUnits="userSpaceOnUse"> + <meshrow> + <meshpatch> + <stop style="stop-color:#0000ff" path="c 33.33,0 66.67,0 100,0" /> + <stop style="stop-color:#00ff00" path="c 0,33.33 0,66.67 0,100" /> + <stop style="stop-color:#ffff00" path="c -33.33,0 -66.67,0 -100,0" /> + <stop style="stop-color:#00ff00" path="c 0,-33.33 0,-66.67 0,-100" /> + </meshpatch> + <meshpatch> + <stop path="c 33.33,0 66.67,0 100,0" /> + <stop style="stop-color:#ffff00" path="c 0,33.33 0,66.67 0,100" /> + <stop style="stop-color:#0000ff" path="c -33.33,0 -66.67,0 -100,0" /> + <!-- No final stop --> + </meshpatch> + </meshrow> + <meshrow> + <meshpatch> + <!-- No initial stop --> + <stop path="c 0,33.33 0,66.67 0,100" /> + <stop style="stop-color:#0000ff" path="c -33.33,0 -66.67,0 -100,0" /> + <stop style="stop-color:#ffff00" path="c 0,-33.33 0,-66.67 0,-100" /> + </meshpatch> + <meshpatch> + <!-- No initial stop --> + <stop path="c 0,33.33 0,66.67 0,100" /> + <stop style="stop-color:#00ff00" path="c -33.33,0 -66.67,0 -100,0" /> + <!-- No final stop --> + </meshpatch> + </meshrow> + </meshgradient> + </defs> + + <g id="test-body-content"> + <rect x="20" y="140" width="200" height="200" style="fill:url(#LinearMesh)" /> + <rect x="260" y="140" width="200" height="200" style="fill:url(#BezierMesh)" /> + </g> + +</svg> diff --git a/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-004-ref.png b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-004-ref.png Binary files differnew file mode 100644 index 0000000000..39c36a150f --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-004-ref.png diff --git a/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-004.svg b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-004.svg new file mode 100644 index 0000000000..c7e7501993 --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-004.svg @@ -0,0 +1,103 @@ +<svg id="svg-root" + width="480" height="360" viewBox="0 0 480 360" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:html="http://www.w3.org/1999/xhtml"> + <g id="testmeta"> + <title>Mesh gradient: Simple 2x2 patch mesh (objectBoundingBox).</title> + <html:link rel="author" + title="Tavmjong Bah" + href="http://tavmjong.free.fr"/> + <html:link rel="help" + href="https://www.w3.org/TR/SVG2/pservers.html#MeshGradients"/> + <html:link rel="match" href="meshgradient-basic-004-ref.png" /> + </g> + + <style id="test-font" type="text/css"> + /* Standard Font (if needed). */ + @font-face { + font-family: FreeSans; + src: url("../fonts/FreeSans.woff") format("woff"); + } + text { + font-family: FreeSans, sans-serif; + text-anchor: middle; + fill: black; + } + #title { + font-size: 24px; + } + .label { + font-size: 18px; + } + </style> + + <defs> + <meshgradient id="LinearMesh" x="0" y="0" gradientUnits="objectBoundingBox"> + <meshrow> + <meshpatch> + <stop style="stop-color:#0000ff" path="l 0.5,0" /> + <stop style="stop-color:#00ff00" path="l 0,0.5" /> + <stop style="stop-color:#ffff00" path="l -0.5,0" /> + <stop style="stop-color:#00ff00" path="l 0,-0.5" /> + </meshpatch> + <meshpatch> + <stop path="l 0.5,0" /> + <stop style="stop-color:#ffff00" path="l 0,0.5" /> + <stop style="stop-color:#0000ff" path="l -0.5,0" /> + <!-- No final stop --> + </meshpatch> + </meshrow> + <meshrow> + <meshpatch> + <!-- No initial stop --> + <stop path="l 0,0.5" /> + <stop style="stop-color:#0000ff" path="l -0.5,0" /> + <stop style="stop-color:#ffff00" path="l 0,-0.5" /> + </meshpatch> + <meshpatch> + <!-- No initial stop --> + <stop path="l 0,0.5" /> + <stop style="stop-color:#00ff00" path="l -0.5,0" /> + <!-- No final stop --> + </meshpatch> + </meshrow> + </meshgradient> + <meshgradient id="BezierMesh" x="0" y="0" gradientUnits="objectBoundingBox"> + <meshrow> + <meshpatch> + <stop style="stop-color:#0000ff" path="c 0.1667,0 0.3333,0 0.5,0" /> + <stop style="stop-color:#00ff00" path="c 0,0.1667 0,0.3333 0,0.5" /> + <stop style="stop-color:#ffff00" path="c -0.1667,0 -0.3333,0 -0.5,0" /> + <stop style="stop-color:#00ff00" path="c 0,-0.1667 0,-0.3333 0,-0.5" /> + </meshpatch> + <meshpatch> + <stop path="c 0.1667,0 0.3333,0 0.5,0" /> + <stop style="stop-color:#ffff00" path="c 0,0.1667 0,0.3333 0,0.5" /> + <stop style="stop-color:#0000ff" path="c -0.1667,0 -0.3333,0 -0.5,0" /> + <!-- No final stop --> + </meshpatch> + </meshrow> + <meshrow> + <meshpatch> + <!-- No initial stop --> + <stop path="c 0,0.1667 0,0.3333 0,0.5" /> + <stop style="stop-color:#0000ff" path="c -0.1667,0 -0.3333,0 -0.5,0" /> + <stop style="stop-color:#ffff00" path="c 0,-0.1667 0,-0.3333 0,-0.5" /> + </meshpatch> + <meshpatch> + <!-- No initial stop --> + <stop path="c 0,0.1667 0,0.3333 0,0.5" /> + <stop style="stop-color:#00ff00" path="c -0.1667,0 -0.3333,0 -0.5,0" /> + <!-- No final stop --> + </meshpatch> + </meshrow> + </meshgradient> + </defs> + + <g id="test-body-content"> + <rect x="20" y="140" width="200" height="200" style="fill:url(#LinearMesh)" /> + <rect x="260" y="140" width="200" height="200" style="fill:url(#BezierMesh)" /> + </g> + +</svg> diff --git a/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-005-ref.png b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-005-ref.png Binary files differnew file mode 100644 index 0000000000..3cd5164b77 --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-005-ref.png diff --git a/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-005.svg b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-005.svg new file mode 100644 index 0000000000..59a6c2500a --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-basic-005.svg @@ -0,0 +1,226 @@ +<svg id="svg-root" + width="480" height="360" viewBox="0 0 480 360" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:html="http://www.w3.org/1999/xhtml"> + <g id="testmeta"> + <title>Mesh gradient: Star: 10x2 patches.</title> + <html:link rel="author" + title="Tavmjong Bah" + href="http://tavmjong.free.fr"/> + <html:link rel="help" + href="https://www.w3.org/TR/SVG2/pservers.html#MeshGradients"/> + <html:link rel="match" href="meshgradient-basic-005-ref.png" /> + </g> + + <style id="test-font" type="text/css"> + /* Standard Font (if needed). */ + @font-face { + font-family: FreeSans; + src: url("../fonts/FreeSans.woff") format("woff"); + } + text { + font-family: FreeSans, sans-serif; + text-anchor: middle; + fill: black; + } + #title { + font-size: 24px; + } + .label { + font-size: 18px; + } + </style> + + <defs> + <meshgradient id="StarMesh" x="240" y="140" gradientUnits="userSpaceOnUse"> + <meshrow> + <meshpatch> + <stop + style="stop-color:#0000ff" + path="l 32.3286,65.5041" /> + <stop + style="stop-color:#0000ff" + path="l -16.1641,22.248" /> + <stop + style="stop-color:#00ff00" + path="l -16.1643,-32.752" /> + <stop + style="stop-color:#00ff00" + path="l -0.000202026,-55" /> + </meshpatch> + <meshpatch> + <stop + path="l 72.2879,10.5037" /> + <stop + style="stop-color:#0000ff" + path="l -52.308,16.9961" /> + <stop + style="stop-color:#00ff00" + path="l -36.144,-5.25184" /> + </meshpatch> + <meshpatch> + <stop + path="l -52.308,50.9882" /> + <stop + style="stop-color:#0000ff" + path="l -26.1541,-8.49796" /> + <stop + style="stop-color:#00ff00" + path="l 26.154,-25.4941" /> + </meshpatch> + <meshpatch> + <stop + path="l 12.3486,71.9957" /> + <stop + style="stop-color:#0000ff" + path="l -32.3284,-44.4958" /> + <stop + style="stop-color:#00ff00" + path="l -6.1743,-35.9979" /> + </meshpatch> + <meshpatch> + <stop + path="l -64.6567,-33.9916" /> + <stop + style="stop-color:#0000ff" + path="l -5.60788e-06,-27.5" /> + <stop + style="stop-color:#00ff00" + path="l 32.3283,16.9958" /> + </meshpatch> + <meshpatch> + <stop + path="l -64.6561,33.9921" /> + <stop + style="stop-color:#0000ff" + path="l 32.328,-44.4961" /> + <stop + style="stop-color:#00ff00" + path="l 32.328,-16.9961" /> + </meshpatch> + <meshpatch> + <stop + path="l 12.3479,-71.9962" /> + <stop + style="stop-color:#0000ff" + path="l 26.1541,-8.49797" /> + <stop + style="stop-color:#00ff00" + path="l -6.17397,35.9981" /> + </meshpatch> + <meshpatch> + <stop + path="l -52.3082,-50.9874" /> + <stop + style="stop-color:#0000ff" + path="l 52.3082,16.9957" /> + <stop + style="stop-color:#00ff00" + path="l 26.1541,25.4937" /> + </meshpatch> + <meshpatch> + <stop + path="l 72.2881,-10.5044" /> + <stop + style="stop-color:#0000ff" + path="l 16.1641,22.248" /> + <stop + style="stop-color:#00ff00" + path="l -36.1441,5.25222" /> + </meshpatch> + <meshpatch> + <stop + path="l 32.3278,-65.5041" /> + <stop + style="stop-color:#0000ff" + path="l 0.000202026,55" /> + <stop + style="stop-color:#00ff00" + path="l -16.1639,32.752" /> + </meshpatch> + </meshrow> + <meshrow> + <meshpatch> + <stop + path="l -16.1641,22.248" /> + <stop + style="stop-color:#ffff00" + path="l 0,0" /> + <stop + style="stop-color:#ffff00" + path="l -0.000202026,-55" /> + </meshpatch> + <meshpatch> + <stop + path="l -52.308,16.9961" /> + <stop + style="stop-color:#ffff00" + path="l 0,0" /> + </meshpatch> + <meshpatch> + <stop + path="l -26.1541,-8.49796" /> + <stop + style="stop-color:#ffff00" + path="l 0,0" /> + </meshpatch> + <meshpatch> + <stop + path="l -32.3284,-44.4958" /> + <stop + style="stop-color:#ffff00" + path="l 0,0" /> + </meshpatch> + <meshpatch> + <stop + path="l -5.60788e-06,-27.5" /> + <stop + style="stop-color:#ffff00" + path="l 0,0" /> + </meshpatch> + <meshpatch> + <stop + path="l 32.328,-44.4961" /> + <stop + style="stop-color:#ffff00" + path="l 0,0" /> + </meshpatch> + <meshpatch> + <stop + path="l 26.1541,-8.49797" /> + <stop + style="stop-color:#ffff00" + path="l 0,0" /> + </meshpatch> + <meshpatch> + <stop + path="l 52.3082,16.9957" /> + <stop + style="stop-color:#ffff00" + path="l 0,0" /> + </meshpatch> + <meshpatch> + <stop + path="l 16.1641,22.248" /> + <stop + style="stop-color:#ffff00" + path="l 0,0" /> + </meshpatch> + <meshpatch> + <stop + path="l 0.000202026,55" /> + <stop + style="stop-color:#ffff00" + path="l 0,0" /> + </meshpatch> + </meshrow> + </meshgradient> + </defs> + + <g id="test-body-content"> + <path d="m 240,140 32.328,65.504 72.288,10.504 -52.308,50.988 12.349,71.996 -64.657,-33.992 -64.6561,33.992 12.348,-71.996 -52.3082,-50.987 72.2881,-10.505 z" + style="fill:url(#StarMesh)" /> + </g> + +</svg> diff --git a/testing/web-platform/tests/svg/pservers/reftests/meshgradient-bicubic-001-ref.png b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-bicubic-001-ref.png Binary files differnew file mode 100644 index 0000000000..551345d732 --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-bicubic-001-ref.png diff --git a/testing/web-platform/tests/svg/pservers/reftests/meshgradient-bicubic-001.svg b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-bicubic-001.svg new file mode 100644 index 0000000000..8c3c219f18 --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-bicubic-001.svg @@ -0,0 +1,223 @@ +<svg id="svg-root" + width="480" height="360" viewBox="0 0 480 360" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:html="http://www.w3.org/1999/xhtml"> + <g id="testmeta"> + <title>Mesh gradient: Coons vs. Bicubic.</title> + <html:link rel="author" + title="Tavmjong Bah" + href="http://tavmjong.free.fr"/> + <html:link rel="help" + href="https://www.w3.org/TR/SVG2/pservers.html#MeshGradients"/> + <html:link rel="match" href="meshgradient-bicubic-001-ref.png" /> + </g> + + <style id="test-font" type="text/css"> + /* Standard Font (if needed). */ + @font-face { + font-family: FreeSans; + src: url("../fonts/FreeSans.woff") format("woff"); + } + text { + font-family: FreeSans, sans-serif; + text-anchor: middle; + fill: black; + } + #title { + font-size: 24px; + } + .label { + font-size: 18px; + } + </style> + + <defs> + <meshgradient id="CheckerBoardCoons" x="20" y="140" gradientUnits="userSpaceOnUse"> + <meshrow> + <meshpatch> + <stop + style="stop-color:#0000ff;stop-opacity:1" + path="c 22.2222,0 44.4444,0 66.6667,0" /> + <stop + style="stop-color:#00ff00;stop-opacity:1" + path="c 0,22.2222 0,44.4444 0,66.6667" /> + <stop + style="stop-color:#0000ff;stop-opacity:1" + path="c -22.2222,0 -44.4444,0 -66.6667,0" /> + <stop + style="stop-color:#00ff00;stop-opacity:1" + path="c 0,-22.2222 0,-44.4444 0,-66.6667" /> + </meshpatch> + <meshpatch> + <stop + path="c 22.2222,0 44.4444,0 66.6667,0" /> + <stop + style="stop-color:#0000ff;stop-opacity:1" + path="c 0,22.2222 0,44.4444 0,66.6667" /> + <stop + style="stop-color:#00ff00;stop-opacity:1" + path="c -22.2222,0 -44.4444,0 -66.6667,0" /> + </meshpatch> + <meshpatch> + <stop + path="c 22.2222,0 44.4444,0 66.6667,0" /> + <stop + style="stop-color:#00ff00;stop-opacity:1" + path="c 0,22.2222 0,44.4444 0,66.6667" /> + <stop + style="stop-color:#0000ff;stop-opacity:1" + path="c -22.2222,0 -44.4444,0 -66.6667,0" /> + </meshpatch> + </meshrow> + <meshrow> + <meshpatch> + <stop + path="c 0,22.2222 0,44.4444 0,66.6667" /> + <stop + style="stop-color:#00ff00;stop-opacity:1" + path="c -22.2222,0 -44.4444,0 -66.6667,0" /> + <stop + style="stop-color:#0000ff;stop-opacity:1" + path="c 0,-22.2222 0,-44.4444 0,-66.6667" /> + </meshpatch> + <meshpatch> + <stop + path="c 0,22.2222 0,44.4444 0,66.6667" /> + <stop + style="stop-color:#0000ff;stop-opacity:1" + path="c -22.2222,0 -44.4444,0 -66.6667,0" /> + </meshpatch> + <meshpatch> + <stop + path="c 0,22.2222 0,44.4444 0,66.6667" /> + <stop + style="stop-color:#00ff00;stop-opacity:1" + path="c -22.2222,0 -44.4444,0 -66.6667,0" /> + </meshpatch> + </meshrow> + <meshrow> + <meshpatch> + <stop + path="c 0,22.2222 0,44.4444 0,66.6667" /> + <stop + style="stop-color:#0000ff;stop-opacity:1" + path="c -22.2222,0 -44.4444,0 -66.6667,0" /> + <stop + style="stop-color:#00ff00;stop-opacity:1" + path="c 0,-22.2222 0,-44.4444 0,-66.6667" /> + </meshpatch> + <meshpatch> + <stop + path="c 0,22.2222 0,44.4444 0,66.6667" /> + <stop + style="stop-color:#00ff00;stop-opacity:1" + path="c -22.2222,0 -44.4444,0 -66.6667,0" /> + </meshpatch> + <meshpatch> + <stop + path="c 0,22.2222 0,44.4444 0,66.6667" /> + <stop + style="stop-color:#0000ff;stop-opacity:1" + path="c -22.2222,0 -44.4444,0 -66.6667,0" /> + </meshpatch> + </meshrow> + </meshgradient> + <meshgradient id="CheckerBoardBicubic" x="260" y="140" type="bicubic" gradientUnits="userSpaceOnUse"> + <meshrow> + <meshpatch> + <stop + style="stop-color:#0000ff;stop-opacity:1" + path="c 22.2222,0 44.4444,0 66.6667,0" /> + <stop + style="stop-color:#00ff00;stop-opacity:1" + path="c 0,22.2222 0,44.4444 0,66.6667" /> + <stop + style="stop-color:#0000ff;stop-opacity:1" + path="c -22.2222,0 -44.4444,0 -66.6667,0" /> + <stop + style="stop-color:#00ff00;stop-opacity:1" + path="c 0,-22.2222 0,-44.4444 0,-66.6667" /> + </meshpatch> + <meshpatch> + <stop + path="c 22.2222,0 44.4444,0 66.6667,0" /> + <stop + style="stop-color:#0000ff;stop-opacity:1" + path="c 0,22.2222 0,44.4444 0,66.6667" /> + <stop + style="stop-color:#00ff00;stop-opacity:1" + path="c -22.2222,0 -44.4444,0 -66.6667,0" /> + </meshpatch> + <meshpatch> + <stop + path="c 22.2222,0 44.4444,0 66.6667,0" /> + <stop + style="stop-color:#00ff00;stop-opacity:1" + path="c 0,22.2222 0,44.4444 0,66.6667" /> + <stop + style="stop-color:#0000ff;stop-opacity:1" + path="c -22.2222,0 -44.4444,0 -66.6667,0" /> + </meshpatch> + </meshrow> + <meshrow> + <meshpatch> + <stop + path="c 0,22.2222 0,44.4444 0,66.6667" /> + <stop + style="stop-color:#00ff00;stop-opacity:1" + path="c -22.2222,0 -44.4444,0 -66.6667,0" /> + <stop + style="stop-color:#0000ff;stop-opacity:1" + path="c 0,-22.2222 0,-44.4444 0,-66.6667" /> + </meshpatch> + <meshpatch> + <stop + path="c 0,22.2222 0,44.4444 0,66.6667" /> + <stop + style="stop-color:#0000ff;stop-opacity:1" + path="c -22.2222,0 -44.4444,0 -66.6667,0" /> + </meshpatch> + <meshpatch> + <stop + path="c 0,22.2222 0,44.4444 0,66.6667" /> + <stop + style="stop-color:#00ff00;stop-opacity:1" + path="c -22.2222,0 -44.4444,0 -66.6667,0" /> + </meshpatch> + </meshrow> + <meshrow> + <meshpatch> + <stop + path="c 0,22.2222 0,44.4444 0,66.6667" /> + <stop + style="stop-color:#0000ff;stop-opacity:1" + path="c -22.2222,0 -44.4444,0 -66.6667,0" /> + <stop + style="stop-color:#00ff00;stop-opacity:1" + path="c 0,-22.2222 0,-44.4444 0,-66.6667" /> + </meshpatch> + <meshpatch> + <stop + path="c 0,22.2222 0,44.4444 0,66.6667" /> + <stop + style="stop-color:#00ff00;stop-opacity:1" + path="c -22.2222,0 -44.4444,0 -66.6667,0" /> + </meshpatch> + <meshpatch> + <stop + path="c 0,22.2222 0,44.4444 0,66.6667" /> + <stop + style="stop-color:#0000ff;stop-opacity:1" + path="c -22.2222,0 -44.4444,0 -66.6667,0" /> + </meshpatch> + </meshrow> + </meshgradient> + </defs> + + <g id="test-body-content"> + <rect x="20" y="140" width="200" height="200" style="fill:url(#CheckerBoardCoons)" /> + <rect x="260" y="140" width="200" height="200" style="fill:url(#CheckerBoardBicubic)" /> + </g> + +</svg> diff --git a/testing/web-platform/tests/svg/pservers/reftests/meshgradient-complex-001-ref.png b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-complex-001-ref.png Binary files differnew file mode 100644 index 0000000000..4ce893b827 --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-complex-001-ref.png diff --git a/testing/web-platform/tests/svg/pservers/reftests/meshgradient-complex-001.svg b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-complex-001.svg new file mode 100644 index 0000000000..625fae59ea --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/meshgradient-complex-001.svg @@ -0,0 +1,89 @@ +<svg id="svg-root" + width="480" height="360" viewBox="0 0 480 360" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:html="http://www.w3.org/1999/xhtml"> + <g id="testmeta"> + <title>Mesh gradient: Patch paint order.</title> + <html:link rel="author" + title="Tavmjong Bah" + href="http://tavmjong.free.fr"/> + <html:link rel="help" + href="https://www.w3.org/TR/SVG2/pservers.html#MeshGradients"/> + <html:link rel="match" href="meshgradient-complex-001-ref.png" /> + </g> + + <style id="test-font" type="text/css"> + /* Standard Font (if needed). */ + @font-face { + font-family: FreeSans; + src: url("../fonts/FreeSans.woff") format("woff"); + } + text { + font-family: FreeSans, sans-serif; + text-anchor: middle; + fill: black; + } + #title { + font-size: 24px; + } + .label { + font-size: 18px; + } + </style> + + <defs> + <meshgradient id="PatchPaintOrder" x="120" y="110" gradientUnits="userSpaceOnUse"> + <meshrow> + <meshpatch> + <stop + style="stop-color:#0000ff" + path="c 53.3333,0 250,0 250,20" /> + <stop + style="stop-color:#00ff00" + path="c 0,40 0,60 0,100" /> + <stop + style="stop-color:#ffff00" + path="c 0,-20 -196.667,-20 -250,-20" /> + <stop + style="stop-color:#00ff00" + path="c 0,-40 0,-60 0,-100" /> + </meshpatch> + <meshpatch> + <stop + path="c 0,20 -210,0 -140,20" /> + <stop + style="stop-color:#ffff00" + path="c 0,40 0,60 0,100" /> + <stop + style="stop-color:#0000ff" + path="c -70,-20 140,0 140,-20" /> + </meshpatch> + </meshrow> + <meshrow> + <meshpatch> + <stop + path="c 0,40 0,60 0,100" /> + <stop + style="stop-color:#0000ff" + path="c 0,-20 -196.667,-20 -250,-20" /> + <stop + style="stop-color:#ffff00" + path="c 0,-40 0,-60 0,-100" /> + </meshpatch> + <meshpatch> + <stop + path="c 0,40 0,60 0,100" /> + <stop + style="stop-color:#00ff00" + path="c -70,-20 140,0 140,-20" /> + </meshpatch> + </meshrow> + </meshgradient> + </defs> + + <g id="test-body-content"> + <rect x="80" y="110" width="320" height="240" style="fill:url(#PatchPaintOrder)" /> + </g> + +</svg> diff --git a/testing/web-platform/tests/svg/pservers/reftests/pattern-inheritance-not-in-rendertree-01.tentative.svg b/testing/web-platform/tests/svg/pservers/reftests/pattern-inheritance-not-in-rendertree-01.tentative.svg new file mode 100644 index 0000000000..1a6d0a0b32 --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/pattern-inheritance-not-in-rendertree-01.tentative.svg @@ -0,0 +1,13 @@ +<svg xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:h="http:/www.w3.org/1999/xhtml"> + <title><pattern> (without content) inheriting from a <pattern> in an invalid context</title> + <h:link rel="match" href="reference/green-100x100.svg"/> + <pattern id="pattern1" xlink:href="#pattern0" width="1" height="1"/> + <rect width="100" height="100" fill="url(#pattern1) green"/> + <text> + <pattern id="pattern0"> + <rect width="100" height="100" fill="orange"/> + </pattern> + </text> +</svg> diff --git a/testing/web-platform/tests/svg/pservers/reftests/pattern-inheritance-not-in-rendertree-02.tentative.svg b/testing/web-platform/tests/svg/pservers/reftests/pattern-inheritance-not-in-rendertree-02.tentative.svg new file mode 100644 index 0000000000..961d069e08 --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/pattern-inheritance-not-in-rendertree-02.tentative.svg @@ -0,0 +1,15 @@ +<svg xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:h="http:/www.w3.org/1999/xhtml"> + <title><pattern> (with content) inheriting from a <pattern> in an invalid context</title> + <h:link rel="match" href="reference/green-100x100.svg"/> + <pattern id="pattern1" xlink:href="#pattern0" width="1" height="1"> + <rect width="100" height="100" fill="green"/> + </pattern> + <rect width="100" height="100" fill="url(#pattern1) yellow"/> + <text> + <pattern id="pattern0"> + <rect width="100" height="100" fill="orange"/> + </pattern> + </text> +</svg> diff --git a/testing/web-platform/tests/svg/pservers/reftests/pattern-inheritance-template-pattern-removed.svg b/testing/web-platform/tests/svg/pservers/reftests/pattern-inheritance-template-pattern-removed.svg new file mode 100644 index 0000000000..b80f81095a --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/pattern-inheritance-template-pattern-removed.svg @@ -0,0 +1,23 @@ +<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml" + class="reftest-wait"> + <title>SVG Pattern: Inherited pattern removed after style change</title> + <h:link rel="help" href="https://svgwg.org/svg2-draft/pservers.html"/> + <h:link rel="match" href="reference/green-100x100.svg"/> + <h:script src="/common/rendering-utils.js"/> + <h:script src="/common/reftest-wait.js"/> + <pattern id="pattern" width="1" height="1"> + <rect width="100" height="100" fill="orange"/> + </pattern> + <pattern id="inheritedPattern" href="#pattern"/> + <rect width="100" height="100" fill="url(#inheritedPattern) green"/> + <script> + waitForAtLeastOneFrame().then(() => { + let svg = document.querySelector('svg'); + let pattern = document.getElementById("pattern"); + svg.style.imageRendering = 'pixelated'; + getComputedStyle(svg).imageRendering; + pattern.remove(); + takeScreenshot(); + }); + </script> +</svg> diff --git a/testing/web-platform/tests/svg/pservers/reftests/pattern-opacity-01.svg b/testing/web-platform/tests/svg/pservers/reftests/pattern-opacity-01.svg new file mode 100644 index 0000000000..eb2d2d7e9a --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/pattern-opacity-01.svg @@ -0,0 +1,14 @@ +<svg xmlns="http://www.w3.org/2000/svg" xmlns:html="http://www.w3.org/1999/xhtml"> + <g id="testmeta"> + <title>Pattern: fill-opacity</title> + <html:link rel="help" + href="https://www.w3.org/TR/SVG2/pservers.html#Patterns"/> + <html:link rel="match" href="reference/pattern-opacity-01-ref.svg"/> + </g> + <defs> + <pattern id="pattern" width='1' height='1' patternContentUnits="objectBoundingBox">> + <rect fill="lime" width="1" height="1"/> + </pattern> + </defs> + <rect width="100%" height="100%" fill-opacity="0.5" fill="url(#pattern)"/> +</svg> diff --git a/testing/web-platform/tests/svg/pservers/reftests/pattern-text-01.svg b/testing/web-platform/tests/svg/pservers/reftests/pattern-text-01.svg new file mode 100644 index 0000000000..16c053590d --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/pattern-text-01.svg @@ -0,0 +1,21 @@ +<svg height="100px" width="100px" viewBox="0 0 1000 300" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml"> + <metadata> + <h:title>pattern on text elements</h:title> + <h:link rel="help" href="https://www.w3.org/TR/SVG2/pservers.html#Patterns"/> + <h:link rel="match" href="reference/green-100x100.svg"/> + <h:link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> + </metadata> + <defs> + <pattern id="green" width="10%" height="10%" patternUnits="userSpaceOnUse"> + <rect width="8%" height="8%" fill="green"/> + </pattern> + <pattern id="red" width="10%" height="10%" patternUnits="userSpaceOnUse"> + <rect x="0.5%" y="0.5%" width="7%" height="7%" fill="red"/> + </pattern> + </defs> + <rect fill="green" width="1000" height="300"/> + + <!-- the text should be covered by the rect that follows --> + <text fill="url(#red)" font-family="Ahem" font-size="100px" x="50" y="150">XXXXXXXX</text> + <rect fill="url(#green)" width="1000" height="300"/> +</svg> diff --git a/testing/web-platform/tests/svg/pservers/reftests/pattern-transform-01.svg b/testing/web-platform/tests/svg/pservers/reftests/pattern-transform-01.svg new file mode 100644 index 0000000000..e3db18f2ed --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/pattern-transform-01.svg @@ -0,0 +1,15 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 2" xmlns:html="http://www.w3.org/1999/xhtml"> + <g id="testmeta"> + <title>Pattern: with patternTransform</title> + <html:link rel="help" + href="https://www.w3.org/TR/SVG2/pservers.html#Patterns"/> + <html:link rel="match" href="reference/pattern-transform-01-ref.svg"/> + </g> + <defs> + <pattern id="pattern" patternTransform="translate(.5 .5)" patternUnits="userSpaceOnUse" width="2" height="2"> + <path d="M0 0h1v1H0zM1 1h1v1H1z" /> + </pattern> + </defs> + <rect width="2" height="2" fill="url(#pattern)" /> +</svg> + diff --git a/testing/web-platform/tests/svg/pservers/reftests/pattern-viewbox-01.svg b/testing/web-platform/tests/svg/pservers/reftests/pattern-viewbox-01.svg new file mode 100644 index 0000000000..618b8fc29e --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/pattern-viewbox-01.svg @@ -0,0 +1,17 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 5669 5669" xmlns:html="http://www.w3.org/1999/xhtml"> + <g id="testmeta"> + <title>Pattern: viewBox with x offset</title> + <html:link rel="help" + href="https://www.w3.org/TR/SVG2/pservers.html#Patterns"/> + <html:link rel="match" href="reference/pattern-viewbox-01-ref.svg"/> + </g> + <pattern width="2258.997" height="1289.823" patternUnits="userSpaceOnUse" id="pattern" + viewBox="752.999 0 2258.997 1289.823" patternTransform="scale(0.5)"> + <g transform="translate(0,1934.735)" fill="none" stroke="black" stroke-width="10"> + <rect x="752.999" y="-1934.735" width="2258.997" height="1289.823"/> + <circle cx="1882.4975" cy="-1289.8235" r="644.9115"/> + </g> + </pattern> + <rect width="100%" height="100%" fill="url(#pattern)"/> +</svg> + diff --git a/testing/web-platform/tests/svg/pservers/reftests/radialgradient-basic-002-ref.svg b/testing/web-platform/tests/svg/pservers/reftests/radialgradient-basic-002-ref.svg new file mode 100644 index 0000000000..26f4f508f3 --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/radialgradient-basic-002-ref.svg @@ -0,0 +1,50 @@ +<svg id="svg-root" + width="100%" height="100%" viewBox="0 0 480 360" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:html="http://www.w3.org/1999/xhtml"> + <g id="testmeta"> + <title>Radial gradient: Basic three stop gradient with 'fr'.</title> + <html:link rel="author" + title="Tavmjong Bah" + href="http://tavmjong.free.fr"/> + </g> + + <style id="test-font" type="text/css"> + /* Standard Font (if needed). */ + @font-face { + font-family: FreeSans; + src: url("../fonts/FreeSans.woff") format("woff"); + } + text { + font-family: FreeSans, sans-serif; + text-anchor: middle; + fill: black; + } + #title { + font-size: 24px; + } + .label { + font-size: 18px; + } + </style> + + <defs> + <radialGradient id="RadialGradient1" gradientUnits="userSpaceOnUse" cx="120" cy="240" fx="120" fy="240" r="100"> + <stop style="stop-color:#0000ff" offset="50%"/> + <stop style="stop-color:#00ffff" offset="75%"/> + <stop style="stop-color:#ffff00" offset="100%"/> + </radialGradient> + <radialGradient id="RadialGradient2" gradientUnits="objectBoundingBox" cx="0.5" cy="0.5" rx="0.5" y2="0.5" r="0.5"> + <stop style="stop-color:#0000ff" offset="50%"/> + <stop style="stop-color:#00ffff" offset="75%"/> + <stop style="stop-color:#ffff00" offset="100%"/> + </radialGradient> + </defs> + + <g id="test-reference" font-size="16"> + <rect x="20" y="140" width="200" height="200" style="fill:url(#RadialGradient1)" /> + <rect x="260" y="140" width="200" height="200" style="fill:url(#RadialGradient2)" /> + </g> + +</svg> diff --git a/testing/web-platform/tests/svg/pservers/reftests/radialgradient-basic-002.svg b/testing/web-platform/tests/svg/pservers/reftests/radialgradient-basic-002.svg new file mode 100644 index 0000000000..04d8d3025e --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/radialgradient-basic-002.svg @@ -0,0 +1,53 @@ +<svg id="svg-root" + width="100%" height="100%" viewBox="0 0 480 360" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:html="http://www.w3.org/1999/xhtml"> + <g id="testmeta"> + <title>Radial gradient: Basic three stop gradient with 'fr'.</title> + <html:link rel="author" + title="Tavmjong Bah" + href="http://tavmjong.free.fr"/> + <html:link rel="help" + href="https://www.w3.org/TR/SVG2/pservers.html#RadialGradients"/> + <html:link rel="match" href="radialgradient-basic-002-ref.svg" /> + </g> + + <style id="test-font" type="text/css"> + /* Standard Font (if needed). */ + @font-face { + font-family: FreeSans; + src: url("../fonts/FreeSans.woff") format("woff"); + } + text { + font-family: FreeSans, sans-serif; + text-anchor: middle; + fill: black; + } + #title { + font-size: 24px; + } + .label { + font-size: 18px; + } + </style> + + <defs> + <radialGradient id="RadialGradient1" gradientUnits="userSpaceOnUse" cx="120" cy="240" fx="120" fy="240" r="100" fr="50"> + <stop style="stop-color:#0000ff" offset="0%"/> + <stop style="stop-color:#00ffff" offset="50%"/> + <stop style="stop-color:#ffff00" offset="100%"/> + </radialGradient> + <radialGradient id="RadialGradient2" gradientUnits="objectBoundingBox" cx="0.5" cy="0.5" rx="0.5" y2="0.5" r="0.5" fr="0.25"> + <stop style="stop-color:#0000ff" offset="0%"/> + <stop style="stop-color:#00ffff" offset="50%"/> + <stop style="stop-color:#ffff00" offset="100%"/> + </radialGradient> + </defs> + + <g id="test-body-content" font-size="16"> + <rect x="20" y="140" width="200" height="200" style="fill:url(#RadialGradient1)" /> + <rect x="260" y="140" width="200" height="200" style="fill:url(#RadialGradient2)" /> + </g> + +</svg> diff --git a/testing/web-platform/tests/svg/pservers/reftests/radialgradient-fully-overlapping.svg b/testing/web-platform/tests/svg/pservers/reftests/radialgradient-fully-overlapping.svg new file mode 100644 index 0000000000..5b5f7bd4c8 --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/radialgradient-fully-overlapping.svg @@ -0,0 +1,16 @@ +<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml"> + <title>Radial gradient with overlapping start and end circles</title> + <metadata> + <h:link rel="help" href="https://svgwg.org/svg2-draft/pservers.html#RadialGradientNotes"/> + <h:link rel="match" href="reference/green-100x100.svg"/> + <h:meta name="assert" content="If the start circle fully overlaps with the end circle, the gradient should be drawn."/> + </metadata> + + <rect width="100" height="100" fill="red"/> + + <radialGradient id="fully_overlapping" r="100" fr="100"> + <stop stop-color="green"/> + <stop stop-color="green" offset="1"/> + </radialGradient> + <rect width="100" height="100" fill="url(#fully_overlapping) orange"/> +</svg> diff --git a/testing/web-platform/tests/svg/pservers/reftests/reference/green-100x100.svg b/testing/web-platform/tests/svg/pservers/reftests/reference/green-100x100.svg new file mode 100644 index 0000000000..120941444a --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/reference/green-100x100.svg @@ -0,0 +1,3 @@ +<svg xmlns="http://www.w3.org/2000/svg"> + <rect width="100" height="100" fill="green"/> +</svg> diff --git a/testing/web-platform/tests/svg/pservers/reftests/reference/pattern-opacity-01-ref.svg b/testing/web-platform/tests/svg/pservers/reftests/reference/pattern-opacity-01-ref.svg new file mode 100644 index 0000000000..1c9c68bd9d --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/reference/pattern-opacity-01-ref.svg @@ -0,0 +1,3 @@ +<svg xmlns="http://www.w3.org/2000/svg"> + <rect width="100%" height="100%" fill-opacity="0.5" fill="lime"/> +</svg> diff --git a/testing/web-platform/tests/svg/pservers/reftests/reference/pattern-transform-01-ref.svg b/testing/web-platform/tests/svg/pservers/reftests/reference/pattern-transform-01-ref.svg new file mode 100644 index 0000000000..9ac036177b --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/reference/pattern-transform-01-ref.svg @@ -0,0 +1,8 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0.5 0.5 2 2" xmlns:html="http://www.w3.org/1999/xhtml"> + <defs> + <pattern id="pattern" patternUnits="userSpaceOnUse" width="2" height="2"> + <path d="M0 0h1v1H0zM1 1h1v1H1z" /> + </pattern> + </defs> + <rect x="0.5" y="0.5" width="2" height="2" fill="url(#pattern)" /> +</svg> diff --git a/testing/web-platform/tests/svg/pservers/reftests/reference/pattern-viewbox-01-ref.svg b/testing/web-platform/tests/svg/pservers/reftests/reference/pattern-viewbox-01-ref.svg new file mode 100644 index 0000000000..c9f6931dea --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/reference/pattern-viewbox-01-ref.svg @@ -0,0 +1,10 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 5669 5669"> + <pattern width="2258.997" height="1289.823" patternUnits="userSpaceOnUse" id="pattern" + viewBox="0 0 2258.997 1289.823" patternTransform="scale(0.5)"> + <g transform="translate(-752.999, 1934.735)" fill="none" stroke="black" stroke-width="10"> + <rect x="752.999" y="-1934.735" width="2258.997" height="1289.823"/> + <circle cx="1882.4975" cy="-1289.8235" r="644.9115"/> + </g> + </pattern> + <rect width="100%" height="100%" fill="url(#pattern)"/> +</svg> diff --git a/testing/web-platform/tests/svg/pservers/reftests/stop-color-currentcolor-dynamic-001.svg b/testing/web-platform/tests/svg/pservers/reftests/stop-color-currentcolor-dynamic-001.svg new file mode 100644 index 0000000000..da0a05dd87 --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/reftests/stop-color-currentcolor-dynamic-001.svg @@ -0,0 +1,18 @@ +<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml" + style="color: red"> + <title>stop-color: Dynamically changing 'color' for a gradient with a stop with 'currentcolor'</title> + <h:link rel="help" href="https://svgwg.org/svg2-draft/pservers.html#StopColorProperty"/> + <h:link rel="match" href="reference/green-100x100.svg"/> + <linearGradient id="g"> + <stop stop-color="currentcolor"/> + </linearGradient> + <rect width="50" height="100" fill="url(#g)"/> + <rect width="50" height="100" x="50" fill="currentcolor"/> + <script> + <![CDATA[ + let root = document.querySelector(':root'); + root.getBoundingClientRect(); // Force layout + root.style.color = 'green'; + ]]> + </script> +</svg> diff --git a/testing/web-platform/tests/svg/pservers/scripted/stop-color-inheritance-currentcolor.svg b/testing/web-platform/tests/svg/pservers/scripted/stop-color-inheritance-currentcolor.svg new file mode 100644 index 0000000000..22bf513c86 --- /dev/null +++ b/testing/web-platform/tests/svg/pservers/scripted/stop-color-inheritance-currentcolor.svg @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml" + color="red"> + <title>SVG Paint Servers: 'stop-color' inheritance of 'currentcolor'</title> + <metadata> + <h:link rel="help" href="https://svgwg.org/svg2-draft/pservers.html#StopColorProperty"/> + <h:link rel="help" href="https://drafts.csswg.org/css-color/#resolve-color-values"/> + </metadata> + <h:script src="/resources/testharness.js"/> + <h:script src="/resources/testharnessreport.js"/> + <linearGradient stop-color="currentcolor" id="g"> + <stop stop-color="inherit" color="green"/> + </linearGradient> + <script><![CDATA[ + + test(function() { + let stop = document.querySelector('stop'); + assert_equals(getComputedStyle(stop).stopColor, 'rgb(0, 128, 0)'); + }, '"currentcolor" is inherited as a keyword'); + + ]]></script> +</svg> |