Permalink
Browse files

Fixed false positive of 3d transforms if test element inherits margin…

…, padding or border, fixes #740
  • Loading branch information...
ryanseddon committed Nov 3, 2012
1 parent 871caa1 commit d7c7393fb03ec29c0b398c4efc740315bdd5a152
Showing with 2 additions and 1 deletion.
  1. +2 −1 feature-detects/css-transforms3d.js
@@ -11,7 +11,8 @@ Modernizr.addTest('csstransforms3d', function() {
// Webkit allows this media query to succeed only if the feature is enabled.
// `@media (transform-3d),(-webkit-transform-3d){ ... }`
- Modernizr.testStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function( node, rule ) {
+ // If loaded inside the body tag and the test element inherits any padding, margin or borders it will fail #740
+ Modernizr.testStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;margin:0;padding:0;border:0}}', function( node, rule ) {
ret = node.offsetLeft === 9 && node.offsetHeight === 3;
});
}

0 comments on commit d7c7393

Please sign in to comment.