Skip to content

Commit

Permalink
documented opera mini's false pos on background-size. fixes Modernizr…
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed May 11, 2012
1 parent 916294c commit db60ffb
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions modernizr.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,18 @@ window.Modernizr = (function( window, document, undefined ) {
}

/*>>testprop*/
/**
* testProps is a generic CSS / DOM property test; if a browser supports
* a certain property, it won't return undefined for it.
* A supported CSS property returns empty string when its not yet set.
*/

// testProps is a generic CSS / DOM property test.

// In testing support for a given CSS property, it's legit to test:
// `elem.style[styleName] !== undefined`
// If the property is supported it will return an empty string,
// if unsupported it will return undefined.

// We'll take advantage of this quick test and skip setting a style
// on our modernizr element, but instead just testing undefined vs
// empty string.

function testProps( props, prefixed ) {
for ( var i in props ) {
if ( mStyle[ props[i] ] !== undefined ) {
Expand Down Expand Up @@ -576,15 +583,9 @@ window.Modernizr = (function( window, document, undefined ) {
};


// In testing support for a given CSS property, it's legit to test:
// `elem.style[styleName] !== undefined`
// If the property is supported it will return an empty string,
// if unsupported it will return undefined.

// We'll take advantage of this quick test and skip setting a style
// on our modernizr element, but instead just testing undefined vs
// empty string.

// this will false positive in Opera Mini
// github.com/Modernizr/Modernizr/issues/396

tests['backgroundsize'] = function() {
return testPropsAll('backgroundSize');
Expand Down

0 comments on commit db60ffb

Please sign in to comment.