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

Unified Diff: LayoutTests/web-animations-api/animations-responsive-to-style-change.html

Issue 273683005: Web Animations API: Deferred computation of interpolated values (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add missing test file Created 6 years, 7 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: LayoutTests/web-animations-api/animations-responsive-to-style-change.html
diff --git a/LayoutTests/web-animations-api/animations-responsive-to-style-change.html b/LayoutTests/web-animations-api/animations-responsive-to-style-change.html
index 573c3ebff4f24e291a33222d438003f67da099af..6770389f89d1659a693b86b1f19d73abfaec4ba7 100644
--- a/LayoutTests/web-animations-api/animations-responsive-to-style-change.html
+++ b/LayoutTests/web-animations-api/animations-responsive-to-style-change.html
@@ -8,6 +8,8 @@
<script>
var element = document.getElementById('element');
+var container = document.getElementById('container');
+
test(function() {
element.style.fontSize = '10px';
container.style.width = '1000px';
@@ -20,5 +22,23 @@ test(function() {
container.style.width = '500px';
assert_equals(getComputedStyle(element).left, '350px');
}, 'Lengths responsive to style changes');
-</script>
+test(function() {
+ container.style.width = '1000px';
+ var player = element.animate([{paddingTop: '30%', offset: 0}, {paddingTop: '50%', offset: 1}], 10);
+ player.pause();
+ player.currentTime = 5;
+ container.style.width = '700px';
+ assert_equals(getComputedStyle(element).paddingTop, '280px');
+}, 'Percentages responsive to width style changes');
+
+test(function() {
+ element.style.fontSize = '1px';
+ var player = element.animate([{lineHeight: '9', offset: 0}, {lineHeight: '13', offset: 1}], 10);
+ player.pause();
+ player.currentTime = 2.5;
+ element.style.fontSize = '7px';
+ assert_equals(getComputedStyle(element).lineHeight, '70px');
+}, 'Numbers responsive to style changes');
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698