Remix.run Logo
nine_k 7 days ago

One of the more senior engineers I worked with told me: "Every real-life data structure I encountered was tree-like".

It would be easiest to just ask the browser to render a fragment of HTML onto a canvas, or onto some invisible bitmap, like you can with most other UI toolkits.

monster_truck 7 days ago | parent | next [-]

They would never do this because of fingerprinting, which is already the cause of most of the reasons we cannot 'just' do a lot of things, unfortunately.

E: And the infamous other half: malware. A bit over a decade ago malware devs started using canvas to do things like hide fragments inside of bitmap data in seemingly harmless ads and then a second script would extract and assemble it to evade detection.

rezonant 7 days ago | parent [-]

The web platform can already do this, see SVG foreignObject elsewhere in the thread. The key is to have the proper bounds in place (cross origin resources, etc), and the infrastructure for that is already in place.

This just removes the extra step of relying on SVG to accomplish rendering the HTML, adds a path for getting this content into the accessibility tree, and supporting input on the rendered elements.

bongodongobob 7 days ago | parent | prev | next [-]

> Every real-life data structure I encountered was tree-like

I don't understand what the takeaway is here. Is that surprising? Is it not? What does "real-life" mean?

nine_k 7 days ago | parent [-]

As found in production code, not (only) in textbooks and academic papers.

This is an exaggeration, of course.

mook 7 days ago | parent | prev | next [-]

Yeah, that's already available in Firefox for chrome/extensions, but not allowed for the web due to fingerprinting and other security risks. For example, rendering an iframe of your bank account…

https://searchfox.org/mozilla-central/rev/f691af5143ebd97034...

7 days ago | parent [-]
[deleted]
do_not_redeem 7 days ago | parent | prev [-]

> Every real-life data structure I encountered was tree-like

What does this even mean? Is a hash map "tree-like" somehow? Or is a hash map just a toy data structure with no real-life use cases?

UltraSane 7 days ago | parent | next [-]

Nested hash maps are trees

koolala 7 days ago | parent | prev [-]

branch map. dictionary tree.