Stop using `CreateElementTransaction` in `HTMLEditor`
Categories
(Core :: DOM: Editor, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox96 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
CreateElementTransaction
is too similar to InsertNodeTransaction
. Only the difference is, CreateElementTransaction::DoTransaction()
creates an element via editor instance and marks it dirty before inserting the new element. E.g., selection management and whether inserting new node or not at "redo" are same.
So, for the maintenance cost reason, we should get rid of CreateElementTransaction
, but for now, we should just make HTMLEditor
use InsertNodeTransaction
instead with a new pref to make it possible to back it out the new behavior.
Assignee | ||
Comment 1•2 years ago
|
||
This is a different point from InsertNodeTransaction
. If reference node has
been removed from the DOM tree, it tries to insert the given node to end of
the container instead of returning error. This is an edge case of "redo", and
this is tested by WPT. If we'd need to back it out with Normandy after shipping
this changes, we'd need to uplift WPT expectation change. However, we should
avoid this situation. Therefore, this patch fixes the bug of
CreateElementTransaction
first.
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
CreateElementTransaction
is too similar to InsertNodeTransaction
. Only the
difference is, CreateElementTransaction::DoTransaction() creates an element via
editor instance and marks it dirty before inserting the new element. E.g.,
selection management and whether inserting new node or not at "redo" are same.
So, for the maintenance cost reason, we should get rid of
CreateElementTransaction
, but for now, we should just make HTMLEditor
use
InsertNodeTransaction
instead, with a new pref to make it possible to back it
out the new behavior even after shipping.
Depends on D132118
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/8a151455283b part 1: Make `CreateElementTransaction::InsertNode()` not return error if reference child is disconnected r=m_kato https://hg.mozilla.org/integration/autoland/rev/d4bd94bc7b58 part 2: Make `HTMLEditor` stop using `CreateElementTransaction` by default r=m_kato
Comment 4•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8a151455283b
https://hg.mozilla.org/mozilla-central/rev/d4bd94bc7b58
Description
•