Re: [css3-regions] auto widths and heights of regions

On 12-26 19:44, fantasai wrote:
>   # 4.2.1. Auto width on regions
>   #
>   # If a region's ‘width’ property is computed to ‘auto’, its resolved value is
>   # computed based on the region's ::before and ::after generated content only.
>   #
>   # 4.2.2. Auto height on regions
>   #
>   # If a region's ‘height’ property is computed to ‘auto’, its resolved value is
>   # computed based on the region's ::before and ::after generated content only.
> 
> Now, I wasn't there when you discussed this with Rossen, but I think this is
> one of the biggest flaws with the Regions proposal as it stands today.
> 
> The inability to auto-size elements to their content restricts Regions to
> fixed-size containers, giving up entirely the flexibility and robustness of
> CSS layout, which by design is able to accommodate varying font sizes, screen
> sizes, and amounts of content. By forbidding intrinsic sizing, even in the
> height, you are restricting the use of Regions to fixed layout designs, which
> are really considered bad practice for the Web and are not something we should
> be designing entire new layout systems around.
> 
> It should definitely be possible for the last region to have auto height. I
> assume an auto-height region would just consume all the content in the flow.
> (Which will effectively force it to be the last region, actually.) Imo it
> should also be possible for an intermediary region to have auto height and a
> max-height and have that work, too.

+1.

Not only intermediary region could have auto height, but also multiple
regions could have it. When you think about it, it opens lots of
interesting and usefull possibilities.

How about similar mechanism like in columns? Regions with auto height
would then eat as much as needed, and will balance heights of this auto
regions (over min-height). This makes height computation slightly
harder, but makes regions extreamally flexible to support various amount
of content!

This way even multi-columns with fixed number of columns and balanced
height of them, can be implemented somehow using regions. This makes
sense, because column in multi-column layout is sort of region,
and in fact we shouldn't have saprate mechanisms for them, only
some syntactic sugar in CSS, to generate multi-column layout
using regions easier to use. (Currently this is impossible not only
because we do not have auto height, but also because regions
needs this empty psedo-elements in HTML...)

It will make implementation slightly more complex (determining correct
heights, could be hard, may even need iterative procedure, if widths
of all regions are different, but approximate solution based is quite simple
to create, and iterating few times for finding optimum should be enough.
Or maybe some sort of dynamic programming would solve this. I do not
know details of multi column balancing to say how it is done, hower
it is simpler there due to the same height and same width of each column.

> If there are technical concerns with auto
> heights, let's solve them;

+1.


Regards,
Witek

-- 
Witold Baryluk

Received on Wednesday, 28 December 2011 04:44:07 UTC