diff options
Diffstat (limited to 'testing/web-platform/tests/css/css-fill-stroke')
4 files changed, 218 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-fill-stroke/META.yml b/testing/web-platform/tests/css/css-fill-stroke/META.yml new file mode 100644 index 0000000000..237aea970a --- /dev/null +++ b/testing/web-platform/tests/css/css-fill-stroke/META.yml @@ -0,0 +1,3 @@ +spec: https://drafts.fxtf.org/fill-stroke/ +suggested_reviewers: + - tabatkins diff --git a/testing/web-platform/tests/css/css-fill-stroke/animation/fill-interpolation.html b/testing/web-platform/tests/css/css-fill-stroke/animation/fill-interpolation.html new file mode 100644 index 0000000000..aef91eb79c --- /dev/null +++ b/testing/web-platform/tests/css/css-fill-stroke/animation/fill-interpolation.html @@ -0,0 +1,130 @@ +<!DOCTYPE html> +<meta charset="UTF-8"> +<title>'fill' interpolation</title> +<link rel="help" href="https://drafts.csswg.org/css-color/#interpolation"> +<link rel="help" href="https://drafts.fxtf.org/fill-stroke/#fill-shorthand"> +<meta name="assert" content="'fill' supports animation by computed value type"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/interpolation-testcommon.js"></script> +<style> +.parent { + fill: blue; +} +.target { + display: inline-block; + font-size: 60pt; + fill: yellow; +} +.expected { + margin-right: 15px; +} +</style> +<body> + <template id="target-template">T</template> +</body> +<script> +test_interpolation({ + property: 'fill', + from: neutralKeyframe, + to: 'green', +}, [ + {at: -0.3, expect: 'rgb(255, 255, 0)'}, + {at: 0, expect: 'rgb(255, 255, 0)'}, + {at: 0.3, expect: 'rgb(179, 217, 0)'}, + {at: 0.6, expect: 'rgb(102, 179, 0)'}, + {at: 1, expect: 'rgb(0, 128, 0)'}, + {at: 1.5, expect: 'rgb(0, 65, 0)'}, +]); + +test_interpolation({ + property: 'fill', + from: 'initial', + to: 'green', +}, [ + {at: -0.3, expect: 'rgb(0, 0, 0)'}, + {at: 0, expect: 'rgb(0, 0, 0)'}, + {at: 0.3, expect: 'rgb(0, 38, 0)'}, + {at: 0.6, expect: 'rgb(0, 77, 0)'}, + {at: 1, expect: 'rgb(0, 128, 0)'}, + {at: 1.5, expect: 'rgb(0, 192, 0)'}, +]); + +test_interpolation({ + property: 'fill', + from: 'inherit', + to: 'green', +}, [ + {at: -0.3, expect: 'rgb(0, 0, 255)'}, + {at: 0, expect: 'rgb(0, 0, 255)'}, + {at: 0.3, expect: 'rgb(0, 38, 179)'}, + {at: 0.6, expect: 'rgb(0, 77, 102)'}, + {at: 1, expect: 'rgb(0, 128, 0)'}, + {at: 1.5, expect: 'rgb(0, 192, 0)'}, +]); + +test_interpolation({ + property: 'fill', + from: 'unset', + to: 'green', +}, [ + {at: -0.3, expect: 'rgb(0, 0, 255)'}, + {at: 0, expect: 'rgb(0, 0, 255)'}, + {at: 0.3, expect: 'rgb(0, 38, 179)'}, + {at: 0.6, expect: 'rgb(0, 77, 102)'}, + {at: 1, expect: 'rgb(0, 128, 0)'}, + {at: 1.5, expect: 'rgb(0, 192, 0)'}, +]); + +test_interpolation({ + property: 'fill', + from: 'black', + to: 'orange', +}, [ + {at: -0.3, expect: 'rgb(0, 0, 0)'}, + {at: 0, expect: 'rgb(0, 0, 0)'}, + {at: 0.3, expect: 'rgb(77, 50, 0)'}, + {at: 0.6, expect: 'rgb(153, 99, 0)'}, + {at: 1, expect: 'rgb(255, 165, 0)'}, + {at: 1.5, expect: 'rgb(255, 248, 0)'}, +]); + +test_interpolation({ + property: 'fill', + from: 'rgb(0 0 0)', + to: 'color(srgb 1 1 1)', +}, [ + {at: -0.3, expect: 'oklab(0 0 0)'}, + {at: 0, expect: 'oklab(0 0 0)'}, + {at: 0.3, expect: 'oklab(0.3 0 0)'}, + {at: 0.6, expect: 'oklab(0.6 0 0)'}, + {at: 1, expect: 'oklab(1 0 0)'}, + {at: 1.5, expect: 'oklab(1 0 0)'}, +]); + +test_interpolation({ + property: 'fill', + from: 'color(srgb 0 0 0)', + to: 'rgb(255 255 255)', +}, [ + {at: -0.3, expect: 'oklab(0 0 0)'}, + {at: 0, expect: 'oklab(0 0 0)'}, + {at: 0.3, expect: 'oklab(0.3 0 0)'}, + {at: 0.6, expect: 'oklab(0.6 0 0)'}, + {at: 1, expect: 'oklab(1 0 0)'}, + {at: 1.5, expect: 'oklab(1 0 0)'}, +]); + +test_interpolation({ + property: 'fill', + from: 'color(srgb 0 0 0)', + to: 'color(srgb 1 1 1)', +}, [ + {at: -0.3, expect: 'oklab(0 0 0)'}, + {at: 0, expect: 'oklab(0 0 0)'}, + {at: 0.3, expect: 'oklab(0.3 0 0)'}, + {at: 0.6, expect: 'oklab(0.6 0 0)'}, + {at: 1, expect: 'oklab(1 0 0)'}, + {at: 1.5, expect: 'oklab(1 0 0)'}, +]); +</script> diff --git a/testing/web-platform/tests/css/css-fill-stroke/paint-order-001.tentative.html b/testing/web-platform/tests/css/css-fill-stroke/paint-order-001.tentative.html new file mode 100644 index 0000000000..9d1604116b --- /dev/null +++ b/testing/web-platform/tests/css/css-fill-stroke/paint-order-001.tentative.html @@ -0,0 +1,43 @@ +<!DOCTYPE html> +<html> +<meta charset="utf-8"> +<title>webkit-text-stroke and paint-order</title> +<link rel="author" title="Jonathan Kew" href="jfkthame@gmail.com"> +<link rel="author" title="Mozilla" href="https://www.mozilla.org"> +<link rel="match" href="reference/paint-order-001-ref.tentative.html"> +<link rel="help" href="https://www.w3.org/TR/fill-stroke-3/#strokes"> +<meta name="fuzzy" content="maxDifference=0-1;totalPixels=0-5"> +<style> +span { -webkit-text-stroke: 5px orange; } +span.i { paint-order: initial; } +span.f { paint-order: fill; } +span.fs { paint-order: fill stroke; } +span.s { paint-order: stroke; } +span.sf { paint-order: stroke fill; } +</style> +<body> +<div style="font: bold 32px serif;"> + <span class="i">initial</span> + <span class="f">fill</span> + <span class="s">stroke</span> + <span class="fs">f-s</span> + <span class="sf">s-f</span> +</div> + +<div style="font: bold 64px serif;"> + <span class="i">initial</span> + <span class="f">fill</span> + <span class="s">stroke</span> + <span class="fs">f-s</span> + <span class="sf">s-f</span> +</div> + +<div style="font: bold 96px serif;"> + <span class="i">initial</span><br> + <span class="f">fill</span> + <span class="s">stroke</span><br> + <span class="fs">f-s</span> + <span class="sf">s-f</span> +</div> +<body> +<html> diff --git a/testing/web-platform/tests/css/css-fill-stroke/reference/paint-order-001-ref.tentative.html b/testing/web-platform/tests/css/css-fill-stroke/reference/paint-order-001-ref.tentative.html new file mode 100644 index 0000000000..af56147f52 --- /dev/null +++ b/testing/web-platform/tests/css/css-fill-stroke/reference/paint-order-001-ref.tentative.html @@ -0,0 +1,42 @@ +<!DOCTYPE html> +<html> +<meta charset="utf-8"> +<title>webkit-text-stroke and paint-order: reference</title> +<link rel="author" title="Jonathan Kew" href="jfkthame@gmail.com"> +<link rel="author" title="Mozilla" href="https://www.mozilla.org"> +<style> +body>div { position: relative; clear: left; float: left; } +span.f { -webkit-text-stroke: 5px orange; } +span.s, +span.sf { display: inline-block; position: relative; } +span.s::before, +span.sf::before { -webkit-text-stroke: 5px orange; position: absolute; z-index: -1; } +span.s::before { content: "stroke"; } +span.sf::before { content: "s-f"; } +</style> +<body> +<div style="font: bold 32px serif;"> + <span class="f">initial</span> + <span class="f">fill</span> + <span class="s">stroke</span> + <span class="f">f-s</span> + <span class="sf">s-f</span> +</div> + +<div style="font: bold 64px serif;"> + <span class="f">initial</span> + <span class="f">fill</span> + <span class="s">stroke</span> + <span class="f">f-s</span> + <span class="sf">s-f</span> +</div> + +<div style="font: bold 96px serif;"> + <span class="f">initial</span><br> + <span class="f">fill</span> + <span class="s">stroke</span><br> + <span class="f">f-s</span> + <span class="sf">s-f</span> +</div> +<body> +<html> |