[css-sizing][css-grid] Doubt about definite/indefinite size

Hi,

we're trying to implement properly in Blink the support for percentage
tracks when the size of the grid container is indefinite [1]:
"If the inline or block size of the grid container is indefinite,
<percentage> values relative to that size are treated as auto."

However, we've had some discussions about when a size is or not indefinite.

The particular case is an absolutely positioned grid container with
"auto" height, but "non-auto" top and bottom properties. E.g.
<div style="position: relative; height: 100px;">
  <div style="display: grid; position: absolute; top: 0; bottom: 0;">
  </div>
</div>

IMHO, the height of the grid container should be definite in this case,
as we don't have to measure the content to determine it. Is this right?

Talking about grids, if it's definite and we've grid-template-rows: 40%
60%. 1st row should be 40px and 2nd row 60px. Otherwise, the rows would
become as "auto" rows (adapting the size to their contents).


As a side note, I'm not sure if the wording for "definite" in the sizing
spec is or not completely right [2]:
"A size that can be determined without measuring content; that is, a
<length>, a size of the initial containing block, or a <percentage> that
is resolved against a definite size."

My question is that from the spec text it seems be limited to:
1) <length>
2) size of the initial containing block
3) <percentage>

However, from a previous thread [3] it seems clear that "width: auto;"
can be definite (if the container has a definite size). E.g.
<div style="width: 200px;">
  <div sltyle="width: auto;">Inner div</div>
</div>

The width of the "Inner div" is definite, but it doesn't seem to comply
with any of 1), 2) and/or 3) options listed above.

Would it be nice to add some clarification to the spec?


Thanks,
  Rego


[1]
https://drafts.csswg.org/css-grid/#valdef-grid-template-columns-percentage
[2] https://drafts.csswg.org/css-sizing/#definite
[3] https://lists.w3.org/Archives/Public/www-style/2014Oct/0315.html

Received on Tuesday, 6 October 2015 11:14:06 UTC