Closed Bug 756647 Opened 9 years ago Closed 8 years ago

Implement "auto" value for min-width and min-height

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 763689

People

(Reporter: dholbert, Unassigned)

References

()

Details

The flexbox ED now defines an "auto" keyword for min-height / min-width, which is the new initial value for those properties.

# 4.3. Implied Minimum Size of Flex Items
# To provide a more reasonable default minimum size for flex containers, this
# specification introduces a new ‘auto’ value as the initial value of the
# ‘min-width’ and ‘min-height’ # properties defined in CSS 2.1. [CSS21]

The definition of "auto" is:

# auto
#     On a flex item, this keyword indicates a minimum size of the
#     min-content size.
#
#    It is intended that this will compute to the ‘min-content’ keyword when
#    the specification defining it (Writing Modes Appendix D) is sufficiently
#    mature.
#
#    On any other element, this keyword computes to ‘0’ (unless otherwise defined
#    by a future specification).

Note that because "auto" computes to 0 outside of a flexbox, this change shouldn't be detectable in existing web content (except for content that accidentally uses "auto" already and depends on the fact that the CSS parser rejects it).
Component: Layout → Style System (CSS)
OS: Linux → All
QA Contact: layout → style-system
Hardware: x86_64 → All
Since this depends on flex-itemness, and is the default value, it means we need to either store "auto" in the style struct and handle that everywhere or put some serious thought about how ruletree caching should work with all these context-dependent-computed-value default values the CSSWG is insisting on.  :(
I think 'auto' should be a computed value (but not a used value).  If the spec doesn't say that we should get it changed.
(In reply to David Baron [:dbaron] from comment #2)
> I think 'auto' should be a computed value (but not a used value).  If the
> spec doesn't say that we should get it changed.

Er, the spec does say that.  It says the computed value line is:
  the percentage as specified or the absolute length or a keyword
which is a change from CSS 2.1, which says:
  the percentage as specified or the absolute length

So we just store eStyleUnit_Auto in the style struct and fix all the code that uses nsStylePosition::mMin{Width,Height} (including nsComputedDOMStyle).
oops -- I forgot that I'd filed this bug -- I filed another bug on this a month later (& landed one patch for it, doing part of comment 3): bug 763689
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 763689
You need to log in before you can comment on or make changes to this bug.