gecko-dev/editor
Masayuki Nakano fa7ceedfb7 Bug 1814337 - Fix bugs at applying multiple styles to collapsed Selection r=m_kato
There are 3 bugs.

One is, `PendingStyles::TakeAllPreservedStyles` returns styles in reversed order
of setting styles, this unexpected order causes that `<font>` element is placed
innermost instead of outermost, thus, background color may be applied to shorter
area than text.  Unfortunately, Chrome applies the style in fixed order, but
using same order as setting the styles is reasonable for us because we use
same code to apply multiple styles once.

Another is, `AutoInlineStyleSetter` extends the range to apply new style to
parents even if the given point is not in start or end of the first container.
Current code works fine if there is only one text node in an inline element,
but after un-setting a style, text nodes may be keep split.  And also when we
apply new style, we create an empty text node for a placeholder of new text,
therefore, the range may be extended from the empty text node to before/after
its previous/next text node.  Note that the latter case needs to work with
invisible things more, but this bug needs to be fixed ASAP due to the dead line,
and invisible things not so appear in inline elements.  Therefore, it's okay
to leave it.

The other is, the delete handlers do not clear the cached styles (cached when
`HTMLEditor` starts handling it).  If it's caused by a `Backspace` key press
in start of a block, `HTMLEditor` caches the style at caret (right paragraph),
then, collapse `Selection` to end of the ex-left block where may have different
style, then, when user types new text there, the cached style is applied into
to the new text **too**.  Therefore, if `Selection` was collapsed and handling
a `Backspace` key press, the cached styles should be forgotten.

Depends on D168640

Differential Revision: https://phabricator.services.mozilla.com/D168865
2023-02-07 14:52:02 +00:00
..
composer Bug 1802288 - remove trailing whitespaces in idl/webidl files r=credential-management-reviewers,webidl,smaug,sgalich 2022-12-28 09:52:44 +00:00
docs Bug 1802799 - [refactor] Migrate NS_STYLE_TEXT_DECORATION_STYLE_* defines r=emilio,geckoview-reviewers,ohall 2022-12-19 22:47:24 +00:00
libeditor Bug 1814337 - Fix bugs at applying multiple styles to collapsed Selection r=m_kato 2023-02-07 14:52:02 +00:00
reftests Bug 1809742 - Remove nativeThemePref annotations. r=dshin 2023-01-13 21:18:08 +00:00
spellchecker Bug 1776879, replace text/unicode for clipboard and drag and drop and use text/plain directly, r=edgar,mak,stransky,geckoview-reviewers,extension-reviewers,zombie,m_kato 2023-02-01 23:30:55 +00:00
txmgr Bug 1802288 - remove trailing whitespaces in idl/webidl files r=credential-management-reviewers,webidl,smaug,sgalich 2022-12-28 09:52:44 +00:00
AsyncSpellCheckTestHelper.jsm Bug 1803914 - Automatically replace Cu.reportError with console.error (misc). r=mossop 2022-12-06 14:34:57 +00:00
moz.build Bug 1769128 - Enable '-ftrivial-auto-var-init=pattern' in editor. r=glandium 2022-05-26 06:15:36 +00:00
nsIDocumentStateListener.idl
nsIEditActionListener.idl
nsIEditor.idl Bug 1814337 - Fix bugs at applying multiple styles to collapsed Selection r=m_kato 2023-02-07 14:52:02 +00:00
nsIEditorMailSupport.idl Bug 1802288 - remove trailing whitespaces in idl/webidl files r=credential-management-reviewers,webidl,smaug,sgalich 2022-12-28 09:52:44 +00:00
nsIEditorSpellCheck.idl Bug 1402822 - Support multiple dictionaries in EditorSpellCheck; r=smaug 2022-03-23 13:53:38 +00:00
nsIHTMLAbsPosEditor.idl
nsIHTMLEditor.idl Bug 1802288 - remove trailing whitespaces in idl/webidl files r=credential-management-reviewers,webidl,smaug,sgalich 2022-12-28 09:52:44 +00:00
nsIHTMLInlineTableEditor.idl Bug 1802288 - remove trailing whitespaces in idl/webidl files r=credential-management-reviewers,webidl,smaug,sgalich 2022-12-28 09:52:44 +00:00
nsIHTMLObjectResizer.idl Bug 1802288 - remove trailing whitespaces in idl/webidl files r=credential-management-reviewers,webidl,smaug,sgalich 2022-12-28 09:52:44 +00:00
nsITableEditor.idl Bug 1730442 - part 1: Make all nsITableEditor features flush pending layout at start to handle their jobs r=m_kato 2022-05-20 07:39:51 +00:00