Re: [css-page-floats] Why does float-defer have just "last"?

On Sat, Jan 23, 2016 at 8:26 AM, Johannes Wilm <johannes@fiduswriter.org> wrote:
> On Fri, Jan 22, 2016 at 10:54 PM, Tab Atkins Jr. <jackalmage@gmail.com>
> wrote:
>> "float-defer" currently takes either an <integer> (indicating it
>> should be put in the Nth relevant fragment) or the keyword "last",
>> indicating the last such fragment.  But the <integer> is allowed to be
>> negative, which counts backwards from the end, so "float-defer: last"
>> is equivalent to "float-defer: -1;".
>
> As I read it, negative and positive float-defer values work somewhat
> differently.
>
> - Positive numbers defer X fragments starting from the one that the float
> anchor is placed in.
>
> - Negative numbers count backwards from the last fragment that is part of
> the fragmentation context.
>
> I actually wonder whether this is a good idea. The negative values seem like
> they would create quite a lot of headache for implementers, and I'm not sure
> how valuable they are for authors. I mainly kept them in in order to
> preserve as much functionality as possible. After our conversation in
> December I wonder if this is one of the things you would want to
> remove/change.
>
> Example: You are layouting a series of fragments (pages/columns) and you
> encounter a float that has float-defer: -5. In order to know what that -5
> refers to, you first need to layout all the remaining content so you see how
> many fragments you have. Once you are done with that, you go to the
> fifth-last fragment and try to place the float there. Chances are that the
> placement of a float means that the content will overflow and create yet
> another fragment (a column or a page). So the float ends up on -6 rather
> than -5, unless you place it a second time if the first placement ended up
> creating new fragments.
>
> And if you want to place a float exactly into the first or second fragment,
> I don't think you currently have a way to easily do that. What you could do
> is to use some other mechanism than a page flaot to place it there and then
> declare it an exclusion so that the content moves around it.

Yeah, negative numbers are problematic.  We should skip them for this
level, at least.

> I can see these options:
>
> A) One option would be to have positive integers count from the start of the
> fragmentation series and not allow negative numbers.
>
> B) Another option would be to have both negative and positive integers count
> from start and end (which may create the above mentioned complications).
>
> C) A third option would be to only have positive integers and count starting
> from the float anchor (as positive integers currently do).

D) Allow both absolute and relative positive integers.  The latter can
be indicated as "next 2" or whatever.

>> I understand having "last" as syntax sugar for -1 (though it's
>> actually *longer* ^_^), but it doesn't make sense to not also have
>> "first" in that case.

If we add a "flow-root" origin (in addition to page/column), then just
being a bottom-float in your flow-root should work the same as "last",
so I don't think "last" is necessary.  (Assuming you can't escape a
flow-root. If you can, then if you're currently nested in a flow-root
tighter than columns, this will give you different results than going
to the end of the last column.)

~TJ and fantasai

Received on Monday, 25 January 2016 19:37:48 UTC