There's no need to pass the StyleResolver to this function. Nodes that need it can just get it from the document.
Building a whole layout tree shouldn't be a concern of Node, so this patch moves it to a separate class.