Re: [css-regions][css-flexbox] Interaction between flexboxes and regions

On 6/26/13 10:23 AM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:

>On Wed, Jun 26, 2013 at 1:56 AM, Catalin Badea <badea@adobe.com> wrote:
>> On 6/18/13 1:33 AM, "Alan Stearns" <stearns@adobe.com> wrote:
>>>Thanks for bringing this up. My first thought is that the regions
>>>processing model should merely be an input to the flex layout algorithm.
>>>So when flex asks for a region height, we run through the entire
>>>processing model to get an answer, without reference to the flex layout
>>>algorithm.
>>
>> I believe this might require a multi-step layout if more complex
>> situations are to be handled. Consider the following case:
>> <flexbox>
>>         <region_1 height=auto></region_1>
>> </flexbox>
>> <flexbox>
>>         <region_2 height=auto></region_2>
>> </flexbox>
>>
>> The layout for the second flexbox would require the height for region_2
>> to be computed which can only be known _after_ the content has been
>>flowed
>> in region_1 and the first flexbox has flexed its size.
>
>No, this'll be the same as the simpler case before.  Both regions will
>be laid out first as if they had no content in them, then, after
>flexing/stretching/etc is finished, they'll be filled with whatever
>content fits.
>
>~TJ

Well, I agree this is the same as the simpler case before. But I have a
different result in mind. As I said before, the result of the regions
processing model should be an input to the flex layout algorithm. You're
not using the full result of the processing model here.

My result is that the first flexbox looks to size itself, asks region_1
for its size, and the processing model either says that the height of
region_1 is either (A) the entire height of the named flow or (B) the
height of the content up to the first region break. Then the flexbox sizes
itself and this might cause region_1 to grow. This does not change the
named flow fragment to change in region_1 in either A or B.

Then the second flexbox looks to size itself, and asks region_2 for its
size. This is either (A) 0, because all of the named flow fit in region_1
or (B) the next fragment of the named flow (all or up to the second
break). The second flexbox uses the height determined by the first run of
the region processing model, because nothing has changed.

I think there *are* more complicated scenarios, though. I'll be posting
more later today.

Thanks,

Alan

Received on Wednesday, 26 June 2013 17:32:32 UTC