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: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 25 Jul 2012 14:20:49 -0700
Message-ID: <CAAWBYDDhU+4yzTTHBkLxr1NsCLgy3A1+swupyps4WaxKuU6-bw@mail.gmail.com>
To: fantasai <fantasai.lists@inkedblade.net>
Cc: John Hax <johnhax@gmail.com>, www-style@w3.org, Alex Mogilevsky <alexmog@microsoft.com>
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.

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.

Received on Wednesday, 25 July 2012 21:21:37 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:19 UTC