Page layout need not be complicated if you write it yourself in simple imperative code, for your own website.
But parsing the different standards of HTML and deal with invalid HTML in the "appropriate" way must be a lot of work. And implementing CSS to work with existing websites, and making it efficient, must be a PITA.
Much of that complexity was created in the name of discoverability. Given the amount of money that was spent on search and looking at the quality of search results nowadays, I'm not so sure.
In general the idea is to separate structure from style, and to allow developers to specify style more declaratively to enable them to make sites quickly. But I'm not positive that that worthwhile goal implies that the logic should be implemented in the browser. IMO it should be implemented in downloadable library code.
It strikes me as completely insane that it's more complicated to write a browser rendering engine than a whole OS. But I suppose the proof is in the pudding and the fact that there are so many more hobby OSs than hobby browsers must be testament to this fact.
> It strikes me as completely insane that it's more complicated to write a browser rendering engine than a whole OS.
There was once a programmer who was attached to the court of the warlord of Wu. The warlord asked the programmer: “Which is easier to design: an accounting package or an operating system?”
“An operating system,” replied the programmer.
The warlord uttered an exclamation of disbelief.
“Surely an accounting package is trivial next to the complexity of an operating system,” he said.
“Not so,” said the programmer, “when designing an accounting package, the programmer operates as a mediator between people having different ideas: how it must operate, how its reports must appear, and how it must conform to tax laws.
By contrast, an operating system is not limited by outward appearances. When designing an operating system, the programmer seeks the simplest harmony between machine and ideas. This is why an operating system is easier to design.”
The warlord of Wu nodded and smiled. “That is all good and well,” he said, “but which is easier to debug?”
Writing a browser that passes acid tests and supports all the standards (old and new) as well as the sites that aren’t standards compliant but users might still expect it to work; that is an insane hard task. But building a console browser that supports a subset of standards and has no Javascript support is a much easier job (read: “easier” as in relative to the former task).
Much like building a kernel + CLI shell is easier than building a fully multi-tasking OS with GPU accelerated GUI compositing, stable ABIs, modular driver model, and full support for 99% of common hardware.
But parsing the different standards of HTML and deal with invalid HTML in the "appropriate" way must be a lot of work. And implementing CSS to work with existing websites, and making it efficient, must be a PITA.
Much of that complexity was created in the name of discoverability. Given the amount of money that was spent on search and looking at the quality of search results nowadays, I'm not so sure.
In general the idea is to separate structure from style, and to allow developers to specify style more declaratively to enable them to make sites quickly. But I'm not positive that that worthwhile goal implies that the logic should be implemented in the browser. IMO it should be implemented in downloadable library code.