gecko-dev/editor/libeditor
Masayuki Nakano b9ef2f71b3 Bug 1911010 - Make `IMEContentObserver` observe `ParentChainChanged` and let `IMEStateManager` know that r=smaug
`mozAutoDocUpdate` does not make it in a document change when container node
of `insertBefore` has already been removed from the tree.  Therefore, once
`IMEContentObserver::mRootElement` is removed from the DOM tree without a
focus move, `IMEContentObserver` is notified mutations not in a document change.

Similar situations are handled in `IMEStateManager::OnRemoveContent` with
emulating a focus change and that will destroy the active `IMEContentObserver`.
Therefore, if `IMEContentObserver::mRootElement` is removed, we should emulate
a focus move when `IMEStateManager` does not have focused element but there
is active `IMEContentObserver` (that means it is/was in the design mode).

However, checking whether the removed node contains the observing node of the
active `IMEContentObserver` may be expensive.  So, doing expensive things in
`IMEStateManager::OnRemoveContent` may make mutations slower.  Therefore, this
patch makes `IMEContentObserver` observe `ParentChainChanged` and it let
`IMEStateManager` know that with calling its
`OnParentChainChangedOfObservingElement`.  Finally, it calls
`IMEStateManager::OnRemoveContent` to emulate "blur" (and refocus if it's
required).

Differential Revision: https://phabricator.services.mozilla.com/D218696
2024-08-27 00:39:49 +00:00
..
crashtests Bug 1892514 - part 5-3: Enable the assertions in `IMEContentObserver::FlatTextCache` in some automated tests r=smaug 2024-07-03 08:04:28 +00:00
tests Bug 1149826 - Part 1. Add eContentCommandReplaceText. r=masayuki 2024-07-26 06:38:52 +00:00
AutoRangeArray.cpp Bug 1883562 - part 1: Make `AutoBlockElementsJoiner` work with one range r=m_kato 2024-03-11 08:01:50 +00:00
AutoRangeArray.h Bug 1883562 - part 1: Make `AutoBlockElementsJoiner` work with one range r=m_kato 2024-03-11 08:01:50 +00:00
AutoSelectionRestorer.cpp Bug 1149826 - Part 1. Add eContentCommandReplaceText. r=masayuki 2024-07-26 06:38:52 +00:00
AutoSelectionRestorer.h Bug 1149826 - Part 1. Add eContentCommandReplaceText. r=masayuki 2024-07-26 06:38:52 +00:00
CSSEditUtils.cpp Bug 1519636 - Reformat recent changes to the Google coding style r=emilio,necko-reviewers,geckoview-reviewers,application-update-reviewers,media-playback-reviewers,devtools-reviewers,anti-tracking-reviewers,profiler-reviewers,win-reviewers,migration-reviewers,padenot,mconley,nchevobbe,kershaw,gstoll,mstange,bytesized,m_kato 2024-07-17 11:15:31 +00:00
CSSEditUtils.h
ChangeAttributeTransaction.cpp
ChangeAttributeTransaction.h
ChangeStyleTransaction.cpp Bug 1856795 - Remove redundant member init r=emilio 2023-10-15 15:29:02 +00:00
ChangeStyleTransaction.h
CompositionTransaction.cpp
CompositionTransaction.h
DeleteContentTransactionBase.cpp
DeleteContentTransactionBase.h
DeleteMultipleRangesTransaction.cpp
DeleteMultipleRangesTransaction.h
DeleteNodeTransaction.cpp
DeleteNodeTransaction.h
DeleteRangeTransaction.cpp
DeleteRangeTransaction.h
DeleteTextTransaction.cpp
DeleteTextTransaction.h
EditAction.h Bug 1877513 - Make `HTMLEditor` deletes only preceding lines of right child block if the range starts from start of a line r=m_kato 2024-04-27 00:36:26 +00:00
EditAggregateTransaction.cpp
EditAggregateTransaction.h
EditTransactionBase.cpp
EditTransactionBase.h
EditorBase.cpp Bug 1809713 - Make DataTransfer use Maybe<ClipboardType>. r=edgar 2024-07-29 11:52:34 +00:00
EditorBase.h Bug 1809713 - Use ClipboardType in editor. r=masayuki 2024-07-29 11:52:33 +00:00
EditorCommands.cpp Bug 1883367 - Disable editor commands for read-only editors. r=masayuki 2024-03-08 17:55:57 +00:00
EditorCommands.h Bug 1244437 - part 1: Make `HTMLEditUtils::IsFormatNode` check same tags as Chromium does r=m_kato 2023-10-26 03:45:17 +00:00
EditorController.cpp
EditorController.h
EditorDOMPoint.h Bug 1865729 - part 0: Add logging code of `AutoMoveOneLineHandler` r=m_kato 2023-11-27 01:46:42 +00:00
EditorEventListener.cpp Bug 1909577 - Make some `nsFocusManager::GetFocusedElement()` users use its static version instead r=emilio,credential-management-reviewers,issammani 2024-07-25 00:33:58 +00:00
EditorEventListener.h Bug 1675847 - part 2: Rename some methods which handle "MouseClick" r=smaug 2024-06-14 00:18:46 +00:00
EditorForwards.h Bug 1149826 - Part 1. Add eContentCommandReplaceText. r=masayuki 2024-07-26 06:38:52 +00:00
EditorUtils.cpp Bug 1852478 - Convert CSS `white-space` into a shorthand that expands to `white-space-collapse` and `text-wrap-mode` longhands. r=firefox-style-system-reviewers,emilio 2024-01-26 09:40:02 +00:00
EditorUtils.h Bug 1852478 - Convert CSS `white-space` into a shorthand that expands to `white-space-collapse` and `text-wrap-mode` longhands. r=firefox-style-system-reviewers,emilio 2024-01-26 09:40:02 +00:00
HTMLAbsPositionEditor.cpp
HTMLAnonymousNodeEditor.cpp Bug 1861231 - Make editor handle user input with original target instead of target r=sefeng,dom-core 2023-11-21 03:58:01 +00:00
HTMLEditHelpers.cpp Bug 1856795 - Remove redundant member init r=emilio 2023-10-15 15:29:02 +00:00
HTMLEditHelpers.h Bug 1859245 - part 1: Make `JoinNodesResult` and `SplitNodeResult` handle only the new direction mode r=m_kato 2023-10-27 01:57:28 +00:00
HTMLEditSubActionHandler.cpp Bug 1149826 - Part 1. Add eContentCommandReplaceText. r=masayuki 2024-07-26 06:38:52 +00:00
HTMLEditUtils.cpp Bug 1519636 - Reformat recent changes to the Google coding style r=emilio,necko-reviewers,geckoview-reviewers,application-update-reviewers,media-playback-reviewers,devtools-reviewers,anti-tracking-reviewers,profiler-reviewers,win-reviewers,migration-reviewers,padenot,mconley,nchevobbe,kershaw,gstoll,mstange,bytesized,m_kato 2024-07-17 11:15:31 +00:00
HTMLEditUtils.h Bug 1891656 - Make `HTMLEditUtils::GetMostDistantAncestorEditableEmptyInlineElement()` use `Element::FromNode()` r=m_kato 2024-04-25 03:47:41 +00:00
HTMLEditor.cpp Bug 1911010 - Make `IMEContentObserver` observe `ParentChainChanged` and let `IMEStateManager` know that r=smaug 2024-08-27 00:39:49 +00:00
HTMLEditor.h Bug 1809713 - Use ClipboardType in editor. r=masayuki 2024-07-29 11:52:33 +00:00
HTMLEditorCommands.cpp Bug 1883367 - Disable editor commands for read-only editors. r=masayuki 2024-03-08 17:55:57 +00:00
HTMLEditorController.cpp Bug 1244437 - part 1: Make `HTMLEditUtils::IsFormatNode` check same tags as Chromium does r=m_kato 2023-10-26 03:45:17 +00:00
HTMLEditorController.h
HTMLEditorDataTransfer.cpp Bug 1809713 - Use ClipboardType in editor. r=masayuki 2024-07-29 11:52:33 +00:00
HTMLEditorDeleteHandler.cpp Bug 1877513 - Make `HTMLEditor` deletes only preceding lines of right child block if the range starts from start of a line r=m_kato 2024-04-27 00:36:26 +00:00
HTMLEditorDocumentCommands.cpp Bug 1859245 - part 4: Make `HTMLEditor` handle only the new direction mode r=m_kato 2023-10-27 01:57:29 +00:00
HTMLEditorEventListener.cpp Bug 1675847 - part 2: Rename some methods which handle "MouseClick" r=smaug 2024-06-14 00:18:46 +00:00
HTMLEditorEventListener.h Bug 1675847 - part 2: Rename some methods which handle "MouseClick" r=smaug 2024-06-14 00:18:46 +00:00
HTMLEditorInlines.h Bug 1865729 - part 0: Add logging code of `AutoMoveOneLineHandler` r=m_kato 2023-11-27 01:46:42 +00:00
HTMLEditorNestedClasses.h Bug 1906559 - Make `AutoInlineStyleSetter::OnHandled()` never set point in `aContent` if it's not a container r=m_kato 2024-08-19 00:35:33 +00:00
HTMLEditorObjectResizer.cpp
HTMLEditorState.cpp Bug 1865729 - part 1: Make `AutoMoveOneLineHandler` make `AutoRangeArray` work with `BlockInlineCheck::UseComputedDisplayOutsideStyle` r=m_kato 2023-11-27 01:46:42 +00:00
HTMLInlineTableEditor.cpp Bug 1675847 - part 2: Rename some methods which handle "MouseClick" r=smaug 2024-06-14 00:18:46 +00:00
HTMLStyleEditor.cpp Bug 1906727 - Make `HTMLEditor::SplitAncestorStyledInlineElementsAt` check attr value type first r=peterv 2024-07-25 00:41:49 +00:00
HTMLTableEditor.cpp Bug 1149826 - Part 1. Add eContentCommandReplaceText. r=masayuki 2024-07-26 06:38:52 +00:00
InsertNodeTransaction.cpp
InsertNodeTransaction.h
InsertTextTransaction.cpp
InsertTextTransaction.h
InternetCiter.cpp Bug 1519636 - Reformat recent changes to the Google coding style r=emilio,necko-reviewers,geckoview-reviewers,application-update-reviewers,media-playback-reviewers,devtools-reviewers,anti-tracking-reviewers,profiler-reviewers,win-reviewers,migration-reviewers,padenot,mconley,nchevobbe,kershaw,gstoll,mstange,bytesized,m_kato 2024-07-17 11:15:31 +00:00
InternetCiter.h
JoinNodesTransaction.cpp Bug 1859245 - part 3: Make `JoinNodesTransaction` and `SplitNodeTransaction` handle only the new direction mode r=m_kato 2023-10-27 01:57:29 +00:00
JoinNodesTransaction.h Bug 1859245 - part 3: Make `JoinNodesTransaction` and `SplitNodeTransaction` handle only the new direction mode r=m_kato 2023-10-27 01:57:29 +00:00
ManualNAC.h
MoveNodeTransaction.cpp
MoveNodeTransaction.h
PendingStyles.cpp
PendingStyles.h
PlaceholderTransaction.cpp
PlaceholderTransaction.h
ReplaceTextTransaction.cpp
ReplaceTextTransaction.h
SelectionState.cpp Bug 1859245 - part 4: Make `HTMLEditor` handle only the new direction mode r=m_kato 2023-10-27 01:57:29 +00:00
SelectionState.h Bug 1859245 - part 2: Make `HTMLEditor::DoJoinNodes` and `HTMLEditor::DoSplitNode` handle only the new direction mode r=m_kato 2023-10-27 01:57:29 +00:00
SplitNodeTransaction.cpp Bug 1859245 - part 3: Make `JoinNodesTransaction` and `SplitNodeTransaction` handle only the new direction mode r=m_kato 2023-10-27 01:57:29 +00:00
SplitNodeTransaction.h Bug 1859245 - part 3: Make `JoinNodesTransaction` and `SplitNodeTransaction` handle only the new direction mode r=m_kato 2023-10-27 01:57:29 +00:00
TextEditSubActionHandler.cpp Bug 1893351 - part 1: Add an option to make `EditorBase::InsertTextWithTransaction` always create a `Text` node r=m_kato 2024-05-30 00:42:41 +00:00
TextEditor.cpp Bug 1809713 - Use ClipboardType in editor. r=masayuki 2024-07-29 11:52:33 +00:00
TextEditor.h Bug 1809713 - Use ClipboardType in editor. r=masayuki 2024-07-29 11:52:33 +00:00
TextEditorDataTransfer.cpp Bug 1809713 - Use ClipboardType in editor. r=masayuki 2024-07-29 11:52:33 +00:00
WSRunObject.cpp Bug 1893351 - part 1: Add an option to make `EditorBase::InsertTextWithTransaction` always create a `Text` node r=m_kato 2024-05-30 00:42:41 +00:00
WSRunObject.h Bug 1900164 - Add missing empty template argument list in function call. r=masayuki 2024-06-04 01:19:41 +00:00
moz.build Bug 1149826 - Part 1. Add eContentCommandReplaceText. r=masayuki 2024-07-26 06:38:52 +00:00