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

CSS3 animations rotate3d bug? #17

Closed
futtta opened this issue Sep 17, 2014 · 4 comments
Closed

CSS3 animations rotate3d bug? #17

futtta opened this issue Sep 17, 2014 · 4 comments

Comments

@futtta
Copy link

futtta commented Sep 17, 2014

Hi Tubal;
Just got the following feedback from an Autoptimize user;

I'm using @-webkit-keyframes for CSS3 animations and it seems the compressor in yui-php-
cssmin-2.4.8-3.php is doing something wrong.

In line 601 it does a preg_replace to replace keyframe zero percentages, so that the optimized
code is converted from this:

0{...}
to this:
0%{...}

However, the preg_replace also replaces any zero values within the parenthesis, in my case
there's a rotate3d() like this:
0% { transform: rotate3d(0,0,1,30deg); }
This is converted to this:
0% { transform: rotate3d(0%,0%,1,30deg); }

Which is wrong, because the first three parameters are boolean values.

Would be great if you could have a look!

Kind regards,
frank

@tubalmartin
Copy link
Owner

Thanks @futtta! I'll look into it.

@patrickbeser
Copy link

Thank you for your super-quick help! Pretty good job!

However, under certain circumstances the fix still won't work. In your test it works fine, but try to edit your test file from this:

@-webkit-keyframes test4{
    0% { transform: rotate3d(0,0,1,30deg); }
 }

to this:

@-webkit-keyframes test4{
    0% { transform: rotate3d(0,0,1,30deg); }
    100% { transform: rotate3d(0,0,1,30deg); }
 }

So basically just add a second line to it. The compressor will then convert it to this:

test4{0%{transform:rotate3d(0%,0,1,30deg)}100%{transform:rotate3d(0,0,1,30deg)}}

The % sign is back in the first parameter of the 0% keyframe! You think you could have a look at it?

Thank you so much!
Patrick

@tubalmartin tubalmartin reopened this Sep 19, 2014
@tubalmartin
Copy link
Owner

Ah, good catch! Thanks, I'll fix it soon.

@patrickbeser
Copy link

Works like a charm! Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants