Last modified: 2010-12-05 14:50:12 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T8765, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 6765 - Extend IE PNG transparency hack to all PNG images
Extend IE PNG transparency hack to all PNG images
Status: RESOLVED DUPLICATE of bug 2074
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.8.x
PC Windows XP
: Low normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-07-21 04:40 UTC by Charlie Huggard
Modified: 2010-12-05 14:50 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Charlie Huggard 2006-07-21 04:40:15 UTC
As we all know, IEs before 7 have issues with PNG alpha transparencies, however
I noticed that in IE 6 I was never having trouble with the site image in the
upper right (for the monobook skin), even though using the Logo extension that
would be a SVG image rasterized to PNG and should have the same  issues. 

I found that in skins/common/IEFixes.js there is a fixalpha() function that
fixes this issue for the logo image only. Would it be possible to modify that
function so that it would do the same thing for all images that are on a page
and not just the logo?
Comment 1 M.D. Klapwijk 2007-08-23 11:38:32 UTC
Inject the following into fixalpha() in IEFixes.js infront of the orginal if-statement:

    var array_version = navigator.appVersion.split("MSIE")
    var version = parseFloat(array_version[1])

    if (((version < 7 && version >= 5.5 && document.body.filters) || isMSIE55) && !doneIEAlphaFix)
    {
       for(var i=0; i<document.images.length; i++)
       {
          var img = document.images[i]
          var imgName = img.src.toUpperCase()
          if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
          {
             var imgID = (img.id) ? "id='" + img.id + "' " : ""
             var imgClass = (img.className) ? "class='" + img.className + "' " : ""
             var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
             var imgStyle = "display:inline-block;" + img.style.cssText
             if (img.align == "left") imgStyle = "float:left;" + imgStyle
             if (img.align == "right") imgStyle = "float:right;" + imgStyle
             if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
             var strNewHTML = "<span " + imgID + imgClass + imgTitle
             + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
             + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
             + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
             img.outerHTML = strNewHTML
             i = i-1
          }
       }
        doneIEAlphaFix = true;
    }
Comment 2 Brion Vibber 2007-08-23 14:04:21 UTC
If you have to hack the code, it's probably not a WORKSFORME is it? :)
Comment 3 DieBuche 2010-12-05 14:50:12 UTC

*** This bug has been marked as a duplicate of bug 2074 ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links