Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests for clamping to 0 with keyframes with calc() values #37457

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions web-animations/responsive/columnGap.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@

player.currentTime = 5;
element.style.fontSize = '40px';
assert_equals(getComputedStyle(element).columnGap, '0px');
assert_equals(getComputedStyle(element).columnGap, '20px');

player.currentTime = 7.5;
assert_equals(getComputedStyle(element).columnGap, '0px');
}, 'column-gap clamped to 0px');
assert_equals(getComputedStyle(element).columnGap, '10px');
}, 'column-gap clamped to 0px on keyframes');

test(function() {
container.style.columnGap = 'normal';
Expand Down
6 changes: 3 additions & 3 deletions web-animations/responsive/lineHeight.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@

player.currentTime = 5;
element.style.fontSize = '40px';
assert_equals(getComputedStyle(element).lineHeight, '0px');
assert_equals(getComputedStyle(element).lineHeight, '20px');

player.currentTime = 7.5;
assert_equals(getComputedStyle(element).lineHeight, '0px');
}, 'lineHeight clamped to 0px');
assert_equals(getComputedStyle(element).lineHeight, '10px');
}, 'lineHeight clamped to 0px on keyframes');

test(function() {
container.style.lineHeight = 'normal';
Expand Down
12 changes: 8 additions & 4 deletions web-animations/responsive/minHeight.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@

test(function() {
element.style.fontSize = '10px';
var player = element.animate([{minHeight: '30px'}, {minHeight: 'calc(30px - 2em)'}], 10);
var player = element.animate([{minHeight: '40px'}, {minHeight: 'calc(40px - 2em)'}], 10);
player.pause();
player.currentTime = 7.5;

player.currentTime = 5;
element.style.fontSize = '40px';
assert_equals(getComputedStyle(element).minHeight, '0px');
}, 'minHeight clamped to 0px');
assert_equals(getComputedStyle(element).minHeight, '20px');

player.currentTime = 7.5;
assert_equals(getComputedStyle(element).minHeight, '10px');
}, 'minHeight clamped to 0px on keyframes');

</script>
6 changes: 3 additions & 3 deletions web-animations/responsive/perspective.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@

player.currentTime = 5;
element.style.fontSize = '40px';
assert_equals(getComputedStyle(element).perspective, '0px');
assert_equals(getComputedStyle(element).perspective, '20px');

player.currentTime = 7.5;
assert_equals(getComputedStyle(element).perspective, '0px');
}, 'perspective clamped to 0px');
assert_equals(getComputedStyle(element).perspective, '10px');
}, 'perspective clamped to 0px on keyframes');

test(function() {
container.style.perspective = 'none';
Expand Down
6 changes: 3 additions & 3 deletions web-animations/responsive/rowGap.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@

player.currentTime = 5;
element.style.fontSize = '40px';
assert_equals(getComputedStyle(element).rowGap, '0px');
assert_equals(getComputedStyle(element).rowGap, '20px');

player.currentTime = 7.5;
assert_equals(getComputedStyle(element).rowGap, '0px');
}, 'row-gap clamped to 0px');
assert_equals(getComputedStyle(element).rowGap, '10px');
}, 'row-gap clamped to 0px on keyframes');

test(function() {
container.style.rowGap = 'normal';
Expand Down