padding|margin + <grid> : miscalculation of cropping and preferred size

NEW
Assigned to

Status

()

Core
XUL
P3
normal
18 years ago
17 years ago

People

(Reporter: John Morrison, Assigned: Eric Vaughan)

Tracking

Trunk
Future
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

18 years ago
Overview Description:
  padding|margin + <grid> : miscalculation of cropping and preferred size

Steps to Reproduce:
1) load the attached example XUL file (from disk)

Actual Results:
  <button>s contained in a grid are:
   (1) partially transparent, in the region where they should be cropped
   (2) shouldn't really be cropped at all (should they?)

Expected Results:
   <button>s (and the <text>) should get their preferred size, and that 
   should determine the preferred size for the grid columns and rows

Reproducibility: .

Build Date & Platform Bug Found:
  2000071008 win95
  2000071008 linux
  2000070708 mac

Additional Information:
 The xul in question looks like:

  <grid style="border:1px solid red;padding:0px;margin:0px;">
    <columns>
      <column style="border:1px solid green;padding:10px;margin:10px;"/>
      <column style="border:1px solid green;padding:10px;margin:10px;"/>
    </columns>
    <rows>
      <row style="border:1px solid blue;padding:10px;margin:10px;">
        <button value="Blah, Blah, Blah, Blah, Blah"/>
        <button value="Blah, Blah, Blah, Blah"/>
      </row>
      <row style="border:1px solid blue;padding:10px;margin:10px;">
        <button value="Blah, Blah, Blah, Blah, Blah, Blah, Blah"/>
        <button value="Blah, Blah"/>
      </row>
    </rows>
  </grid>

and a second grid is the same as the above, but substitutes <text> for 
<button> in the example.
(Reporter)

Comment 1

18 years ago
Created attachment 11223 [details]
testcase; a grid with margin & padding, containing buttons

Comment 2

18 years ago
Hey John, i modified your test case to show the problem i'm having with crop.

Attaching . . .

pete

Comment 3

18 years ago
Created attachment 11405 [details]
variation on John's test case

Comment 4

18 years ago
On one of the text elements below, i have a crop="right" set.
The value is a long fooooooo.

It crops but still expands it's width beyond it's boundaries beyond 200px.


<box orient="vertical" style="min-width: 600px;" flex="100%">
  <grid style="border:1px solid red;padding:0px;margin:0px;">
    <columns>
      <column style="border:1px solid green;padding:10px;margin:10px;"
flex="100%"/>
      <column style="border:1px solid green;padding:10px;margin:10px;"
flex="100%"/>
    </columns>
    <rows flex="100%">
      <row style="border:1px solid blue;padding:10px;margin:10px;">
        <button value="Blah, Blah, Blah, Blah, Blah"/>
        <button value="Blah, Blah, Blah, Blah"/>
      </row>
      <row style="border:1px solid blue;padding:10px;margin:10px;">
        <button value="Blah, Blah, Blah, Blah, Blah, Blah, Blah"/>
        <button value="Blah, Blah"/>
      </row>
    </rows>
  </grid>
  <grid style="border:1px solid red;padding:0px;margin:0px;">
    <columns>
      <column style="border:1px solid green;padding:10px;margin:10px;"
flex="100%"/>
      <column style="border:1px solid green;padding:10px;margin:10px;"
flex="100%"/>
    </columns>
    <rows flex="100%">
      <row style="border:1px solid blue;padding:10px;margin:10px; max-width:
200px;">
        <text crop="right"  value="Blah, Blah, Blah, Blah, Blah
f000000000000000000000000000000000000000000000000000000000000
0000000000oooooooooooooooooooooooooooooooooooooooooooo"/>
        <text value="Blah, Blah, Blah, Blah"/>
      </row>
      <row style="border:1px solid blue;padding:10px;margin:10px;">
        <text value="Blah, Blah, Blah, Blah, Blah, Blah, Blah"/>
        <text value="Blah, Blah"/>
      </row>
    </rows>
  </grid>
</box>
(Reporter)

Comment 5

18 years ago
(per trudelle). mass-moving all evaughan non-nsbeta3+ bugs to future milestone
Target Milestone: --- → Future
(Assignee)

Comment 6

17 years ago
This is fixed except for the clipping case. Currently grids support setting
the height of a row but not its width. Or the width of a column but not its height.
I should support this but is a little messy. So try removing the max-width off
of the row in the second grid and the example works.


You need to log in before you can comment on or make changes to this bug.