code: public Viewport createViewportTree(Element root, Graphics2D g, VisualContext ctx, int width, int height)
      {
          Element vp = createAnonymousElement(root.getOwnerDocument(), "Xdiv", "block");
          viewport = new Viewport(vp, g, ctx, this, root, width, height);
          viewport.setConfig(config);
          overflowPropagated = false;
          BoxTreeCreationStatus stat = new BoxTreeCreationStatus(viewport);
          createSubtree(root, stat);
          log.debug("Root box is: " + viewport.getRootBox());
          
          return viewport;
      }
docs: Create the viewport and the underlying box tree from a DOM tree.
  
  @param root the root element of the source DOM tree.
  @param g the root graphic context. Copies of this context will be used for the individual boxes.
  @param ctx the visual context (computed style). Copies of this context will be used for the individual boxes.
  @param width preferred viewport width.
  @param height preferred viewport height.
  @return the created viewport box with the corresponding box subtrees.