Skip to content

MapHilight v1.4.0 broken on Firefox when using SVG image (naturalWidth === 0) #94

@Kadigan

Description

@Kadigan

I traced the issue down to the canvas context, this bit:

if(typeof img.naturalWidth != "undefined" && img.naturalWidth === 0) {

Unfortunately, as per Mozilla Bug ID #700533 (funnily enough - opened 9 years ago, and still open...), Firefox returns a 0 on both naturalWidth and naturalHeight when using an SVG image.

As such, on Firefox and when using SVG, it's locked in a permanent "waiting for the image to load" loop. The image is, of course, loaded.

If I return true from there, everything else works as exepcted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions