removeChild and insertBefore is clearing IMG tag dimensions

RESOLVED WORKSFORME

Status

()

Core
DOM: Core & HTML
RESOLVED WORKSFORME
15 years ago
6 years ago

People

(Reporter: Robert Schultz, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

15 years ago
See the URL for full details on this problem.

Essential a DOM create table contains two rows each with a single TD column 
containging a DOM created IMG tag with a DOM specified .width and .height
When the functions removeChild() and insertBefore() are used on a row withing 
this table, the IMG attributes for .width and .height are being reset to image 
defaults by Mozilla.
This behavior is not present in IE.

Comment 1

15 years ago
See it on Linux 2002072204; OS/Plat -> All
OS: Windows 2000 → All
Hardware: PC → All
confirmed.  The cool part is that if you load the page, right click the image,
select "view image", then click back then the testcase suddenly works...

Updated

15 years ago
Component: DOM Other → DOM Core
QA Contact: gerardok → stummala
(Reporter)

Comment 3

15 years ago
Also...
I had a web page with a stylesheet, and the stylesheet has a BODY attribute of 
background-color: "white";

If I javascript (after the page is loaded) changes the background with:
document.body.style.backgroundColor = "black";

All the images shrink back to their defaults.

It's almost as if any change to certain things causes Mozilla to 'scan' all 
child nodes and reset their attributes.
(Reporter)

Comment 4

15 years ago
I'd like to point out that it works fine if you use the 'style' width and 
height attributes instead of the IMG tag's attributes.
See:
http://www.cosmicrealms.com/MozillaBugTestTwo.html

That code uses tImg.style.width instead of tImg.width and works okay.

Comment 5

15 years ago
changing status to new
Status: UNCONFIRMED → NEW
Ever confirmed: true
Hmm... This should work now, but the testcase is gone.  I should have attached
it to the bug, back then.  :(

Robert, do you still have a page that runs into this problem?

Updated

9 years ago
Component: DOM: Core → DOM: Core & HTML
QA Contact: stummala → general
Should be fixed indeed.
Assignee: jonas → nobody
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.