org.xhtmlrenderer.swing.RootPanel implements Scrollable which specifies the viewport resize rules.
This gets rid of some layout hacks, removes unsightly scrollbar flicker when resizing the viewport (especially noticeable when scrollbar policy is set to 'AS_NEEDED'), and may prevent some unnecessary revalidates/repaints.