Closed Bug 1639161 Opened 4 years ago Closed 4 years ago

Create ReplaceTextTransaction to avoid creating both InsertTextTransaction and DeleteTextTransaction

Categories

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

task

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox78 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

(Regressed 1 open bug)

Details

Attachments

(3 files)

No description provided.

Currently, when HTMLEditor replaces text in a text node, HTMLEditor
creates a set of DeleteTextTransaction and InsertTextTransaction.
However, this has bad impact for footprint and causes the callers messy.

This patch creates ReplaceTextTransaction instead and
HTMLEditor::ReplaceTextWithTransaction() as its wrapper. Unfortunately,
this becomes not calling nsIEditActionListener::DidDeleteText(), however,
this is not used by mozilla-central, comm-central nor BlueGriffon. IIRC,
it was not removed for some legacy addons of Thunderbird. Therefore, it
must be okay to remove it.

Depends on D75889

It's not used by mozilla-central, comm-central nor BlueGriffon, and it cannot
work with replacing content, mutation event listener's changes. Therefore,
we should remove this for now. If we need to support this feature in some
business reasons, we should provide better API than this anyway.

Depends on D76079

Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/2ac7be4d8239 part 1: Create `ReplaceTextTransaction` class r=m_kato https://hg.mozilla.org/integration/autoland/rev/5f86836c31e5 part 2: Make `WSRunObject` use `HTMLEditor::ReplaceTextWithTransaction()` r=m_kato https://hg.mozilla.org/integration/autoland/rev/7043d20f06b5 part 3: Get rid of `nsIEditActionListener::DidDeleteText()` r=m_kato
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: