Closed Bug 1018449 Opened 12 years ago Closed 12 years ago

Firefox stretches flex items to container's cross-size, in some multi-line cases, when it shouldn't

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla32

People

(Reporter: dholbert, Assigned: dholbert)

Details

Attachments

(2 files)

Spec quote: As a special case for handling stretched flex items, if a single-line flex container has a definite cross size, the outer cross size of any flex items with align-self: stretch is the flex container’s inner cross size (clamped to the flex item’s min and max cross size) and is considered definite. http://dev.w3.org/csswg/css-flexbox/#layout-algorithm In vertical flex containers, we apply this here: >1099 aFlexItem.ResolveStretchedCrossSize(aParentReflowState.ComputedWidth(), >1100 aAxisTracker); http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsFlexContainerFrame.cpp?rev=8aa36dab2765#1099 HOWEVER, this code doesn't check whether we're single-line or not. It should. (And it shouldn't stretch the auto-size [to the container's cross size] at this point, if we're multi-line.) I don't have a testcase yet, but I suspect it shouldn't be hard to construct one that we fail because of this. (According to the linkification in the spec, "single-line" here is purely based on the "flex-wrap" property -- it does not include cases with flex-wrap:wrap w/ only enough content to fill a single line. That's good, because if it did include that scenario, we wouldn't know whether or not to apply this special-case, because at this point in the code, multi-line flexboxes don't necessarily know yet whether they'll occupy more than one line or not.)
Attached file testcase 1
Attached patch fix v1Splinter Review
Attachment #8435548 - Flags: review?(matspal)
Comment on attachment 8435548 [details] [diff] [review] fix v1 Makes sense, thanks for the detailed explanation (as always :-) )
Attachment #8435548 - Flags: review?(matspal) → review+
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: