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

Unified Diff: third_party/WebKit/LayoutTests/animations/custom-properties/empty-initial-value-crash.html

Issue 2649863006: Add null check to animations for registered custom property initial values (Closed)
Patch Set: Fix shadowed variable Created 3 years, 11 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/animations/custom-properties/empty-initial-value-crash.html
diff --git a/third_party/WebKit/LayoutTests/animations/custom-properties/empty-initial-value-crash.html b/third_party/WebKit/LayoutTests/animations/custom-properties/empty-initial-value-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..efd5e5d0053e795404e94c9f9a3ed506715b82b6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/animations/custom-properties/empty-initial-value-crash.html
@@ -0,0 +1,31 @@
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<style>
+#target {
+ --x: initial;
+}
+</style>
+<div id="target"></div>
+<script>
+setup(() => {
+ CSS.registerProperty({name: '--x'});
+});
+
+test(() => {
+ var animation = target.animate({'--x': 'test'}, 1);
+ assert_equals(getComputedStyle(target).getPropertyValue('--x'), '');
+ animation.cancel();
+}, 'Do not crash when animating with an underlying value of initial');
+
+test(() => {
+ var animation = target.animate({'--x': 'initial'}, {fill: 'forwards'});
+ assert_equals(getComputedStyle(target).getPropertyValue('--x'), '');
+ animation.cancel();
+}, 'Do not crash when animating an empty initial value');
+
+test(() => {
+ var animation = target.animate({'--x': 'inherit'}, {fill: 'forwards'});
+ assert_equals(getComputedStyle(target).getPropertyValue('--x'), '');
+ animation.cancel();
+}, 'Do not crash when animating an inherited empty initial value');
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698