commit 528d6cc125efbf57cddd460d0e32131954cb2135
parent 26ed023f4d25db53b8cf3f9150fc75d1e8280f01
Author: Fredrik Söderquist <fs@opera.com>
Date: Sat, 22 Nov 2025 21:13:00 +0000
Bug 2001674 [wpt PR 56187] - Move animations/composition/font-*-composition.html to WPT, a=testonly
Automatic update from web-platform-tests
Move animations/composition/font-*-composition.html to WPT
Move the tests and perform a mechanical rewrite:
* Change assertComposition() to test_composition().
* Change 'is' to 'expect' in the expectation objects.
* Include required testharness.js and framework.
* Add links to spec.
Bug: 40663834
Change-Id: Id48b2c2f715a27340301b2f06504e3da5df062ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7185645
Auto-Submit: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Kevin Ellis <kevers@chromium.org>
Reviewed-by: Kevin Ellis <kevers@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1548519}
--
wpt-commits: d29bb343862aa95d658fe8f93d3221a8908106de
wpt-pr: 56187
Diffstat:
2 files changed, 129 insertions(+), 0 deletions(-)
diff --git a/testing/web-platform/tests/css/css-fonts/animations/font-size-composition.html b/testing/web-platform/tests/css/css-fonts/animations/font-size-composition.html
@@ -0,0 +1,93 @@
+<!DOCTYPE html>
+<meta charset="UTF-8">
+<title>font-size composition</title>
+<link rel="help" href="https://drafts.csswg.org/css-fonts-3/#propdef-font-size">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/interpolation-testcommon.js"></script>
+<style>
+:root {
+ font-size: 30px;
+}
+.parent {
+ font-size: 20px;
+}
+</style>
+<body>
+<script>
+test_composition({
+ property: 'font-size',
+ underlying: '50px',
+ addFrom: '100px',
+ addTo: '200px',
+}, [
+ {at: -0.3, expect: '120px'},
+ {at: 0, expect: '150px'},
+ {at: 0.25, expect: '175px'},
+ {at: 0.5, expect: '200px'},
+ {at: 0.75, expect: '225px'},
+ {at: 1, expect: '250px'},
+ {at: 1.5, expect: '300px'},
+]);
+
+test_composition({
+ property: 'font-size',
+ underlying: '100px',
+ addFrom: '10px',
+ addTo: 'large',
+}, [
+ {at: -0.5, expect: '106px'},
+ {at: 0, expect: '110px'},
+ {at: 0.25, expect: '112px'},
+ {at: 0.5, expect: '114px'},
+ {at: 0.75, expect: '116px'},
+ {at: 1, expect: '118px'},
+ {at: 1.5, expect: '122px'},
+]);
+
+test_composition({
+ property: 'font-size',
+ underlying: '50%',
+ addFrom: 'small',
+ addTo: '20px',
+}, [
+ {at: -0.3, expect: '20.9px'},
+ {at: 0, expect: '23px'},
+ {at: 0.25, expect: '24.75px'},
+ {at: 0.5, expect: '26.5px'},
+ {at: 0.75, expect: '28.25px'},
+ {at: 1, expect: '30px'},
+ {at: 1.5, expect: '33.5px'},
+]);
+
+test_composition({
+ property: 'font-size',
+ underlying: '20%',
+ addFrom: '10rem',
+ replaceTo: '5em',
+}, [
+ {at: -0.3, expect: '365.2px'},
+ {at: 0, expect: '304px'},
+ {at: 0.25, expect: '253px'},
+ {at: 0.5, expect: '202px'},
+ {at: 0.75, expect: '151px'},
+ {at: 1, expect: '100px'},
+ {at: 1.5, expect: '0px'},
+]);
+
+test_composition({
+ property: 'font-size',
+ underlying: 'small',
+ replaceFrom: 'medium',
+ addTo: 'larger',
+}, [
+ {at: -0.3, expect: '9.7px'},
+ {at: 0, expect: '16px'},
+ {at: 0.25, expect: '21.25px'},
+ {at: 0.5, expect: '26.5px'},
+ {at: 0.75, expect: '31.75px'},
+ {at: 1, expect: '37px'},
+ {at: 1.5, expect: '47.5px'},
+]);
+</script>
+</body>
diff --git a/testing/web-platform/tests/css/css-fonts/animations/font-weight-composition.html b/testing/web-platform/tests/css/css-fonts/animations/font-weight-composition.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<meta charset="UTF-8">
+<title>font-weight composition</title>
+<link rel="help" href="https://drafts.csswg.org/css-fonts-3/#propdef-font-weight">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/interpolation-testcommon.js"></script>
+<body>
+<script>
+test_composition({
+ property: 'font-weight',
+ underlying: '500',
+ addFrom: '100',
+ addTo: '500',
+}, [
+ {at: -0.3, expect: '480'},
+ {at: 0, expect: '600'},
+ {at: 0.5, expect: '800'},
+ {at: 1, expect: '1000'},
+ {at: 1.5, expect: '1000'},
+]);
+
+test_composition({
+ property: 'font-weight',
+ underlying: '200',
+ addFrom: '600',
+ replaceTo: '500',
+}, [
+ {at: -0.3, expect: '889.75'},
+ {at: 0, expect: '800'},
+ {at: 0.5, expect: '650'},
+ {at: 1, expect: '500'},
+ {at: 1.5, expect: '350'},
+]);
+</script>
+</body>