Giter Site home page Giter Site logo

Comments (10)

NekR avatar NekR commented on September 24, 2024 1

@developit need to test first if <object> works as expected on all mobile devices.

from simple-element-resize-detector.

developit avatar developit commented on September 24, 2024

Indeed! I would love to see some benchmarks on this, since the approach you suggested is what the much larger element-resize-detector uses.

from simple-element-resize-detector.

csuwildcat avatar csuwildcat commented on September 24, 2024

@developit ha, small world: the other repo cites my code/blog post as the basis for its approach

I was at Mozilla when I wrote the original thing, and I used the built in mem tools we had to observe the memory allocations to elements embedded with iframes vs objects in various scenarios. There was a pretty significant difference as I remember, but it was so long ago I can't remember the specific numbers.

from simple-element-resize-detector.

developit avatar developit commented on September 24, 2024

It seems reasonably drop-in in terms of a swap, just change iframe for object and set the type to text/html, right?

from simple-element-resize-detector.

NekR avatar NekR commented on September 24, 2024

Just a very naive heap allocation comparison:

Adding 100 iframes:
image
Adding 100 objects:
image

from simple-element-resize-detector.

developit avatar developit commented on September 24, 2024

hmm. not sure what to make of that. Object seems slightly better?

from simple-element-resize-detector.

NekR avatar NekR commented on September 24, 2024

@developit to me it seems the same (see initial heap is smaller for the second attempt). Just left it here to show that it eats a lot of memory in general with both iframe and object.

from simple-element-resize-detector.

tigt avatar tigt commented on September 24, 2024

It's possibly an edge case, but I have had no end of trouble with UC Mini messing with <object> in ways it really shouldn't; it shows neither <object data="foo.jpg" type="image/jpeg"> nor its internal fallback content, for example.

from simple-element-resize-detector.

NekR avatar NekR commented on September 24, 2024

@tigt sounds like one more reason to not use <object>.

from simple-element-resize-detector.

developit avatar developit commented on September 24, 2024

Indeed. I don't trust it quite as much on mobile where flash never really necessitated that it work years ago

from simple-element-resize-detector.

Related Issues (6)

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.