nsIEditor.pasteTransferable won't insert image/png if nsITransaferable uses nsIInputStream
Categories
(Core :: DOM: Editor, defect, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox90 | --- | fixed |
People
(Reporter: m_kato, Assigned: m_kato)
References
Details
Attachments
(1 file)
I found this when I tried to use pasteTransferable for image keyboard support (https://developer.android.com/guide/topics/text/image-keyboard).
pasteTransferable initializes DataTransfer when using nsITransferable parameter.
But when mime type is image/png, this is recognized as KIND_FILE at here. So if using nsIInputStream, this fetches all data at
here. Then, when InsertObject tries fetching data from nsIInputStream, this stream of image/png is already EOF. So at finally, we cannot insert PNG image.
| Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
| Assignee | ||
Comment 1•5 years ago
|
||
editor.pastedTransferable cannot insert image/png when using nsITransaferable.
Although pastedTransferable stores DataTransfer in stack, when mime type is
image/png, DataTransfer fetches all data in
DataTransferItem::FillInExternalData then stores it as KIND_FILE.
It means that nsIInputStream in nsITransferable is already EOF.
So we should use InsertFromDataTransfer when internal data moves to
DataTransfer.
Comment 3•5 years ago
|
||
| bugherder | ||
Description
•