Chapter 5
Chapter 5, Laying Out Pages, is out! This is the first chapter that really starts going into the deep browser internals, by introducing layout trees and the tree-based layout algorithm. Yes, there are trees beyond the DOM! (Not even just two, actually...) It’s a pretty complex chapter, with a lot of moving pieces, but the concepts it introduces are going to be at the center of a lot of what comes later: styles, events, and JavaScript.
With complex ideas you need a really simple presentation, so this chapter in particular required a lot of effort. I wanted the chapter to reflect some real-world browser weirdness (anonymous block boxes!) and to connect to the academic literature (attribute grammars!) but also emphasize core themes like the difference between the HTML and layout trees. After lots of redesigns and advice from readers of various drafts, I hope we did a good job.
One thing Chris and I realized, working on this chapter, is that to really understand some of these concepts it’s best to play with examples. So in this release we’ve included two interactive widgets. Please play with them; Chris and I will be working on making more widgets this next month, so we’re really hoping they’re useful.
If you like the chapter and the book, please share with your friends! We have a twitter account or the blog. And thanks as always for reading!