Bug 1774718 [wpt PR 34480] - Reland "Implementing grid-template-columns/rows interpolation support", a=testonly

Automatic update from web-platform-tests
Reland "Implementing grid-template-columns/rows interpolation support"

This is a reland of commit b266b143ec994a7a97349cd2d54e18f52bf9534f

It was reverted due to failures in MSAN builds: https://crrev.com/c/3704863. The variable |progress_| in InterpolableGridTrackList was uninitialized, resulting in crashes in Add(...) and RawClone().

Original change's description:
> Implementing grid-template-columns/rows interpolation support
>
> This CL adds new interpolation types to represent grid track lists and
> their track sizes, allowing interpolation of grid-template-columns and
> grid-template-rows. A more detailed explanation of the design can be
> found in this doc: https://docs.google.com/document/d/1byO4UU-gFRNrqAEuhL3AKgUuFprz4ZQYNEeXSF9T6w0/edit?usp=sharing
>
> Bug: 759665
> Change-Id: Iecef825cd843c60bf6268cdbfc2f9180c884f853
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3403003
> Reviewed-by: Ethan Jimenez <ethavar@microsoft.com>
> Commit-Queue: Ana Sollano Kim <ansollan@microsoft.com>
> Reviewed-by: Robert Flack <flackr@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1013983}

Bug: 759665
Change-Id: I71aba0c2be7e4cd56aa92521b9b0008ab25c0ed6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3705054
Commit-Queue: Ana Sollano Kim <ansollan@microsoft.com>
Reviewed-by: Robert Flack <flackr@chromium.org>
Reviewed-by: Daniel Libby <dlibby@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1015433}

--

wpt-commits: 97330944a2b19338d3f58955adb3250cf4b5279e
wpt-pr: 34480
This commit is contained in:
Ana SollanoKim 2022-06-21 10:00:07 +00:00 committed by moz-wptsync-bot
parent 83571b72c8
commit 4beba6b368
8 changed files with 212 additions and 0 deletions

View File

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>grid-template-columns neutral keyframe</title>
<link rel="help" href="https://drafts.csswg.org/css-grid/#track-sizing">
<meta name="assert" content="grid-template-columns supports neutral keyframe.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/interpolation-testcommon.js"></script>
</head>
<body>
<div id="target"></div>
<script>
test(() => {
target.style.gridTemplateColumns = '1fr 200px';
var animation = target.animate([{}, {gridTemplateColumns: '30px 300px'}], 1000);
animation.pause();
animation.currentTime = 500;
assert_equals(getComputedStyle(target).gridTemplateColumns, '30px 250px');
target.style.gridTemplateColumns = '20px 200px';
assert_equals(getComputedStyle(target).gridTemplateColumns, '25px 250px');
}, 'Invalidate the result for the neutral keyframe if the value of the <track-breadth> changes.');
</script>
</body>
</html>

View File

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>grid-template-columns neutral keyframe</title>
<link rel="help" href="https://drafts.csswg.org/css-grid/#track-sizing">
<meta name="assert" content="grid-template-columns supports neutral keyframe.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/interpolation-testcommon.js"></script>
</head>
<body>
<div id="target"></div>
<script>
test(() => {
target.style.gridTemplateColumns = '10px minmax(10px, 1fr)';
var animation = target.animate([{}, {gridTemplateColumns: '30px minmax(30px, 3fr)'}], 1000);
animation.pause();
animation.currentTime = 500;
assert_equals(getComputedStyle(target).gridTemplateColumns, '20px minmax(20px, 2fr)');
target.style.gridTemplateColumns = '10px fit-content(10px)';
assert_equals(getComputedStyle(target).gridTemplateColumns, '20px minmax(30px, 3fr)');
}, 'Invalidate the result for the neutral keyframe if the type of <track-size> changes.');
</script>
</body>
</html>

View File

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>grid-template-columns neutral keyframe</title>
<link rel="help" href="https://drafts.csswg.org/css-grid/#track-sizing">
<meta name="assert" content="grid-template-columns supports neutral keyframe.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/interpolation-testcommon.js"></script>
</head>
<body>
<div id="target"></div>
<script>
test(() => {
target.style.gridTemplateColumns = '200px';
var animation = target.animate([{}, {gridTemplateColumns: '30px 300px'}], 1000);
animation.pause();
animation.currentTime = 500;
assert_equals(getComputedStyle(target).gridTemplateColumns, '30px 300px');
target.style.gridTemplateColumns = '20px 200px';
assert_equals(getComputedStyle(target).gridTemplateColumns, '25px 250px');
target.style.gridTemplateColumns = '200px';
assert_equals(getComputedStyle(target).gridTemplateColumns, '30px 300px');
}, 'Invalidate the result for the neutral keyframe if the size of the list changes.');
</script>
</body>
</html>

View File

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>grid-template-columns neutral keyframe</title>
<link rel="help" href="https://drafts.csswg.org/css-grid/#track-sizing">
<meta name="assert" content="grid-template-columns supports neutral keyframe.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/interpolation-testcommon.js"></script>
</head>
<body>
<div id="target"></div>
<script>
test(() => {
target.style.gridTemplateColumns = '10px [a] 20px [b]';
var animation = target.animate([{}, {gridTemplateColumns: '30px 40px [c]'}], 1000);
animation.pause();
animation.currentTime = 250;
assert_equals(getComputedStyle(target).gridTemplateColumns, '15px [a] 25px [b]');
target.style.gridTemplateColumns = '10px 20px [d]';
assert_equals(getComputedStyle(target).gridTemplateColumns, '15px 25px [d]');
}, 'Invalidate the result for the neutral keyframe if the named lines change.');
</script>
</body>
</html>

View File

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>grid-template-rows neutral keyframe</title>
<link rel="help" href="https://drafts.csswg.org/css-grid/#track-sizing">
<meta name="assert" content="grid-template-rows supports neutral keyframe.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/interpolation-testcommon.js"></script>
</head>
<body>
<div id="target"></div>
<script>
test(() => {
target.style.gridTemplateRows = '1fr 200px';
var animation = target.animate([{}, {gridTemplateRows: '30px 300px'}], 1000);
animation.pause();
animation.currentTime = 500;
assert_equals(getComputedStyle(target).gridTemplateRows, '30px 250px');
target.style.gridTemplateRows = '20px 200px';
assert_equals(getComputedStyle(target).gridTemplateRows, '25px 250px');
}, 'Invalidate the result for the neutral keyframe if the value of the <track-breadth> changes.');
</script>
</body>
</html>

View File

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>grid-template-rows neutral keyframe</title>
<link rel="help" href="https://drafts.csswg.org/css-grid/#track-sizing">
<meta name="assert" content="grid-template-rows supports neutral keyframe.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/interpolation-testcommon.js"></script>
</head>
<body>
<div id="target"></div>
<script>
test(() => {
target.style.gridTemplateRows = '10px minmax(10px, 1fr)';
var animation = target.animate([{}, {gridTemplateRows: '30px minmax(30px, 3fr)'}], 1000);
animation.pause();
animation.currentTime = 500;
assert_equals(getComputedStyle(target).gridTemplateRows, '20px minmax(20px, 2fr)');
target.style.gridTemplateRows = '10px fit-content(10px)';
assert_equals(getComputedStyle(target).gridTemplateRows, '20px minmax(30px, 3fr)');
}, 'Invalidate the result for the neutral keyframe if the type of <track-size> changes.');
</script>
</body>
</html>

View File

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>grid-template-rows neutral keyframe</title>
<link rel="help" href="https://drafts.csswg.org/css-grid/#track-sizing">
<meta name="assert" content="grid-template-rows supports neutral keyframe.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/interpolation-testcommon.js"></script>
</head>
<body>
<div id="target"></div>
<script>
test(() => {
target.style.gridTemplateRows = '200px';
var animation = target.animate([{}, {gridTemplateRows: '30px 300px'}], 1000);
animation.pause();
animation.currentTime = 500;
assert_equals(getComputedStyle(target).gridTemplateRows, '30px 300px');
target.style.gridTemplateRows = '20px 200px';
assert_equals(getComputedStyle(target).gridTemplateRows, '25px 250px');
target.style.gridTemplateRows = '200px';
assert_equals(getComputedStyle(target).gridTemplateRows, '30px 300px');
}, 'Invalidate the result for the neutral keyframe if the size of the list changes.');
</script>
</body>
</html>

View File

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>grid-template-rows neutral keyframe</title>
<link rel="help" href="https://drafts.csswg.org/css-grid/#track-sizing">
<meta name="assert" content="grid-template-rows supports neutral keyframe.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/interpolation-testcommon.js"></script>
</head>
<body>
<div id="target"></div>
<script>
test(() => {
target.style.gridTemplateRows = '10px [a] 20px [b]';
var animation = target.animate([{}, {gridTemplateRows: '30px 40px [c]'}], 1000);
animation.pause();
animation.currentTime = 250;
assert_equals(getComputedStyle(target).gridTemplateRows, '15px [a] 25px [b]');
target.style.gridTemplateRows = '10px 20px [d]';
assert_equals(getComputedStyle(target).gridTemplateRows, '15px 25px [d]');
}, 'Invalidate the result for the neutral keyframe if the named lines change.');
</script>
</body>
</html>