Open Bug 394078 Opened 17 years ago Updated 2 years ago

Setting width to a percentage value on XUL box children fails

Categories

(Core :: XUL, defect)

defect

Tracking

()

People

(Reporter: jwatt, Unassigned)

References

Details

Attachments

(2 files)

Setting the CSS 'width' property to a percentage value on children of XUL boxes fails.
Adding flex="1" to the <div> "fixes" things - unless of course you want to use a percentage other than 100%.
The problem is that XUL layout asks the box for its pref width (which ends up computing to 0 in this case) and then starts it off with that size as the computed size, more or less.

This is basically a duplicate of one of the existing "XUL does not play nice with the CSS box model" bugs.

Also known as "don't do that". ;)
Attached image SVG testcase
By "don't do that", do you mean we don't want to/won't fix this?

FWIW here's an SVG example that's similar. For it, the problem is that nsFrame::BoxReflow passes an nsSize with unconstrained size to nsSVGOuterSVGFrame::ComputeSize as aCBSize.
(In reply to comment #3)
> By "don't do that", do you mean we don't want to/won't fix this?
> 

Fixing the XUL box implementation is my plan for the Mozilla 2 timeframe.
Okay, thanks Neil. Feel free to keep this bug open or close it, as you prefer.
> By "don't do that", do you mean we don't want to/won't fix this?

I mean that to fix it one first has to spec out the interaction between the flexbox and CSS box models, then implement it.

> FWIW here's an SVG example that's similar.

Frankly, if you just want to allow using SVG in XUL effectively, you should just make SVG implement the XUL box layout methods instead of relying on the underspecified, underdesigned, and buggy flexbox-to-css-box shim code.
Blocks: 373960
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.xul → xptoolkit.widgets
OS: Windows XP → All
Hardware: x86 → All
#1 jwatt

<svg flex="1" >  works fine for me,

now add width and height at 100%, this still displays fine in mozilla, but then if one makes an app in os x this will not display at all.

Does this apply to other OS?
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: