Skip to content

Commit

Permalink
fixup lastchild syntax. fixes Modernizr#631
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Jul 19, 2012
1 parent 819cd5a commit 45bdc31
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions feature-detects/css-lastchild.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
// https://github.com/Modernizr/Modernizr/pull/304


Modernizr.testStyles("#modernizr div {width:100px} #modernizr :last-child{width:200px;display:block}", function (elem) {
var lastchild = Modernizr.addTest('lastchild', elem.lastChild.offsetWidth > elem.firstChild.offsetWidth);
}, 2);
Modernizr.addTest('lastchild', function(){

return Modernizr.testStyles("#modernizr div {width:100px} #modernizr :last-child{width:200px;display:block}", function (elem) {
return elem.lastChild.offsetWidth > elem.firstChild.offsetWidth;
}, 2);

});

0 comments on commit 45bdc31

Please sign in to comment.