Bug 1940377 - part 4: Make HTMLEditor normalize white-spaces before inserting HTML fragment if the new normalizer is enabled r=m_kato

Unfortunately, this change does not make
`white-spaces-after-insert-image.tentative.html?paste-image` pass because we
paste the `<div>` at pasting the `<img>`, but Chrome pastes only the `<img>`.

Differential Revision: https://phabricator.services.mozilla.com/D239466
This commit is contained in:
Masayuki Nakano
2025-03-08 22:31:55 +00:00
parent e8e8d245bc
commit a4270d20ef
3 changed files with 19 additions and 32 deletions

View File

@@ -561,11 +561,10 @@ nsresult HTMLEditor::OnEndHandlingTopLevelEditSubActionInternal() {
case EditSubAction::eInsertTextComingFromIME:
case EditSubAction::eInsertLineBreak:
case EditSubAction::eInsertParagraphSeparator:
return !StaticPrefs::
editor_white_space_normalization_blink_compatible();
case EditSubAction::ePasteHTMLContent:
case EditSubAction::eInsertHTMLSource:
return true;
return !StaticPrefs::
editor_white_space_normalization_blink_compatible();
default:
return false;
}