Skip to content

Step 5b: Layout engine — inline layout and text wrapping #72

@thomasnemer

Description

@thomasnemer

Parent: #24
Prerequisites: Step 5a

Goal

Implement inline formatting context: line box construction, text wrapping, text-align, baseline alignment.

Implementation

  • Line box construction: accumulate inline boxes, break when exceeding container width
  • Text wrapping: break at whitespace boundaries (greedy)
  • white-space: normal (collapse+wrap), nowrap, pre, pre-wrap
  • text-align: left, center, right
  • Inline box splitting across lines
  • Mixed block+inline: anonymous block wrapping

Tests

  • Short text one line, long text wraps, nowrap, text-align center
  • Multiple inline elements on same line
  • ~8 tests

Acceptance Criteria

  • cargo test -p ie-layout passes
  • Clippy clean

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions