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

supports should take a dictionary instead of a DOMString as argument for readability #211

Closed
snianu opened this issue Jan 25, 2024 · 2 comments

Comments

@snianu
Copy link
Contributor

snianu commented Jan 25, 2024

From TAG review feedback,
"supports() is a rather generic name, but the type of support being tested is very specific. This could hinder both learnability and future extensibility. One way to address that would be to adopt a dictionary argument (e.g. ClipboardItem.supports({type: "image/webp"})). If it later becomes clear that MIME type is the primary criteria that support queries are used for, a string argument could be supported as an overloaded shortcut."

@annevk
Copy link
Member

annevk commented Jan 26, 2024

The way we did this matches precedent in HTML and still makes sense to me. I'd argue that once we need a lot of things we can then add the overload.

Also said so here: w3ctag/design-reviews#901 (comment)

@snianu
Copy link
Contributor Author

snianu commented Feb 6, 2024

Since the TAG closed the original issue with a satisfied resolution for the existing supports method, closing this issue as well.

@snianu snianu closed this as completed Feb 6, 2024
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

2 participants