For those wanting to dive deeper, the layout code in Chromium is surprisingly easy to read considering its a 20+ year old codebase.
This is a good starting point:
https://source.chromium.org/chromium/chromium/src/+/master:t...
This is a good starting point:
https://source.chromium.org/chromium/chromium/src/+/master:t...
Most of the main files still say Copyright 1999 **@kde.org showing the origin of the original codebase that hasn't changed much to today.
It's now so huge and complex that a major redesign/rewrite is pretty much out of the question.
It's still mostly single threaded and all the main objects aren't thread safe. JavaScript shares that thread too. Parts of the rendering are multiththreaded and async, but that's it.