Create new APIs for users of `nsIEditor.transactionManager`
Categories
(Core :: DOM: Editor, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox107 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
Details
Attachments
(4 files)
Assignee | ||
Comment 1•2 years ago
|
||
nsIEditor.transactionManager
is used only for some simple purposes, however,
nsIEditor
exposes the rich API. That makes it harder to maintain internal
code around transactions. Instead, nsIEditor
exposes only simple and
necessary APIs.
This patch creates a new API to clear undo/redo history and make the users in
mozilla-central use it instead of using nsITransactionManager.clear()
.
Depends on D158335
Assignee | ||
Comment 2•2 years ago
|
||
They are methods to take 2 out params, and it's not convenient for light use.
I think that there should be 3 attributes, undoRedoEnabled
, canUndo
and
canRedo
. Then, the findbar does not need to check number of transactions
with nsITransactionManager
.
Depends on D158336
Assignee | ||
Comment 3•2 years ago
|
||
nsIEditor.undo
and nsIEditor.redo
are called with 1
except by the search
bar, and search bar wants to undo everything to reset the value. Therefore,
search bar needs an API to undo all, and the others do not need the number of
undoing/redoing transactions. Therefore, this patch adds nsIEditor.undoAll
for search bar, and remove the arguments from nsIEditor.undo
and
nsIEditor.redo
.
Depends on D158337
Assignee | ||
Comment 4•2 years ago
|
||
Now, nsIEditor
has all alternatives of remaining nsITransactionManager
usage in mozilla-central.
Depends on D158338
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/cd2887479b57 part 1: Add `nsIEditor.clearUndoRedo()` to get rid of `nsIEditor.transactionManager` r=m_kato,NeilDeakin,Standard8 https://hg.mozilla.org/integration/autoland/rev/a8905b5dc95a part 2: Redesign `nsIEditor.canUndo` and `nsIEditor.canRedo` r=m_kato,NeilDeakin https://hg.mozilla.org/integration/autoland/rev/52f672a5a34b part 3: Add `nsIEditor.undoAll` r=m_kato,Standard8 https://hg.mozilla.org/integration/autoland/rev/b8567457ece9 part 4: Make all tests in mozilla-central stop using `nsIEditor.transactionManager` r=m_kato
Comment 6•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/cd2887479b57
https://hg.mozilla.org/mozilla-central/rev/a8905b5dc95a
https://hg.mozilla.org/mozilla-central/rev/52f672a5a34b
https://hg.mozilla.org/mozilla-central/rev/b8567457ece9
Description
•