-
Notifications
You must be signed in to change notification settings - Fork 17
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
Clarify whether dataTransfer
may have text/html
when pasting rich text into contenteditable=plaintext-only
#162
Comments
I meant in the case of |
On linux/Firefox when pasting with ctrl+shift+v I seem to get only plain/text, not text/html And Chrome doesn't seem to get access to .dataTransfer ever when inputType is insertFromPaste. |
…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
…t when `contenteditable=plaintext-only` r=m_kato 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
…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
…t when `contenteditable=plaintext-only` r=m_kato 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
…t when `contenteditable=plaintext-only` r=m_kato 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
From TPAC 2024 minutes:
|
…t when `contenteditable=plaintext-only` r=m_kato 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 UltraBlame original commit: 2e3f866560e2c750fe1e4469b81d89f10bffc6a1
…t when `contenteditable=plaintext-only` r=m_kato 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 UltraBlame original commit: 2e3f866560e2c750fe1e4469b81d89f10bffc6a1
According to Input Events Level 2,
beforeinput
ofinsertFromPaste
should havedata
asnull
anddataTransfer
when contenteditable. However, it's unclear that whether thedataTransfer
should or should not havetext/html
when the user pasts intocontenteditable=plaintext-only
.From point of view of web apps, if
dataTransfer
hastext/html
as same ascontenteditable=true
, they can serialize the HTML to plaintext by themselves to avoid dependency of browser/OS.On the other hand,
inputType
does not haveinsertFromPaste
for "Paste without format" (Ctrl
+V
on Firefox/Chrome for Windows). Therefore, web apps cannot distinguish whether the user pasting with or without format.Perhaps, there should be new
inputType
value anddataTransfer
may havetext/html
data even when pasting without format.The text was updated successfully, but these errors were encountered: