Open
Bug 1925439
Opened 4 months ago
Updated 1 month ago
Reduce the jobs of `HTMLEditor::OnEndHandlingTopLevelEditSubActionInternal()`
Categories
(Core :: DOM: Editor, task)
Core
DOM: Editor
Tracking
()
NEW
People
(Reporter: masayuki, Unassigned)
References
(Depends on 2 open bugs, Blocks 1 open bug)
Details
Currently, HTMLEditor::OnEndHandlingTopLevelEditSubActionInternal()
does:
- Insert a padding
<br>
at caret when deleting selection and the caret is in empty last line immediately before a block boundary - Insert a
<br>
element into empty list items and table cells in the range which were edited - Join adjacent
Text
nodes in the range which was edited - Remove empty nodes in the range which was edited
- Normalize consecutive white-spaces to make them visible and breakable
- Adjust caret position and insert a padding
<br>
at new caret position if it's in empty line immediately before a block boundary - Delete inline ancestors which become empty
- But cache the styles at caret position to restore them when user types characters
- Schedule spellcheck
- Insert
<br>
if the editing host is the<body>
and it becomes empty - Adjust interline position of caret
In some scenarios, edit action handlers do not want to be handled later. Therefore, there are a lot of flags in TopLevelEditSubActionData
. This approach is ugly and makes developers harder to understand the behavior. I think that except #9 (scheduling the spellchecker), those things should be done when they may need to be done.
You need to log in
before you can comment on or make changes to this bug.
Description
•