Closed Bug 1802736 Opened 2 years ago Closed 2 years ago

HTML editor should not reuse existing container at styling text with `execCommand` if the element is not created in current mode

Categories

(Core :: DOM: Editor, defect, P2)

defect

Tracking

()

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

Attachments

(1 file)

There are the HTML mode and the CSS mode in HTMLEditor. The former creates an element representing the style, but the latter creates <span> element to specify the style. In the other browsers, whether the opposite type of elements are not reused. However, Gecko does. We should align the behavior to the other browsers for making the WPT results stabler.

The other browsers do not move styling nodes to existing element if the element
is never created in the mode. For example, execCommand("bold") in the CSS mode
for [abc]<b>def</b>, the other browsers make it
<span style="font-weight: bold">abc</span><b>def</b>, but Gecko does
<b>abcdef</b>. Similarly, execCommand("bold") in the HTML mode for
[abc]<span style="font-weight: bold">def</span>, the other browsers make it
<b>abc</b><span style="font-weight: bold">def</span>, but Gecko does it
<span style="font-weight: bold">abcdef</span>.

This patch makes Gecko align the behavior to the other browsers.

Depends on D163187

Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/c9789163d375
Make `AutoInlineStyleSetter` stop using different type of elements from the HTML/CSS mode point of view r=m_kato
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: