-
-
Save dshaw/560767 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tests['backgroundsize'] = function() { | |
var bool = test_props_all( 'backgroundSize' ); | |
if (bool){ | |
bool = new Boolean(bool); | |
bool.contain = !!(function() { | |
set_css('background-size: contain'); | |
return contains(m_style['backgroundSize'], 'contain'); | |
}); | |
bool.cover = !!(function() { | |
set_css('background-size: cover'); | |
return contains(m_style['backgroundSize'], 'cover'); | |
}); | |
} | |
return bool; | |
}; |
Oops, was returning a function instead of a boolean.
Fixed that, BUT it's worth noting that going down this rabbit hole breaks the existing feature in test evaluation loop and does not provide a css flag for these properties. That css flag is probably the most valuable contribution from adding these contributions. The use case that I could think of for this is primarily css related: if there's no .backgroundsize-contain support, for example, provide a sensible work around in another css block.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Regarding Modernizr issue:
http://github.com/Modernizr/Modernizr/issues/issue/109
Adding support for backgroundSize: contain and backgroundSize: cover.