Skip to content

feat: support display: block with anonymous inline rows - #142

Open
dreyfus92 wants to merge 1 commit into
feat/ua-stylesheetfrom
feat/display-block
Open

dreyfus92 wants to merge 1 commit into
feat/ua-stylesheetfrom
feat/display-block

Conversation

@dreyfus92

Copy link
Copy Markdown
Member

What does this PR do?

second step for #133. before giving div and p browser-like defaults we need display: block. a flex column alone would stack blocks fine but split hello <b>world</b> onto two lines, since each text run and inline element is its own text op.

a block with only inline children lays out as a row, same as today. a block with any block child becomes a column, and each run of inline content between the blocks goes in an anonymous row, like css anonymous boxes. anonymous row ids come from the parent id plus their position, so they're stable across frames. flex-direction and gap don't apply to blocks.

two things left out on purpose: whitespace-only text between blocks still renders as its own row (browsers collapse it, but we keep text verbatim everywhere else), and blocks size to their content instead of stretching to the full width.

also selects the upstream display: block parsing subtest, which passes now.

Part of #133

Type of change

  • Bug fix
  • Feature
  • Refactor (no behavior change)
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • All tests pass (pnpm test)
  • Files are formatted (pnpm format)
  • I have added/updated tests for my changes (if applicable)
  • I have added a changeset

AI-generated code disclosure

  • This PR includes AI-generated code

@dreyfus92
dreyfus92 added this pull request to stack #144 December 1, 2026 23:09
@pkg-pr-new

pkg-pr-new Bot commented Dec 1, 2026

Copy link
Copy Markdown

commit: d2b9536

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant