gecko-dev/editor
Masayuki Nakano a56eed4600 Bug 1852849 - Make `HTMLEditor::AutoInlineStyleSetter::ExtendOrShrinkRangeToApplyTheStyle` recompute common ancestor of the range if it updates the range r=m_kato
In this case, `<font face="monospace">abc []<br></font>`, the range applying
new style will be extended as `<font face="monospace">abc [<br>}</font>` first.
https://searchfox.org/mozilla-central/rev/29bdf6ff9965a647c6f64d63fed2b5bd094532c7/editor/libeditor/HTMLStyleEditor.cpp#1944

Then, the start point should be shrunken and the range should become
`<font face="monospace">abc {<br>}</font>`.
https://searchfox.org/mozilla-central/rev/29bdf6ff9965a647c6f64d63fed2b5bd094532c7/editor/libeditor/HTMLStyleEditor.cpp#1977-1978

However, `commonAncestor` is still the text node because it's not updated
after extending the range to include the `<br>`.  Then,
`AutoInlineStyleSetter::GetNextEditableInlineContent` fails to get `<br>`
from the text node.
https://searchfox.org/mozilla-central/rev/29bdf6ff9965a647c6f64d63fed2b5bd094532c7/editor/libeditor/HTMLStyleEditor.cpp#1576-1578

Finally, the unexpected range computation will reach here with the text editor
and adjust the start of the range to start of the text node.
https://searchfox.org/mozilla-central/rev/29bdf6ff9965a647c6f64d63fed2b5bd094532c7/editor/libeditor/HTMLStyleEditor.cpp#420-423

Therefore, the new text which the new style should be applied is jumped to
start of the text node.

Differential Revision: https://phabricator.services.mozilla.com/D190028
2023-10-07 05:56:15 +00:00
..
composer Bug 1855134 - Move existing MOZ_TRY macros to a dedicated header file; r=glandium 2023-09-28 20:46:07 +00:00
docs Bug 1842986 - Remove dom.forms.inputmode pref r=emilio 2023-09-15 16:49:21 +00:00
libeditor Bug 1852849 - Make `HTMLEditor::AutoInlineStyleSetter::ExtendOrShrinkRangeToApplyTheStyle` recompute common ancestor of the range if it updates the range r=m_kato 2023-10-07 05:56:15 +00:00
reftests Bug 1850293 - Make editable states not intrinsic. r=smaug,masayuki 2023-08-30 09:18:31 +00:00
spellchecker Bug 1851951 - Make `HTMLEditor` refer computed `display` instead of the HTML default style at considering block or inline element r=m_kato 2023-09-27 03:01:26 +00:00
txmgr
AsyncSpellCheckTestHelper.sys.mjs
moz.build
nsIDocumentStateListener.idl
nsIEditActionListener.idl
nsIEditor.idl Bug 1839553 - Move `EditorBase::IsInPlaintextMode()` to `HTMLEditor` with renaming to `IsPlaintextMailComposer()` r=m_kato 2023-06-28 01:01:12 +00:00
nsIEditorMailSupport.idl Bug 1839814 - Move `nsIEditor.wrapWidth` to `nsIEditorMailSupport` r=m_kato 2023-06-27 05:47:55 +00:00
nsIEditorSpellCheck.idl
nsIHTMLAbsPosEditor.idl
nsIHTMLEditor.idl Bug 1851951 - Make `HTMLEditor` refer computed `display` instead of the HTML default style at considering block or inline element r=m_kato 2023-09-27 03:01:26 +00:00
nsIHTMLInlineTableEditor.idl
nsIHTMLObjectResizer.idl
nsITableEditor.idl