Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Gecko Bug 1920646] part 1: Make HTMLEditor paste/drop things as plaintext when `contenteditable=plaintext-only #48435

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

moz-wptsync-bot
Copy link
Collaborator

Chrome sets beforeinput.data instead of beforeinput.dataTransfer, but
Input Events Level 2 spec defines that browsers should set dataTransfer when
contenteditable [1]. Therefore, the new WPT expects dataTransfer.

However, it's unclear that the dataTransfer should have text/html or only
text/plain. From web apps point of view, text/html data may make them
serialize 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, I
filed a spec issue for this. We need to be back later about this issue.

  1. https://w3c.github.io/input-events/#overview
  2. Clarify whether dataTransfer may have text/html when pasting rich text into contenteditable=plaintext-only w3c/input-events#162

Differential 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

…teditable=plaintext-only

Chrome sets `beforeinput.data` instead of `beforeinput.dataTransfer`, but
Input Events Level 2 spec defines that browsers should set `dataTransfer` when
**contenteditable** [1].  Therefore, the new WPT expects `dataTransfer`.

However, it's unclear that the `dataTransfer` should have `text/html` or only
`text/plain`.  From web apps point of view, `text/html` data may make them
serialize 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, I
filed a spec issue for this.  We need to be back later about this issue.

1. https://w3c.github.io/input-events/#overview
2. w3c/input-events#162

Differential 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
…converted from given source

Differential Revision: https://phabricator.services.mozilla.com/D223909

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1920646
gecko-commit: 39f1a092f31fc2950ea974b4df5e8710f9bf500d
gecko-reviewers: m_kato
Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Firefox project.

@moz-wptsync-bot moz-wptsync-bot merged commit 947f66f into master Oct 3, 2024
15 of 17 checks passed
@moz-wptsync-bot moz-wptsync-bot deleted the gecko/1920646 branch October 3, 2024 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants