Making BrowserFrame adjust size for content

I have the following problem: I have a layout where I want to put one or more BrowserFrames, stacked on top of each other. I would like the height of the frames to adjust automatically so that the full content is displayed without need of a scroller. I call .setSizeFull on the frames and I have tried to call .setExpandRatio(browserFrame, 1.0f), but the result is that the frames always have the same height. If the content is high, scrollers are displayed. If the content is small, the frame height does not get smaller. I have looked for similar issues in this forum, but didn’t find an answer. Anyone who has a hint on how to solve this?