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

Unified Diff: third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-unregistered.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-unregistered.html
diff --git a/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-unregistered.html b/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-unregistered.html
new file mode 100644
index 0000000000000000000000000000000000000000..2c0652b7bb9c9f5c1b0764d8b2b2a19d3c64a69b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/animations/custom-properties/registered-var-to-unregistered.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<style>
+#target {
+ --from: 100;
+ --to: 200;
+}
+</style>
+<div id="target"></div>
+<script>
+CSS.registerProperty({
+ name: '--test',
+ syntax: '<number>',
+ initialValue: '0',
+});
+
+test(() => {
+ let animation = target.animate({'--test': ['var(--from)', 'var(--to)']}, 100);
+
+ animation.currentTime = 25;
+ assert_equals(getComputedStyle(target).getPropertyValue('--test'), '125', 'target at 25%');
+
+ animation.currentTime = 75;
+ assert_equals(getComputedStyle(target).getPropertyValue('--test'), '175', 'target at 75%');
+}, 'Registered custom property animation keyframes with var() references to unregistered custom properties');
+</script>

Powered by Google App Engine
This is Rietveld 408576698