To detect if a browser support translate3d we can use (WebKitCSSMatrix in window && m11 in new WebKitCSSMatrix())
but now that firefox support translate3d how to have a correct detection of it?
The idea would be to find a solution without using Modernizr.
I needed something similar. I wanted to test if a browser supported translate3d without using a library. I didn’t find any good generic test that wasn’t webkit specific. So after much experimentation, I came up with the following test. I first create a test element, assign a transform function to it, then see if the element retained the transform function.
The function is plenty fast for my needs: < 50 microseconds in desktop browsers, < 500 microseconds in mobile browsers.
Hope this helps.