Skip to content

Commit

Permalink
Reland "Implementing grid-template-columns/rows interpolation support"
Browse files Browse the repository at this point in the history
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 <[email protected]>
> Commit-Queue: Ana Sollano Kim <[email protected]>
> Reviewed-by: Robert Flack <[email protected]>
> 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 <[email protected]>
Reviewed-by: Robert Flack <[email protected]>
Reviewed-by: Daniel Libby <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1015433}
  • Loading branch information
Ana SollanoKim authored and chromium-wpt-export-bot committed Jun 17, 2022
1 parent 8b9da29 commit 9733094
Show file tree
Hide file tree
Showing 8 changed files with 212 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit 9733094

Please sign in to comment.