Skip to content

Commit

Permalink
add MathML in HTML test.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Dec 16, 2011
1 parent 6a9b39d commit 08afd66
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions feature-detects/mathml.js
@@ -0,0 +1,22 @@

// MathML omg!
// http://www.w3.org/Math/

// this tests MathML in HTML, not MathML as XML.
// test by Niels Leenheer

// demo:
// http://www1.chapman.edu/~jipsen/mathml/mathhtmltest.htm

Modernizr.addTest('mathml', function(){

var e = document.createElement('div');
e.innerHTML = '<math></math>';

var bool = e.firstChild
&& "namespaceURI" in e.firstChild
&& e.firstChild.namespaceURI == 'http://www.w3.org/1998/Math/MathML';

return bool;

});

0 comments on commit 08afd66

Please sign in to comment.