Problem with danielthebanana4's project

  1. What browsers show this problem?
    Firefox on Ubuntu
  2. Please share an example project (if possible).
  3. Describes the steps to reproduce this issue.
  4. What does Snap! currently do?
    Making everything black, because of clicking somewhere
  5. What should Snap! do instead?
    work normal

Oy. Does it happen only after you slide out the stage size?

It might be the xml file, I converted it from scratch through @djdolphin's Snapinator, the xml file may have a bug in it or this a really a bug

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="" xmlns:xlink="" version="1.1" width="0" height="0" viewBox="0 0 0 0">
  <!-- Exported by Scratch - -->

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 :slight_smile:
I am really curious, how the project works...

Here's the Bugzilla issue for this:

Haven't gotten around to figuring out Mozilla's contribution process so I can submit a patch...