Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-multicol] the minimum and preferred width of a multicol is not defined anywhere #420

Closed
FremyCompany opened this issue Aug 22, 2016 · 7 comments
Assignees
Labels
Closed Rejected as Invalid Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-multicol-1 Current Work

Comments

@FremyCompany
Copy link
Contributor

And, of course, that means it isn't interoperable ;-)
So even if it is defined somewhere implementers didn't find it...

https://drafts.csswg.org/css-multicol-1/#pseudo-algorithm

I think Firefox makes sense when you need fit-content:

https://jsfiddle.net/L03rqecj/2/

  • Edge allocates 10 columns, then fill only three of them
  • Firefox allocates as many columns as the container width allows, then fill only three of them
  • Chrome allocates as many columns as the container width allows, then fill only two of them by wrapping the first two lines on the same column, but not the third one (wait, what)?

And it makes sense again when you need min-content:

https://jsfiddle.net/L03rqecj/3/

  • Edge does as it does in the previous case (whaaaat?)
  • Firefox collapses the whole thing to one column (of about 10px size)
  • Chrome does like it did for preferred width (whaaaat?)

I have seen real interop issues due to this while digging some tables bugs.

We should sort this out ;-)

@FremyCompany
Copy link
Contributor Author

Cc @frivoal, and because chrome is buggy also @tabatkins

@frivoal frivoal self-assigned this Sep 5, 2016
@mstensho
Copy link

Regarding Chrome's behavior in the first jsfiddle: This is because Chrome respects orphans and widows, whose initial values are 2. See https://bugs.chromium.org/p/chromium/issues/detail?id=638530

@fantasai
Copy link
Collaborator

Multi-col intrinsic sizes are defined in https://drafts.csswg.org/css-sizing-4/#multicol-intrinsic

@tabatkins
Copy link
Member

Yup, looks like this is well-defined now (and results in Firefox's behavior).

  • min-content size is the larger of its column-width and the largest width of its inline content; in this case, that is 100px.
  • fit-content is just the normal algorithm: max-content size (here 10 * 100px) clamped by min-content size (100px) and available space. The multicol filling algorithm then decides how many columns to put into that area (here floor(screen-width / 100px, 100px), probably 4 or 5)

@astearns astearns removed the Agenda+ label Oct 12, 2016
@frivoal
Copy link
Collaborator

frivoal commented Oct 13, 2016

Alright, since we have a definition everybody seems to be happy about, I'm closing this.

@frivoal
Copy link
Collaborator

frivoal commented Oct 13, 2016

@FremyCompany Based on you being there during the conf call where we decided on this, I'm labeling you as "Commenter Satisfied". Let me know if that is a misunderstanding.

@frivoal frivoal added the Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. label Oct 13, 2016
@FremyCompany
Copy link
Contributor Author

@frivoal No misunderstanding, I'm satisfied with the resolution 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed Rejected as Invalid Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-multicol-1 Current Work
Projects
None yet
Development

No branches or pull requests

6 participants