false negative for 3d transforms / canary #465

paulirish opened this Issue Jan 8, 2012 · 6 comments


None yet

2 participants

  1. Use the latest chrome canary
  2. open http://tympanus.net/Development/Slicebox/
  3. open console
  4. $ Modernizr.csstransforms3d + Modernizr._version
  1. open http://haz.io/
  2. open console
  3. $ Modernizr.csstransforms3d + Modernizr._version
  1. scratch head because WTF..
  1. open http://modernizr.github.com/Modernizr/test/index.html
  2. see it's false there too..
  3. open http://www.webkit.org/blog-files/3d-transforms/poster-circle.html
  4. see that you do, indeed have 3D.

uh oh.


WTF indeed.

After digging around I've narrowed it down to the 3d transform media query returns false as the offsetLeft is returning 8 and not 9 even though the styles injected have left:9px applied?!

There is another check of the perspective css property which returns true, but the test takes the result of media query check, see L602.

Check out this screenshot: http://www.thecssninja.com/i/wtf3d.png

But the kicker is that this slicebox page is the only test where it's returning the wrong offsetLeft, haz.io returns the correct offset value...


We did just add that new offset trick to master like two days ago. But I'm surprised Slicebox and haz.io have different results...

here's another false negative: http://desandro.github.com/3dtransforms/examples/carousel-02-dynamic.html

i do feel more comfortable checking something like width/offsetWidth more than a positional offset. but that doesnt answer this question..


Well this test passes in latest canary http://jsfiddle.net/ryanseddon/ZeAAZ/5/ using offset left and the media query, so i'm not sure what's causing the element to have the value off by 1px?


This has got to be a bug with canary, that 8px value is actually just the computed margin applied to the body in that slicebox demo. Setting top:9px and width:9px will return 15 and however wide the browser window is for offsetTop and offsetWidth respectively...


Canary is just psycho. Thanks a bunch for driving us mad!

can't repro this anymore and seems fixed with the 2 most recent canaries.


@paulirish paulirish closed this Jan 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment