Closed Bug 1717155 Opened 5 years ago Closed 1 year ago

Stop storing text node in `DeleteTextTransaction`, `InsertTextTransaction` and `ReplaceTextTransaction` if editor is a `TextEditor`

Categories

(Core :: DOM: Editor, task)

task

Tracking

()

RESOLVED FIXED
138 Branch
Tracking Status
firefox138 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

(Blocks 4 open bugs)

Details

Attachments

(2 files)

I've not checked instance size of the transaction, we could reduce the footprint of them if they store dom::Text in derived class of them only when the editor is an HTMLEditor. Otherwise, just stopping storing text node is also fine.

Assignee: nobody → masayuki
Status: NEW → ASSIGNED

Anyway, we need to fix this for making TextEditor can work after recreating the native anonymous subtree.

Type: enhancement → task
Priority: P5 → --

The anonymous <div> of TextEditor has only one Text as its first child.
Therefore, we can make TextEditor simpler to access the Text node.

So, Text editor can access the Text node quickly and it's not needed to
be grabbed by a lot of transactions. Additionally, when we support keeping
TextEditor instance even if the text control is reflowed (bug 1922141,
bug 1339052 and bug 1620050), transactions need to work with new anonymous
nodes. Therefore, retrieving Text node of TextEditor each time does make
sense rather than storing the node.

Depends on D240419

Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/7b4beaa4fab1 part 1: Make `TextEditor` use `GetTextNode()` more r=m_kato https://hg.mozilla.org/integration/autoland/rev/7672cad7ff78 part 2: Make `InsertTextTransaction`, `CompositionTransaction`, `DeleteTextTransaction` and `ReplaceTextTransaction` not store `Text` node if it's for `TextEditor` r=m_kato
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 138 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: