The default bug view has changed. See this FAQ.

Setting width to a percentage value on XUL box children fails




10 years ago
4 years ago


(Reporter: jwatt, Unassigned)


(Blocks: 1 bug)


Firefox Tracking Flags

(Not tracked)



(2 attachments)



10 years ago
Setting the CSS 'width' property to a percentage value on children of XUL boxes fails.

Comment 1

10 years ago
Created attachment 278661 [details]
testcase (if you see any red the test has failed)

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". ;)

Comment 3

10 years ago
Created attachment 278734 [details]
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.

Comment 4

10 years ago
(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.

Comment 5

10 years ago
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.


10 years ago
Blocks: 373960


9 years ago
Duplicate of this bug: 411456


9 years ago
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.xul → xptoolkit.widgets


8 years ago
OS: Windows XP → All
Hardware: x86 → All

Comment 8

8 years ago
#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?

Comment 9

6 years ago
ref: for flexbox bug
You need to log in before you can comment on or make changes to this bug.