Re: [csswg-drafts] [css-contain-1] maybe 'contain-size' shouldn't apply to display:table-caption?

> That said, it's also not clear to me why this isn't allowed for cells.

Because the effect would be something like setting the table cell's width and height to 0 (if they're not otherwise specified, or to what they're specified, if anything), then layout out the content of the cell without resizing it.

That cannot be done today, as table cells are always enlarged to fit their in flow content, which never overflows, and the `width`/`height` properties act more like `min-width`/`min-height`. Adding support for `contain:size` on table cells would therefore mean that we'd need to change how table layout works, which nobody expressed interest in doing.

Unlike table cells, on table captions you can set a width and height, can cause overflow if you set them too small (or to 0). So if `contain:size` is applied to a table caption with a definite size, you just do the layout with that size, and if it is applied to a table caption without a definite size, you do the layout with the captions's height being 0 and the caption's width being the fill-available width to the table size (where the table's size is not influenced by the intrinsic size of the captions's content, since it's contained away.)

-- 
GitHub Notification of comment by frivoal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2952#issuecomment-408369314 using your GitHub account

Received on Friday, 27 July 2018 09:45:33 UTC