Bug 1940377 - part 3: Make "insert paragraph" handlers use the new normalizer if it's enabled r=m_kato
Unfortunately, this change does not make `white-spaces-after-execCommand-insertparagraph.tentative.html` pass because the insert paragraph handler inserts a temporary `<br>` element and that causes normalizing the following white-spaces at the split point. However, Chrome does not normalize the following white-spaces if it begins with an NBSP. Differential Revision: https://phabricator.services.mozilla.com/D239465
This commit is contained in:
@@ -4394,7 +4394,9 @@ Result<EditorDOMPoint, nsresult> HTMLEditor::PrepareToInsertLineBreak(
|
||||
}
|
||||
Result<EditorDOMPoint, nsresult> pointToInsertOrError =
|
||||
WhiteSpaceVisibilityKeeper::NormalizeWhiteSpacesToSplitAt(
|
||||
*this, aPointToInsert);
|
||||
*this, aPointToInsert,
|
||||
{WhiteSpaceVisibilityKeeper::NormalizeOption::
|
||||
StopIfPrecedingWhiteSpacesEndsWithNBP});
|
||||
if (NS_WARN_IF(pointToInsertOrError.isErr())) {
|
||||
return pointToInsertOrError.propagateErr();
|
||||
}
|
||||
@@ -4413,7 +4415,9 @@ Result<EditorDOMPoint, nsresult> HTMLEditor::PrepareToInsertLineBreak(
|
||||
Result<EditorDOMPoint, nsresult> pointToInsertOrError =
|
||||
StaticPrefs::editor_white_space_normalization_blink_compatible()
|
||||
? WhiteSpaceVisibilityKeeper::NormalizeWhiteSpacesToSplitAt(
|
||||
*this, aPointToInsert)
|
||||
*this, aPointToInsert,
|
||||
{WhiteSpaceVisibilityKeeper::NormalizeOption::
|
||||
StopIfPrecedingWhiteSpacesEndsWithNBP})
|
||||
: aPointToInsert;
|
||||
if (NS_WARN_IF(pointToInsertOrError.isErr())) {
|
||||
return pointToInsertOrError.propagateErr();
|
||||
|
||||
Reference in New Issue
Block a user