From 99020fb15efb5dc7a20ba709721b35afcb219f82 Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Tue, 8 Oct 2024 07:59:35 +0000 Subject: [PATCH] Add automated tests for `insertText` in `contenteditable=plaintext-only` and make its handlers compute editing host without limiting in the `` for consistency with the other edit action handlers which we've changed at implementing `contenteditable=plaintext-only`. Unfortunately, there are a lot of changes to pass the editing host to `EnsureCaretNotAfterInvisibleBRElement()`, though. Note that the tests trying to preserve the style in `contenteditable=plaintext-only` fails on Chrome too due to `
` is put outside the `` or forgot the `` after caret move. However, as you know, `contenteditable=plaintext-only` does not allow to change text style even for web app developers. Therefore, loosing the style only in some conditions must be wrong. Therefore, I made the expectations. Differential Revision: https://phabricator.services.mozilla.com/D224188 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1921723 gecko-commit: f0d7650bda3cac49a7177de29bcaeb06d249237a gecko-reviewers: m_kato --- editing/plaintext-only/insertText.html | 271 +++++++++++++++++++++++++ 1 file changed, 271 insertions(+) create mode 100644 editing/plaintext-only/insertText.html diff --git a/editing/plaintext-only/insertText.html b/editing/plaintext-only/insertText.html new file mode 100644 index 00000000000000..9045e04d368f3f --- /dev/null +++ b/editing/plaintext-only/insertText.html @@ -0,0 +1,271 @@ + + + + + + + + + +Inserting text in plaintext-only + + + + + + + + + +