[Gecko Bug 1920646] part 1: Make HTMLEditor
paste/drop things as plaintext when `contenteditable=plaintext-only
#48435
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Chrome sets
beforeinput.data
instead ofbeforeinput.dataTransfer
, butInput Events Level 2 spec defines that browsers should set
dataTransfer
whencontenteditable [1]. Therefore, the new WPT expects
dataTransfer
.However, it's unclear that the
dataTransfer
should havetext/html
or onlytext/plain
. From web apps point of view,text/html
data may make themserialize the rich text format to plaintext without any dependencies of browsers
and OS. On the other hand, they cannot distinguish whether the user tries to
paste with or without formatting when
contenteditable=true
. Therefore, Ifiled a spec issue for this. We need to be back later about this issue.
dataTransfer
may havetext/html
when pasting rich text intocontenteditable=plaintext-only
w3c/input-events#162Differential Revision: https://phabricator.services.mozilla.com/D223908
bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1920646
gecko-commit: 2e3f866560e2c750fe1e4469b81d89f10bffc6a1
gecko-reviewers: m_kato