Closed Bug 246706 Opened 22 years ago Closed 22 years ago

inconsistency in dealing with inflexible spacers

Categories

(Core :: XUL, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bryner, Assigned: bryner)

Details

(Keywords: fixed-aviary1.0, fixed1.7.5)

Attachments

(2 files)

If you have a spacer that has only a min-width specified in CSS, and is not flexible, then the parent box will miscalculate how much space is needed. This results in a shortage of space when the parent box lays out its children so that the last child may not get its min-width even if there is plenty of room. Here's what causes the problem: - In nsSprocketLayout::GetMinWidth(), we use the preferred size as the min size for inflexible children. This is the size used when computing the min-width of the parent box. Since the preferred width is not specified, it uses 0 as the min width. - In nsSprocketLayout::ComputeChildSizes() (used to lay out the children), we do the same thing, but these sizes have previously been bounds-checked in PopulateBoxSizes to ensure that min <= pref <= max. So the min-size used here is the actual min size from CSS. This inconsistency is the source of the problem. Since most of the box code assumes that min <= pref <= max, I think this should be the case for nsBox::GetPrefSize() as well. It's already done in nsContainerBox::GetPrefSize, which is why this bug only affects leaf boxes such as spacers.
Attached file testcase
The label should not wrap. Instead, the parent box should expand to give it enough space.
Attached patch patchSplinter Review
Attachment #150745 - Flags: superreview?(dbaron)
Attachment #150745 - Flags: review?(dbaron)
Attachment #150745 - Flags: superreview?(dbaron)
Attachment #150745 - Flags: superreview+
Attachment #150745 - Flags: review?(dbaron)
Attachment #150745 - Flags: review+
checked in
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
checked in on aviary branch.
Whiteboard: fixed-aviary-1.0
Keywords: fixed-aviary1.0
Whiteboard: fixed-aviary-1.0
Comment on attachment 150745 [details] [diff] [review] patch We should take this for 1.7 since we're taking the gtk2 native theme changes, I think this is needed for that to work properly.
Attachment #150745 - Flags: approval1.7.x?
Comment on attachment 150745 [details] [diff] [review] patch a=mkaply for 1.7 - please mark fixed1.7.x when checked in.
Attachment #150745 - Flags: approval1.7.x? → approval1.7.x+
Keywords: fixed1.7.x
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: