Skip to content

TXT-W2 (v2): the font shorthand and font-synthesis, restacked onto the text stack - #107

Open
thejackshelton wants to merge 186 commits into
review/txt-w1-v2from
txt-w2-v2
Open

thejackshelton wants to merge 186 commits into
review/txt-w1-v2from
txt-w2-v2

Conversation

@thejackshelton

Copy link
Copy Markdown
Contributor

Stacked, lands as the text-stack train after train 3. This branch is a restack onto INL1a (#88 B1, #89 B2, #90 C1, #91 C2), made by intent: C2 plus this branch's own change. Its base is review/txt-w1-v2, pushed at txt-w1-v2's head 53699e2, so the diff is this branch's alone. The text stack lands as one train after train 3; master is merged in during the train's catch-up. Host-only: no device run yet (pending-device).

What changed

  • TXT-W2 (T147J), restacked from txt-w2 (657673bb2): the font shorthand, font-synthesis and its longhands, font: inherit.
  • Conflict: the css-escapes twin count.
  • math.ts: the font shorthand takes a calculation of any of its parts' kinds: a number, a length-percentage or an angle. Master's check gave it <length-percentage>, so font: calc(600) 10px Ahem would be dropped where Chrome accepts it.
  • ua/uncaptured.ts holds TEXT_FONT_LONGHANDS and UNCAPTURED_LONGHANDS (datasets.ts re-exports them), and capture-ua-defaults.ts captures every longhand except those. Under pnpm regen, the UA tables had gained the font-synthesis rows that the dataset says no table holds.
  • Regenerated outputs:
    • Every capture gains the three font-synthesis keys.
    • The font-shorthand cases gain their outputs.
    • WPT expectations: font shorthands now reach their next refusal.

Tests and pins changed, with reasons

  • math-validity.test.ts:
    • Pins the font grammar.
    • Leaves font out of the webref syntax walk, which cannot see its parts.
  • ua.test.ts: a new check that no captured table holds an uncaptured longhand. It fails without the fix.
  • font-shorthand.test.ts:
    • TXT-W1 is now txt-w1-v2 53699e2, whose captures the group must leave unchanged except for the font-synthesis keys.
    • The cases before the group are 514 (they were 502).
  • text-weight.test.ts: the group slice starts at 502.
  • paint-seams.test.ts: LONGHANDS 71 -> 74.
  • css-escapes.test.ts: TXT-W2 adds 151 twins on this base, not 153 (seed-dependent; every twin is still judged against Chrome).

What passed (host-side, this head)

  • /tmp/heavy-lease.sh pnpm regen reaches a fixed point; its outputs are in their own commit, whose message names the command.
  • pnpm typecheck passes.
  • pnpm test: everything passes except the 12 device-record tests that need a fresh device run (lanes, lanes-records, lanes-concurrent, device-failures, p6a-promotion): device step pending. Load timeouts in the full run: inline, native-compare, native-encoders, native-host, p6a-raster, pixel-reference, state-cases, text-latin and values timed out at 120 s under load (load 20–45). All pass on rerun; native-encoders, text-latin and values passed only when run one at a time.

🤖 Generated with Claude Code

…xt px is proven in, and in the border shorthands

css/values.ts: a math function in border, border-<side>, border-block(-start/-end) and border-inline(-start/-end) is the <line-width>, typed and refused as the border-*-width longhands are (css-backgrounds-3 §3.1, css-logical-1 §6.3); shorthands/border.ts and logical.ts assign it to the width.

Fixtures (values group, ltr and rtl): values-calc-contexts-block, -flex, -positioned, -display-none, -root, -root-min-max put each of calc(), min(), max() and clamp() in every box property in the block, flex-row/column, relative, absolute (cb-ltr and cb-rtl), display-none and root contexts, and gaps in every flex line mode and on a non-flex container, plus px, rem and % insets, flex-basis and gaps on a static block; values-calc-border-shorthand; values-calc-length-max, the CSS_LENGTH_MAX golden (T118J): Chrome collapses float(33554429) with -33554430 to -2 device px at every DPR. values-reject-order-fraction pins the order refusal.

Retargets: values-reject-border-shorthand moves from calc(1px + 0.5vw), now accepted, to calc(1px * 2px / 1px) solid #000, still refused (typed arithmetic), refused on border-left-width. values.test.ts blinkNumber writes printf %g (3.35544e+07), which the new computed values need.
…ture, then pnpm run profile:rows and pnpm run parity:capture three times to the fixed point, then pnpm run profile:rows; pnpm run parity:dpr-capture; pnpm run layout:vectors; pnpm run layout:dpr-vectors; pnpm run layout:break-vectors; pnpm run parity:break-capture; pnpm run parity:pixel-capture; pnpm run native:gen; node --conditions=dragon-internal examples/music-player/tools/check.ts (pnpm run north-star:check lacks the condition, T124); pnpm run parity:glyph-b3 -- --write-bottom-pins; node --conditions=dragon-internal packages/parity/src/cli/media-sweep.ts (then --check: 18/18, 286 samples); pnpm run wpt:run -- --target web and pnpm run wpt:update-expectations -- --target web (no change); pnpm run tw:sweep. Profiles: 1922 rows added on each target (web and ios exact, android unsupported), none removed or changed. Tailwind 4.3.3: web and ios 2214 -> 4121 supported, none the other way, 0 mismatch
…nes -- --run-host) for the CALC-2 cases; device lanes not run (device step pending, landing-queue rule)
…h its own height treated as auto (T128)

css-flexbox-1 §4.5 content size suggestion; ported from Blink third_party/blink/renderer/core/layout/flex/flex_layout_algorithm.cc at 145.0.7632.6 (BSD, The Chromium Authors; sha256 b0ea68654c62d2ca1d73d801ffca395901aa37e51569281266fc9ef87a9e892c) lines 914-923 and 1117-1120 (LayoutResult::IntrinsicBlockSize). A percentage height child of such an item is refused as percent-height-flex, since Blink resolves it against the item's set height.
…ontainer shorter than its items, px and calc() heights, empty and non-empty content, ltr and rtl; Chrome captures from pnpm run parity:capture and pnpm run parity:dpr-capture
…ize (flex_layout_algorithm.cc lines 1078-1084 at 145.0.7632.6): an item that cannot shrink takes its specified size without measuring its content, which gives the same used size and avoids 4 percent-height-flex refusals
…enerated), rt-hit.ts (Chrome 145 hit test with the T063J inline rule), the hit table, hit capture and report, the states fixture group
…eld-r1: faults.ts keeps both field sets; lanes.ts takes master's SUITE_LINE; grammar.generated.ts regenerated (pnpm run grammar:gen); out/lanes.json taken from master and regenerated later
…ure values-calc-flex-column-auto-min): pnpm run grammar:gen; pnpm run parity:capture and pnpm run profile:rows twice (fixed point); pnpm run parity:dpr-capture; pnpm run layout:vectors; pnpm run layout:dpr-vectors; pnpm run layout:break-vectors; pnpm run parity:break-capture; pnpm run parity:pixel-capture; pnpm run native:gen; node --conditions=dragon-internal examples/music-player/tools/check.ts; pnpm run tw:sweep; pnpm run wpt:run -- --target web; pnpm run wpt:update-expectations -- --target web; pnpm run parity:glyph-b3 -- --write-bottom-pins; node --conditions=dragon-internal packages/parity/src/cli/media-sweep.ts (then --check); pnpm run parity:lanes -- --run-host. Every existing vector and capture is byte-identical; emitted CSS changes only in the compilation-digest header; the new fixture adds its vectors, captures, pixel and break records; corpus.json and corpus-dpr.json carry the new engine digests
…unk); hit-capture identity manifest writer and hit-capture-identity.test.ts
…efused loudly by the hit table, the line ink gate from Skia's run-local glyph bounds, layers in order-modified paint order, layer clips; tap steps on the host runtime; rt-hit, pointer-events, hit report and identity tests; hit-pointer-events covers an absolute pointer-events: none track (the north-star context)
… run parity:hit-capture -- --identity-base 9b60a9e, then grammar:gen, parity:capture, profile:rows, parity:capture, profile:rows, parity:dpr-capture, layout:vectors, layout:dpr-vectors, layout:break-vectors, parity:break-capture, parity:pixel-capture, native:gen, node --conditions=dragon-internal examples/music-player/tools/check.ts, tw:sweep, parity:glyph-b3 -- --write-bottom-pins, node --conditions=dragon-internal packages/parity/src/cli/media-sweep.ts, parity:hit-capture twice; ua:capture earlier changed nothing more). Every capture and emitted file of 9b60a9e differs only by the pointer-events key (hit-capture-identity.test.ts); profiles gain only the pointer-events rows; expected-media changes only valuesCompared (one more longhand per element); RtHit.swift and RtHit.kt are new translated roots
…ed grid, pinned by the grid's sha256 (hit-capture/2): 15 MB to 2 MB
…y:hit-capture, run twice: the second run changes nothing): 468 cases, 703666 points
…rder, and px lengths clamped to the CSS length range

Chrome places an rtl in-flow block child at line-left = ((Pb + border-padding) + additional) + margin-left with
additional = ((available - inline size) - InlineSum()), so a margin-left near the CSS length minimum saturates and
lands the box at x = 1.984375 px where CSS2 (and the engine) ignored it (block_layout_algorithm.cc 2799-2804,
3283-3304 at 145.0.7632.6, BSD). The engine now threads the container's BFC line offset and follows Blink's order for
in-flow children (ComputeChildData), new formatting contexts (LayoutNewFormattingContext 2054-2169, no floats),
ResolveInlineAutoMargins (length_utils.cc 1555-1574), the stretch size (46-65) and SlowToPhysical. px lengths are
clamped after zoom like calc() results already were (measured: width 1e9px is 33554428 px at DPR 1 and 2).
Without saturation the result equals the old closed form (pinned by a 2000-case test).
New fixture values-length-saturation.
…it.ts (translated, the same function on host and device); P1 corpus hit suite (one line per layout vector at DPR 1, 2, 3 and 2.625: rt-hit harness op, corpus.ts suite hunk, targets.ts declares p1/hit from the vector counts); parity:hit-capture -- --vectors writes the hit facts
…ors, then pnpm run native:gen): RtHit.swift and RtHit.kt gain hitTableOf, hitGrid and hitRuns; the harnesses gain the rt-hit operation; corpus.json declares hit 1872; native:swift and native:kotlin give hit 1872/1872 and every other suite unchanged
… inline placement): pnpm run parity:capture, profile:rows, parity:capture, profile:rows (fixed point); pnpm run parity:dpr-capture; pnpm run layout:vectors; pnpm run layout:dpr-vectors; pnpm run layout:break-vectors; pnpm run parity:break-capture; pnpm run parity:pixel-capture; pnpm run native:gen; node --conditions=dragon-internal examples/music-player/tools/check.ts (no change); node --conditions=dragon-internal packages/parity/src/cli/media-sweep.ts (then --check: 18/18, 286 samples; no change); pnpm run parity:glyph-b3 -- --write-bottom-pins (no change); pnpm run wpt:run -- --target web and wpt:update-expectations -- --target web (no change); pnpm run tw:sweep (no change).

No existing vector, capture or expectation moves: every changed tracked file is a new fixture's files, an emitted-CSS compilation header (bodies identical), 88 profile rows that gain values-length-saturation proof cases (no status changes), the generated Swift and Kotlin engines, the pixel manifest, and the corpus-dpr lock (+2 vectors-m2, +6 vectors-dpr/engine-dpr/snap-values lines; on identical corpus lines the old engine differs only on the 16 lines built from values-length-saturation-rtl (1 vectors-m2, 3 vectors-dpr, 4 engine-dpr, 8 engine-calc); corpus.json (the milestone-1 corpus with its 20000 random trees) is unchanged).
…nes --run-host) for the values-length-saturation cases; device lanes not run (device step pending, landing-queue rule)
…ve-swift and native-kotlin: hit 1872/1872 appended; intent kept: exact suite sizes, full passes); device-vectors pins p1/hit at 1872 and fails a short run; the identity test checks every manifest hash's shape
…parity:lanes --run-host) on the SELD-R1b head after merging origin/master: layout-vectors-host passes on ios and android with p1/hit 1872/1872 and p1/rt 54588/54588; device lanes not run until the device step
… keeps the engine's Ctx and Piece names (the native support code reads Ctx)
… run native:gen): the engine's Ctx and Piece keep their names; only RtHit and the harnesses change
…once, hitAt answers a point (hitTest is the two); hitRuns and the host compare prepare once per case. The Swift hit suite drops from 65 s to 19 s, so it no longer reaches the 180 s suite timeout when both host lanes run at once
…en); native:swift and native:kotlin keep hit 1872/1872
…t): seams and grid registry order gain pointer-events after grid (and INHERITED gains it); values stays the group before states; rt stays the P1 suite before hit; css-escapes twin count 13778 -> 13799 and the glyph-clearance counts per DPR grow with the eight hit-* cases. targets.ts derives the hit suite's DPR directories from DPRS (no DPR literal). The visiblePainted reject expects Dragon's lowercased message
…to seld-r1: lanes.ts takes master's SUITE_CAUSE; native-swift and native-kotlin pins take master's cause check with rt and hit appended; generated files taken from seld-r1a and regenerated in the next commit
…in: grammar:gen, ua:capture, parity:capture and profile:rows twice, parity:dpr-capture, layout:vectors, layout:dpr-vectors, layout:break-vectors, parity:break-capture, parity:pixel-capture, parity:hit-capture --vectors, native:gen, music-player check.ts, tw:sweep, parity:glyph-b3 --write-bottom-pins, media-sweep.ts, parity:hit-capture, wpt:run and wpt:update-expectations --target web, parity:lanes --run-host) and parity:hit-capture --identity-base 77c641e; north-star errors per target equal master's (android equals ios) and pointer-events has no diagnostic
…'s break faults once (the merge had them twice, so every corpus line's 41 fault keys failed the harness's 45 and the corpus suites were all harness errors); hit-capture-identity.test.ts allows files beyond its base only for fixtures the base lacks (SELD-R1b's, and INL1a's inline fixtures merged after it), and still fails a file added to a base fixture
…nline-tags-faces is refused on ios and android until phase R, ready on web, and the engine lane lays it out; the original no-error compile holds under phase C's lowering (nativeRealFaces); the tags-change-the-faces check reads the engine projection, the faces the engine is given
…h no error under phase C's native lowering, off by default until TXT1a-2 phase R; text-weight.test.ts: the cases before the text-weight group are 533 (520 on the merged C2, TXT1a-2's 11 and T133's 2)
…rts at 533 and font-shorthand.test.ts's cases before its group are 545 (the merged C2's 520, TXT1a-2's 11, T133's 2 and TXT-W1's 12)
…heavy-lease.sh pnpm regen (fixed point after 2 passes). The generated Swift and Kotlin harnesses list INL1a's break faults once, and lanes.json host lanes pass again
# Conflicts:
#	packages/translate/harness/harness.ts
…-lanes-v2 merged forward): /tmp/heavy-lease.sh pnpm regen (fixed point after 3 passes). The translated engines and harnesses (shaping and order faults), corpus digests and lanes.json host lanes
…t resolves to

fontParts took any math function as the font-size, so font: calc(600) 10px x (valid since 54aa958 widened the
font math grammar) expanded to font-size: calc(600) and font-family: 10px x and was called invalid CSS, which
Chrome parses. A number calculation is now the weight and an angle calculation after oblique the oblique angle
(refused as a calculation, as font-style: oblique calc(20deg) is). A value whose last token is taken as the size
has no family and is invalid, as in Chrome (font: calc(600) x).

Tests: font-shorthand.test.ts (dragon) pins the expansions; the parity Chrome FONT table gains the four values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RmroV2L1CVkES7G3nTm2Mt

Copy link
Copy Markdown
Contributor Author

Correctness review of TXT-W2's own commits. One finding fixed in d1de424: the font shorthand took any math function as the font-size, so font: calc(600) 10px x (valid since 54aa958) was called invalid CSS. A number calculation is now the weight and an angle after oblique is the oblique angle (refused as the longhand refuses it). font: calc(600) x is now invalid, as in Chrome. The parity FONT table gains the four values.

Passed locally: pnpm typecheck, plus dragon font-shorthand, math-validity and font-weight tests (24/24). parity/font-shorthand.test.ts (Chrome) runs after the catch-up merge, because this branch predates scripts/test-shards.ts and ci:test-files can't resolve it.


Generated by Claude Code

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.

2 participants