this post was submitted on 22 Jan 2025
57 points (98.3% liked)

Microblog Memes

6661 readers
2012 users here now

A place to share screenshots of Microblog posts, whether from Mastodon, tumblr, ~~Twitter~~ X, KBin, Threads or elsewhere.

Created as an evolution of White People Twitter and other tweet-capture subreddits.

Rules:

  1. Please put at least one word relevant to the post in the post title.
  2. Be nice.
  3. No advertising, brand promotion or guerilla marketing.
  4. Posters are encouraged to link to the toot or tweet etc in the description of posts.

Related communities:

founded 2 years ago
MODERATORS
 

Original post: fedi.aria.dog (~~fat Yoshi~~ Akkoma?)

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 4 points 1 month ago* (last edited 1 month ago) (3 children)

As a backend developer this could equally be real front end stuff or satire to take the piss out of it. To me the entire DOM stuff is as understandable as magical lore anyway.

[–] [email protected] 3 points 1 month ago (1 children)

Shadow DOM trees are very real, and I feel like a Wizard trying to decrypt ancient runes every time I have to deal with them, so you're not far off.

[–] [email protected] 1 points 1 month ago (1 children)
[–] [email protected] 1 points 1 month ago

The browser has an internal model for representing the HTML document, called the Document Object Model (DOM). This DOM happens to be tree-shaped, because HTML is tree-shaped. And certain logic in a browser gets applied to subtrees, like e.g. most CSS rules.

Sometimes, however, you want a subtree to not get affected by what's going on in the main tree, for example when including an SVG into that tree, or if you're offering JavaScript library with a pre-built component.
And yeah, that is what the Shadow DOM does. It also shields the rest of the DOM from what you're doing inside the Shadow DOM. And there's certain mechanisms to selectively allow interaction across the shadow boundary, e.g. when providing a pre-built component, you might still want the user to be able to style parts of it.

[–] [email protected] 1 points 1 month ago

Everyone knows you just keep guessing until you get it right.

Don't worry about how janky or slow it makes the UI. That's basically a requirement for the modern browser.

[–] [email protected] 0 points 1 month ago (1 children)

Thank you for not shitting on frontend. Have a wonderful day

[–] [email protected] 0 points 1 month ago* (last edited 1 month ago)

It wasn't meant as shitting on front end. I love a good gui. I just don't understand half of the things you guys work with.

I work mostly with business logic. Integtations, APIs and process automation etc. GUI stuff is quite far from my day to day so I don't have any incentives to learn at work either.