← 返回首页
[css-flexbox-1] Clamp "hypothetical main size" to be non-negative? · Issue #12222 · w3c/csswg-drafts · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

[css-flexbox-1] Clamp "hypothetical main size" to be non-negative? #12222

New issue
New issue

Description

As @bfgeek points out in #3070 (comment), the Flexbox spec uses the "outer size" of flex items to calculate line-breaking, but negative margins can cause this size to become negative, and nothing prevents that.

This means flex-line length is not monotonically non-decreasing; a line can be full (zero free space), then take an item with a negative outer size, and now it's no longer full and can accept more positive-sized items.

This was just an oversight on our part; negative-size boxes are very easy to forget to handle. I don't believe there's any use-cases for allowing this. Unless there's evidence of compat impact, can we add a clamping step to the line-breaking algorithm that forces a minimum size of zero?

(Note: this also happens in inline contexts, and it's pretty likely people are depending on that, accidentally or not. I'm not proposing to change that. Flexbox is analogous to an inline formatting context in many ways, but different and generally simpler in many others.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Wednesday morning

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    • Open in GitHub Copilot app

    Footer

    © 2026 GitHub, Inc.