Skip to content

Keep the continuation limit's verdict for elements that lay out differently from 2.3.3 #686

Closed

Description

@Tim81

A single top-level element that needs more than 50,000 page continuations is refused (DocumentRenderer, since 2.3.1, #459). The limit guards against a renderer that never advances. Several 2.x fixes make an element lay out differently from 2.3.3 (taller rows, clamped indents, moved list entries, a different word split), so the same document can now need more continuations than it did, and be refused where it saved, or fewer, and save where it was refused.

The 2.x rule is that a document that saved keeps saving and one that was refused stays refused. To keep that rule at the limit for every such fix, one shared internal mechanism:

  • The document marks each layout context it builds with the renderer it is calling. A renderer whose layout differs from 2.3.3 uses its new layout only under such a context, and otherwise lays out the 2.3.3 way.
  • At the first call where the new layout can differ, the renderer reports an upper bound on its continuations. Within the limit, the new layout is used. Above it, the document places the element without drawing, once with each layout, and places the 2.3.3 layout if either reaches the limit. The verdict is kept per start, so every pass reuses it.
  • No public API. A table or list laid out by a caller's own renderer, or under a context the caller builds, lays out as on 2.3.3, which is documented on IRenderer.Layout, LayoutContext.WithArea and the public constructor.

This issue lands the mechanism with no output change on main. The list fixes (#476, #685) and the table fixes (#679) adopt it, as does a fix for the paragraph word split at the limit (separate issue).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions