Permalink
Browse files

3d transforms. only do the media query check for webkit. fixes #133

  • Loading branch information...
1 parent 7e2703b commit 6ba742c0e0bd1d98de74aa9b643dc7ffeff1a939 @paulirish paulirish committed Nov 4, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 modernizr.js
View
@@ -558,10 +558,10 @@ window.Modernizr = (function(window,document,undefined){
var ret = !!test_props([ 'perspectiveProperty', 'WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective' ]);
// Webkit’s 3D transforms are passed off to the browser's own graphics renderer.
- // It works fine in Safari on Leopard and Snow Leopard, but not in Chrome (yet?).
- // As a result, Webkit typically recognizes the syntax but will sometimes throw a false
- // positive, thus we must do a more thorough check:
- if (ret){
+ // It works fine in Safari on Leopard and Snow Leopard, but not in Chrome in
+ // some conditions. As a result, Webkit typically recognizes the syntax but
+ // will sometimes throw a false positive, thus we must do a more thorough check:
+ if (ret && 'webkitPerspective' in docElement.style){
// Webkit allows this media query to succeed only if the feature is enabled.
// "@media (transform-3d),(-o-transform-3d),(-moz-transform-3d),(-ms-transform-3d),(-webkit-transform-3d),(modernizr){ ... }"

0 comments on commit 6ba742c

Please sign in to comment.