Comments (10)
@developit need to test first if <object>
works as expected on all mobile devices.
from simple-element-resize-detector.
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.
@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.
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.
Just a very naive heap allocation comparison:
Adding 100 iframes:
Adding 100 objects:
from simple-element-resize-detector.
hmm. not sure what to make of that. Object seems slightly better?
from simple-element-resize-detector.
@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.
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.
@tigt sounds like one more reason to not use <object>
.
from simple-element-resize-detector.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simple-element-resize-detector.