Merge "Feature detection for MV load: add SVG, remove Object.create"

This commit is contained in:
jenkins-bot 2014-09-10 11:42:50 +00:00 committed by Gerrit Code Review
commit 01e05f07bf

View file

@ -19,13 +19,15 @@
( function ( mw ) {
mw.mmv = {
/**
* Feature-detects OOJS support. OOJS uses es5-shim, and from the remaining ES5 additions
* (the ones provided by es5-sham) the only one it uses is Object.create.
* Feature-detects SVG support. MuyltimediaViewer uses SVG icons extensively and is
* unusable without them.
* @member mw.mmv.MultimediaViewer
* @return {boolean}
*/
isBrowserSupported : function () {
return !!Object.create;
// From modernizr 2.6.1
var ns = { 'svg': 'http://www.w3.org/2000/svg' };
return !!document.createElementNS && !!document.createElementNS( ns.svg, 'svg' ).createSVGRect;
}
};
}( mediaWiki ) );