head attributes leaking into recycled compose window

RESOLVED FIXED

Status

MailNews Core
Composition
RESOLVED FIXED
14 years ago
10 years ago

People

(Reporter: Scott MacGregor, Assigned: neil@parkwaycc.co.uk)

Tracking

({fixed-aviary1.0})

Trunk
x86
Windows XP
fixed-aviary1.0

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

14 years ago
If I reply to a message that has some style stuff inside of the head tag (such
as an RSS message):

  <head>
    <title>Bart Decrem: Make planet rock even more</title>
    <style type="text/css">
      body {
        margin: 0;
        border: none;
        padding: 0;
      }
      
      #content {
        margin: 0;
        border: none;
        padding: 0.4em;
        padding-top: 1.8em;
      }

    </style>
  </head>

From that point forward, the head attributes are always present in the recyled
compose window. We never clear them out. 

We should be removing the head element from the document when we move the
compose window into the recylced state in the same way that we remove any body
style attributes.
(Reporter)

Comment 1

14 years ago
Created attachment 157524 [details] [diff] [review]
a fix

Note: this method is only called from mailnews when we are recycling a compose
window.
(Reporter)

Updated

14 years ago
Attachment #157524 - Flags: superreview?(sspitzer)
Attachment #157524 - Flags: review?(neil.parkwaycc.co.uk)
(Reporter)

Comment 2

14 years ago
Neil tells me he has a better way to fix this that doesn't require my patch nor
Seth's original body attribute cloning patch to editor.js. 

(Assignee)

Comment 3

14 years ago
Created attachment 157548 [details] [diff] [review]
Let the punishment fit the crime

Since the problem was caused by improving RebuildDocumentFromSource I was
inspired to use RebuildDocumentFromSource to solve it ;-)
Assignee: mscott → neil.parkwaycc.co.uk
Status: NEW → ASSIGNED
(Assignee)

Updated

14 years ago
Attachment #157548 - Flags: superreview?(mscott)
Attachment #157548 - Flags: review?(daniel)
(Reporter)

Comment 4

14 years ago
Comment on attachment 157548 [details] [diff] [review]
Let the punishment fit the crime

Thanks for fixing this Neil.
Attachment #157548 - Flags: superreview?(mscott) → superreview+
Comment on attachment 157548 [details] [diff] [review]
Let the punishment fit the crime

>Index: editor.js
>===================================================================
>RCS file: /cvsroot/mozilla/editor/ui/composer/content/editor.js,v
>retrieving revision 1.228
>diff -p -u -d -r1.228 editor.js
>--- editor.js	14 Jul 2004 04:27:31 -0000	1.228
>+++ editor.js	31 Aug 2004 22:58:16 -0000
>@@ -668,21 +668,10 @@ function EditorSharedStartup()
> function EditorResetFontAndColorAttributes()
> {
>   try {  
>+    var editor = GetCurrentEditor();
>+    editor.rebuildDocumentFromSource("");
>+    editor.removeAllInlineProperties();

Yes. r=daniel@glazman.org
Please add a comment line saying that in case of a collapsed selection,
and we have one here, the last line above really means "Discontinue all
inline styles", the effect you want to achieve here. Thanks.
Attachment #157548 - Flags: review?(daniel) → review+
(Assignee)

Comment 6

14 years ago
Fix checked in to the trunk.
Status: ASSIGNED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
(Reporter)

Comment 7

14 years ago
FYI, I landed Neil's patch on the aviary branch and backed out mine. My patch
also caused lots of problems with forwarding inline attachments and editing
drafts (Bug #257952) so it's a good thing Neil had a better fix :)
Keywords: fixed-aviary1.0
(Reporter)

Updated

14 years ago
Attachment #157524 - Attachment is obsolete: true
Attachment #157524 - Flags: superreview?(sspitzer)
Attachment #157524 - Flags: review?(neil.parkwaycc.co.uk)
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.