Min and pref width for inline and text frames

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Min and pref width for inline and text frames

Boris Zbarsky
Would it make sense for inline and text frames to implement GetMinWidth and
GetPrefWidth in addition to the inline methods?  Presumably they would implement
these in terms of the inline methods...

The reason I'm running into this is twofold.  First of all, XUL boxes with text
in them (eg   data:text/html,<div style="display:-moz-box">aaa</div> ) assert,
since the text doesn't implement GetPrefWidth/GetMinWidth.  Second, I'm
considering nixing nsLegendFrame altogether if I can; it really doesn't have
that much reason to exist.  But then in the fieldset frame I'll want to call
GetPrefWidth on the legend (since the fieldset's minimum width depends on the
legend's preferred width as things stand).  And if the legend frame is
constructed by display (so it can be an inline), then I run into inlines not
supporting GetPrefWidth.

Of course another option for the latter problem is to just set "display: block
!important" on legends in forms.css...

And a third option (possibly to be combined with the second) is that we allow
legends to wrap.

-Boris
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|

Re: Min and pref width for inline and text frames

L. David Baron
On Friday 2006-04-28 00:07 -0500, Boris Zbarsky wrote:
> Would it make sense for inline and text frames to implement GetMinWidth and
> GetPrefWidth in addition to the inline methods?  Presumably they would
> implement these in terms of the inline methods...

Inline, definitely not.  Text, maybe.  Anything that needs inlines
absolutely needs to wrap them in a block.  Although given the current
text frame code, I'm tempted to say the same for text, unless you can
convince me that the numerous null-checks of nsLineLayout objects don't
actually break anything.  See
https://bugzilla.mozilla.org/show_bug.cgi?id=320502

-David

--
L. David Baron                                <URL: http://dbaron.org/ >
           Technical Lead, Layout & CSS, Mozilla Corporation

_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout

attachment0 (196 bytes) Download Attachment