W3C home > Mailing lists > Public > www-style@w3.org > July 2012

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

From: fantasai <fantasai.lists@inkedblade.net>
Date: Tue, 24 Jul 2012 23:53:40 -0700
Message-ID: <500F97F4.9040908@inkedblade.net>
To: Morten Stenshorne <mstensho@opera.com>
CC: John Hax <johnhax@gmail.com>, www-style@w3.org
On 07/24/2012 12:17 AM, Morten Stenshorne wrote:
> fantasai<fantasai.lists@inkedblade.net>  writes:
>> On 07/11/2012 03:34 AM, John Hax wrote:
>>> Absolutely positioned flex item should not have side effect on space distribution. Since space-* is about distribute spaces
>>> evenly,
>>>     A--B--C
>>> with B absolutely positioned, should be rendered as
>>>     A--C
>>> , where B is positioned at the middle of A and C if all 'top'/'bottom'/'right'/'left' are 'auto'。
>> I've summarized the state of the thread at
>>    http://wiki.csswg.org/topics/flex-abspos-placeholders
>> It would help if people gave solid arguments in favor of or against
>> one or the other of the proposals, preferably with understandable
>> use cases. :)
>> So far we've had Kang-hao and Brad Kemper weigh in on
>>    B>  A>  C
>>  From implementer's perspective, I suspect it would be more like
>>    C>  B>  A
> That's about right. :) What I read in the spec about abspos, back when I
> did the initial flexbox implementation, looked sane. That was C.
> This is a corner case (well, that's what I'm thinking anyway, so I
> cannot provide any use cases), so keeping it easy to spec and implement
> would be nice. C is similar to how abspos behaves inside of table,
> table-row-group and table-row (anonymous table structural boxes are
> inserted).

I'm not sure how much explicitly absolute-positioning an element that's
inside a flex container is a corner case. In which case, authors would
expect it not to impact layout within the flex container.

Afaict from this thread, however, using an accurate static position for
the flex item is a corner case. Nobody's give a reason to want to use
it, and I can't think of a case where the static-positioned abspos isn't
more logically placed inside one of the (real) flex items.

(My guess is, absolute positioning a table cell is definitely a corner
case; but we expect flex layout to be used for a lot more different/
crazy things than table layout, and it's conceivable that some of the
contents of these flex containers will wind up being absolutely
positioned elsewhere.)

> Allowing abspos boxes to live inside of a non-container sounds
> unpleasant (A / B), not only on the implementation side, but it also
> requires you to spec a lot of things. Cross position? Is it stretched?
> Flexed? Order?
> It looks like B attempts to give the element "the position an element
> would have had in the normal flow" [1]. But then I think it should
> rather say that the static position is identical to that of the next
> flex item (or, if there is no next, then at main-end? Unless there's no
> preceding flex item, in which case we could pick main-start?). And then
> some justify-content stuff. That was the main axis position. What about
> cross axis position? Honor align-items/align-self (obviously in a way
> that doesn't affect the cross size of the flexbox or its lines)?
> My preferences:
> C>  world-wide coffee ban>  B ~ A
> A is simpler than B, but behavior A almost sounds like a bug report. :)

Where does your proposal (D) fit in this list? :)

Also, what about a modified (C) where the justification space between a
preceding flex item and a placeholder item is suppressed? I think that
would satisfy all concerns, really.

Received on Wednesday, 25 July 2012 06:54:20 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:01 UTC