gecko-dev/editor/composer
Masayuki Nakano 2020349542 Bug 1430982 - part 10: Make EditorBase store TextServicesDocument for its mInlineSpellChecker for avoiding to run for loops to call nsIEditActionListener methods r=m_kato
Currently, first edit action listener is always TextServicesDocument for
EditorBase::mInlineSpellChecker if spell check is enabled and it requires
only DidDeleteNode() and DidJoinNodes().  So, in most cases, EditorBase
should call only them to avoid running redundant for loops for
nsIEditActionListener methods.

This patch makes that EditorBase::AddEditActionListener() and
RemoveEditActionListener() check whether coming nsIEditActionListener is
TextServicesDocument for mInlineSpellChecker.  If so, EditorBase should
store it as reference to TextServicesDocument.  And when edit action occurs,
its DidDeleteNode() and DidJoinNodes() should be called directly.

Unfortunately, this patch makes TextServiceDocument's maintaining rules
complicated.  However, it must be really rare case to add new edit action
listener because it's really old component.

Note that EditorSpellCheck may be created multiple instances for an editor
from chrome JS.  Therefore, we need to keep TextServicesDocument being
derived from nsIEditActionListener because in such case, TextServicesDocument
for other EditorSpellCheck instances should be supported via
nsIEditActionListener even though such case makes EditorBase slower.

MozReview-Commit-ID: KtlXsBCOzKL

--HG--
extra : rebase_source : 6827ed09a028f2049fd7afba2f5116d092bd14e5
2018-01-18 23:46:03 +09:00
..
crashtests
res
test
EditorSpellCheck.cpp Bug 1430982 - part 10: Make EditorBase store TextServicesDocument for its mInlineSpellChecker for avoiding to run for loops to call nsIEditActionListener methods r=m_kato 2018-01-18 23:46:03 +09:00
EditorSpellCheck.h Bug 1430982 - part 9: Create accessors for each member of mozSpellChecker, EditorSpellCheck, mozInlineSpellChecker r=m_kato 2018-01-18 21:38:50 +09:00
moz.build Bug 1430982 - part 6: Rename nsEditorSpellCheck to mozilla::EditorSpellCheck and expose its header r=m_kato 2018-01-18 21:01:13 +09:00
nsComposerCommands.cpp Bug 1427060 - PropItem should use nsAtom instead of nsString. r=masayuki 2017-12-26 12:25:45 +09:00
nsComposerCommands.h
nsComposerCommandsUpdater.cpp
nsComposerCommandsUpdater.h
nsComposerController.cpp
nsComposerController.h
nsComposerDocumentCommands.cpp
nsComposerRegistration.cpp Bug 1430982 - part 6: Rename nsEditorSpellCheck to mozilla::EditorSpellCheck and expose its header r=m_kato 2018-01-18 21:01:13 +09:00
nsComposeTxtSrvFilter.cpp Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz 2017-12-25 17:50:10 +01:00
nsComposeTxtSrvFilter.h
nsEditingSession.cpp
nsEditingSession.h
nsIEditingSession.idl