mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-17 15:11:04 +00:00
24 lines
710 B
JavaScript
24 lines
710 B
JavaScript
/*!
|
|
{
|
|
"name": "CSS :invalid pseudo-class",
|
|
"property": "cssinvalid",
|
|
"notes": [{
|
|
"name": "MDN Docs",
|
|
"href": "https://developer.mozilla.org/en-US/docs/Web/CSS/:invalid"
|
|
}]
|
|
}
|
|
!*/
|
|
/* DOC
|
|
Detects support for the ':invalid' CSS pseudo-class.
|
|
*/
|
|
define(['Modernizr', 'testStyles', 'createElement'], function(Modernizr, testStyles, createElement) {
|
|
Modernizr.addTest('cssinvalid', function() {
|
|
return testStyles('#modernizr input{height:0;border:0;padding:0;margin:0;width:10px} #modernizr input:invalid{width:50px}', function(elem) {
|
|
var input = createElement('input');
|
|
input.required = true;
|
|
elem.appendChild(input);
|
|
return input.clientWidth > 10;
|
|
});
|
|
});
|
|
});
|