XUL listboxes too "flexy"

RESOLVED INVALID

Status

()

Core
XUL
RESOLVED INVALID
13 years ago
9 years ago

People

(Reporter: Rob Adams, Unassigned)

Tracking

({testcase})

Trunk
x86
All
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

285 bytes, application/vnd.mozilla.xul+xml
Details
314 bytes, application/vnd.mozilla.xul+xml
Details
(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8b2) Gecko/20050524 Firefox/1.0+
Build Identifier: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8b2) Gecko/20050524 Firefox/1.0+

If a XUL listbox is in a box with another XUL element, both with flex="1", the
listbox comes out much bigger than the other element.

Testcases to be attached.

Reproducible: Always
(Reporter)

Comment 1

13 years ago
Created attachment 184452 [details]
Test case 1

listbox and another box.  It need not be a tree.
(Reporter)

Comment 2

13 years ago
Created attachment 184453 [details]
Test case 2

test case 1 but horizontal instead of vertical
+kw testcase, although i have no idea what i'm meant to be seeing/not seeing here..
Keywords: testcase
(Reporter)

Comment 4

13 years ago
The listbox and tree in both examples should be the same size; they're not.

Comment 5

13 years ago
confirmed with linux trunk 2005052401

==> xul
Status: UNCONFIRMED → NEW
Component: Layout → XP Toolkit/Widgets: XUL
Ever confirmed: true
QA Contact: layout → xptoolkit.xul

Comment 6

13 years ago
Listboxes have a default size of 200x200. Trees have a default size of 0x0.
(ignoring margins, borders, etc.) Thus the listbox will be 200px larger.

Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → INVALID
(Reporter)

Comment 7

13 years ago
Sorry but this explanation makes no sense.  Nothing in any XUL documentation or
specifications leads me to believe that this behavior is correct, and absolutely
every other case works according to the flex attributes.

Why should listboxes be any different, and why should the default size affect
how it works with the flex attribute?

I'm sorry, but this is a bug.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---

Comment 8

13 years ago
The default height of the listbox is 200. The default height of the tree is 0.
If the height of the window is 800 pixels, there will be 600 pixels of remaining
space. Since both elements are equally flexible (flex="1"), the remaining space
will be divided equally among both elements, which is 600 divided by 2 = 300
pixels per element. The listbox will become 500 pixels and the tree will be 300
pixels. Which is what I see happening in a recent Firefox build.


(Reporter)

Comment 9

13 years ago
OK I think I understand what you're saying, and setting the width and height to
0 works as a workaround.  I would put forth however that trees and lists, at
least, should have the same "default" size because

<vbox>
 <listbox height="0" flex="1"/>
 <tree flex="1"/>
</vbox>

isn't how I, or I believe most people, would expect that to work in order to get
equal-sized boxes.

Comment 10

13 years ago
You can use

<vbox equalsize="always">
 <listbox flex="1"/>
 <tree flex="1"/>
</vbox>

if you want the children to be the same size.

I don't see any reason to change the default size of listboxes/trees which have
been in place for a long time, just for this particular circumstance. You
shouldn't be relying on any particular default size for an element anyway since
it may vary by platform/theme.
Status: REOPENED → RESOLVED
Last Resolved: 13 years ago13 years ago
Resolution: --- → INVALID

Updated

9 years ago
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.xul → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.