Closed Bug 1921723 Opened 26 days ago Closed 18 days ago

Make `HTMLEditor` aware of inserting text in `contenteditable=plaintext-only`

Categories

(Core :: DOM: Editor, task)

task

Tracking

()

RESOLVED FIXED
133 Branch
Tracking Status
firefox133 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

At least, we need to add WPTs. We should make use similar behavior when typing multiple white-spaces.

Severity: -- → N/A
Type: defect → task

This patch makes HTMLEditor::HandleInsertText compute the editing host without
limiting in the <body> 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 <br> is put
outside the <b> or forgot the <b> 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.

Depends on D224186

Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/f0d7650bda3c Add automated tests for `insertText` in `contenteditable=plaintext-only` and make its handlers compute editing host without limiting in the `<body>` r=m_kato
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/48517 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 18 days ago
Resolution: --- → FIXED
Target Milestone: --- → 133 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: