Closed Bug 1815383 Opened 2 years ago Closed 2 years ago

`InsertTextTransaction::DoTransaction` and `ReplaceTextTransaction::DoTransaction` should stop updating `Selection` directly

Categories

(Core :: DOM: Editor, task, P3)

task

Tracking

()

RESOLVED FIXED
112 Branch
Tracking Status
firefox112 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

No description provided.
Summary: `InsertTextTransaction::DoTransaction` should top updating `Selection` directly → `InsertTextTransaction::DoTransaction` and `ReplaceTextTransaction::DoTransaction` should stop updating `Selection` directly

And also this patch makes its only user,
EditorBase::InsertTextIntoTextNodeWithTransaction, and its only caller,
EditorBase::InsertTextWithTransaction, return InsertTextResult for
returning both end of inserted text and caret point suggestion. Note that
if it's for IME composition, CompositionTransaction needs to update
Selection directly. Therefore, caret point may be unset under composition
to updating Selection to wrong point (it seems that
TextEditor::HandleInsertText can be simplified later because of this change).

Depends on D169044

And also this changes HTMLEditor::ReplaceTextWithTransaction which is the only
user of ReplaceTextTransaction.

Depends on D169745

Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/c0c7ac76b5f3 part 1: Make `InsertTextTransaction::DoTransaction` stop updating `Selection` directly r=m_kato
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/6af593c327b0 part 2: Make `InsertText` and `ReplaceText` of `WhiteSpaceVisibilityKeeper` return `InsertTextResult` r=m_kato
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/47e6b9573249 part 3: Make `ReplaceTextTransaction::DoTransaction` stop updating `Selection` directly r=m_kato
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 112 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: