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

Unified Diff: third_party/WebKit/LayoutTests/animations/custom-properties/unregistered-simple.html

Issue 2309963002: Apply custom property animation (Closed)
Patch Set: Rebase Created 4 years, 1 month 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/unregistered-simple.html
diff --git a/third_party/WebKit/LayoutTests/animations/custom-properties/unregistered-simple.html b/third_party/WebKit/LayoutTests/animations/custom-properties/unregistered-simple.html
new file mode 100644
index 0000000000000000000000000000000000000000..bac89193b8fbd50ea22df12b88232f32f1da2fb5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/animations/custom-properties/unregistered-simple.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<style>
+@keyframes test {
+ from { --x: green; }
+ to { --x: lime; }
+}
+div {
+ --x: red;
+ background-color: var(--x);
+}
+#targetA {
+ animation: test 10s -2.5s;
+}
+#targetB {
+ animation: test 10s -7.5s;
+}
+</style>
+<div id="targetA"></div>
+<div id="targetB"></div>
+<script>
+test(() => {
+ assert_equals(getComputedStyle(targetA).getPropertyValue('--x'), ' green');
+ assert_equals(getComputedStyle(targetB).getPropertyValue('--x'), ' lime');
+}, 'CSS Animations on custom properties should be applied');
+
+test(() => {
+ assert_equals(getComputedStyle(targetA).backgroundColor, 'rgb(0, 128, 0)');
+ assert_equals(getComputedStyle(targetB).backgroundColor, 'rgb(0, 255, 0)');
+}, 'CSS Animations on custom properties should be reflected in var() references');
+</script>

Powered by Google App Engine
This is Rietveld 408576698