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

Unified Diff: third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-registered-any-order.html

Issue 2809063002: WIP Support var() references in registered custom property keyframes (Closed)
Patch Set: Rebased Created 3 years, 6 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/registered-var-to-registered-any-order.html
diff --git a/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-registered-any-order.html b/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-registered-any-order.html
new file mode 100644
index 0000000000000000000000000000000000000000..599366ea04e13c8861c357f27bb6f9a66b096f4c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-registered-any-order.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<div id="target"></div>
+<script>
+for (let name of ['--a', '--b']) {
+ CSS.registerProperty({
+ name,
+ syntax: '<number>',
+ initialValue: '0',
+ });
+}
+
+test(() => {
+ let a = target.animate({'--a': ['100', 'var(--b)']}, 100);
+ let b = target.animate({'--b': ['200', '200']}, 100);
+
+ a.currentTime = 50;
+ assert_equals(getComputedStyle(target).getPropertyValue('--a'), '150', '--a animating towards --b');
+ assert_equals(getComputedStyle(target).getPropertyValue('--b'), '200', '--b stationary at 200');
+
+ a.cancel();
+ b.cancel();
+
+ a = target.animate({'--a': ['200', '200']}, 100);
+ b = target.animate({'--b': ['100', 'var(--a)']}, 100);
+
+ b.currentTime = 50;
+ assert_equals(getComputedStyle(target).getPropertyValue('--a'), '200', '--a stationary at 200');
+ assert_equals(getComputedStyle(target).getPropertyValue('--b'), '150', '--b animating towards --a');
+}, 'Registered custom property animation keyframes with var() references should not be affected by name ordering');
+</script>

Powered by Google App Engine
This is Rietveld 408576698