Body Text instead of Paragraph shows in the Formatting bar with Use Paragraph format enabled
Categories
(Thunderbird :: Message Compose Window, defect, P1)
Tracking
(thunderbird_esr78 fixed)
Tracking | Status | |
---|---|---|
thunderbird_esr78 | --- | fixed |
People
(Reporter: walts48, Unassigned)
References
(Regression)
Details
(Keywords: regression, Whiteboard: [fixed by bug 1582410 (which caused five regressions)])
Attachments
(1 file, 1 obsolete file)
4.99 KB,
patch
|
Details | Diff | Splinter Review |
In preferences set Composition to "Use Paragraph format instead of Body Text by default".
Click "Write" to open a composition window.
Enter an address and subject, or just enter the body section.
Notice that "Body Text" is the default selection in the Formatting bar.
It should be "Paragraph".
Comment 1•5 years ago
|
||
Regression window:
https://hg.mozilla.org/comm-central/pushloghtml?fromchange=dd918656e4d7e4c79ebf44d9cb4e31eec406c1de&tochange=a96336115ce738cabc6bc86cb156067dd417e05f
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=b3ecb5aef45a8fb74764bb32e54567d57ed00383&tochange=6b93a83735ed3ab3b57b46c1b768814b1a1af5d6
Comment 2•5 years ago
|
||
Hmm, if the compose window doesn't show the right indicators, that will make for a lot of unhappy users.
Masayuki-san, could you please take a look, this seems to be caused by one of these:
bcaada0fa740bf6d07b95df1e1da820e12f990a9 Masayuki Nakano — Bug 1581337 - Make HTMLEditor::DeleteMostAncestorMailCiteElementIfEmpty()
do nothing if found mail-cite element is not empty r=m_kato
71cfe2c9fc79e46e8fe0c360839ca2a5b595c696 Masayuki Nakano — Bug 1581034 - part 2: Get rid of TextEditUtils::IsBreak()
and TextEditUtils
itself r=m_kato
4e5e43eefae5f5762a3651b44ea08450fe478d83 Masayuki Nakano — Bug 1581034 - part 1: Get rid of TextEditUtils::IsBody()
r=m_kato
620fa59408e852fe7cec0e1584ccde64d69e41c9 Masayuki Nakano — Bug 1540029 - part 11: Get rid of AutoEditInitRulesTrigger
r=m_kato
72e2b71294b4b30411516c671382b6fba25cb610 Masayuki Nakano — Bug 1540029 - part 10: Get rid of TextEditRules
and HTMLEditRules
r=m_kato
Comment 3•5 years ago
|
||
Jorg K:
I still don't have idea what changed the initialization behavior. However, according to "Insert HTML" dialog, HTMLEditor
puts <p>
element with <br>
element (and perhaps, it's followed by empty text node), and <pre class="moz-signature">
follows it with preceding empty text node. If so, the DOM tree does not match what NotifyComposeBodyReadyNew
expected. Could you fix this on there?
(you don't accept ni?...)
Comment 4•5 years ago
|
||
Thanks for the comment.
https://searchfox.org/comm-central/rev/7979a5b153574449076ca28611f2e6afd5677511/mail/components/compose/content/MsgComposeCommands.js#537-558
has if (insertParagraph && gBodyFromArgs) {
just above, so that's code that runs when you start TB with -compose.
The case we're looking at is:
https://searchfox.org/comm-central/rev/7979a5b153574449076ca28611f2e6afd5677511/mail/components/compose/content/MsgComposeCommands.js#530-533
and
https://searchfox.org/comm-central/rev/7979a5b153574449076ca28611f2e6afd5677511/mail/components/compose/content/MsgComposeCommands.js#562-577
where we insert a <p><br></p> and set the state on cmd_paragraphState
.
The "mode" indicator "Body Text" or "Paragraph" in Thunderbird is driven off the cmd_paragraphState
, I believe. I've just tried
<body>
<p>xxx</p>
<p>yyy</p>
zzz<br>
</body>
and clicking into the xxx, yyy or zzz does set the "mode" indicator correctly. So could it be that this line
document.getElementById("cmd_paragraphState").setAttribute("state", "p");
doesn't work any more?
Comment 5•5 years ago
•
|
||
I still don't understand the regression reason, though, nsIHTMLEditor.insertElementAtSelection()
behaves unexpectedly for you.
It collapse selection after the <p>
element in this case:
https://searchfox.org/mozilla-central/rev/dc4560dcaafd79375b9411fdbbaaebb0a59a93ac/editor/libeditor/HTMLEditor.cpp#1712,1716
Therefore, when you call document.getElementById("cmd_paragraphState").setAttribute("state", "p");
, the selection is collapsed outside the <p>
element.
And oddly, after that nsIEditor.beginningOfDocument()
is called, then, selection will be collapsed into the <p>
element (probably). I don't understand why this was previously working, but I guess that you can fix this with swapping order of document.getElementById("cmd_paragraphState").setAttribute("state", "p");
and editor.beginningOfDocument();
.
(I really don't understand why the patches caused this regression...)
Comment 6•5 years ago
|
||
Like so? That doesn't change anything.
As the bug says, when you start a new composition, you the "mode" indicator shows "Body Text" although paragraphs are inserted. Also, if you create multiple paragraphs, then clicking onto the first one, the indicator is still doesn't display "Paragraph". Also, there is an assortment of disconcerting warnings in the console:
[7636, Main Thread] WARNING: '!aTarget', file c:/mozilla-source/comm-central/editor/libeditor/HTMLEditorObjectResizer.cpp, line 734
[7636, Main Thread] WARNING: HTMLEditor::OnMouseDown() failed, but ignored: 'NS_SUCCEEDED(rvIgnored)', file c:/mozilla-source/comm-central/editor/libeditor/HTMLEditorEventListener.cpp, line 408
[7636, Main Thread] WARNING: HTMLEditor::GetAbsolutelyPositionedSelectionContainer() reached <html> element: file c:/mozilla-source/comm-central/editor/libeditor/HTMLAbsPositionEditor.cpp, line 93
So to me it looks like there's something going quite wrong inside the editor. The last warning looks like it tried to find a selection container, like a paragraph, but for some reason, ascended right to the <html> element without finding it.
Updated•5 years ago
|
Comment 7•5 years ago
|
||
I think this is triggered by Bug 1581305.
Comment 8•5 years ago
|
||
Hey, Alice, yes, that is a good candidate, let's go with that assumption for now. Sorry, when I see editor issues, I immediately jump to M-C, my apologies!
Magnus, a broken "mode" indicator makes decent editing in TB pretty hard. Can you please get this fixed, maybe it's really related to the observer changes you made. cmd_paragraphState was also part of those changes.
Comment 9•5 years ago
|
||
Working... But, I don't understand exactly why both the .doCommand() and window.updateCommands("style") are needed.
Also calling window.updateCommands("style") before editor.beginningOfDocument() etc. won't help.
If I move the editor.beginningOfDocument(); call to up earlier, thing also doesn't work.
Updated•5 years ago
|
Comment 10•5 years ago
|
||
Thanks, I'm glad the bug moved onto the radar and the solution is within reach :-)
Comment 11•5 years ago
|
||
Comment 12•4 years ago
|
||
Bug 1582410 fixes this.
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 13•4 years ago
|
||
Comment on attachment 9146765 [details] [diff] [review]
bug1625218_toolbar_p.patch
Let's take the patch here and back out
https://bugzilla.mozilla.org/show_bug.cgi?id=1582410
https://bugzilla.mozilla.org/show_bug.cgi?id=1653545
https://bugzilla.mozilla.org/show_bug.cgi?id=1655279
instead.
Bug 1582410 caused five regressions so far. See bug 1658999 comment #1 for details.
Updated•4 years ago
|
Updated•4 years ago
|
Comment 14•4 years ago
|
||
The try build
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=e03a557a6bfe67461dba44a851bf0c5a8278f975
"mostly" works and restores TB 68 functionality. The only thing that doesn't work is that when starting up the compose window with "Fixed width" as composing preference, it's not shown until the first text is typed. Maybe we can improve on that here.
Comment 15•4 years ago
|
||
Comment on attachment 9146765 [details] [diff] [review]
bug1625218_toolbar_p.patch
Sigh, I tested this some more. It works well enough in paragraph mode, but it doesn't work at all in "body text" mode. Can this be made to work, or do we have to abandon the idea of using this instead of bug 1582410 and all the regressions it causes?
Comment 16•4 years ago
|
||
OK, let's return the bug to the state at comment #12.
Summary: This was fixed by bug 1582410 and the regressions of the latter were fixed bug bug 1658999.
Updated•4 years ago
|
Description
•