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-align-3][css-multicol] How is the last-baseline of a multi-col determined? #7639

Open
bfgeek opened this issue Aug 23, 2022 · 6 comments

Comments

@bfgeek
Copy link

bfgeek commented Aug 23, 2022

Is it the last-baseline of the first fragmentainer or the last?

Today in an inline-context the baseline is always synthesized from the block-end border-box edge. (We likely aren't restricted by compat here however).

@bfgeek bfgeek added css-align-3 Current Work css-multicol-1 Current Work labels Aug 23, 2022
@tabatkins
Copy link
Member

tabatkins commented Aug 29, 2022

Four options that seem to maybe make sense here are:

  1. Last baseline of the last column
    • logically makes the most sense, but least likely to be near the bottom of the container
  2. Last baseline of the first column
    • as likely to be relevant as any other filled column, and easiest to talk about
  3. Lowest of the last baselines of all the columns
    • Gets a real baseline, not susceptible to large-box-moved-to-next-column fragmentation quirks.
  4. No last baseline; synthesize
    • simple, current behavior, but doesn't line up text at all despite the author clearly desiring that

Note: A regular block box (that contains text) uses its last baseline. (Defined in 2.1 for inline blocks, at least, which was the only context the question made sense back then.)

We suspect (3) will give the best behavior; in simple cases it and (2) will be more or less identical, but (3) works better in more cases.

/cc @MurakamiShinyu for opinions

@astearns astearns added this to 3:30-4:45 in TPAC Thursday 2022 Sep 11, 2022
@astearns astearns moved this from 3:30-4:45 to 11:45-12:30 in TPAC Thursday 2022 Sep 15, 2022
@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed How is the last-baseline of a multi-col determined?, and agreed to the following:

  • RESOLVED: (and vice-versa for the last baseline)
  • RESOLVED: for multicolumns, use the lowest last baseline of all columns as its last baseline
The full IRC log of that discussion <Rossen_> Topic: How is the last-baseline of a multi-col determined?
<fremy> RESOLVED: (and vice-versa for the last baseline)
<Rossen_> github: https://github.com//issues/7639
<fremy> iank_: for multicolumns elements, we currently take the baseline of the first column
<fremy> iank_: and implementations don't look for a last baseline
<fremy> iank_: maybe we should?
<fremy> iank_: but it's still an option not to, like we do today
<TabAtkins> q+
<fremy> iank_: we can take the last baseline of the first column
<fremy> iank_: or of the last column
<fremy> iank_: or the lowest of all the columns
<fremy> dbaron: exporting the baseline of a multicolumn sounds scary
<fremy> dbaron: especially if you have balancing going on
<dbaron> s/the baseline/the last baseline/
<fremy> iank_: if you use the last column and you balance, it will often work
<fremy> iank_: but without balancing, you can end up somewhere random in the height
<Rossen_> q?
<fremy> fantasai: that seems the worst indeed
<fremy> fantasai: I think the best would be the max
<fremy> TabAtkins: fantasai just said what I was about to say
<fantasai> s/the max/the max, and second best would be the last line of the first column/
<fremy> iank_: the only caveat is that we probably don't want to include spanned items
<fremy> fantasai: why not?
<fremy> fantasai: if sounds like an rare case, but why not?
<fremy> iank_: (nodding)
<fremy> fantasai: I think checking all columns is better
<rachelandrew> +1 to checking all columns
<fremy> fantasai: in case you have a large image that doesn't fit at the bottom of the first column
<fremy> iank_: I'm fine with that
<fremy> iank_: we have some compat constraints for inline-block
<fremy> iank_: but here it's ok
<fremy> fantasai: proposed resolution is to use the lowest last baseline of all columns
<fremy> Rossen_: any objection?
<fremy> RESOLVED: for multicolumns, use the lowest last baseline of all columns as its last baseline
<TabAtkins> ScribeNick:
<TabAtkins> ScribeNick: TabAtkins

@MurakamiShinyu
Copy link
Collaborator

/cc @MurakamiShinyu for opinions

Sorry for not giving my opinion. I had no idea of inline multi-column use cases, but I agree that the worst is "Last baseline of the last column", and the best is "Lowest of the last baselines of all the columns". So I am content with the resolution.

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 6, 2022
See: w3c/csswg-drafts#7639

Effectively we need to propagate the last baseline from the lowest
of all fragments. This does change the baseline of a multi-col within
a inline-block context.

Bug: 885175
Change-Id: I8385f89cbe0bb3cc89fc972546f56ddd9ae391bd
@mstensho
Copy link

mstensho commented Oct 7, 2022

Would this be a good opportunity to also fix first-baseline, so that we're consistent about this?

I agree with the resolution, so that last-baseline becomes the lowest last baseline of all columns. But it's quite different from what we do for first-baseline. Why not also make the first-baseline of a multicol container the same as the highest first-baseline of all columns?

Granted, it's very likely that the first column has a good first-baseline, much more so than expecting the last column to have a good last-baseline (the last column may only be partially filled, for instance), but it's not guaranteed. Also, consistency.

@bfgeek
Copy link
Author

bfgeek commented Oct 7, 2022

@mstensho Split off into new issue.

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 10, 2022
See: w3c/csswg-drafts#7639

Effectively we need to propagate the last baseline from the lowest
of all fragments. This does change the baseline of a multi-col within
a inline-block context.

Bug: 885175
Change-Id: I8385f89cbe0bb3cc89fc972546f56ddd9ae391bd
aarongable pushed a commit to chromium/chromium that referenced this issue Oct 10, 2022
See: w3c/csswg-drafts#7639

Effectively we need to propagate the last baseline from the lowest
of all fragments. This does change the baseline of a multi-col within
a inline-block context.

Bug: 885175
Change-Id: I8385f89cbe0bb3cc89fc972546f56ddd9ae391bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3931189
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1056833}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 10, 2022
See: w3c/csswg-drafts#7639

Effectively we need to propagate the last baseline from the lowest
of all fragments. This does change the baseline of a multi-col within
a inline-block context.

Bug: 885175
Change-Id: I8385f89cbe0bb3cc89fc972546f56ddd9ae391bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3931189
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1056833}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 10, 2022
See: w3c/csswg-drafts#7639

Effectively we need to propagate the last baseline from the lowest
of all fragments. This does change the baseline of a multi-col within
a inline-block context.

Bug: 885175
Change-Id: I8385f89cbe0bb3cc89fc972546f56ddd9ae391bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3931189
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1056833}
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this issue Oct 14, 2022
See: w3c/csswg-drafts#7639

Effectively we need to propagate the last baseline from the lowest
of all fragments. This does change the baseline of a multi-col within
a inline-block context.

Bug: 885175
Change-Id: I8385f89cbe0bb3cc89fc972546f56ddd9ae391bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3931189
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1056833}
NOKEYCHECK=True
GitOrigin-RevId: bc669f613244300d069571e47dc3e89b16871937
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Oct 21, 2022
…ne to lowest of all fragments, a=testonly

Automatic update from web-platform-tests
[last-baseline] Set multicol last-baseline to lowest of all fragments

See: w3c/csswg-drafts#7639

Effectively we need to propagate the last baseline from the lowest
of all fragments. This does change the baseline of a multi-col within
a inline-block context.

Bug: 885175
Change-Id: I8385f89cbe0bb3cc89fc972546f56ddd9ae391bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3931189
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1056833}

--

wpt-commits: 5e9bb795bc7c57a07ee258f362e50c4014108530
wpt-pr: 36316
jamienicol pushed a commit to jamienicol/gecko that referenced this issue Oct 26, 2022
…ne to lowest of all fragments, a=testonly

Automatic update from web-platform-tests
[last-baseline] Set multicol last-baseline to lowest of all fragments

See: w3c/csswg-drafts#7639

Effectively we need to propagate the last baseline from the lowest
of all fragments. This does change the baseline of a multi-col within
a inline-block context.

Bug: 885175
Change-Id: I8385f89cbe0bb3cc89fc972546f56ddd9ae391bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3931189
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1056833}

--

wpt-commits: 5e9bb795bc7c57a07ee258f362e50c4014108530
wpt-pr: 36316
@fantasai
Copy link
Collaborator

This is edited in, and the latest text should soon be appearing here: https://drafts.csswg.org/css-align-3/#baseline-export
Please let us know if anything seems incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

8 participants