Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Use of translate3d instead of translateX or translateY for -webkit-transform ? #1603

Closed
hakanson opened this issue May 12, 2011 · 10 comments
Closed

Comments

@hakanson
Copy link
Contributor

Saw an CSS3 Hardware acceleration on PlayBook post on the BlackBerry PlayBook forms that says Webkit only hardware accelerates 3d transitions and not 2d ones. This appears to also be true/have been true on iOS as well based on a 2009 stackoverflow question (Slow animation with webkit-transform translate() in iPhone OS 3.0).

Should -webkit-transform translateX and translateY based CSS constructs

.slide.in {
    -webkit-transform: translateX(0);
    -webkit-animation-name: slideinfromright;
}

be rewritten to use translate3d?

.slide.in {
    -webkit-transform: translate3d(0,0,0);
    -webkit-animation-name: slideinfromright;
}
@mynameistechno
Copy link

I agree with this. I've been using translate3d myself for same reasons.

@toddparker
Copy link
Contributor

Thanks guys, this is a good tip. We're going to be re-working transitions in the next week or two so this is good timing.

@ghost ghost assigned jblas May 12, 2011
@toddparker
Copy link
Contributor

If either of you have time to set up a branch that uses this approach, that would be really helpful for testing. Anyone want to volunteer?

@mynameistechno
Copy link

I wouldn't mind, but I'm kind of new to using git and github. Sounds
like I just fork the project, make changes in the fork, then send a
pull request?

On Thu, May 12, 2011 at 11:09 AM, toddparker
reply@reply.github.com
wrote:

If either of you have time to set up a branch that uses this approach, that would be really helpful for testing. Anyone want to volunteer?

Reply to this email directly or view it on GitHub:
#1603 (comment)

@toddparker
Copy link
Contributor

Yep.

On May 12, 2011, at 2:22 PM | May 12, 2011, mynameistechno wrote:

I wouldn't mind, but I'm kind of new to using git and github. Sounds
like I just fork the project, make changes in the fork, then send a
pull request?

On Thu, May 12, 2011 at 11:09 AM, toddparker
reply@reply.github.com
wrote:

If either of you have time to set up a branch that uses this approach, that would be really helpful for testing. Anyone want to volunteer?

Reply to this email directly or view it on GitHub:
#1603 (comment)

Reply to this email directly or view it on GitHub:
#1603 (comment)

@jblas
Copy link
Contributor

jblas commented May 13, 2011

I just spoke to one of the engineers at Apple regarding this. He confirmed that both 2d and 3d transformations are hardware accelerated when using CSS3 transitions and keyframe animations. We shouldn't have to change anything.

He did clarify that when NOT using transitions and keyframes to animate, that 2d transformed elements are not accelerated to save memory. But, in our case, our transitions always use keyframe animation.

@toddparker
Copy link
Contributor

Thanks for getting such first-hand info on this from Apple. Looks like we should close this and not make changes because we're using keyframe animation for all the transitions.

@hakanson - Thanks so much for you help on this, even though we didn't pull this in!

@hakanson
Copy link
Contributor Author

I'm glad we could get some first hand info from Apple. The other article I could find on it was June 2010 and pre iOS 4. http://mir.aculo.us/2010/06/04/making-an-ipad-html5-app-making-it-really-fast/

Also, now we have it documented in case someone else recommends this "optimization."

@hakanson
Copy link
Contributor Author

Just saw the @paulirish video on HTML5, CSS3, and DOM Performance where he also talks about this and refers to Thomas Fuchs' Visualizing WebKit’s hardware acceleration. I ran the iOS simulator with CA_COLOR_OPAQUE=1 as described in the article and was able to see the red tint indication of hardware acceleration on the existing page transitions.

@mynameistechno
Copy link

Cool! thx for the info and links.

On Thu, May 19, 2011 at 11:50 AM, hakanson
reply@reply.github.com
wrote:

Just saw the @paulirish video on HTML5, CSS3, and DOM Performance where he also talks about this and refers to Thomas Fuchs' Visualizing WebKit’s hardware acceleration.  I ran the iOS simulator with CA_COLOR_OPAQUE=1 as described in the article and was able to see the red tint indication of hardware acceleration on the existing page transitions.

Reply to this email directly or view it on GitHub:
#1603 (comment)

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

No branches or pull requests

4 participants