Closed Bug 1795179 Opened 2 years ago Closed 2 years ago

`HTMLEditor` shouldn't split atomic nodes when `Selection` is collapsed in it

Categories

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

defect

Tracking

()

RESOLVED FIXED
108 Branch
Tracking Status
firefox108 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

Attachments

(1 file)

This is the root cause of bug 1793873, but this requires a risky patch. Therefore, this should be fixed in the next cycle.

One of the reason of bug 1793873 is, HTMLEditUtils::IsSplittableNode returns
false for <textarea>. Then, insertParagraph etc command with Selection
collapsed in <textarea> causes splitting the <textarea> and it's not split
at same parent.

Then, I found that we need to take care <button> specially. It creates a
block formatting context, and it's a form control so that it should never be
split. Therefore, HTMLEditor::GetAncestorElement requires to take care of
<button> element with additional scan option for minimizing the risk.

Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/038341029e6b Make some elements non-splittable r=m_kato
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/36542 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: