private void layout(int width) {
Rectangle rect = new Rectangle(0, 0, width, DEFAULT_HEIGHT);
sharedContext.set_TempCanvas(rect);
BlockBox root = BoxBuilder.createRootBox(layoutContext, doc);
root.setContainingBlock(new ViewportBox(rect));
root.layout(layoutContext);
this.root = root;
}