Closed Bug 137428 Opened 22 years ago Closed 22 years ago

[FIX]broken layout in dynamically (javascript) built div table since nightly builds after 0.9.9 release (cloneNode does not copy style attribute)

Categories

(Core :: DOM: Core & HTML, defect, P1)

defect

Tracking

()

VERIFIED FIXED
mozilla1.0

People

(Reporter: pepto, Assigned: bzbarsky)

References

()

Details

(Keywords: regression)

Attachments

(2 files, 2 obsolete files)

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-AT; rv:0.9.9+)
Gecko/20020413
BuildID:    2002041308

A made some little small Javascript code which builds a table made of div's and
puts numbers (made of gif's) into certain cells...

It's located here: www.pepto.de/test/div.html

It works beautifully in Mozilla 0.9.9 (and probably versions before that) and
Internet Explorer 5.1.3 on MacOS X (although IE is pretty slow at it)...

I downloaded the latest nightly build a few days ago and today again and
recognized that my little small script doesn't seem to work any longer in the
nighties after 0.9.9... The numbers are all over the screen vertically and stuff
like that...

I guess somebody changed something in the Mozilla-code and now it's broken...
I'm no Javascript-wizard, but I'm not doing anything too fancy in my script so I
think that this is a bug in Mozilla (especially as it worked in Mozilla before
and works in IE)...

I'm sorry if I'm the one to blame as my JS-programming skills are far from
perfect... =)


Reproducible: Always
Steps to Reproduce:
1. Load www.pepto.de/test/div.html in Mozilla 0.9.9 release
2. Load www.pepto.de/test/div.html in Mozilla latest nightly build
3. See the difference and try to fix the bug ;-)

Actual Results:  The numbers are all over the screen vertically and stuff like
that...

Expected Results:  Put the numbers correctly in certain div's like Moz 0.9.9 and
IE do...
Attached file testcase
It looks like cloneNode loses the "style" attribute....  This is a regression
from 0.9.9.

Fabian?  Any ideas?
Assignee: attinasi → jst
Severity: normal → major
Status: UNCONFIRMED → NEW
Component: Layout → DOM Core
Ever confirmed: true
OS: MacOS X → All
QA Contact: petersen → stummala
Hardware: Macintosh → All
Oh, backing out the patch from bug 26528 fixes this.  So it's something in that
general area of things...
Attached patch Patch to fix (obsolete) — Splinter Review
The problem is that nsGenericHTMLElement::SetAttr doesn't parse style
attributes for things that are not in a document.  So we need to copy over the
HTMLValue of the style attr instead of setting it as a string in cloneNode().
Attached patch Same patch as diff -uw (obsolete) — Splinter Review
This may be a little easier to review.	The easiest way to review the patch is
probably to apply it and look at the code, though.
Oh, and the patch does not regress bug 26528
Comment on attachment 79227 [details] [diff] [review]
Patch to fix

+      if (name == nsHTMLAtoms::style) {

Make that "name == nsHTMLAtoms::style && namespace == kNameSpaceID_None".

sr=jst
Attachment #79227 - Flags: superreview+
Attachment #79227 - Attachment is obsolete: true
Attachment #79228 - Attachment is obsolete: true
Comment on attachment 79285 [details] [diff] [review]
same patch with namespace check

marking jst's sr
Attachment #79285 - Flags: superreview+
Comment on attachment 79285 [details] [diff] [review]
same patch with namespace check

eww, this one escaped my vigileance! thanks!
r=fabian
Attachment #79285 - Flags: review+
taking to land
Assignee: jst → bzbarsky
Checked in on the trunk.  I'll ask for driver approval for the branch tomorrow
once I can say that there have been no regressions filed for a bit....
Whiteboard: pending drivers decision
Priority: -- → P1
Summary: broken layout in dynamically (javascript) built div table since nightly builds after 0.9.9 release → [FIX]broken layout in dynamically (javascript) built div table since nightly builds after 0.9.9 release
Target Milestone: --- → mozilla1.0
Comment on attachment 79285 [details] [diff] [review]
same patch with namespace check

a=rjesup@wgate.com fro branch checkin
Attachment #79285 - Flags: approval+
fixed on branch.
Status: NEW → RESOLVED
Closed: 22 years ago
Keywords: fixed1.0.0
Resolution: --- → FIXED
Whiteboard: pending drivers decision
Summary: [FIX]broken layout in dynamically (javascript) built div table since nightly builds after 0.9.9 release → [FIX]broken layout in dynamically (javascript) built div table since nightly builds after 0.9.9 release (cloneNode does not copy style attribute)
*** Bug 140189 has been marked as a duplicate of this bug. ***
verified1.0.0 on 05-22-18-1.0.0 & also Verified on trunk on 05-23-08-trunk.
Status: RESOLVED → VERIFIED
Keywords: verified1.0.0
Component: DOM: Core → DOM: Core & HTML
QA Contact: stummala → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: