Skip to content

[css-sizing] clarification around Compressible Replaced Elements and min-content size #5665

Open
@davidsgrogan

Description

@davidsgrogan

5.2.2 Compressible Replaced Elements applies to 5.2 Intrinsic Contributions. Does it also apply to 5.1 Intrinsic Sizes?

The answer affects the size of <input> below because the flexbox will respect the min-content size of the <input> element when shrinking.

<div style="display: flex; width: 150px;">
  <div style="flex: 0 0 100px;"></div>
  <input style="width: 100%">
</div>

https://jsfiddle.net/pfv2x6sd/1/

Indications that 5.2.2 applies to 5.1:

  • The text of 5.2.2 explicitly says min-content size, which is clearly in the purview of 5.1: The following elements can have their min-content size compressed

Indications 5.2.2 does not apply to 5.1:

  • 5.2.2 is only in the 5.2 section, not an independent section like a hypothetical 5.3
  • 5.2.2 refers to 5.2.1 for clarification about when min-content sizes can be "compressed"

Chrome behaves as if 5.2.2 applies to 5.1. Firefox behaves as if it does not apply. (In an unlikely scenario, the implementors of the respective engines think the other engine is right.)

Can we get this part of the spec clarified so we know how to size the <input> element in the above example? One suggestion from the chrome bug is

  1. Replace "compressible" with a clearer term
  2. Make sure the two places match about whether this affects min-content size or contribution

The firefox bug is at https://bugzilla.mozilla.org/show_bug.cgi?id=1585485

/cc @dholbert @cbiesinger who I've been discussing this with

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions