Last Comment Bug 394078 - Setting width to a percentage value on XUL box children fails
: Setting width to a percentage value on XUL box children fails
Status: NEW
:
Product: Core
Classification: Components
Component: XUL (show other bugs)
: Trunk
: All All
: -- normal with 2 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
: 411456 (view as bug list)
Depends on:
Blocks: 373960
  Show dependency treegraph
 
Reported: 2007-08-28 15:57 PDT by Jonathan Watt [:jwatt] (back in October - email directly if necessary)
Modified: 2013-03-27 08:21 PDT (History)
10 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
testcase (if you see any red the test has failed) (298 bytes, application/vnd.mozilla.xul+xml)
2007-08-28 15:59 PDT, Jonathan Watt [:jwatt] (back in October - email directly if necessary)
no flags Details
SVG testcase (284 bytes, image/svg+xml)
2007-08-29 00:37 PDT, Jonathan Watt [:jwatt] (back in October - email directly if necessary)
no flags Details

Description Jonathan Watt [:jwatt] (back in October - email directly if necessary) 2007-08-28 15:57:07 PDT
Setting the CSS 'width' property to a percentage value on children of XUL boxes fails.
Comment 1 Jonathan Watt [:jwatt] (back in October - email directly if necessary) 2007-08-28 15:59:56 PDT
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%.
Comment 2 Boris Zbarsky [:bz] (TPAC) 2007-08-28 20:32:08 PDT
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 Jonathan Watt [:jwatt] (back in October - email directly if necessary) 2007-08-29 00:37:30 PDT
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 Neil Deakin (away until Oct 3) 2007-08-29 05:13:20 PDT
(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 Jonathan Watt [:jwatt] (back in October - email directly if necessary) 2007-08-29 05:37:16 PDT
Okay, thanks Neil. Feel free to keep this bug open or close it, as you prefer.
Comment 6 Boris Zbarsky [:bz] (TPAC) 2007-08-29 07:42:42 PDT
> 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.
Comment 7 Neil Deakin (away until Oct 3) 2008-01-09 06:20:14 PST
*** Bug 411456 has been marked as a duplicate of this bug. ***
Comment 8 jonathan chetwynd 2009-03-29 07:37:03 PDT
#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 Oli Studholme 2011-01-13 14:57:14 PST
ref: https://bugzilla.mozilla.org/show_bug.cgi?id=529761 for flexbox bug

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