forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support animating <integer> custom properties
This patch adds support for animating custom properties registered with the <integer> syntax. Spec: https://drafts.css-houdini.org/css-properties-values-api/#supported-syntax-strings BUG: 671904 Change-Id: I9696f0da0ab7f0f82af65ad59a9dc415c576b3be Reviewed-on: https://chromium-review.googlesource.com/544358 Commit-Queue: Alan Cutter <alancutter@chromium.org> Reviewed-by: Suzy Howlett <suzyh@chromium.org> Cr-Commit-Position: refs/heads/master@{#482549}
- Loading branch information
1 parent
9cdf143
commit 0ebef0f
Showing
5 changed files
with
121 additions
and
3 deletions.
There are no files selected for viewing
94 changes: 94 additions & 0 deletions
94
third_party/WebKit/LayoutTests/animations/custom-properties/integer-type-interpolation.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<!DOCTYPE html> | ||
<meta charset="UTF-8"> | ||
<style> | ||
.parent { | ||
--integer: 30; | ||
} | ||
.target { | ||
--integer: 10; | ||
} | ||
</style> | ||
<body> | ||
<script src="../interpolation/resources/interpolation-test.js"></script> | ||
<script> | ||
CSS.registerProperty({ | ||
name: '--integer', | ||
syntax: '<integer>', | ||
initialValue: '40', | ||
}); | ||
|
||
assertInterpolation({ | ||
property: '--integer', | ||
from: neutralKeyframe, | ||
to: '20', | ||
}, [ | ||
{at: -0.3, is: '7'}, | ||
{at: 0, is: '10'}, | ||
{at: 0.5, is: '15'}, | ||
{at: 1, is: '20'}, | ||
{at: 1.5, is: '25'}, | ||
]); | ||
|
||
assertInterpolation({ | ||
property: '--integer', | ||
from: 'initial', | ||
to: '20', | ||
}, [ | ||
{at: -0.3, is: '46'}, | ||
{at: 0, is: '40'}, | ||
{at: 0.5, is: '30'}, | ||
{at: 1, is: '20'}, | ||
{at: 1.5, is: '10'}, | ||
]); | ||
|
||
assertInterpolation({ | ||
property: '--integer', | ||
from: 'inherit', | ||
to: '20', | ||
}, [ | ||
{at: -0.3, is: '33'}, | ||
{at: 0, is: '30'}, | ||
{at: 0.5, is: '25'}, | ||
{at: 1, is: '20'}, | ||
{at: 1.5, is: '15'}, | ||
]); | ||
|
||
assertInterpolation({ | ||
property: '--integer', | ||
from: 'unset', | ||
to: '20', | ||
}, [ | ||
{at: -0.3, is: '46'}, | ||
{at: 0, is: '40'}, | ||
{at: 0.5, is: '30'}, | ||
{at: 1, is: '20'}, | ||
{at: 1.5, is: '10'}, | ||
]); | ||
|
||
assertInterpolation({ | ||
property: '--integer', | ||
from: '-10', | ||
to: '10', | ||
}, [ | ||
{at: -0.3, is: '-16'}, | ||
{at: 0, is: '-10'}, | ||
{at: 0.5, is: '0'}, | ||
{at: 1, is: '10'}, | ||
{at: 1.5, is: '20'} | ||
]); | ||
|
||
assertInterpolation({ | ||
property: '--integer', | ||
from: '10', | ||
to: '15', | ||
}, [ | ||
{at: -0.3, is: '9'}, | ||
{at: 0, is: '10'}, | ||
{at: 0.25, is: '11'}, | ||
{at: 0.5, is: '13'}, | ||
{at: 0.75, is: '14'}, | ||
{at: 1, is: '15'}, | ||
{at: 1.5, is: '18'} | ||
]); | ||
</script> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters