All Downloads are FREE. Search and download functionalities are using the official Maven repository.

static.js.vendor.modernizr.feature-detects.mathml.js Maven / Gradle / Ivy

The newest version!
/*!
{
  "name": "MathML",
  "property": "mathml",
  "caniuse": "mathml",
  "authors": ["Addy Osmani", "Davide P. Cervone", "David Carlisle"],
  "knownBugs": ["Firefox < 4 will likely return a false, however it does support MathML inside XHTML documents"],
  "notes": [{
    "name": "W3C spec",
    "href": "http://www.w3.org/Math/"
  }],
  "polyfills": ["mathjax"]
}
!*/
/* DOC
Detects support for MathML, for mathematic equations in web pages.
*/
define(['Modernizr', 'testStyles'], function(Modernizr, testStyles) {
  // Based on work by Davide (@dpvc) and David (@davidcarlisle)
  // in https://github.com/mathjax/MathJax/issues/182

  Modernizr.addTest('mathml', function() {
    var ret;

    testStyles('#modernizr{position:absolute;display:inline-block}', function(node) {
      node.innerHTML += 'xxyy';

      ret = node.offsetHeight > node.offsetWidth;
    });

    return ret;
  });
});




© 2015 - 2025 Weber Informatics LLC | Privacy Policy