From 43cf32449ea36158d8998e0024c6b0ded87631c9 Mon Sep 17 00:00:00 2001 From: Shinichi Kogai Date: Thu, 20 Dec 2018 11:43:27 +0900 Subject: [PATCH 1/3] Add spec where represents the issue --- test.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test.js b/test.js index 51253cb..04ae2fe 100644 --- a/test.js +++ b/test.js @@ -191,6 +191,13 @@ const tests = [ expected: ':local(.foo) { animation: 1s normal ease-out infinite :local(foo); }' }, + { + should: + 'not treat animation curve as identifier of animation name even if it separated by comma', + input: '.foo { animation: 1s normal ease-out infinite, 1s normal ease-out infinite; }', + expected: + ':local(.foo) { animation: 1s normal ease-out infinite, 1s normal ease-out infinite; }' + }, { should: 'handle animations with custom timing functions', input: From e5129c10a230f39add335a04d21ca01f59b146aa Mon Sep 17 00:00:00 2001 From: Shinichi Kogai Date: Thu, 20 Dec 2018 12:28:02 +0900 Subject: [PATCH 2/3] Fix inappropriate modification of animation keywords --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 6c81ff8..e2e2791 100644 --- a/index.js +++ b/index.js @@ -243,8 +243,12 @@ function localizeAnimationShorthandDeclValues(decl, context) { }; const didParseAnimationName = false; - const parsedAnimationKeywords = {}; + let parsedAnimationKeywords = {}; const valueNodes = valueParser(decl.value).walk((node) => { + /* If div-token appeared (represents as comma ','), a possibility of an animation-keywords should be reflesh. */ + if (node.type === 'div') { + parsedAnimationKeywords = {}; + } const value = node.type === 'word' ? node.value.toLowerCase() : null; From bb4bec6d105227aef67e2fbadf8fa7f727853b13 Mon Sep 17 00:00:00 2001 From: Shinichi Kogai Date: Fri, 21 Dec 2018 09:48:15 +0900 Subject: [PATCH 3/3] Adjust input/expected pair of specs more properly which includes local variables like keyframe name --- test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test.js b/test.js index 04ae2fe..9ec62ff 100644 --- a/test.js +++ b/test.js @@ -194,9 +194,9 @@ const tests = [ { should: 'not treat animation curve as identifier of animation name even if it separated by comma', - input: '.foo { animation: 1s normal ease-out infinite, 1s normal ease-out infinite; }', + input: '.foo { animation: slide-right 300ms forwards ease-out, fade-in 300ms forwards ease-out; }', expected: - ':local(.foo) { animation: 1s normal ease-out infinite, 1s normal ease-out infinite; }' + ':local(.foo) { animation: :local(slide-right) 300ms forwards ease-out, :local(fade-in) 300ms forwards ease-out; }' }, { should: 'handle animations with custom timing functions',