Skip to content

CSS3 animations rotate3d bug? #17

Description

@futtta

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

Activity

tubalmartin commented on Sep 17, 2014

@tubalmartin
Owner

Thanks @futtta! I'll look into it.

patrickbeser commented on Sep 18, 2014

@patrickbeser

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 commented on Sep 19, 2014

@tubalmartin
Owner

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

patrickbeser commented on Sep 20, 2014

@patrickbeser

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions