Re: [css-align][css-grid] which position to use for aligning a baseline-aligned subtree of grid items?

On 05/14/2016 08:16 AM, Mats Palmgren wrote:
> I'm implementing baseline alignment for grid layout in Gecko.
> I have a couple of spec questions:
>
> https://drafts.csswg.org/css-align-3/#align-by-baseline
> "Position this aligned subtree
> within the alignment container according to the rules of the box
> alignment properties in effect."
>
> It's rather vague what "alignment properties in effect" you're
> referring to here.  When aligning grid items the alignment
> container is a track, which doesn't have any properties per se.

I think what this is referring to is the fallback alignment
https://drafts.csswg.org/css-align-3/#baseline
  # If the alignment subject’s position is not fully determined
  # by baseline alignment, the content is start-aligned insofar
  # as possible while preserving the baseline alignment. (Content
  # that has no first baselines is thus start-aligned.

> Should I use the grid container's [align|justify]-content for
> aligning the subtree?
> If so, since the spec text above calls for a _position_ to align
> the subtree to, what should I use when the value is 'stretch',
> <baseline-position> or <content-distribution> ?

No

> The spec also needs to have a description of how aligning
> a subtree works exactly, especially when overflow is involved.

You assume everything is scrolled to its origin, i.e. no
user or JS scroll actions have been performed.

> (I suggest that you define the alignment edges of the subtree
> as the union of alignment edges for the individual boxes and
> that this union should be aligned as an alignment subject
> using the position defined above.)

Hmm, yes, we didn't give an <overflow-position> for this case.
Probably it's better to default to safe-alignment. Certainly
the 'baseline' value, which is the established one, is safe
because it falls back to start alignment.

> In general, all the spec sections on baseline alignment would
> benefit from illustrations to make your intent clearer.

Yeah... Agreed on that point. :(

~fantasai

Received on Tuesday, 17 May 2016 22:46:33 UTC