Skip to content

Commit

Permalink
Merge pull request #1107 from zachleat/master
Browse files Browse the repository at this point in the history
:target Feature Test
  • Loading branch information
patrickkettner committed Nov 25, 2013
2 parents c5fc164 + 824e4d6 commit 91dbab7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
35 changes: 35 additions & 0 deletions feature-detects/css/target.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*!
{
"name": "CSS :target pseudo-class",
"caniuse": "css-sel3",
"property": "target",
"tags": ["css"],
"notes": [{
"name": "MDN documentation",
"href": "https://developer.mozilla.org/en-US/docs/Web/CSS/:target"
}],
"authors": ["@zachleat"],
"warnings": ["Opera Mini supports :target but doesn't update the hash for anchor links."]
}
!*/
/* DOC
Detects support for the ':target' CSS pseudo-class.
*/
define(['Modernizr'], function( Modernizr ) {
// querySelector
Modernizr.addTest('target', function() {
var doc = window.document;
if(!('querySelectorAll' in doc) ) {
return false;
}

try {
doc.querySelectorAll(':target');
return true;
} catch(e) {
return false;
}
});
});
1 change: 1 addition & 0 deletions lib/config-all.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"test/css/siblinggeneral",
"test/css/subpixelfont",
"test/css/supports",
"test/css/target",
"test/css/textshadow",
"test/css/transforms",
"test/css/transformstylepreserve3d",
Expand Down

0 comments on commit 91dbab7

Please sign in to comment.