Javascript image.src change loses Opacity setting




12 years ago
10 years ago


(Reporter: fafnir.crow, Unassigned)



Windows XP

Firefox Tracking Flags

(Not tracked)




(1 attachment)



12 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20070713 Firefox/
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20070713 Firefox/

When using Javascript to change the opacity of an image, then changing the getElementByID(imageid).src property, the browser resets the opacity setting to full.

On the page given the example of fading one image into another (note, not the author of example page, but is only place where code is avaliable that I can find.) demonstrates the problem.

This problem is also visible in SeaMonkey 1.1.1.

Reproducible: Always

Steps to Reproduce:
1. Set HTML code for a div, with img tag inside
2. use javascript to set opacity to 0 on the img tag
3. use javascript to change src of img tag
Actual Results:  
new image appears with full opacity

Expected Results:  
image should stay transparent (i.e. 0 opacity)
This seems to be worksforme, using:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a7pre) Gecko/2007072304 Minefield/3.0a7pre

Could you test with trunk build to see if this has become worksforme?

Comment 2

12 years ago
With the trunk build from that link, the problem is now intermittent. It continues to happen about one of every ten times.
A minimal testcase that would show it would be nice.
You can add a testcase with the "Add an attachment" link.
Note that when you click on the links before the fading in/out has been finished, I can see also some kind of image flicker, but that might very well be a problem with the script itself.
But that's just speculation, it can only be known until a minimal testcase is made.
Keywords: qawanted


12 years ago
Component: General → Layout
Product: Firefox → Core
QA Contact: general → layout
Version: unspecified → Trunk

Comment 4

12 years ago
Created attachment 277744 [details]
Test HTML file demonstrating annoying flicker

This HTML file which loads two external images (from a German anti-spy campaign) and slides between them demonstrates the annoying flicker effect.  It is reproducible with Firefox on MacOS 10.4/PPC, Windows 2000 and Linux/PPC (Fedora 7) as well as with all older Firefox versions or applications using Gecko (like Epiphany).  The effect is worse if the machine is slow and/or the images are large.

The page displays perfectly with inter alia Safari 2.0.4 and Internet Explorer 6 on Win 2k!

It looks as if the flicker effect is gone with firefox-3.0a8pre.en-US.mac.dmg (Aug. 22nd, 2007), again on MacOS 10.4/PPC.  Is it possible to backport the fix to the mainstream Gecko releases, as the effect is *really* annoying?

Comment 5

10 years ago
@Albrecht, there were some major architectural chances between Fx2 and Fx3, so it's hard to tell what actually fixed this.

Anyway, now Firefox 2 reached its end of life. Most people already updated to Fx3.
Last Resolved: 10 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.