зеркало из https://github.com/mozilla/gecko-dev.git
2020349542
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 |
||
---|---|---|
.. | ||
crashtests | ||
res | ||
test | ||
EditorSpellCheck.cpp | ||
EditorSpellCheck.h | ||
moz.build | ||
nsComposeTxtSrvFilter.cpp | ||
nsComposeTxtSrvFilter.h | ||
nsComposerCommands.cpp | ||
nsComposerCommands.h | ||
nsComposerCommandsUpdater.cpp | ||
nsComposerCommandsUpdater.h | ||
nsComposerController.cpp | ||
nsComposerController.h | ||
nsComposerDocumentCommands.cpp | ||
nsComposerRegistration.cpp | ||
nsEditingSession.cpp | ||
nsEditingSession.h | ||
nsIEditingSession.idl |