Closed Bug 1612477 Opened 5 years ago Closed 5 years ago

Remove `nsIDocumentStateListener::NotifyDocumentCreated()`

Categories

(Core :: DOM: Editor, task)

task
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

Meaningful implementation of nsIDocumentStateListener::NotifyDocumentCreated() is only ComposerCommandsUpdater. But it's already stored by HTMLEditor, thus, EditorBase::NotifyDocumentListeners() can notify ComposerCommandsUpdater of everything without nsIDocumentStateListener interface. Therefore, we can get rid of it.

This patch makes EditorBase::NotifyDocumentListeners() notify
ComposerCommandsUpdater via HTMLEditor::mComposerCommandsUpdater directly.
Therefore, ComposerCommandsUpdater can stop inheriting
nsIDocumentStateListener.

Note that this patch also makes ComposerCommandsUpdater::UpdateCommandGroup()
not take nsAString as its parameter because inlinning the
nsIDocumentStateListener requires ComposerCommandsUpdater.h to include
nsAString.h, but it's redundant and UpdateCommandGroup() just compares
it with literal strings. Therefore, using enum class for specifying command
group is faster.

There is no meaningful listener of this so that we can get rid of it.

Depends on D61357

Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/badf2dc13775 part 1: Make `ComposerCommandsUpdater` not inherit `nsIDocumentStateListener` r=m_kato https://hg.mozilla.org/integration/autoland/rev/78a3452181fa part 2: Remove `nsIDocumentStateListener.NotifyDocumentCreated()` r=m_kato
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
See Also: → 1613920
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: