diff --git a/lib/style.js b/lib/style.js index 5c1570d9e..8f047cd20 100644 --- a/lib/style.js +++ b/lib/style.js @@ -84,8 +84,12 @@ const parseStylesheet = (css, dynamic) => { } if (cssNode.type === 'Atrule') { if ( - cssNode.name === 'keyframes' || - cssNode.name === '-webkit-keyframes' + [ + 'keyframes', + '-webkit-keyframes', + '-o-keyframes', + '-moz-keyframes', + ].includes(cssNode.name) ) { return csstreeWalkSkip; } diff --git a/lib/style.test.js b/lib/style.test.js index 544926beb..f904ede23 100644 --- a/lib/style.test.js +++ b/lib/style.test.js @@ -356,3 +356,64 @@ it('ignores @-webkit-keyframes atrule', () => { }, }); }); +it('ignores @-moz-keyframes atrule', () => { + const root = parseSvg(` + + + + + `); + const stylesheet = collectStylesheet(root); + expect( + computeStyle(stylesheet, getElementById(root, 'element')), + ).toStrictEqual({ + animation: { + type: 'static', + inherited: false, + value: 'loading 4s linear infinite', + }, + }); +}); + +it('ignores @-o-keyframes atrule', () => { + const root = parseSvg(` + + + + + `); + const stylesheet = collectStylesheet(root); + expect( + computeStyle(stylesheet, getElementById(root, 'element')), + ).toStrictEqual({ + animation: { + type: 'static', + inherited: false, + value: 'loading 4s linear infinite', + }, + }); +});