Skip to content

Commit

Permalink
Add testStyles and prefixed to the depedencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhorvath committed Mar 26, 2013
1 parent 525b9de commit f066554
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions feature-detects/css/shapes.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
define(['Modernizr', 'createElement', 'docElement'], function( Modernizr, createElement, docElement ) {
define(['Modernizr', 'createElement', 'docElement', 'prefixed', 'testStyles'], function( Modernizr, createElement, docElement, prefixed, testStyles ) {
// http://www.w3.org/TR/css3-exclusions
// http://www.w3.org/TR/css3-exclusions/#shapes
// Examples: http://html.adobe.com/webstandards/cssexclusions
// Separate test for CSS shapes as WebKit has just implemented this alone
Modernizr.addTest('shapes', function () {
var prefixedProperty = Modernizr.prefixed('shapeInside');
var prefixedProperty = prefixed('shapeInside');

if (!prefixedProperty)
return false;

var shapeInsideProperty = prefixedProperty.replace(/([A-Z])/g, function (str, m1) { return '-' + m1.toLowerCase(); }).replace(/^ms-/, '-ms-');

return Modernizr.testStyles('#modernizr { ' + shapeInsideProperty + ':rectangle(0,0,0,0) }', function (elem) {
return testStyles('#modernizr { ' + shapeInsideProperty + ':rectangle(0,0,0,0) }', function (elem) {
// Check against computed value
var styleObj = window.getComputedStyle ? getComputedStyle(elem, null) : elem.currentStyle;
return styleObj[prefixed('shapeInside', docElement.style, false)] == 'rectangle(0px, 0px, 0px, 0px)';
Expand Down

0 comments on commit f066554

Please sign in to comment.