Index: third_party/WebKit/LayoutTests/imported/web-platform-tests/web-animations/keyframe-effect/keyframe-handling.html |
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/web-animations/keyframe-effect/keyframe-handling.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/web-animations/keyframe-effect/keyframe-handling.html |
index 613933c4e32b8b45c87a60e8010ce9197ce61c69..2267503d8c3adeb789cfe77070f68c19ab6f1dcf 100644 |
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/web-animations/keyframe-effect/keyframe-handling.html |
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/web-animations/keyframe-effect/keyframe-handling.html |
@@ -70,6 +70,46 @@ test(function(t) { |
}, 'Overlapping keyframes between 0 and 1 use the appropriate value on each' |
+ ' side of the overlap point'); |
+test(function(t) { |
+ var div = createDiv(t); |
+ var anim = div.animate({ visibility: ['hidden','visible'] }, |
+ { duration: 100 * MS_PER_SEC, fill: 'both' }); |
+ |
+ anim.currentTime = 0; |
+ assert_equals(getComputedStyle(div).visibility, 'hidden', |
+ 'Visibility when progress = 0.'); |
+ |
+ anim.currentTime = 10 * MS_PER_SEC + 1; |
+ assert_equals(getComputedStyle(div).visibility, 'visible', |
+ 'Visibility when progress > 0 due to linear easing.'); |
+ |
+ anim.finish(); |
+ assert_equals(getComputedStyle(div).visibility, 'visible', |
+ 'Visibility when progress = 1.'); |
+ |
+}, "Test visibility clamping behavior."); |
+ |
+test(function(t) { |
+ var div = createDiv(t); |
+ var anim = div.animate({ visibility: ['hidden', 'visible'] }, |
+ { duration: 100 * MS_PER_SEC, fill: 'both', |
+ easing: 'cubic-bezier(0.25, -0.6, 0, 0.5)' }); |
+ |
+ anim.currentTime = 0; |
+ assert_equals(getComputedStyle(div).visibility, 'hidden', |
+ 'Visibility when progress = 0.'); |
+ |
+ // Timing function is below zero. So we expected visibility is hidden. |
+ anim.currentTime = 10 * MS_PER_SEC + 1; |
+ assert_equals(getComputedStyle(div).visibility, 'hidden', |
+ 'Visibility when progress < 0 due to cubic-bezier easing.'); |
+ |
+ anim.currentTime = 60 * MS_PER_SEC; |
+ assert_equals(getComputedStyle(div).visibility, 'visible', |
+ 'Visibility when progress > 0 due to cubic-bezier easing.'); |
+ |
+}, "Test visibility clamping behavior with an easing that has a negative component"); |
+ |
done(); |
</script> |
</body> |