Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2214)

Unified Diff: third_party/WebKit/LayoutTests/animations/custom-properties/length-type-interpolation.html

Issue 2658333003: Add smooth interpolation support for <length> custom properties (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/animations/custom-properties/length-type-interpolation-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/animations/custom-properties/length-type-interpolation.html
diff --git a/third_party/WebKit/LayoutTests/animations/custom-properties/length-type-interpolation.html b/third_party/WebKit/LayoutTests/animations/custom-properties/length-type-interpolation.html
new file mode 100644
index 0000000000000000000000000000000000000000..e6878e727f2b92b8614a713801ac69f7e7c3dbae
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/animations/custom-properties/length-type-interpolation.html
@@ -0,0 +1,105 @@
+<!DOCTYPE html>
+<meta charset="UTF-8">
+<style>
+.parent {
+ --length: 30px;
+}
+.target {
+ --length: 10px;
+ font-size: 20px;
+}
+</style>
+<body>
+<script src="../interpolation/resources/interpolation-test.js"></script>
+<script>
+CSS.registerProperty({
+ name: '--length',
+ syntax: '<length>',
+ initialValue: '40px',
+});
+
+assertInterpolation({
+ property: '--length',
+ from: neutralKeyframe,
+ to: '20px',
+}, [
+ {at: -0.3, is: '7px'},
+ {at: 0, is: '10px'},
+ {at: 0.5, is: '15px'},
+ {at: 1, is: '20px'},
+ {at: 1.5, is: '25px'},
+]);
+
+assertInterpolation({
+ property: '--length',
+ from: 'initial',
+ to: '20px',
+}, [
+ {at: -0.3, is: '46px'},
+ {at: 0, is: '40px'},
+ {at: 0.5, is: '30px'},
+ {at: 1, is: '20px'},
+ {at: 1.5, is: '10px'},
+]);
+
+assertInterpolation({
+ property: '--length',
+ from: 'inherit',
+ to: '20px',
+}, [
+ {at: -0.3, is: '33px'},
+ {at: 0, is: '30px'},
+ {at: 0.5, is: '25px'},
+ {at: 1, is: '20px'},
+ {at: 1.5, is: '15px'},
+]);
+
+assertInterpolation({
+ property: '--length',
+ from: 'unset',
+ to: '20px',
+}, [
+ {at: -0.3, is: '46px'},
+ {at: 0, is: '40px'},
+ {at: 0.5, is: '30px'},
+ {at: 1, is: '20px'},
+ {at: 1.5, is: '10px'},
+]);
+
+assertInterpolation({
+ property: '--length',
+ from: '-10px',
+ to: '10px',
+}, [
+ {at: -0.3, is: '-16px'},
+ {at: 0, is: '-10px'},
+ {at: 0.5, is: '0px'},
+ {at: 1, is: '10px'},
+ {at: 1.5, is: '20px'}
+]);
+
+assertInterpolation({
+ property: '--length',
+ from: '10em',
+ to: '20em',
+}, [
+ {at: -0.3, is: '140px'},
+ {at: 0, is: '200px'},
+ {at: 0.5, is: '300px'},
+ {at: 1, is: '400px'},
+ {at: 1.5, is: '500px'}
+]);
+
+assertInterpolation({
+ property: '--length',
+ from: '10em',
+ to: '100px',
+}, [
+ {at: -0.3, is: '230px'},
+ {at: 0, is: '200px'},
+ {at: 0.5, is: '150px'},
+ {at: 1, is: '100px'},
+ {at: 1.5, is: '50px'}
+]);
+</script>
+</body>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/animations/custom-properties/length-type-interpolation-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698