Improved the solution, and added a test.

Instead of statically saving the previous height of the element, we now
recompute it as it is needed.  This is done by removing any height directive
that may be on the element (e.g., if it is collapsed), computing the resulting
height with jQuery, and then re-establishing the height directive.  During
transitions, this computed height is used as the target height, and then the
height directive is removed (for open panels).  This way, whenever content is
added to the control panel, its appearance will be correct.  For open panels,
there is no constraining height directive, so the panel will re-render
immediately to its new height, while for closed panels, the height will be low,
but then a freshly computed new height will be used when opening.

This commit also adds a web-content-test to test the correct behavior.