<select size="n"> sizing

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

<select size="n"> sizing

Boris Zbarsky
How should <select size="n" size itself?  At the moment what we do is:

1)  Reflow the options at unconstrained width and height
2)  Walk the list of options examining their frame rects to determine the
     biggest height of a single option.
3)  Multiply that by the "size" attribute.

I suppose I could still effectively do that (reflow at unconstrained height,
then reflow with the computed constrained height).  Is there a better way, though?

-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: <select size="n"> sizing

L. David Baron
On Tuesday 2006-05-02 18:19 -0500, Boris Zbarsky wrote:

> How should <select size="n" size itself?  At the moment what we do is:
>
> 1)  Reflow the options at unconstrained width and height
> 2)  Walk the list of options examining their frame rects to determine the
>     biggest height of a single option.
> 3)  Multiply that by the "size" attribute.
>
> I suppose I could still effectively do that (reflow at unconstrained
> height, then reflow with the computed constrained height).  Is there a
> better way, though?
Why do we need to reflow twice?  We still have unconstrained heights.
Do we support percentage height on options?  Why?

-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
Reply | Threaded
Open this post in threaded view
|

Re: <select size="n"> sizing

Robert O'Callahan-3
In reply to this post by Boris Zbarsky
Boris Zbarsky wrote:

> How should <select size="n" size itself?  At the moment what we do is:
>
> 1)  Reflow the options at unconstrained width and height
> 2)  Walk the list of options examining their frame rects to determine the
>     biggest height of a single option.
> 3)  Multiply that by the "size" attribute.
>
> I suppose I could still effectively do that (reflow at unconstrained
> height, then reflow with the computed constrained height).  Is there a
> better way, though?

Reflow with the current height, if this is not the initial reflow,
otherwise unconstrained height, then you only have to reflow again if
the computed constrained height is not the current height?

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

Re: <select size="n"> sizing

Boris Zbarsky
Robert O'Callahan wrote:
>> I suppose I could still effectively do that (reflow at unconstrained
>> height, then reflow with the computed constrained height).  Is there a
>> better way, though?
>
> Reflow with the current height, if this is not the initial reflow,
> otherwise unconstrained height, then you only have to reflow again if
> the computed constrained height is not the current height?

Yeah, ok.  That makes sense.  I'll give it a shot tomorrow night.

-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: <select size="n"> sizing

Boris Zbarsky
L. David Baron wrote:
 > On Tuesday 2006-05-02 18:19 -0500, Boris Zbarsky wrote:
 >> I suppose I could still effectively do that (reflow at unconstrained
 >> height, then reflow with the computed constrained height).  Is there a
 >> better way, though?
 >
 > Why do we need to reflow twice?  We still have unconstrained heights.
 > Do we support percentage height on options?  Why?

We need to know the height of the largest option to decide on our height when
size="n" is set.  At the moment we get the rects of all the option frames and
just grab the largest height.  Is there another way I could do this?

Once I know the proper height, I need to reflow at that height or with that
amount of avail height or whatever to make the vertical scrollbar size correctly.

-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: <select size="n"> sizing

Robert O'Callahan-3
Boris Zbarsky wrote:
> Once I know the proper height, I need to reflow at that height or with
> that amount of avail height or whatever to make the vertical scrollbar
> size correctly.

That second reflow should be really cheap if our incremental reflow
doesn't suck.

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