Re: Shrinkwrap

I have recently run into this problem while debugging an application of mine
in Mozilla, so I would be happy to describe several situations in which
"shrink-wrapping" would be of extreme value.

Say, for example, that you are using Javascript and DOM to write a widget
for displaying a list.  The user provides you with a list of labels, and you
display the labels in divs (positioned absolutely) vertically one on top of
the other.  The user does not provide an explicit width for the list,
meaning that he wants it to default to the width of the longest label in the
list.

Using the current system, it is impossible to determine the actual width of
each of the label elements so that you can calculate the widest one.
Defaulting element size to expand to the edge of it's parent simply robs us
of this essential information. Conceptually, when a user declares an
element, gives it a style and some content, the user expects the element to
be the size of it's content.

Received on Tuesday, 29 February 2000 10:05:16 UTC