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

CSS transitions of transforms are not smooth #7783

Closed
paulrouget opened this issue Sep 29, 2015 · 8 comments · Fixed by #7812
Closed

CSS transitions of transforms are not smooth #7783

paulrouget opened this issue Sep 29, 2015 · 8 comments · Fixed by #7812

Comments

@paulrouget
Copy link
Contributor

We are trying to build a sidebar that moves from the right of the window (offscreen) to cover the content, with a CSS transition, but it's very choppy.

Here is a slowed down screencast (had to use my camera, the screencast software doesn't show the progressive painting):

enormouscircularkillifish

<style>
  div {
    position: absolute;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    background: rgba(255,0,0,1);
    transform: translateX(500px);
    transition: transform 400ms linear;
  }

  .show div {
    transform: translateX(1px);
  }
</style>

<p>
  Hey, what kinda party is this? There's no booze and only one hooker. This is the worst part. The calm before the battle. What's with you kids? Every other day it's food, food, food. Alright, I'll get you some stupid food. Hey, you add a one and two zeros to that or we walk! We're rescuing ya. And then the battle's not so bad?
</p>

<div>
</div>


<script>
  document.body.addEventListener('keypress', e => {
    if (e.charCode == 97) { // a
      document.body.classList.toggle('show');
    }
  });
</script>
@paulrouget
Copy link
Contributor Author

Is this a regression or transition on transforms are not properly optimized yet?

@pcwalton
Copy link
Contributor

They should be working. We'll need to dive into what exactly the problem is here.

(Though it could just be the lack of DLBI.)

@notriddle
Copy link
Contributor

What's DLBI?

@metajack
Copy link
Contributor

@pcwalton
Copy link
Contributor

Also WebRender might just fix this issue for good

@paulrouget
Copy link
Contributor Author

Tried with WebRender. Animation is not smoother.

@glennw
Copy link
Member

glennw commented Oct 1, 2015

We looked into this and (at least for the webrender case) it's just that vsync wasn't enabled and it was tearing. I imagine that would fix the normal renderer case too, since it's such a simple transition it shouldn't take long to paint that.

@paulrouget
Copy link
Contributor Author

@glennw figured it was because vsync was not used on osx. Adding with_vsync() to the glutin window improves the performance quiet a lot. PR: #7812

bors-servo pushed a commit that referenced this issue Oct 1, 2015
enable vsync on osx

fixes #7783

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7812)
<!-- Reviewable:end -->
jrmuizel pushed a commit to jrmuizel/gecko-cinnabar that referenced this issue Jun 12, 2017
…r=glennw

fixes servo/servo#7783

Source-Repo: https://github.com/servo/servo
Source-Revision: fd66620602474e2070dc6fd6429e64cc6145b01c
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Sep 30, 2019
…r=glennw

fixes servo/servo#7783

Source-Repo: https://github.com/servo/servo
Source-Revision: fd66620602474e2070dc6fd6429e64cc6145b01c

UltraBlame original commit: 7631bb8726045fe607ed392973b65e47a684adfb
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 1, 2019
…r=glennw

fixes servo/servo#7783

Source-Repo: https://github.com/servo/servo
Source-Revision: fd66620602474e2070dc6fd6429e64cc6145b01c

UltraBlame original commit: 7631bb8726045fe607ed392973b65e47a684adfb
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 1, 2019
…r=glennw

fixes servo/servo#7783

Source-Repo: https://github.com/servo/servo
Source-Revision: fd66620602474e2070dc6fd6429e64cc6145b01c

UltraBlame original commit: 7631bb8726045fe607ed392973b65e47a684adfb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants