Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use margin instead of width to test for :change pseudo-selector #922

Merged
merged 2 commits into from
May 20, 2013
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Positioning #modernizr absolutely to enable more precise offsetLeft c…
…heck
  • Loading branch information
tnajdek committed May 19, 2013
commit 6757ec4fc9a901b975fac37c94650b6aabb12131
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 {margin-left:10px} #modernizr :checked {margin-left:20px;display:block}', function(elem, rule){
return testStyles('#modernizr {position:absolute} #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.offsetLeft >= 20;
return cb.offsetLeft === 20;
});
});
});