- From: Tab Atkins Jr. <jackalmage@gmail.com>
- Date: Thu, 3 Jun 2010 11:11:40 -0700
- To: David Hyatt <hyatt@apple.com>
- Cc: Alex Mogilevsky <alexmog@microsoft.com>, www-style list <www-style@w3.org>
On Tue, Jun 1, 2010 at 2:30 PM, David Hyatt <hyatt@apple.com> wrote: > > On Jun 1, 2010, at 4:16 PM, David Hyatt wrote: > >> >> I think we could just support vertical-align in horizontal boxes as a means of getting baseline alignment. There would be many details to work out though. I think you could probably say that any value that doesn't involve text alignment (baseline, text-top, text-bottom) would result in alignment using margin boxes (so vertical flex would be applied first). If text-dependent vertical align values are used, stuff could still flex... you'd just move the box's position such that the baselines align (causing the child box to possibly stick out of its container). >> >> > > I should emphasize that box-align comes into its own in 2-dimensions, because you can specify it on a row or a column. For example, although you can specify vertical-align for table rows, there is no corresponding capability for table columns. Sure, you can say "Just set alignment on the cells dummy", but then the 2-dimensional style inheritance problem rears its ugly head; basic capabilities like right-aligning the contents of all the cells in a column actually aren't possible today in Gecko or WebKit. > > However with box-align, once you extend into two dimensions, think of it like "vertical-align" but axis independent. It can apply to the rows of a XUL grid, but it can also be applied to the columns of a XUL grid. I won't get into much more detail than that, but suffice it to say that both the row and the column are able to control the placement of content within the cell at the intersection of that row and column. > > This is what you lose if you dump box-align. Once you make it the responsibility of the cell contents to right-align themselves using flex units, you have the exact same problem of not being able to specify at the column-construct level that all cells in that column should be right-aligned. > > I think this absence of 2-dimensional information from the current spec has left it hard to understand some of the design decisions, but control at the container level over what happens to the kids is very powerful once you consider grids instead of just boxes. I'm not sure how XUL grids solve the problem of 2d inheritance either. Sure, you can align columns, but you then lose the ability to align the rows, right? Content can only be a child of a column or a row, not both. I think the correct solution to this is the :nth-col() pseudoclass bandied about a while back. It may be a good idea to make that name a little more general, since a flexgrid can be column-based, and thus actually need the pseudo to address elements in a particular row. Maybe :nth-cell()? ~TJ
Received on Thursday, 3 June 2010 18:12:37 UTC