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-flexbox-1][css-grid-1] Improve container baseline finding algo #7655 #7641 #8341

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

fantasai
Copy link
Collaborator

This pull request covers the issues #7655 #7641 including the following resolutions (see minutes):

  • RESOLVED: When taking the baseline of a row of items, we check a shared first baseline, then a shared last baseline, then the first baseline of the first item. (And vice versa for last baselines.)

  • RESOLVED: Rowspanning cells participate only in first baseline alignment of their first row, and last baseline alignment in the last row.

  • RESOLVED: Table baselines match grid, per details above.

OPEN ISSUES

  • There was some confusion over whether we resolved to take the baseline from the first item or the highest item, see comments. Firefox and WebKit use the first, Chrome NG uses the highest.
  • If we are indeed using the highest, what happens if there's a tie? (Unclear if there are cases where this matters, but maybe someday there will be?) We wrote in to use order-modified document order for Flex and grid placement order for Grid.
@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed [css-align-3][css-flexbox-1][css-grid-1] Improve container baseline finding algo #7655 #7641, and agreed to the following:

  • RESOLVED: first/last baseline takes from the first/last item (rather than taking highest/lowest baseline)
The full IRC log of that discussion <TabAtkins> fantasai: when tab and I were drafting the fixes, we ran into a few quesitons
<TabAtkins> fantasai: wanted to ask WG
<TabAtkins> fantasai: There was some confusiong whether we resolved to take baseline from "first" item or "highest" item - discussion about highest, but resoultion said first.
<TabAtkins> fantasai: Second is, if we take highest, what to do in a tie?
<Rossen_> q?
<TabAtkins> Rossen_: Is there a reason we're not using first? I presume this was originally what the text says
<TabAtkins> Rossen_: Seems reasonable for the "first" keyword
<TabAtkins> fantasai: This is in a grid row or similar, not clear which is "first"
<TabAtkins> fantasai: first and last refers to whether you take from the first or last linebox, or row
<TabAtkins> fantasai: for lineboxes there's a definite baseline
<TabAtkins> fantasai: For rows (flex rows, multicols, grid rows) it's less clear
<TabAtkins> fantasai: For multicol we resolved to take the highest baseline
<TabAtkins> iank_: Yeah for multicol we take the highest/lowest
<TabAtkins> iank_: Mostly bc first/last column might not hae a baseline
<TabAtkins> iank_: TAbles probably have some historicla stuff
<fantasai> https://github.com//issues/7641#issuecomment-1292240713
<TabAtkins> iank_: For flexbox and grid, suspect we want first/last, bc it's more likely to match the adjacent content
<TabAtkins> fantasai: In October you suggested taking the highest line
<TabAtkins> iank_: Yeah not sure I thought it thru at the time
<TabAtkins> iank_: I think it may make a little more sense to do first/last, but can go either way
<TabAtkins> Rossen_: It sounds like everyone but Chrome is doing first/last?
<TabAtkins> Rossen_: Firefox/WK do first, Chrome NG does highest (per issue)
<TabAtkins> iank_: Not sure if that is correct.
<TabAtkins> iank_: I think I'm fine with whatever makes sense to other people
<TabAtkins> Rossen_: So do we have strong use-cases where we *dont'* want the first/last one?
<iank_> https://www.software.hixie.ch/utilities/js/live-dom-viewer/?saved=11394
<TabAtkins> dholbert: I can imagine if the first flex item was an image, second is text... but even there highest isn't necessarily better
<TabAtkins> fantasai: it would take from the text there
<TabAtkins> dholbert: Unless the image was small
<TabAtkins> fantasai: It'd have to be *really* small, smaller than the first line, which seems unusual
<TabAtkins> Rossen_: I can't think of where you'd want to choose other than first or last one
<iank_> https://www.software.hixie.ch/utilities/js/live-dom-viewer/?saved=11395
<TabAtkins> iank_: I think Firefox's bheavior in this test case shows a weird behavior for last baseline
<TabAtkins> dholbert: I think our last-baseline support is just buggy right now
<TabAtkins> iank_: I think everyone currently implements taking first or last item
<TabAtkins> iank_: But happy to change if necessary
<TabAtkins> Rossen_: Okay, let's resolve on first/last, if we get a strong case to do different we can change it
<TabAtkins> Rossen_: For now we have proof of some compat for first/last
<TabAtkins> RESOLVED: first/last baseline takes from the first/last item (rather than taking highest/lowest baseline)
…inding algo w3c#7655 w3c#7641

* RESOLVED: When taking the baseline of a row of items,
  we check a shared first baseline, then a shared last baseline,
  then the first baseline of the first item.
  (And vice versa for last baselines.)

* RESOLVED: Rowspanning cells participate only
  in first baseline alignment of their first row,
  and last baseline alignment in the last row.

* RESOLVED: Table baselines match grid, per details above.
…inding algo w3c#7655 w3c#7641 Part II w3c#8341

RESOLVED: first/last baseline takes from the first/last item (rather than taking highest/lowest baseline)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants