Closed Bug 275526 Opened 20 years ago Closed 20 years ago

invalid flex algorithm

Categories

(Core :: XUL, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: surkov, Assigned: roc)

Details

Attachments

(1 file)

550 bytes, application/vnd.mozilla.xul+xml
Details
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8a5) Gecko/20041122
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8a5) Gecko/20041122

I have two boxes with flex attribute inside of the same container. Thease boxes
have childs. When boxes are flexed then algorithm of flexing is next: 
width of free place from childs of boxes (container_widht-boxes_childs_width) is
devided between boxes in accordance with value of flex attribute. I think width
of container should be devided between boxes.

Reproducible: Always

Steps to Reproduce:
<hbox>

<hbox style="border: thin solid" flex="1">
<textbox/>
</hbox>

<hbox style="border: thin solid" flex="1">
<textbox/>
</hbox>

</hbox>


<hbox>

<hbox style="border: thin solid" flex="1">
<textbox/>
</hbox>

<hbox style="border: thin solid" flex="1" >
<textbox/>
<textbox/>
</hbox>

</hbox>
Actual Results:  
Boxes have different width.

Expected Results:  
Boxes should have the same width.
Attached file Testcase
After the elements have been positioned and sized, the remaining space is
divided equally (or using the flex ratios) among all flexible children. You'll
note that the empty space in the second row is the same for both the left and
right boxes.

If you want the rows to be aligned, use a grid.

Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Component: Layout: View Rendering → XP Toolkit/Widgets: XUL
Resolution: --- → INVALID
I was thinking such behaviour of flexing elelments isn't correct and looks
strange. I don't understand why does remaining space (not whole space!) should
be devided between flexed elements.
To comment #2.

It is not always possible to use grid element. In this case we should have
attribute with behaviour like I said before (whole space is divided between
flexed elements). That is it's needed to have something like enhanced equalsize
attribute to have posibility to specify proportions of child objects.

I offer to add new attribute to specify proportions of child objects.
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: ian → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: