nsComputedDOMStyle::DoGetMinWidth() shouldn't just convert "min-width:auto" to "min-content" on flex items (and DoGetMinHeight shouldn't just convert "auto" to 0)

RESOLVED DUPLICATE of bug 1304636

Status

()

RESOLVED DUPLICATE of bug 1304636
3 years ago
7 months ago

People

(Reporter: dholbert, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(firefox40 affected)

Details

(Reporter)

Description

3 years ago
In an older version of the flexbox spec, "min-width:auto" was defined as computing to either 0 or min-content, depending on whether we're a flex item. And that's how our getComputedStyle() code currently behaves.

https://mxr.mozilla.org/mozilla-central/source/layout/style/nsComputedDOMStyle.cpp?rev=da024a455adc&mark=4323-4334#4317

However, the spec has gotten more complicated, so this simple behavior isn't correct anymore.

Current spec text is at http://dev.w3.org/csswg/css-flexbox-1/#valdef-min-width-auto .
(Reporter)

Updated

3 years ago
Blocks: 1015474
(Reporter)

Comment 1

3 years ago
For the record, the old spec text (which this code is currently based on) is:
 "It is intended that this will compute to the
  ‘min-content’ keyword when the specification
  defining it (Writing Modes Appendix D) is
  sufficiently mature."
http://www.w3.org/TR/2012/WD-css3-flexbox-20120612/#min-size-auto
(Reporter)

Comment 2

3 years ago
Similarly, we convert "min-height" to 0, regardless of whether the element is a flex item:
 https://mxr.mozilla.org/mozilla-central/source/layout/style/nsComputedDOMStyle.cpp?rev=da024a455adc&mark=4303-4309#4298

We should leave it at "auto" for each property, depending on our flex container's main axis, probably. (whichever property is in the main axis should preserve "auto")
Summary: nsComputedDOMStyle::DoGetMinWidth() shouldn't just convert "min-width:auto" to "min-content" on flex items → nsComputedDOMStyle::DoGetMinWidth() shouldn't just convert "min-width:auto" to "min-content" on flex items (and DoGetMinHeight shouldn't just convert "auto" to 0)

Comment 3

7 months ago
(In reply to Daniel Holbert [:dholbert] from comment #2)
> Similarly, we convert "min-height" to 0, regardless of whether the element
> is a flex item:
>  https://mxr.mozilla.org/mozilla-central/source/layout/style/
> nsComputedDOMStyle.cpp?rev=da024a455adc&mark=4303-4309#4298
> 
> We should leave it at "auto" for each property, depending on our flex
> container's main axis, probably. (whichever property is in the main axis
> should preserve "auto")

Looks like CSS WG just resolved that we should just preserve "auto" for both of these properties.

See: https://github.com/w3c/csswg-drafts/issues/2230 "Computing min-width/min-height: auto to zero #2230" to compute auto to auto.
(Reporter)

Comment 4

7 months ago
This bug is pretty stale actually; the spec changed (in the past) after this bug was filed and we updated to that specced behavior in bug 1304636.

I'll dupe this forward and add a note over on that other bug.
Status: NEW → RESOLVED
Last Resolved: 7 months ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1304636
You need to log in before you can comment on or make changes to this bug.