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][css-grid] Do grid items that have "no baseline set" participate in baseline alignment? #4675

Closed
MatsPalmgren opened this issue Jan 15, 2020 · 8 comments

Comments

@MatsPalmgren
Copy link

Do grid items that have "no baseline set" participate in baseline alignment?

The css-align spec says about blocks:
"If there is no such line box or child, then the block container has no baseline set."
https://drafts.csswg.org/css-align/#baseline-export

So it's clear that grid items that are empty block containers have "no baseline set".

What is unclear is if we should synthesize a baseline and participate in the baseline alignment, or if such items don't participate in baseline alignment at all and instead use their fallback alignment?

(Filed from discussion in this bug.)

CC @javifernandez

@javifernandez
Copy link
Contributor

I think Chrome is failing in the following tests for this same reason:

In these cases, the problem is how to determine the baseline of a grid container, which has an orthogonal item. As orthogonal item, it doesn't have a natural baseline. My understanding of the spec is that the grid container should use that item, which should synthesized its baseline, to generate the grid container's baseline.

https://drafts.csswg.org/css-grid/#grid-baselines

2- Otherwise, if the grid container has at least one grid item, the grid container’s first (last) baseline set is generated from the alignment baseline of the first (last) grid item in row-major grid order (according to the writing mode of the grid container). If the item has no alignment baseline in the grid’s inline axis, then one is first synthesized from its border edges.

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed [css-align][css-grid] Do grid items that have "no baseline set" participate in baseline alignment?.

The full IRC log of that discussion <dael> Topic: [css-align][css-grid] Do grid items that have "no baseline set" participate in baseline alignment?
<dael> github: https://github.com//issues/4675
<GameMaker> present +
<dael> Rossen_: Mats brought this and lajava added to agenda
<dael> TabAtkins: I'm not ready here, I looked into it and realized it wasn't easy so I haven't done enough to dig in and get the right answer. I'll try and take care of it next week
<fantasai_> I thought we assumed that items can baseline-align if they are orthogonal / have no baseline ?
<fantasai_> https://github.com//issues/721#issuecomment-264272653
<dael> Rossen_: If this encourages progress I'm fine with that.
<dael> fantasai: I saw we had discussions about this and had resolved. There was about how do orthogonal grid items align or not when placed in grid. I understand there's wording to clarify but I thought we discussed. Not sure how this is different
<dael> TabAtkins: I had same feeling but couldn't find wording in spec that defines it well. We didn't write it down
<dael> fantasai: We need to add to spec but we've had WG discussion
<dael> Rossen_: I'm happy to move on. Let's see if we can make progress and close with previous resolutions or bring it back next week

@javifernandez
Copy link
Contributor

@MatsPalmgren isn't your comment here implying that grid items with no baseline should synthesize it, especially when the user specified explicitly via the alignment properties.

@javifernandez
Copy link
Contributor

As a matter of fact, @MatsPalmgren filed a bug precisely to allow orthogonal grid items to participate, with the synthesized baseline, in baseline alignment.

I guess the question that still stands is whether any item with no baseline must follow that approach. The spec is not clear regarding the need of items with no baseline to synthesize it in any case, it just mentions how to do it in case of needing to do so.

Unless mats disagree, I think we can all agree that any item with no baseline should participate in baseline alignment, if any of the CSS Box Alignment properties state so, using the synthesized baseline. This is coherent with what we have decided to do for orthogonal items. If we all agree on this, we may want to add some edits in the spec to be more clear about this.

I thought that the following statement of the CSS Box Alignment spec was enough for determining the participation of any grid item, either it has a natural baseline or not:

https://drafts.csswg.org/css-align/#baseline-align-self

A grid item participates in first/last baseline self-alignment in its startmost/endmost row or column if its align-self or justify-self property (respectively) computes to first baseline/last baseline.

However, Mats seems to disagree and would rather to state clearly that items with no natural baseline also participate.

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed [css-align][css-grid] Do grid items that have "no baseline set" participate in baseline alignment?.

The full IRC log of that discussion <dael> Topic: [css-align][css-grid] Do grid items that have "no baseline set" participate in baseline alignment?
<dael> github: https://github.com//issues/4675
<dael> Rossen_: This was discussed a couple weeks back
<dael> Rossen_: We don't have a resolution yet. Can we make any progress now?
<lajava> q+
<dael> fantasai: I thought we had discussed if such items participate and decided that they do. Happy to re-resolve unless someone thinks different.
<Rossen_> ack lajava
<lajava> oh, sorry
<Rossen_> lajava, are you talking?
<dael> Rossen_: lajava we can't hear you
<lajava> yes, I don't know what happens with my mic
<dael> Rossen_: While lajava looks into audio issue...fantasai I'm happy to move on and remove agenda tag. Re-reading discussion we left it as leaning on previous resolution and making progress. Since additional information I wanted to see if there's need to re-resolve or discuss
<dael> lajava: I wanted to comment for me examples from fantasai are clear. We already resolved for orthogonal flow items synthesize. Only doubt that triggered discussion is he considered empty items were different. It's not clear in the spec that those items participate
<dael> lajava: Only thing to clarify in spec is if empty items participate or not in baseline
<dael> lajava: Only sentence I found in spec is the one I added in my last comment
<fantasai> baselines of empty boxes: https://github.com//issues/439
<dael> lajava: If I understood having alignment properties set to baseline implies any item should participate. Mats prefers something more explicit to be added.
<dael> lajava: That's only thing up for discussion I think
<dael> Rossen_: fantasai linked to a discussion about empty boxes for alignment in grid
<dael> Rossen_: There's a clear resolution in the past. With that resolution linked into the minutes and GH I'm happy to move on
<AmeliaBR> Resolution from 439: Have grid and flexbox keep saying that empty boxes have no baseline and they're synthesized with bottom border edge.
<dael> lajava: I mentioned that to Mats in bugzilla. Point is this only clarifies how to syntesize. He continues to state that they don't participate in baseline
<dael> lajava: I'd prefer Mats to define his point.
<dael> lajava: I'm okay closing this issue and resolve that any item that has align or justify self as baseline participates in baseline alignment
<dael> Rossen_: Reasonable
<dael> Rossen_: Anything else on this?

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed css-align][css-grid] Do grid items that have "no baseline set" participate in baseline alignment?, and agreed to the following:

  • RESOLVED: All boxes can participate in baseline alignment. If they don't have a baseline one is synthesized
The full IRC log of that discussion <dael> Topic: css-align][css-grid] Do grid items that have "no baseline set" participate in baseline alignment?
<dael> github: https://github.com//issues/4675
<dael> fantasai: All boes can participate in baseline alignment. If they don't have a baseline one is syntesized
<dael> Rossen_: Objections?
<dael> RESOLVED: All boxes can participate in baseline alignment. If they don't have a baseline one is synthesized

@fantasai
Copy link
Collaborator

@MatsPalmgren @javifernandez We made some edits to clarify the spec, can you let us know if they look correct?

@javifernandez
Copy link
Contributor

I'm satisfied with the changes.

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

No branches or pull requests

5 participants