Skip to content

Commit

Permalink
Fixed test for :checked pseudo-selector
Browse files Browse the repository at this point in the history
  • Loading branch information
tnajdek committed May 8, 2013
1 parent a0e2b25 commit ec10861
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions feature-detects/css/checked.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
!*/
define(['Modernizr', 'createElement', 'testStyles'], function( Modernizr, createElement, testStyles ) {
Modernizr.addTest('checked', function(){
return testStyles('#modernizr input {width:100px} #modernizr :checked {width:200px;display:block}', function(elem, rule){
return testStyles('#modernizr input {margin-left:10px} #modernizr :checked {margin-left:20px;display:block}', function(elem, rule){
var cb = createElement('input');
cb.setAttribute("type", "checkbox");
cb.setAttribute("checked", "checked");
elem.appendChild(cb);
return cb.offsetWidth == 200;
return cb.offsetLeft >= 20;
});
});
});

0 comments on commit ec10861

Please sign in to comment.