Open Bug 1861411 Opened 2 years ago Updated 1 year ago

Port bug 1244437: formatBlock div isn't possible when executed in a <p> [contenteditable, execCommand]

Categories

(Thunderbird :: Upstream Synchronization, defect)

Thunderbird 121
defect

Tracking

(thunderbird_esr115 unaffected, thunderbird120 unaffected)

REOPENED
121 Branch
Tracking Status
thunderbird_esr115 --- unaffected
thunderbird120 --- unaffected

People

(Reporter: babolivier, Assigned: babolivier)

References

Details

Attachments

(1 obsolete file)

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

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Assignee: nobody → brendan
Target Milestone: --- → 121 Branch

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.

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.

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!

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attachment #9383294 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: