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

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

Issue 2701533005: Support animating <percentage> and <length-percentage> custom properties (Closed)
Patch Set: Review changes Created 3 years, 10 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
Index: third_party/WebKit/LayoutTests/animations/custom-properties/length-percentage-type-mismatch-no-interpolation.html
diff --git a/third_party/WebKit/LayoutTests/animations/custom-properties/length-percentage-type-mismatch-no-interpolation.html b/third_party/WebKit/LayoutTests/animations/custom-properties/length-percentage-type-mismatch-no-interpolation.html
new file mode 100644
index 0000000000000000000000000000000000000000..4e8e81c3aae2d4e4e47a7f5b4e7a80b3dd622a08
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/animations/custom-properties/length-percentage-type-mismatch-no-interpolation.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<meta charset="UTF-8">
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<div id="target"></div>
+<script>
+// The console warnings about "Invalid keyframe value" are expected for this test.
suzyh_UTC10 (ex-contributor) 2017/02/20 00:22:01 Heads-up that this would be affected by https://gr
alancutter (OOO until 2018) 2017/02/20 00:27:09 Saw that one, looks like it's only for WPT.
+
+setup(() => {
+ CSS.registerProperty({
+ name: '--length',
+ syntax: '<length>',
+ initialValue: '40px',
+ });
+
+ CSS.registerProperty({
+ name: '--percentage',
+ syntax: '<percentage>',
+ initialValue: '40%',
+ });
+});
+
+test(() => {
+ var animation = target.animate({'--length': ['10%', '100px']}, 1);
+ animation.currentTime = 0;
+ assert_equals(getComputedStyle(target).getPropertyValue('--length'), '40px',
+ 'percentage fails to parse and is treated as neutral value');
+ animation.currentTime = 0.5;
+ assert_equals(getComputedStyle(target).getPropertyValue('--length'), '70px',
+ '--length is being animated');
+ animation.cancel();
+}, "<length> properties don't accept percentages in animation keyframes");
+
+test(() => {
+ var animation = target.animate({'--percentage': ['10px', '100%']}, 1);
+ animation.currentTime = 0;
+ assert_equals(getComputedStyle(target).getPropertyValue('--percentage'), '40%',
+ 'percentage is treated as neutral value');
suzyh_UTC10 (ex-contributor) 2017/02/20 00:22:01 Copy-paste error from (previous version of) test a
+ animation.currentTime = 0.5;
+ assert_equals(getComputedStyle(target).getPropertyValue('--percentage'), '70%',
+ '--length is being animated');
suzyh_UTC10 (ex-contributor) 2017/02/20 00:22:01 Copy-paste error from test above?
alancutter (OOO until 2018) 2017/02/20 00:27:09 Copy paste errors are source of all that is bad.
+ animation.cancel();
+}, "<percentage> properties don't accept lengths in animation keyframes");
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698