Closed Bug 208872 Opened 22 years ago Closed 22 years ago

cloneNode doesn't copy style attribute correctly

Categories

(Core :: CSS Parsing and Computation, defect, P1)

x86
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla1.5alpha

People

(Reporter: mikol, Assigned: dbaron)

References

Details

(Whiteboard: [patch])

Attachments

(6 files)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030609 Mozilla Firebird/0.6 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030609 Mozilla Firebird/0.6 Here's the HTML code in question: <td colspan="2" nowrap="1"> <div> <span style="font-weight:normal;float:right;"> <span id="remDevLink"><a id="rem" href="">Remove...</a> | </span> <a id="mod" href="">Edit...</a> </span> <span id="dev">Floppy Drive</span> </div> </td> The float and font-weight style in td.div.span is not honored. Reproducible: Always Steps to Reproduce: I don't have a small test case, but it happens every time for the page you'll find in the attached screenshots. Expected Results: See the expected results (Mozilla 1.3.1) screenshot.
So... how do I load this page the screenshots are of? Would it be possible to save it and attach it to this bug?
I'm afraid not. The problem being that the page is constructed from a template using the DOM to clone sections of interest. I did load the template in Gecko/20030609 Mozilla Firebird/0.6 by itself. The float and font-weight specifications are honored in the template, but (obviously) not after the parts have been replicated in the DOM. Might be a DOM problem. I will try to create a self-contained example to demonstrate the problem.
Attached file Test Case
The problem in question can be seen by clicking "Demonstrate Problem" on the index.html page contained in the Test Case attachement.
This is a regression from my bug 125246 landing.
Assignee: float → dbaron
Status: UNCONFIRMED → NEW
Component: Layout: Floats → Style System
Ever confirmed: true
Summary: Specified float and font-weight are not honored in spans → cloneNode doesn't copy style attribute correctly
Attached patch patchSplinter Review
This fixes it. The copying of mStyleBits is the fix. The other three changes are two potential UMR/crash fixes and a warning fix that I'd already attached to another bug.
Attachment #125329 - Flags: superreview?(bz-bugspam)
Attachment #125329 - Flags: review?(bz-bugspam)
Status: NEW → ASSIGNED
Priority: -- → P1
Whiteboard: [patch]
Target Milestone: --- → mozilla1.5alpha
Comment on attachment 125329 [details] [diff] [review] patch r+sr=me. mikol@vmware.com, thanks for the bug report and the testcase!
Attachment #125329 - Flags: superreview?(bz-bugspam)
Attachment #125329 - Flags: superreview+
Attachment #125329 - Flags: review?(bz-bugspam)
Attachment #125329 - Flags: review+
bz-bugspam@mit.edu, not a problem. Thanks for the quick response.
Fix checked in to trunk, 2003-06-10 15:08 -0700.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: