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

false negative for 3d transforms / canary #465

Closed
paulirish opened this Issue Jan 8, 2012 · 6 comments

Comments

Projects
None yet
2 participants
@paulirish
Member

paulirish commented Jan 8, 2012

  1. Use the latest chrome canary
  2. open http://tympanus.net/Development/Slicebox/
  3. open console
  4. $ Modernizr.csstransforms3d + Modernizr._version
"false2.0.6"
  1. open http://haz.io/
  2. open console
  3. $ Modernizr.csstransforms3d + Modernizr._version
"true2.0.6"
  1. scratch head because WTF..
@paulirish

This comment has been minimized.

Member

paulirish commented Jan 8, 2012

  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.

@ryanseddon

This comment has been minimized.

Member

ryanseddon commented Jan 9, 2012

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...

@paulirish

This comment has been minimized.

Member

paulirish commented Jan 9, 2012

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..

@ryanseddon

This comment has been minimized.

Member

ryanseddon commented Jan 9, 2012

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?

@ryanseddon

This comment has been minimized.

Member

ryanseddon commented Jan 9, 2012

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...

@paulirish

This comment has been minimized.

Member

paulirish commented Jan 17, 2012

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.

super!

@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