According to Input Events Level 2, beforeinput of insertFromPaste should have data as null and dataTransfer when contenteditable. However, it's unclear that whether the dataTransfer should or should not have text/html when the user pasts into contenteditable=plaintext-only.
From point of view of web apps, if dataTransfer has text/html as same as contenteditable=true, they can serialize the HTML to plaintext by themselves to avoid dependency of browser/OS.
On the other hand, inputType does not have insertFromPaste 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 and dataTransfer may have text/html data even when pasting without format.
According to Input Events Level 2,
beforeinputofinsertFromPasteshould havedataasnullanddataTransferwhen contenteditable. However, it's unclear that whether thedataTransfershould or should not havetext/htmlwhen the user pasts intocontenteditable=plaintext-only.From point of view of web apps, if
dataTransferhastext/htmlas same ascontenteditable=true, they can serialize the HTML to plaintext by themselves to avoid dependency of browser/OS.On the other hand,
inputTypedoes not haveinsertFromPastefor "Paste without format" (Ctrl+Von Firefox/Chrome for Windows). Therefore, web apps cannot distinguish whether the user pasting with or without format.Perhaps, there should be new
inputTypevalue anddataTransfermay havetext/htmldata even when pasting without format.