Git Product home page Git Product logo

Comments (8)

anselmh avatar anselmh commented on June 23, 2024

Hey, thanks for reporting. Indeed this seems to be a bug as the polyfill should react to newly loaded images through the MutationObserver. I’ll try to have a look as soon as possible. Do you by any chance have a demo somewhere? If you want to keep this private, you can also send me an email. :)

from object-fit.

querkmachine avatar querkmachine commented on June 23, 2024

I've uploaded a slightly stripped down version of what I'm working with here: http://greysadventures.com/objectfitexample/
I've tried to keep it fairly complete in case there's some aspect of my implementation or some sort of library conflict that's at fault.

I've had the issue on all versions of IE and older Firefox. Both of them also freeze up for a substantial amount of time whilst applying the polyfill. If there's a reason for that too then it'd be great to know how to speed it up some.

from object-fit.

anselmh avatar anselmh commented on June 23, 2024

Hey, what does preload JavaScript do? Because I’m seeing an error "can't execute code from a freed script" which mostly occurs in IE when you have a script dependency loaded too early OR (but I doubt this is true for your example) when you use foreign frames in the page.

from object-fit.

anselmh avatar anselmh commented on June 23, 2024

In other words: Can you try to figure out if this works as expected when you load everything in order and don’t alter JS loading behavior? Trying to track the issue down now.

from object-fit.

querkmachine avatar querkmachine commented on June 23, 2024

The preload JS is just Modernizr, to my memory. (It's called "preload" as I bundle my scripts with Gulp, and that's the catch-all term I use for all has-to-be-in-the-head stuff.)

Regarding "foreign frames", could this apply to YouTube embeds? These are injected into the DOM when they're needed, but don't exist otherwise.

from object-fit.

anselmh avatar anselmh commented on June 23, 2024

Oh, that YouTube embeds indeed could be the issue. Would you be keen to test if it works (or at least doesn’t output the message in IE’s console) then?

from object-fit.

querkmachine avatar querkmachine commented on June 23, 2024

I've quickly stripped out the code responsible for the embeds (on the page linked above), however the error is still occurring.

from object-fit.

nedbaldessin avatar nedbaldessin commented on June 23, 2024

I was having this issue on IE 9-10-11.
I side-stepped the issue by disabling the DOM watching all together. Dirty, but it works.

window.objectFit.listen = function(){};
window.objectFit.polyfill({
    selector: 'img[data-object-fit-contain]',
    fittype: 'contain',
    disableCrossDomain: 'true'
});

// …later, after injecting new fragment in DOM:
window.objectFit.process({
    selector: '.Lightbox img[data-object-fit-contain]',
    replacedElements: document.querySelectorAll('.Lightbox img[data-object-fit-contain]'),
    fittype: 'contain',
    disableCrossDomain: 'true'
});

Hope this helps.

from object-fit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.