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 Bug 1345253 - Use element.firstChild.remove() instead of element.removeChild(element.firstChild), r=jaws. 2017-03-08 10:17:52 +01:00
res Bug 1355734 - Remove text-decoration-line: -moz-anchor-decoration. r=heycam,masayuki 2017-04-13 16:17:03 +08:00
test Bug 1374282 - script generated patch to remove Task.jsm calls, r=Mossop. 2017-06-22 12:51:42 +02:00
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 Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro. 2017-10-03 09:05:19 +11:00
nsComposerCommandsUpdater.cpp Bug 1404198: Part 2j - Switch to NS_NewTimer* everywhere else. r=njn 2017-09-24 19:57:48 -07:00
nsComposerCommandsUpdater.h Bug 1382172 - Name nsITimerCallback instances in native implementation. r=billm 2017-07-27 02:18:20 +08:00
nsComposerController.cpp Bug 1297414 - Support execCommand("defaultParagraphSeparator"); r=masayuki 2017-04-04 13:47:28 +03:00
nsComposerController.h
nsComposerDocumentCommands.cpp Bug 1390428 (part 1) - Remove many nsXPIDLCString local variables. r=erahm. 2017-08-16 13:58:35 +10:00
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 Bug 1404198: Part 2j - Switch to NS_NewTimer* everywhere else. r=njn 2017-09-24 19:57:48 -07:00
nsEditingSession.h Bug 1388001 - part2: nsEditingSession should treat editor as HTMLEditor r=m_kato 2017-08-04 22:53:28 +09:00
nsIEditingSession.idl Bug 1388001 - part1: Create nsIEditingSession::GetHTMLEditorForWindow() r=smaug 2017-08-12 11:44:16 +09:00