Skip to content

[css-inline-3] inline boxes and line-fit-edge vs text-box-trim/edge #10834

@fantasai

Description

@fantasai

Now that we've split line-fit-edge (inherited) and text-box-edge (non-inherited), there's an interesting question of how these two features interact when applied to inline boxes, particularly if they have conflicting "opinions".

Inline boxes currently have two sizes:

  • the size used to calculate their "fit" within the line box
  • the sized used to draw backgrounds and borders

In the existing line height model, these two are not the same: block-axis margin/padding/borders are ignored completely for sizing, in favor of line-height.

In the newer line-height model, as part of making inline layout more controllable, we want to use the margin box for sizing. That means line-fit-edge has to trim down the content box, not an imaginary other box, otherwise it's confusing (to size by applying margin/padding to one set of edges, but draw by applying it to a different set of edges). Thus by default, we need to apply trimming to inline boxes.

The initial value of text-box-trim is none. Should we:

  1. Make text-box-edge ignored by inline boxes and always trim to the line-fit-edge?
    • This means authors can only ever use line-fit-edge to control the sizing of an inline box; but line-fit-edge inherits and might not be appropriate if they want to change the value on one item in order to draw its border differently.
  2. Make text-box-edge apply to inline boxes regardless of text-box-trim? (Its initial value already defers to line-fit-edge.)?
  3. Make text-box-edge apply to the sides indicated by text-box-trim only, using line-fit-edge otherwise?
  4. Something else?

What would be useful and understandable?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions