summaryrefslogtreecommitdiffstatshomepage
path: root/core/misc/modernizr-additional-tests.js
blob: ec7bbc4547eae9075d39b77a6abb2ed7405be2a7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/

(function (Modernizr) {
  Modernizr.addTest('touchevents', function () {
    var bool = void 0;

    if ('ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch) {
      bool = true;
    } else {
      var query = ['@media (', Modernizr._prefixes.join('touch-enabled),('), 'heartz', ')', '{#modernizr{top:9px;position:absolute}}'].join('');
      Modernizr.testStyles(query, function (node) {
        bool = node.offsetTop === 9;
      });
    }
    return bool;
  });
})(Modernizr);