This repository has been archived by the owner on Aug 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1536688 - Allow animating the 'all' property from Web Animations;…
… r=emilio Differential Revision: https://phabricator.services.mozilla.com/D28763
- Loading branch information
Showing
5 changed files
with
81 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
dom/animation/test/chrome/test_animation_properties_display.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!doctype html> | ||
<head> | ||
<meta charset=utf-8> | ||
<title>Bug 1536688 - Test that 'display' is not included in | ||
KeyframeEffect.getProperties() when using shorthand 'all'</title> | ||
<script type="application/javascript" src="../testharness.js"></script> | ||
<script type="application/javascript" src="../testharnessreport.js"></script> | ||
<script type="application/javascript" src="../testcommon.js"></script> | ||
</head> | ||
<body> | ||
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1536688" | ||
target="_blank">Mozilla Bug 1536688</a> | ||
<div id="log"></div> | ||
<script> | ||
'use strict'; | ||
|
||
SpecialPowers.pushPrefEnv( | ||
{ | ||
set: [['dom.animations-api.core.enabled', true]], | ||
}, | ||
function() { | ||
test(t => { | ||
const div = addDiv(t); | ||
const animation = div.animate( | ||
{ all: ['unset', 'unset'] }, | ||
100 * MS_PER_SEC | ||
); | ||
// Flush styles since getProperties does not. | ||
getComputedStyle(div).opacity; | ||
|
||
const properties = animation.effect.getProperties(); | ||
assert_false( | ||
properties.some(property => property.property === 'display'), | ||
'Should not have a property for display' | ||
); | ||
}); | ||
|
||
done(); | ||
} | ||
); | ||
|
||
</script> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
.../tests/web-animations/animation-model/keyframe-effects/computed-keyframes-shorthands.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!doctype html> | ||
<meta charset=utf-8> | ||
<title>Calculating computed keyframes: Shorthand properties</title> | ||
<link rel="help" href="https://drafts.csswg.org/web-animations-1/#calculating-computed-keyframes"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="../../testcommon.js"></script> | ||
<body> | ||
<div id="log"></div> | ||
<div id="target"></div> | ||
<script> | ||
'use strict'; | ||
|
||
test(t => { | ||
const div = createDiv(t); | ||
div.style.opacity = '0'; | ||
|
||
const animation = div.animate({ all: 'initial' }, 100 * MS_PER_SEC); | ||
animation.currentTime = 50 * MS_PER_SEC; | ||
|
||
assert_approx_equals( | ||
parseFloat(getComputedStyle(div).opacity), | ||
0.5, | ||
0.0001, | ||
'Should be half way through an opacity animation' | ||
); | ||
}, 'It should be possible to animate the all shorthand'); | ||
|
||
</script> | ||
</body> |