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

Unified Diff: third_party/WebKit/LayoutTests/animations/custom-properties/unregistered-element-animate.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-element-animate.html
diff --git a/third_party/WebKit/LayoutTests/animations/custom-properties/unregistered-element-animate.html b/third_party/WebKit/LayoutTests/animations/custom-properties/unregistered-element-animate.html
new file mode 100644
index 0000000000000000000000000000000000000000..a75ccf8a74da953d99945cb7b72768c3d097acac
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/animations/custom-properties/unregistered-element-animate.html
@@ -0,0 +1,19 @@
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<style>
+#target {
+ background-color: var(--x);
+}
+</style>
+<div id="target"></div>
+<script>
+test(() => {
+ var animation = target.animate({'--x': ['green', 'lime']}, 1000);
+ animation.currentTime = 250;
+ assert_equals(getComputedStyle(target).getPropertyValue('--x'), 'green');
+ assert_equals(getComputedStyle(target).backgroundColor, 'rgb(0, 128, 0)');
+ animation.currentTime = 750;
+ assert_equals(getComputedStyle(target).getPropertyValue('--x'), 'lime');
+ assert_equals(getComputedStyle(target).backgroundColor, 'rgb(0, 255, 0)');
+}, 'element.animate() animations should apply custom properties');
+</script>

Powered by Google App Engine
This is Rietveld 408576698