Closed Bug 285079 Opened 20 years ago Closed 19 years ago

Setting className property of <img> element via JavaScript not working

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED EXPIRED

People

(Reporter: skygx, Assigned: bugzilla)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050225 Firefox/1.0.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050225 Firefox/1.0.1

I have two styles within a stylesheet that has been put in use on a page via a
<link> attribute.  The only different between the two styles are border-style:
none; and border-style: solid.  I have style .homedim assigned via HTML class
attribute to an <img> element.  This is the style with border-style: none.  In
an onmouseover event handler attribute, I call a JavaScript function that sets
the className property of the image object to the .homelite style, which has the
border-style: solid.  The solid border does not appear onmouseover.

Reproducible: Always

Steps to Reproduce:
1. Open page with stylesheet in effect and class assignments as described in
Details.
2. Roll mouse over image with assigned class and event handlers as described in
Details.
3. Notice that style change does not occur.
Actual Results:  
The border defined as solid by the border-style property of the assigned class
does not become visible on mouseover.

Expected Results:  
That the border-style defined in the assigned class make the border visible
around the image on mouseover.
Please attach a minimized testcase showing the problem:
https://bugzilla.mozilla.org/attachment.cgi?bugid=285079&action=enter
Following up: I have determined that setting the className property of the <img>
element generates the correct visual behavior when 'border-width: 0px' and
'border-width: 4px' are the differing properties between the two styles in the
stylesheet.  So, to repeat, when 'border-style: none' and 'border-style: solid'
are the differing properties, setting the className property of the <img>
element doesn't produce the desired result, but when border-width is the
differing property, the border's width does change upon setting the className
property.
This simple page (and sub-directory of images) demonstrates the bug. It
contains a simplified stylesheet that includes two variations of the styles
that this page's code switches between (by setting the className property of an
<img> object) on mouseover/mouseout.  The workable pair are currently in effect
in this example, so that you may see how this effect is supposed to look. 
Comment the 'good' pair of styles out, and uncomment the 'bad' pair to see the
problem.
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:
Firefox:     http://www.mozilla.org/projects/firefox/
Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html
Seamonkey:   http://www.mozilla.org/projects/seamonkey/
This bug has been automatically resolved after a period of inactivity (see above
comment). If anyone thinks this is incorrect, they should feel free to reopen it.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → EXPIRED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: