User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16 Build Identifier: 20110318052756 Setting "position" to either "absolute" or "fixed" in a flexbox element breaks this functionality. This applies to the element containing the boxes. Reproducible: Always Steps to Reproduce: 1. Visit http://w3conversions.com/sandbox/css3/flexbox/four_equal_nocontent.html 2. Open Firebug, change div.hbox position to "absolute" or "fixed". Actual Results: Boxes now stretch all the way, rather than behaving as they should. Expected Results: Box model should still be effective, meaning the coloured boxes should still appear next to each other. Not sure the build number I got up there is correct. I'm running Firefox 4.0, no pending updates.
Summary: Flexbox in position: absolute/fixed elements breaks → Setting position: absolute/fixed in flexbox elements breaks it
iirc, :bz told me that this is the expected behavior. But still, this is annoying. What does the spec says?
It doesn't. That's sort of the point. At least nothing regarding the containing element's position having to be anything in particular. I'm not sure how this could or should be intended behavior really. It limits the usefulness of flexbox to statically positioned elements. Not to say there isn't a reason, but I can't think of a good one. Final, from my tests against Chrome, Safari, and Opera (all latest), Firefox seems to be the only browser that has that behavior..
At one point, the CSS2 spec said that any non-replaced element became "display:block" when 'position' was set to absolute or fixed or when it was floated. That's what we implement. That spec was later changed in a way that kept behavior the same for the display types defined in CSS2 but didn't affect other display types. We need to make that change at some point. It's a fair amount of work to do that, unfortunately; see bug 579776 comment 9 through bug 579776 comment 12.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 579776
You need to log in before you can comment on or make changes to this bug.