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

TypeError instead of NotAllowedError in navigator.clipboard.write(image/png DOMString) #49301

Open
karlcow opened this issue Nov 21, 2024 · 0 comments

Comments

@karlcow
Copy link
Contributor

karlcow commented Nov 21, 2024

promise_test(async t => {
await getPermissions();
const item = new ClipboardItem({'image/png': 'not an image'});
await promise_rejects_js(t, TypeError, navigator.clipboard.write([item]));
}, 'navigator.clipboard.write(image/png DOMString) fails');

The current specificiation for write(data)
https://w3c.github.io/clipboard-apis/#dom-clipboard-write

In Steps 4, it says:

  1. For each clipboardItem in dataList:

and then in 4.1.2.*

  1. If representationDataPromise was rejected, then:
    1.Reject p with "NotAllowedError" DOMException in realm.
    2. Abort these steps.

Here the test is assessing a TypeError instead of NotAllowedError.
Is there another step I'm missing?

@saschanaz @whsieh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant