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

$.imageReady error in IE 11 + SVG #2625

Closed
aut0poietic opened this issue Jan 13, 2020 · 6 comments
Closed

$.imageReady error in IE 11 + SVG #2625

aut0poietic opened this issue Jan 13, 2020 · 6 comments

Comments

@aut0poietic
Copy link

Subject of the issue/enhancement/features

imageReady fails when it encounters an SVG on IE11.

Your environment

  • 4.3
  • InternetExplorer 11
  • Windows 10

Steps to reproduce

This error can only be encountered when a Custom Plugin/Menu/Theme has an inline SVG.

Expected behaviour

imageReady should skip the SVG as it does not have a currentStyle property.

Actual behaviour

imageReady throws an error on line 44 "Unable to get property 'backgroundImage' of undefined or null reference.'

imageReady never completes for the component, and the course never finishes loading the page.

Proposed Fix

The issue appears to be that SVG's on IE11 do not have a currentStyle property. I check to ensure el.currentStyle is valid should solve the problem, right?

...
            for (var i = 0, len = tags.length; i < len; i++) {
                el = tags[i];  
                if (!el.currentStyle) continue;
                var hasNoValue = (el.currentStyle[scriptName] == 'none');
                if (hasNoValue) continue;
                rtn.push(el);
            }
...
@oliverfoster
Copy link
Member

oliverfoster commented Jan 14, 2020

Sounds like a good solution.

@aut0poietic
Copy link
Author

Sure can. I'll take it up tonight (day job's in the way today). Should that PR be for the jquery.imageReady repo or this one?

@oliverfoster
Copy link
Member

It's alright, I did it already.

@oliverfoster
Copy link
Member

The other repo is a bit defunct / out of date / unmaintained unfortunately.

@moloko
Copy link
Contributor

moloko commented Jan 29, 2020

@aut0poietic if you have a moment could you review #2626 and a comment of '+1' if you're happy with it?

@aut0poietic
Copy link
Author

Done! Thanks @oliverfoster, @moloko!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants