[css-grid] Sizing of grid containers

Hi,

After careful reading of the Grid spec, it’s unclear to me how the used 
width and height of a grid container is determined, especially when they 
compute to 'auto'. (Same for auto margins, btw.)

They are not necessarily the same as the size of "the grid", as shown by 
§9.4 "Aligning the Grid: the justify-content and align-content properties".

(I’ll assume an horizontal writing mode, adapt as needed for vertical.)

'display: grid' is defined to generate a block-level box. This implies 
that §10.3.3 of CSS 2.1 "Block-level, non-replaced elements in normal 
flow" applies to determine the used width, but it’s worth noting 
explicitly in the Grid spec.

It also implies that §10.6.3 of CSS 2.1 "Block-level non-replaced 
elements in normal flow when 'overflow' computes to 'visible'" applies 
too for the used height, but I don’t think that’s the desired behavior. 
We probably want 'height: auto' to resolve to the height of "the grid" 
instead. (Ie. the sum of used breadths for all rows, explicit and implicit.)

'display: inline-grid' is not 'inline-block', so §10.3.9 of CSS 2.1 
"'Inline-block', non-replaced elements in normal flow" does not apply. 
If the intent is for that section to apply to inline grid containers 
too, this needs to be defined.

The used height for 'display: inline-grid' should probably be the same 
as for 'display: grid', but also needs to be defined.

-- 
Simon Sapin

Received on Friday, 7 February 2014 15:27:25 UTC