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

Potential createPattern() improvements #2475

Open
annevk opened this issue Mar 27, 2017 · 1 comment
Open

Potential createPattern() improvements #2475

annevk opened this issue Mar 27, 2017 · 1 comment
Labels
interop Implementations are not interoperable with each other topic: canvas

Comments

@annevk
Copy link
Member

annevk commented Mar 27, 2017

Code inspection of Firefox suggests that createPattern() there will first throw for the repetition argument, then the image. I wonder if that's universal. Also suggests there's no test coverage for exception order.

It would be better if we could use an enum, though that would change the type of exception.

We should maybe also consider allowing the second argument to be omitted. You can already use null instead of "", but not undefined. Seems silly?

Editorial: the first step can be removed, the arguments are clear from the method header.

@annevk annevk added the interop Implementations are not interoperable with each other label Jan 17, 2018
@annevk
Copy link
Member Author

annevk commented Jan 17, 2018

document.createElement("canvas").getContext("2d").createPattern(document.createElement("img"), "") results in an exception in Firefox, not in the other browsers, despite the image not being fully decodable.

Making this use an enum is probably not worth the effort, though @junov argued elsewhere for more IDL, so maybe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interop Implementations are not interoperable with each other topic: canvas
Development

No branches or pull requests

1 participant