Re: Positioned Layout proposal

> On 10/20/10 1:38 PM, Shelby Moore wrote:
>> The pagination algorithm tests the containing block for intersection
>> with
>> the page boundary, then it flags the constraint and re-runs the layout
>> (which calls the various constraint algorithms).  This repeats until
>> there
>> are no more intersections.
>
> Uh... in general, you never got to "no more interesections".  So I'm not
> sure what you're talking about here.

I will uncompact what I meant for the generalized algorithm (this is just
off top of my head, I've never looked at browser layout code).

1) Run layout with the page rectangle as global constraint available to
all methods. The methods make local decisions about their position and
extent, e.g. the inline flow algorithm wraps (depending on wrapping style
etc) to the Min( viewport, container ) where container might be 'auto'.
The local decisions may cause their parents to clip.

2) Enumerate top-down hierarchy (i.e. box model) for paginate each
container box (margins excluded), and flag any parents which need to be
constrained.

3) If any were flagged, go back to step #1.

In subsequent calls to step #1, the container will not longer be auto, but
rather constrained so that it does not intersect the clip boundary.

I am skipping the complication of prioritizing no clip in the horizontal
direction, and using that constraint to push content to next page for
paged media.

The point being that none of the above depends on how the container boxes
were positioned and sized.

>
>> You optimize this for incremental updates, by making special case rules
>> about how certain constructs can change layout when changed, e.g.
>> identifying propogation boundaries, but you still need the generalized
>> algorithm above for those cases that your special case optimizer can't
>> handle.
>>
>> Am I far off base?
>
> Dunno.  The one pagination setup in a browser that I'm very familiar
> with works nothing like this; the second one I've sort of looked at
> doesn't seem to either.

I guess there are many ways to skin a cat.

Sounds like an area I will enjoy experimenting and become more expert in.

Received on Wednesday, 20 October 2010 18:34:11 UTC