TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/315654

Change subject: Don't use img SVGs on Opera 9 and earlier
......................................................................

Don't use img SVGs on Opera 9 and earlier

It seems that Opera 9 does support SVG, but not inside an image, as it
claims to. Therefor detect if this is old style Opera (window.opera) and
if it is before v9 (window.setDocument was removed in Opera 10).

Bug: T137765
Change-Id: Idc83d5ae56e41976b6a596c4de1b5d5599df8708
---
M modules/ext.math.js
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math 
refs/changes/54/315654/1

diff --git a/modules/ext.math.js b/modules/ext.math.js
index 912798c..e2a69b8 100644
--- a/modules/ext.math.js
+++ b/modules/ext.math.js
@@ -10,7 +10,9 @@
 
        // We verify whether SVG as <img> is supported and otherwise use the
        // PNG fallback. See 
https://github.com/Modernizr/Modernizr/blob/master/feature-detects/svg/asimg.js
-       if ( !document.implementation.hasFeature( 
'http://www.w3.org/TR/SVG11/feature#Image', '1.1' ) ) {
+       if ( !document.implementation.hasFeature( 
'http://www.w3.org/TR/SVG11/feature#Image', '1.1' ) ||
+               ( !!window.opera && !window.setDocument ) // Detect < Opera 10
+       ) {
                $( '.mwe-math-fallback-image-inline, 
.mwe-math-fallback-image-display' ).each( function ( ) {
                        this.src = this.src.replace( 'media/math/render/svg/', 
'media/math/render/png/' );
                } );

-- 
To view, visit https://gerrit.wikimedia.org/r/315654
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc83d5ae56e41976b6a596c4de1b5d5599df8708
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: TheDJ <hartman.w...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to