[webkit-dev] layout intrinsic height

Erik Kay erikkay at chromium.org
Wed Nov 4 15:48:44 PST 2009


This is from (https://bugs.webkit.org/show_bug.cgi?id=31036).  Sorry
for duplicating here, but I was hoping to get some feedback.  I'm
happy to carry on the conversation in the bug.  Also, in case it isn't
clear in the bug, I'm happy to make the change myself if that makes
sense.

For Chrome's extension system, we let the extension create a popup widget using
HTML.  This popup widget's size is (mostly) unconstrained externally.  The idea
is to let the developer take advantage of some dynamic layout so that they
don't have to worry as much about issues like system font sizes and
localization.
Obviously, the developer needs to put some constraints in (whitespace: nowrap,
 , an explicit width or height on an element, etc.).

I can get pretty close to my goal by using RenderBox::minPrefWidth() (on
RenderView) and using contentHeight() for the height and resizing the
RenderView to match.  Unfortunately, with this technique, the height will never
shrink.  There doesn't seem to be a way to ask for the "intrinsic height" of
the view at its current width.  I'm assuming this must be known somewhere in
order to calculate the overflow if any, but it looks like this value isn't
saved or exposed.

thanks,
Erik


More information about the webkit-dev mailing list