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

Feature detect to determine RAF timer size #40

Open
danro opened this issue Dec 12, 2012 · 7 comments
Open

Feature detect to determine RAF timer size #40

danro opened this issue Dec 12, 2012 · 7 comments

Comments

@danro
Copy link
Contributor

danro commented Dec 12, 2012

@rvagg, was thinking about your feature detect for the window.performance + rAF timers.

If it simplifies things, I would be fine with deferring all morpheus starts until the first frame had passed. Since it's usually <20ms, i'd call it a fair trade for not having to check on each frame.

Most browser-based animation seems to naturally defer at least 200ms anyways. I doubt most use cases would notice a frame difference on dom ready.

Thoughts?

@rvagg
Copy link
Collaborator

rvagg commented Dec 12, 2012

Yes, I was thinking the same thing, just queue them up and start them all once we've worked it out. It'd make an assumption that rAF actually works in the browser being tested but I suppose that's a safe-enough assumption! The nice thing about starting off with a bare-bones version and then switching it out once we've feature-detected is that if the detection fails for whatever reason we'll still be left with the basic version.

@stereokai
Copy link

Was anything done about this feature? Thanks.

@ded
Copy link
Owner

ded commented Jul 2, 2013

so far no work has been done on this. surely it wouldn't hurt to move the detection on page load instead of per frame

@stereokai
Copy link

I agree. Do you want to do it or should I?

@ded
Copy link
Owner

ded commented Jul 3, 2013

you can have a crack at it. i will gladly have a look since there's quite a few things on my plate at the moment

@stereokai
Copy link

I'll start looking into it in the next couple of days, I'll update here as I go

@danro
Copy link
Contributor Author

danro commented Jul 3, 2013

FWIW, in my animation library.. I opted to ignore the requestAnimationFrame callback parameter, and decided to call the now() function on each frame. You can find the shims here if you're interested:

https://github.com/BKWLD/tram/blob/f2ee789efa9cba498b2e96ff5f566eb8793c057e/src/tram.js#L60-L83

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

No branches or pull requests

4 participants