Re: [css3-flexbox] absolutely positioned flex item should not have side effect on space distribution

On 07/25/2012 02:20 PM, Tab Atkins Jr. wrote:
> On Wed, Jul 25, 2012 at 2:04 PM, fantasai<fantasai.lists@inkedblade.net>  wrote:
>> Ok, so the WG resolved rather conclusively that placeholders should not
>> have a side-effect on space distribution. That eliminates proposal C.
>>
>> The resolution on what the static position should be was "it should be
>> determined like we do in normal block&inline flow", and now we have to
>> make that principle more precise.
>>
>> Here are the rules for static position in CSS2.1:
>>    http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width
>>    http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height
>>
>> They refer to the position of a "hypothetical box", and then which
>> corner of the box is used depends on 'direction' (and, in CSS3,
>> 'writing-mode'). The position of that box is, roughly, the position
>> it would have it were not positioned. Both 'clear' and 'float' are
>> also set to their initial values for this exercise.
>>
>> Here's a proposal:
>>
>>    # The hypothetical box used to calculate the static position [CSS21]
>>    # of an absolutely-positioned flex item corresponds to that of an
>>    # anonymous empty flex item whose main-axis position coincides with
>>    # the main-start edge of the subsequent real flex item on the flex line
>>    # and, being hypothetical, has no effect on flex layout.
>>    # If there is no subsequent real flex item, the hypothetical box's
>>    # main-axis position is that of a hypothetical last item on the flex
>>    # line, after any packing spaces that were introduced around any
>>    # previous real items due to ‘content-justify: space-around’.
>>
>> In the general case, this places the item where it would have been
>> if it were not positioned, as concretely determined by the flex item
>> after it.
>
> I'm opposed to this language.  It seems self-contradictory, since it
> claims that the hypothetical box doesn't interact with layout, but
> appears to rely on performing at least some steps of layout to
> determine the size of the box.

It doesn't say it doesn't interact with layout, it says it has no effect
*on* flex layout, i.e it's read-only with respect to the layout of other
objects. If you want better wording, then we can change that, but I don't
think the statement is untrue.

> Instead, just make the box 0x0, and position it at the inner
> cross-start edge of the flexbox and the outer main-end edge of the
> preceding item (or the inner main-start edge of the flexbox, if it has
> no preceding siblings).  This just relies on us running step 0 of the
> layout algorithm (reordering) and then we completely ignore them for
> the rest of the algo.

I don't think that handles bidi/vertical text correctly, in particular
because cross-start/main-start != start/head. It also means that the
cross-axis position depends on the size of the next item, which I don't
think is wanted or a good idea. Basically you're asking the placeholder
to get special more treatment than it is already. Right now the only
special treatment is that justification spaces are suppressed.

~fantasai

Received on Wednesday, 25 July 2012 23:16:42 UTC