Bug 1179111 part 1 - Implement CSSAnimation.animationName; r=smaug, r=jwatt

--HG--
rename : dom/animation/test/css-animations/file_effect-name.html => dom/animation/test/css-animations/file_cssanimation-animationname.html
rename : dom/animation/test/css-animations/test_effect-name.html => dom/animation/test/css-animations/test_cssanimation-animationname.html
extra : source : 144276fd40a14a560991baa2f5e7c45ce0e25042
This commit is contained in:
Brian Birtles 2015-07-01 12:15:42 +09:00
parent dd122c2a3d
commit 6d8dd99dd0
5 changed files with 14 additions and 9 deletions

View File

@ -13,21 +13,21 @@
test(function(t) {
var div = addDiv(t);
div.style.animation = 'xyz 100s';
assert_equals(div.getAnimations()[0].effect.name, 'xyz',
'Animation effect name matches keyframes rule name');
}, 'Effect name makes keyframe rule');
assert_equals(div.getAnimations()[0].animationName, 'xyz',
'Animation name matches keyframes rule name');
}, 'Animation name makes keyframe rule');
test(function(t) {
var div = addDiv(t);
div.style.animation = 'x\\yz 100s';
assert_equals(div.getAnimations()[0].effect.name, 'xyz',
'Escaped animation effect name matches keyframes rule name');
assert_equals(div.getAnimations()[0].animationName, 'xyz',
'Escaped animation name matches keyframes rule name');
}, 'Escaped animation name');
test(function(t) {
var div = addDiv(t);
div.style.animation = 'x\\79 z 100s';
assert_equals(div.getAnimations()[0].effect.name, 'xyz',
assert_equals(div.getAnimations()[0].animationName, 'xyz',
'Hex-escaped animation name matches keyframes rule'
+ ' name');
}, 'Animation name with hex-escape');

View File

@ -9,7 +9,7 @@ setup({explicit_done: true});
SpecialPowers.pushPrefEnv(
{ "set": [["dom.animations-api.core.enabled", true]]},
function() {
window.open("file_effect-name.html");
window.open("file_cssanimation-animationname.html");
});
</script>
</html>

View File

@ -24,8 +24,8 @@ support-files = css-animations/file_animation-playstate.html
support-files = css-animations/file_animation-ready.html
[css-animations/test_animation-starttime.html]
support-files = css-animations/file_animation-starttime.html
[css-animations/test_effect-name.html]
support-files = css-animations/file_effect-name.html
[css-animations/test_cssanimation-animationname.html]
support-files = css-animations/file_cssanimation-animationname.html
[css-animations/test_effect-target.html]
support-files = css-animations/file_effect-target.html
[css-animations/test_element-get-animations.html]

View File

@ -13,4 +13,5 @@
[Func="nsDocument::IsWebAnimationsEnabled",
HeaderFile="nsAnimationManager.h"]
interface CSSAnimation : Animation {
[Constant] readonly attribute DOMString animationName;
};

View File

@ -69,6 +69,10 @@ public:
virtual CSSAnimation* AsCSSAnimation() override { return this; }
// CSSAnimation interface
void GetAnimationName(nsString& aRetVal) const { aRetVal = Name(); }
// Animation interface overrides
virtual Promise* GetReady(ErrorResult& aRv) override;
virtual void Play(ErrorResult& aRv, LimitBehavior aLimitBehavior) override;
virtual void Pause(ErrorResult& aRv) override;