http://www.mediawiki.org/wiki/Special:Code/MediaWiki/99653

Revision: 99653
Author:   brion
Date:     2011-10-12 22:46:31 +0000 (Wed, 12 Oct 2011)
Log Message:
-----------
Temporarily disable pre-upload SVG thumbnailing in Special:Upload and 
Special:UploadWizard; workaround for worst part so far of bug 31643: some SVG 
files hanging Firefox during pre-upload thumbnail generation.

It's possible that this isn't SVG-specific though; large JPEGs are so far known 
to take a couple seconds and still pause the browser UI, but some SVGs hang 
Firefox 7/8/9 indefinitely when loaded as a data URI.

Upstream Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=694165

Modified Paths:
--------------
    trunk/extensions/UploadWizard/resources/mw.fileApi.js
    trunk/phase3/resources/mediawiki.special/mediawiki.special.upload.js

Modified: trunk/extensions/UploadWizard/resources/mw.fileApi.js
===================================================================
--- trunk/extensions/UploadWizard/resources/mw.fileApi.js       2011-10-12 
21:49:44 UTC (rev 99652)
+++ trunk/extensions/UploadWizard/resources/mw.fileApi.js       2011-10-12 
22:46:31 UTC (rev 99653)
@@ -16,12 +16,13 @@
                 * Also excludes files over 10M to avoid going insane on memory 
usage.
                 *
                 * @todo is there a way we can ask the browser what's supported 
in <img>s?
+                * @todo put SVG back after working around Firefox 7 bug 
<https://bugzilla.wikimedia.org/show_bug.cgi?id=31643>
                 *
                 * @param {File} file
                 * @return boolean
                 */
                isPreviewableFile: function( file ) {
-                       var     known = [ 'image/png', 'image/gif', 
'image/jpeg', 'image/svg+xml'],
+                       var     known = [ 'image/png', 'image/gif', 
'image/jpeg'],
                                tooHuge = 10 * 1024 * 1024;
                        return ( $.inArray( file.type, known ) !== -1 ) && 
file.size > 0 && file.size < tooHuge;
                },

Modified: trunk/phase3/resources/mediawiki.special/mediawiki.special.upload.js
===================================================================
--- trunk/phase3/resources/mediawiki.special/mediawiki.special.upload.js        
2011-10-12 21:49:44 UTC (rev 99652)
+++ trunk/phase3/resources/mediawiki.special/mediawiki.special.upload.js        
2011-10-12 22:46:31 UTC (rev 99653)
@@ -19,12 +19,13 @@
         * Also excludes files over 10M to avoid going insane on memory usage.
         *
         * @todo is there a way we can ask the browser what's supported in 
<img>s?
+        * @todo put SVG back after working around Firefox 7 bug 
<https://bugzilla.wikimedia.org/show_bug.cgi?id=31643>
         *
         * @param {File} file
         * @return boolean
         */
        function fileIsPreviewable( file ) {
-               var     known = ['image/png', 'image/gif', 'image/jpeg', 
'image/svg+xml'],
+               var     known = ['image/png', 'image/gif', 'image/jpeg'],
                        tooHuge = 10 * 1024 * 1024;
                return ( $.inArray( file.type, known ) !== -1 ) && file.size > 
0 && file.size < tooHuge;
        }


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to