←back to thread

Web Browser Engineering (2021)

(browser.engineering)
770 points MrVandemar | 1 comments | | HN request time: 0.214s | 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 #
vbezhenar ◴[] No.41848784[source]
This Babylonian tower will crumble one day.

Layout does not have to be so complex. There are dozens of GUI frameworks with simpler layout system. Those are enough for applications everyone uses.

replies(5): >>41849894 #>>41850107 #>>41851738 #>>41853975 #>>41855400 #
PaulDavisThe1st ◴[] No.41849894[source]
Actually, almost every GUI toolkit's scheme for layout has issues, and none of them are perfect.

The ones that use absolute pixel positioning fail when using different resolution displays.

The ones that use box packing fail when you need to deal with different sized displays.

The ones that use constraint programming fail when you need to layout hundreds or thousands of widgets.

CSS-style layout has its own pros and cons, but there is no alternative to it that is clearly better under all circumstances. If you doing layout and want to be resolution-independent, function on everything from phones to giant displays and have thousands of things to layout, CSS is actually likely better than any alternative.

replies(1): >>41860899 #
peoplefromibiza ◴[] No.41860899[source]
possibly, but videogames have been doing layout for ages without CSS and they can vary a lot from game to game while most desktop applications have basically the same 2-3 layouts: input and edit some text, fill in some form, display some data in a table, a tree or a chart
replies(2): >>41865670 #>>41875817 #
psd1 ◴[] No.41865670[source]
Games lay out one game.

Document readers lay out every possible document.

replies(1): >>41867312 #
1. peoplefromibiza ◴[] No.41867312[source]
> Document readers lay out every possible document.

you mean like vector graphic software, DTPs, word processors etc etc?

Flash did resolution independent graphics and layouts on the web back in the late '90s, we killed it - not without reasons - but we still haven't created a decent alternative to it