Automatic update from web-platform-tests [SVG] Change `path-length` CSS property from <number> to <length> Per the CSSWG resolution [1], change the `path-length` syntax from `none | <number [0,inf]>` to `none | <length [0,inf]>`, allowing it to be composed with `calc()`. The value is stored as a `Length` (default `Length::None()`), with interpolation moved to the `<length>` group. The stored length is in zoomed pixels, so `AuthorPathLength()` divides out the effective zoom to keep the author-specified value stable across zoom levels. The feature remains behind the experimental `SvgPathLengthCssProperty` flag and is not shipped. [1] https://github.com/w3c/csswg-drafts/issues/13901 https://github.com/w3c/svgwg/pull/1118 Bug: 1045430 Change-Id: I0c5a72c05e87844f3185ed91f290eb1daee02f1a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7870411 Reviewed-by: Fredrik Söderquist <fs@opera.com> Commit-Queue: Virali Purbey <viralipurbey@microsoft.com> Cr-Commit-Position: refs/heads/main@{#1655740} -- wpt-commits: c331d056e3065d8fa4dbc93a073da2c4afed1d27 wpt-pr: 61020
35 lines
1.1 KiB
HTML
35 lines
1.1 KiB
HTML
<!doctype html>
|
|
<title>SMIL from-to animation of the 'pathLength' attribute</title>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>
|
|
<svg>
|
|
<path id="path" d="M0,0 L100,0" pathLength="100">
|
|
<animate id="animation" attributeName="pathLength" attributeType="CSS"
|
|
begin="0s" dur="4s" from="100" to="200" fill="freeze"/>
|
|
</path>
|
|
</svg>
|
|
<script>
|
|
const rootSVGElement = document.querySelector("svg");
|
|
|
|
function checkPathLength(expected) {
|
|
return () => {
|
|
assert_equals(
|
|
getComputedStyle(path).getPropertyValue('path-length'),
|
|
`${expected}px`);
|
|
};
|
|
}
|
|
|
|
smil_async_test((t) => {
|
|
const expectedValues = [
|
|
// [animationId, time, sampleCallback]
|
|
["animation", 0.0, checkPathLength(100)],
|
|
["animation", 1.0, checkPathLength(125)],
|
|
["animation", 2.0, checkPathLength(150)],
|
|
["animation", 3.0, checkPathLength(175)],
|
|
["animation", 4.001, checkPathLength(200)],
|
|
];
|
|
runAnimationTest(t, expectedValues);
|
|
});
|
|
</script>
|