Port bug 1244437: formatBlock div isn't possible when executed in a <p> [contenteditable, execCommand]
Categories
(Thunderbird :: Upstream Synchronization, defect)
Tracking
(thunderbird_esr115 unaffected, thunderbird120 unaffected)
Tracking | Status | |
---|---|---|
thunderbird_esr115 | --- | unaffected |
thunderbird120 | --- | unaffected |
People
(Reporter: babolivier, Assigned: babolivier)
References
Details
Attachments
(1 obsolete file)
Assignee | ||
Comment 1•2 years ago
•
|
||
Caused by https://hg.mozilla.org/mozilla-central/rev/77bccdc1a9b6eac6b3195dfa450cc768730c1e20
Finally, we created new format block element if
<br>
element appears, but
the other browsers moves it into the new format node simply. Therefore, we
should follow them (about<blockquote>
, we've already done this within
the different path).
Considering the following content in the composer (in "Body Text" format):
foo<br>
bar
Previously, changing the paragraph state of this content to e.g. p
would transform it into:
<p>foo</p>
<p>bar</p>
Now, it would be transformed into:
<p>
foo<br>
bar
</p>
The test test_convert_from_body_paragraph_state
expects the former (where each line becomes its own paragraph), hence the failures.
Pushed by brendan@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/5c8b36aae430
Adapt test to incorporate recent changes to paragraph formatting. rs=me
Updated•2 years ago
|
Comment 3•2 years ago
|
||
Oh, that's odd. I was carefully trying to keep the behavior of cmd_paragraphState
for Thunderbird. However, did it change the behavior? If the result is not good for Thunderbird, I'll add a path for Thunderbird in m-c, feel free to request it if so.
Comment 4•2 years ago
|
||
So, here should be the path:
https://searchfox.org/mozilla-central/rev/c51359e1e6beeb6cee5eafe67272c9be16fcf5c1/editor/libeditor/HTMLEditSubActionHandler.cpp#9333-9341,9349,9354
I wonder, the test uses document.execCommand("formatBlock")
instead? After bug 1244437, cmd_paragraphState
and formatBlock
work really differently. The former respects the traditional behavior, but the latter respects the compatibility between browsers.
Assignee | ||
Comment 5•2 years ago
|
||
That's a good point, I'm not sure why we use formatBlock
in Thunderbird instead of cmd_paragraphState
. It seems to come from bug 1582410 and bug 1655014. I'll have another look. Thanks for pointing this out!
Assignee | ||
Updated•2 years ago
|
Updated•1 year ago
|
Description
•