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

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.

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).


> 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.
>



> (FWIW, Grid doesn't have keywords for 1 and -1. It might be a good
> idea to align.)
>
> ~TJ
>
>


-- 
Johannes Wilm
Fidus Writer
http://www.fiduswriter.org

Received on Saturday, 23 January 2016 16:26:41 UTC