Skip to content

PNT1 2/8: border-radius, parsed as Chrome 145 and drawn natively on iOS and Android - #81

Open
thejackshelton wants to merge 3 commits into
review/pnt1-paint-enginesfrom
pnt1-radius
Open

thejackshelton wants to merge 3 commits into
review/pnt1-paint-enginesfrom
pnt1-radius

Conversation

@thejackshelton

Copy link
Copy Markdown
Contributor

PNT1 part 2 of 8 (T115; notes/T046-paint-spec.md §5.2): border-radius and its four corner longhands. They are parsed and computed as Chrome 145 does, and Dragon draws them on iOS and Android with the translated paint-radius.ts from part 1.

Stacked on part 1. The base is review/pnt1-paint-engines, a copy of part 1's head. CI runs only for bases master and review/**. This PR shows only the radius commits, and the chain lands as a PNT1 train after trains 1–4.

What changed

  • CSS.
    • The radius family (css/properties/radius.ts) and the border-radius shorthand (shorthands/radius.ts).
    • The paint value parser hook (css/paint-parsers.ts, called from stylesheet.ts), with Chrome's parsing checks.
    • Native checks in analysis/paint-values/radius.ts: rounded border styles Dragon does not draw are refused.
  • Lowering and emitting:
    • The radius write, and a rounded border-box path from the translated engine (emit/paint/radius.ts, the roundedPath hook in native-support.ts).
    • The rounded background stage: a rounded box paints its colour itself, through the background module's runtime writer.
    • The rounded border stage, and the rounded overflow clip.
  • Proof against Chrome:
    • Radius sample points (paint-samples/radius.ts), which keep base points off antialiased arcs.
    • The host paint model (parity/test/paint-model.ts), with pnt1-radius.test and pnt1-radius-edges.test.
    • Seven radius fixtures, two of them rejects.
    • The radius-square raster plant.
  • State runtime. A border-radius write is refused by name; there is no state writer for it yet.

Changed tests (reasons)

  • paint-seams, seams, grid and s4b tests: the radius module, longhands and shorthand are registered. The pinned lists and the longhand count gain them.
  • device-run.test and device-lanes.test: the radius-square plant joins SUPPORT_PLANTS, PLANT_CASES and PLANT_RULES. The plant-verdict test uses its rule.
  • state-program.test: border-radius is refused by name rather than dropped.
  • native-backends.test: the background is now written through dragonBackground on both backends, because a rounded box paints its colour itself.
  • p6a-dash-oracle.test: a rounded box is drawn by the rounded border painter, which the border stage tries before T116's side painter. The side-painter oracle therefore skips such a box. pnt1-radius.test compares those borders against Chrome.
  • css-escapes.test: twins 13782 → 13795. The radius longhands and fixtures add 13 escaped twins, and each still reads as Chrome reads it.

What passed

  • pnpm regen: fixed point after 3 passes (outputs in d779905), then 0 steps after the last source commit.
  • pnpm typecheck: clean.
  • pnpm test: 3667 passed, 12 failed, 1 skipped.
  • Generated host sources: the Swift typechecks with swiftc for the iOS simulator, and the Kotlin compiles with kotlinc against android-36.

The 12 failing tests are the device-record checks (lanes.test, lanes-records.test, device-failures.test, p6a-promotion.test, lanes-concurrent.test). They fail only because the committed packages/parity/out/lanes.json is host-only: the device lanes run under the device lease at this branch's turn in the PNT1 train. No device run has been made for this branch.

🤖 Generated with Claude Code

…its four corner longhands, parsed and computed as Chrome 145 does and drawn by Dragon on iOS and Android. The radius family and border-radius shorthand (css/properties/radius.ts, shorthands/radius.ts, the paint value parser hook), the native checks (analysis/paint-values/radius.ts), the radius lowering and emitter (a rounded border-box path from the translated paint-radius.ts, the rounded background and border stages, the rounded overflow clip), the radius sample points and host paint model with the pnt1-radius proofs against Chrome, the radius fixtures, and the radius-square raster plant. Split from pnt1-shadow-v2 53ca9f7db2
…ixed point after 3 passes): grammar and UA tables, profiles, captures, DPR, break, font, media and pixel captures and vectors with the radius longhands and fixtures, emitted CSS, tw sweep, the north-star check, corpus-dpr.json and a host-only lanes.json
… master's 13782; the shadow branch adds its own), each still read as Chrome reads it

This branch has not been deployed

No deployments
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