←back to thread

Web Browser Engineering (2021)

(browser.engineering)
679 points MrVandemar | 1 comments | | HN request time: 0s | source
Show context
mannyv ◴[] No.41848587[source]
One great thing about this book is the 'stuff I didn't do' part.

Layout is really hard. Just tables by themselves are hard, even without any css around them. CSS makes layout impossibly difficult. I challenge anyone to keep the whole CSS spec and its associated behaviors in their head.

At this point css + html + javascript have become a dynamic PDL, and probably is one of the most complex pieces of software today.

As an aside, video decoding is offloaded onto hardware, so it's not as battery intensive as it used to be.

replies(11): >>41848643 #>>41848664 #>>41848729 #>>41848784 #>>41848785 #>>41849444 #>>41849487 #>>41849657 #>>41851786 #>>41852399 #>>41854447 #
pstrateman ◴[] No.41848643[source]
> As an aside, video decoding is offloaded onto hardware, so it's not as battery intensive as it used to be.

This is technically but not usefully true with most videos on the web today.

The video decode itself is accelerated, but each frame passes through JavaScript to be composited.

The only time video is fully hardware decoded is when it's a simple video element to a static video file.

replies(4): >>41848766 #>>41848790 #>>41848852 #>>41849217 #
1. pavpanchekha ◴[] No.41848766[source]
I think by "JavaScript" here you mean rendering—that's partially true. In macOS and Windows these days (also I think Linux with GTK4 on Wayland, though only in a limited way), the window manager is itself composited and a window can send a small display list to that window manager for it to composite. In that case, it's possible to actually have the video decoding to happen entirely in hardware and never have the browser directly interact with decoded video bits. That said usually the window manager compositor is pretty limited and the browser will only do this when the stars align. The sort of things that can break it are any kind of weird clipping, transparency, or effects applied to the videos.