Open Bug 358368 Opened 18 years ago Updated 2 years ago

changing 'paragraph mode' discards attributes

Categories

(Core :: DOM: Editor, defect)

defect

Tracking

()

REOPENED

People

(Reporter: eyalroz1, Unassigned)

Details

Attachments

(1 file, 1 obsolete file)

If you change the paragraph mode in a composed message, e.g. from P to H1, then the attributes of the <p> element (dir, align, style, class, etc.) are not maintained. While one may debate whether all of these need be maintained, certainly the default should be 'maintain' rather than 'discard'.

This causes, in particular,
http://bugzilla.mozdev.org/show_bug.cgi?id=13294
I'm completely stepping out of my turf here but can't you use 'aCloneAttributes' in ReplaceContainer()?

In that case, the patch would be just one line: replace 
    ... mHTMLEditor->ReplaceContainer(...);
with
    ... mHTMLEditor->ReplaceContainer(..., nsnull, nsnull, PR_TRUE);
Comment on attachment 243792 [details] [diff] [review]
fix #1, ready for review, tested

(In reply to comment #2)
> I'm completely stepping out of my turf here but can't you use
> 'aCloneAttributes' in ReplaceContainer()?
> 
> In that case, the patch would be just one line: replace 
>     ... mHTMLEditor->ReplaceContainer(...);
> with
>     ... mHTMLEditor->ReplaceContainer(..., nsnull, nsnull, PR_TRUE);

BWAHAHA !!! Pierre, that's certainly the first time I laugh so much reading a technical comment. Thanks a zillion for the good catch.
Attachment #243792 - Attachment is obsolete: true
Attachment #243792 - Flags: review?(brade)
Attachment #244070 - Flags: review?(neil) → review+
neil said in IRC

  <NeilAway> glazou: yes, you can take that as r+sr

checked in (trunk)
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Bug still manifests with SM trunk 2008-07-21.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
QA Contact: editor

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: daniel → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: