-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Remove SVG Blob support from createImageBitmap #10172
base: main
Are you sure you want to change the base?
Conversation
This got added in whatwg#972 but never has been implemented since then. Supporting SVG in Workers is a no-go for most implementers as this would mean at least some DOM would need to be available in these contexts.
cc @whatwg/canvas and particularly @yiyix since you did remove the previous tests. |
This seems fine to me, although it seems surprising it wouldn't be supported anywhere. This is not too different from using an SVG I think it would be okay to add parallel tests for non-support if the canvas harness is too frustrating, although I suspect @fserb probably knows how to get it working. |
Yes, I suppose it could be implemented in a Window context. The issue is with Worker contexts, where you don't have access to the DOM at all and thus can't really load an SVG image since these rely on a DOM. So indeed, another possibility would be to add SVG Blob's support only for Window contexts, but maybe that makes the API more complex for something users can anyway workaround by passing an |
Here's an interesting test:
|
Oh, very good point... There is actually already a test for a similar case where a Blob with a But with the change it should throw because the MIME sniffing algo would return |
I think throwing on the SVG type is probably what we want though. That's a small change that would allow us to introduce this in the future if we wanted to and makes it more consistent with how the |
This got added in #972 but never has been implemented since then.
It seems that supporting SVG in Workers is a no-go for most implementers as this would mean at least some DOM would need to be available in these contexts.
(See WHATWG Working Mode: Changes for more details.)
/imagebitmap-and-animations.html ( diff )