Closed Bug 1501259 Opened 6 years ago Closed 6 years ago

editing a plaintext draft, all lines displayed in blue (in quote span)

Categories

(Thunderbird :: Message Compose Window, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 65.0

People

(Reporter: bugzilla, Assigned: masayuki)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 1 obsolete file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0

Steps to reproduce:

typing/answering a message, sent it to draft, go to draft, edit the message again.


Actual results:

All lines in the message are displayed as Quote, even the lines I typed and also Thunderbird now handles all new lines that I type into the message as quote, for example at word-wrap and color.


Expected results:

The message should not change by sending it to draft.
I can't reproduce using Mozilla/5.0 (X11; Linux x86_64; rv:64.0) Gecko/20100101 Thunderbird/64.0a1 BuildID: 20181022100143 or my Thunderbird 64.0a1 on Windows 10.

Does the problem occur if you use safe mode?
Flags: needinfo?(ruediger.lahl)
Which version are you using?
(In reply to Jorg K (GMT+2) from comment #2)
> Which version are you using?

Actual Windows 64 trunk 64.0a1 (2018-10-22) (64-bit) nightly 20181022100143, but the problem is already some month old.
I reported it on a german newsgroup on August the 26 with a nightly from 63.0a

It seems, the problem only appears in plain-ascii-mails/postings and not in html(sorry, I forgot to tell this).
Flags: needinfo?(ruediger.lahl)
(In reply to WaltS48 [:walts48] from comment #1)
> I can't reproduce using Mozilla/5.0 (X11; Linux x86_64; rv:64.0)
> Gecko/20100101 Thunderbird/64.0a1 BuildID: 20181022100143 or my Thunderbird
> 64.0a1 on Windows 10.
> 
> Does the problem occur if you use safe mode?

Yes.
Tested with plain text newsgroups posts and still can't reproduce.

Tried a new profile?
Confirmed.

STR:
Do a plain-text replay to an e-mail, usually Shift+Reply if your default is HTML.
Note some quoted text in blue.
Add some new text, should be black.
Save and close draft.
Look at the draft, it looks OK, with a vertical quotation bar.
Now edit the draft. It comes back all blue, not the way it was saved.
Sadly ThunderHTMLedit doesn't work in TB 63/64/65, so we can't see what's going on.

Works OK in TN 60 ESR.

Alice, can you please find the regression for us.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(alice0775)
Looking at the bad re-edited draft in the Inspector, I can see that the entire message is now wrapped into the "quote span"
  <span style="white-space: pre-wrap; display: block; width: 98vw;">
instead of just the quote part. Hmm, not good.
Summary: editing a mail from draft, all lines displayed as quotes → editing a plaintext draft, all lines displayed in blue (in quote span)
Thank you, Alice. Yes, I was adding new text below the quote.

Yes, something has gone wrong in bug 1476897.

When editing a plaintext draft - I think - we collect all the lines starting with ">" and insert those as quotation, then insert the unquoted lines.
Flags: needinfo?(masayuki)
Ah, here could be a regression point:
https://searchfox.org/mozilla-central/rev/a21ac3d8e53cd37b6725f982b185d92fe47d8835/editor/libeditor/HTMLEditorDataTransfer.cpp#2021-2023,2026
Assignee: nobody → masayuki
Status: NEW → ASSIGNED
Flags: needinfo?(masayuki)
Attached patch bug1501259-1.diff (obsolete) — Splinter Review
Could you check whether this patch fixes this bug?
Attachment #9020594 - Flags: feedback?(jorgk)
Sorry, the patch doesn't apply. You appear to have other patches from bug 1465702 before in your queue:
https://hg.mozilla.org/try/graph/1ac65b4fcaead5ef0c1798c702e1e7d24ae82f53
Oops, really sorry. Rebased.
Attachment #9020594 - Attachment is obsolete: true
Attachment #9020594 - Flags: feedback?(jorgk)
Attachment #9020600 - Flags: feedback?(jorgk)
Comment on attachment 9020600 [details] [diff] [review]
bug1501259-1.diff

Thank you, this works fine, checked visually and with the Inspector.

Are these warnings relevant?
[8524, Main Thread] WARNING: HTMLEditRules::BeforeEdit() failed to handle someth
ing: 'NS_SUCCEEDED(rv)', file c:/mozilla-source/comm-central/editor/libeditor/HT
MLEditor.cpp, line 3612
[8524, Main Thread] WARNING: Perhaps, <br> element position has been moved to di
fferent point by mutation observer: 'currentPoint == pointToInsert', file c:/moz
illa-source/comm-central/editor/libeditor/HTMLEditRules.cpp, line 1555

The second one repeats about 10 times.
Attachment #9020600 - Flags: feedback?(jorgk) → feedback+
Thanks!

(In reply to Jorg K (GMT+2) from comment #15)
> Are these warnings relevant?
> [8524, Main Thread] WARNING: HTMLEditRules::BeforeEdit() failed to handle
> someth
> ing: 'NS_SUCCEEDED(rv)', file
> c:/mozilla-source/comm-central/editor/libeditor/HT
> MLEditor.cpp, line 3612
> [8524, Main Thread] WARNING: Perhaps, <br> element position has been moved
> to di
> fferent point by mutation observer: 'currentPoint == pointToInsert', file
> c:/moz
> illa-source/comm-central/editor/libeditor/HTMLEditRules.cpp, line 1555
> 
> The second one repeats about 10 times.

I've seen those warnings a lot in these days. Although I need to investigate it, but I keep working on urgent bugs...
Regression of bug 1476897, HTMLEditor::InsertAsPlaintextQuotation() refers
|newNode| which is new created <span> element by the method at collapsing
Selection.  However, it's already been moved to its out param.  Therefore,
after the fix of bug 1476897, it won't collapse Selection.  This patch
moves the code moving |newNode| to the out param after collapsing Selection.

Additionally, this makes HTMLEditor::InsertAsCitedQuotationInternal() use
same style code around collapsing Selection since it's also tested by the
new test of nsIEditorMailSupport.insertAsCitedQuotation().
Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/870be0de691a
HTMLEditor::InsertAsPlaintextQuotation() shouldn't refer |newNode| after calling its |forget()| r=m_kato
https://hg.mozilla.org/mozilla-central/rev/870be0de691a
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 65.0
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: