Setting width to a percentage value on XUL box children fails

NEW
Unassigned

Status

()

Core
XUL
10 years ago
4 years ago

People

(Reporter: jwatt, Unassigned)

Tracking

(Blocks: 1 bug)

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

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

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

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.
(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.
(Reporter)

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.
(Reporter)

Updated

10 years ago
Blocks: 373960
Duplicate of this bug: 411456

Updated

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

Updated

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: https://bugzilla.mozilla.org/show_bug.cgi?id=529761 for flexbox bug
You need to log in before you can comment on or make changes to this bug.