Margin on XUL boxes inside <box equalsize="always"> causes weird layout effects

ASSIGNED
Assigned to

Status

()

Core
XUL
ASSIGNED
17 years ago
10 years ago

People

(Reporter: Roger D, Assigned: Eric Vaughan)

Tracking

({testcase})

Trunk
Future
x86
Windows NT
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

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

Description

17 years ago
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:0.9.1) Gecko/20010607
BuildID:    2001060703

I'm trying to build a simple table using:
  
<box orient="vertical">
  <box flex="1" equalsize="always" >
    <box style="margin: 2px;" flex="1" >
      ...
    </box>
    <box style="margin: 2px;" flex="1" >
      ...
    </box>
  </box>
    <box style="margin: 2px;" flex="1" >
      ...
    </box>
    <box style="margin: 2px;" flex="1" >
      ...
    </box>
  </box>
</box>

When I resize the outer box, the last row is willing to compress the margins
(which I don't want), while the preceeding row(s) don't compress but end up
sticking off the right-hand edge of the screen.

Reproducible: Always
Steps to Reproduce:
1. Load the following XUL:

<?xml version="1.0" encoding="US-ASCII"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>

<window id="main"
 align="center"
 debug="false" 
 valign="middle" 
 
 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" >

  <box flex="1" >
  </box>
  <splitter>
    <grippy/>
  </splitter>
  <box style="border: 1px black solid;" orient="vertical" >
    <box flex="1" equalsize="always" >
      <box style="background: white; margin: 20px;" flex="1" >
        <text value="1111111111111" />
      </box>
      <box style="background: white; margin: 20px;" flex="1" >
        <text value="2222222222222" />
      </box>
    </box>
    <box flex="1" equalsize="always" >
      <box style="background: white; margin: 20px;" flex="1" >
        <text value="3" />
      </box>
      <box style="background: white; margin: 20px;" flex="1" >
        <text value="4" />
      </box>
    </box>
  </box>
</window>

2. Using the grippy (the presence of a grippy isn't essential to reproducing the
problem, but does make it easier to try out), make the table narrower.


Actual Results:  The last row compresses (which it shouldn't), while the
preceeding row goes off the right-hand edge of the screen.

Expected Results:  The table refuses to compress.
(Reporter)

Comment 1

17 years ago
Created attachment 39439 [details]
XUL file for test case
(Reporter)

Updated

17 years ago
Keywords: testcase
box --> evaughan
Assignee: trudelle → evaughan
Target Milestone: --- → mozilla1.0
(Assignee)

Comment 3

16 years ago
I'll take a look. But you should try doing a grid for this. Try:

<grid>
  <columns>
    <column flex="1"/>  
    <column/>
    <column/>
  </columns>

  <rows>
    <row>
      <button value="1"/>
      <button value="2"/>    
      <button value="3"/>
    </row>
 
    <row>
      <button value="4"/>
      <button value="5"/>    
      <button value="6"/>
    </row>
  </rows>
 </grid>
Status: NEW → ASSIGNED
Target Milestone: mozilla1.0 → Future

Updated

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