Skip to content

Commit

Permalink
Add a|area[ping] detection (#2671)
Browse files Browse the repository at this point in the history
* Add a|area[ping] detect

* add aping|areaping to integration tests

* Add author tag
  • Loading branch information
heliocorreia authored and veeck committed Jan 30, 2022
1 parent eaca6c9 commit 605196f
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
20 changes: 20 additions & 0 deletions feature-detects/a/aping.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*!
{
"name": "a[ping] Attribute",
"property": "aping",
"caniuse": "ping",
"tags": ["media", "attribute"],
"builderAliases": ["a_ping"],
"authors": ["Hélio Correia (@heliocorreia)"],
"notes": [{
"name": "WHATWG Spec",
"href": "https://html.spec.whatwg.org/dev/links.html#ping"
}]
}
!*/
/* DOC
The ping attribute, if present, gives the URLs of the resources that are interested in being notified if the user follows the hyperlink.
*/
define(['Modernizr', 'createElement'], function(Modernizr, createElement) {
Modernizr.addTest('aping', !window.externalHost && 'ping' in createElement('a'));
});
20 changes: 20 additions & 0 deletions feature-detects/a/areaping.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*!
{
"name": "area[ping] Attribute",
"property": "areaping",
"caniuse": "ping",
"tags": ["media", "attribute"],
"builderAliases": ["area_ping"],
"authors": ["Hélio Correia (@heliocorreia)"],
"notes": [{
"name": "WHATWG Spec",
"href": "https://html.spec.whatwg.org/dev/links.html#ping"
}]
}
!*/
/* DOC
The ping attribute, if present, gives the URLs of the resources that are interested in being notified if the user follows the hyperlink.
*/
define(['Modernizr', 'createElement'], function(Modernizr, createElement) {
Modernizr.addTest('areaping', !window.externalHost && 'ping' in createElement('area'));
});
2 changes: 2 additions & 0 deletions lib/config-all.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
],
"feature-detects": [
"a/download",
"a/aping",
"a/areaping",
"ambientlight",
"applicationcache",
"audio",
Expand Down
2 changes: 2 additions & 0 deletions test/browser/integration/caniuse.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ window.caniusecb = function(caniuse) {
// the feature detect docs
var map = {
adownload: 'download',
aping: 'ping',
areaping: 'ping',
ambientlight: 'ambient-light',
apng: 'apng',
appearance: 'css-appearance',
Expand Down

0 comments on commit 605196f

Please sign in to comment.