- What browsers show this problem?
Firefox on Ubuntu
- Please share an example project (if possible).
- Describes the steps to reproduce this issue.
- What does Snap! currently do?
Making everything black, because of clicking somewhere
- What should Snap! do instead?
Oy. Does it happen only after you slide out the stage size?
This is a Snap! or Firefox issue, I think. I can reproduce the bug in Firefox on Linux and macOS, but Chromium and Safari work fine.
The problem seems to be this 0x0 SVG costume:
It results in
Uncaught DOMException: Index or size is negative or greater than the allowed amount when it's drawn at lines 1997 and 7550 of objects.js.
When I import just that costume into Snap! in Firefox, I get the same issue.
The plaintext version of the costume is
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="0" height="0" viewBox="0 0 0 0"> <!-- Exported by Scratch - http://scratch.mit.edu/ --> </svg>
Just a normal, empty SVG with a comment.
Oh no, it's an advertising beacon!
You caught me.
I think the proper solution is for Snap! to not draw a costume if its width or height is 0.
Images with these dimensions are valid and apparently appear in the wild, but it doesn't make any sense to draw them. And Firefox considers drawing them to be error-worthy even though no other browser does.
(I should note that Firefox only considers it an error when drawing it on a canvas. Anywhere else, it's inexplicably fine.)
Actually, after looking at the HTML Canvas spec, a standards-compliant web browser should just abort drawing the image without throwing an error.
I found the line to blame in the Firefox source code, and I'll submit a bug report and a patch in the morning, when I'm more awake.
No. It happens everywhere.
That sounds good
I am really curious, how the project works...
Here's the Bugzilla issue for this: https://bugzilla.mozilla.org/show_bug.cgi?id=1659371
Haven't gotten around to figuring out Mozilla's contribution process so I can submit a patch...