Open Bug 2027025 Opened 14 days ago Updated 11 days ago

ClipboardEvent constructor does not set clipboardData

Categories

(Core :: DOM: Copy & Paste and Drag & Drop, defect)

Firefox 149
defect

Tracking

()

UNCONFIRMED

People

(Reporter: david, Unassigned, NeedInfo)

Details

Steps to reproduce:

dt = new DataTransfer();
dt.setData('text/html', '<p>hello world</p>')
ev = new ClipboardEvent('paste', {
      clipboardData: dt,
});

ev.clipboardData.getData('text/html');

Actual results:

returns "<p>hello world</p>" in Chrome, but "" in Firefox

Expected results:

https://w3c.github.io/clipboard-apis/#clipboard-event-interfaces

dictionary ClipboardEventInit : EventInit {
  DataTransfer? clipboardData = null;
};

For synthetic events, the drag data store contains the data added by the script that created the event.

Component: Untriaged → DOM: Copy & Paste and Drag & Drop
Product: Firefox → Core
Severity: -- → S3
Flags: needinfo?(echen)
You need to log in before you can comment on or make changes to this bug.