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

Unified Diff: LayoutTests/web-animations-api/animations-responsive-assorted-lengths.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
« no previous file with comments | « no previous file | LayoutTests/web-animations-api/animations-responsive-backgroundPosition.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/web-animations-api/animations-responsive-assorted-lengths.html
diff --git a/LayoutTests/web-animations-api/animations-responsive-assorted-lengths.html b/LayoutTests/web-animations-api/animations-responsive-assorted-lengths.html
new file mode 100644
index 0000000000000000000000000000000000000000..e6804f5a3be284c1efc32f1e25c50b009449dbef
--- /dev/null
+++ b/LayoutTests/web-animations-api/animations-responsive-assorted-lengths.html
@@ -0,0 +1,102 @@
+<!DOCTYPE html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+
+<div id='container'>
+<div id='element'></div>
+</div>
+
+<script>
+var element = document.getElementById('element');
+var container = document.getElementById('container');
+
+test(function() {
+ element.style.fontSize = '10px';
+ var player = element.animate([{bottom: '3em', offset: 0}, {bottom: '5em', offset: 1}], 10);
+ player.pause();
+ player.currentTime = 5;
+ element.style.fontSize = '20px';
+ assert_equals(getComputedStyle(element).bottom, '80px');
+}, 'bottom responsive to style changes');
+
+test(function() {
+ element.style.fontSize = '10px';
+ var player = element.animate([{height: '3em', offset: 0}, {height: '5em', offset: 1}], 10);
+ player.pause();
+ player.currentTime = 5;
+ element.style.fontSize = '20px';
+ assert_equals(getComputedStyle(element).height, '80px');
+}, 'height responsive to style changes');
+
+test(function() {
+ element.style.fontSize = '10px';
+ var player = element.animate([{letterSpacing: '3em', offset: 0}, {letterSpacing: '5em', offset: 1}], 10);
+ player.pause();
+ player.currentTime = 5;
+ element.style.fontSize = '20px';
+ assert_equals(getComputedStyle(element).letterSpacing, '80px');
+}, 'letterSpacing responsive to style changes');
+
+test(function() {
+ var player = element.animate([{letterSpacing: 'normal', offset: 0}, {letterSpacing: 'normal', offset: 1}], 10);
+ player.pause();
+ player.currentTime = 5;
+ assert_equals(getComputedStyle(element).letterSpacing, 'normal');
+}, 'letterSpacing can be normal');
+
+test(function() {
+ element.style.fontSize = '10px';
+ var player = element.animate([{marginRight: '3em', offset: 0}, {marginRight: '5em', offset: 1}], 10);
+ player.pause();
+ player.currentTime = 5;
+ element.style.fontSize = '20px';
+ assert_equals(getComputedStyle(element).marginRight, '80px');
+}, 'marginRight responsive to style changes');
+
+test(function() {
+ element.style.fontSize = '10px';
+ container.style.width = '300px';
+ var player = element.animate([{marginRight: '3em', offset: 0}, {marginRight: '50%', offset: 1}], 10);
+ player.pause();
+ player.currentTime = 5;
+ element.style.fontSize = '20px';
+ container.style.width = '600px';
+ assert_equals(getComputedStyle(element).marginRight, '180px');
+}, 'marginRight allows percentages');
+
+test(function() {
+ element.style.fontSize = '10px';
+ var player = element.animate([{outlineOffset: '3em', offset: 0}, {outlineOffset: '5em', offset: 1}], 10);
+ player.pause();
+ player.currentTime = 5;
+ element.style.outline = 'dashed thin';
+ element.style.fontSize = '20px';
+ assert_equals(getComputedStyle(element).outlineOffset, '80px');
+}, 'outlineOffset responsive to style changes');
+
+test(function() {
+ container.style.fontSize = '10px';
+ var player = container.animate([{perspective: '3em', offset: 0}, {perspective: '5em', offset: 1}], 10);
+ player.pause();
+ player.currentTime = 5;
+ container.style.fontSize = '20px';
+ assert_equals(getComputedStyle(container).perspective, '80px');
+}, 'perspective responsive to style changes');
+
+test(function() {
+ var player = element.animate([{perspective: 'none', offset: 0}, {perspective: 'none', offset: 1}], 10);
+ player.pause();
+ player.currentTime = 10;
+ assert_equals(getComputedStyle(element).perspective, 'none');
+}, 'perspective can be none');
+
+test(function() {
+ element.style.fontSize = '10px';
+ var player = element.animate([{wordSpacing: '3em', offset: 0}, {wordSpacing: '5em', offset: 1}], 10);
+ player.pause();
+ player.currentTime = 5;
+ element.style.fontSize = '20px';
+ assert_equals(getComputedStyle(element).wordSpacing, '80px');
+}, 'wordSpacing responsive to style changes');
+
+</script>
« no previous file with comments | « no previous file | LayoutTests/web-animations-api/animations-responsive-backgroundPosition.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698