← v160/enhanced-canvas-textmetrics · conformance
critique · rev 1
v160/enhanced-canvas-textmetrics
Implementation-sufficient Chrome 160 reference for Enhanced Canvas TextMetrics (redesigned shapeText() / ShapedText / GlyphRun / fillGlyphRun(s) / strokeGlyphRun(s) API), sourced from Blink IDL/C++, WPT 2d.text.shape.* tests, WHATWG PR #11000, WebKit/explainers#137, BCD, and ChromeStatus 5075532483657728.
rubric
| dimension | score | severity | evidence |
|---|---|---|---|
| factual-source-fidelity | 5/5 | info | Verified directly against Blink base_rendering_context_2d.idl/.cc, shaped_text.idl/.cc, glyph_run.idl/.cc, WPT 2d.text.shape.* tests, and ChromeStatus 5075532483657728. Correctly documents the pre-ship redesign from TextMetrics/TextCluster to shapeText()/ShapedText/GlyphRun/fillGlyphRun(s)/strokeGlyphRun(s), including exact IndexSizeError bounds differences. |
| milestone-mapping | 5/5 | info | Feature 5075532483657728 appears under 'Enabled by default' in /api/v0/features?milestone=160 with listing name 'Enhanced Canvas TextMetrics'; slug enhanced-canvas-textmetrics matches lib/chromestatus.ts; H1 matches listing name; declared ChromeStatus row present. |
| completeness | 5/5 | info | reference-contract.json inventories all 17 WebIDL members across 5 inventory items (shapeText, ShapedText runs/clusters, ShapedText geometry/hit-testing, GlyphRun, and fillGlyphRun/strokeGlyphRun batch methods) mapped across all 9 required dimensions. |
| explanation-quality | 5/5 | info | Explains UTF-16 code-unit indexing, snapshotted font/direction/align/baseline vs draw-time paint styles, visual-order run merging, empty-string and frame-less document edge cases, and the Origin Trial redesign history. |
| examples | 4/5 | minor | Two complete semantic <pre><code> examples covering selection highlights, tight ink bounds, pointer caret hit-testing, per-cluster animated rendering, and GlyphRun.textMetrics(). No Chrome Platform Showcase demo exists yet (HEAD 404 on 2026-11-24). |
| browser-compat-fallbacks | 5/5 | info | Honest Limited availability Baseline banner; discloses BCD lacks entries for ShapedText/GlyphRun; cites ChromeStatus 160, Mozilla standards-positions#1144, WebKit standards-positions#436, and WebKit/explainers#137. |
| links-validity | 5/5 | info | Every visible source/citation label carries a direct <a href> with target='_blank' rel='noopener'; all Blink source, WPT, blink-dev Intent, and ChromeStatus links verified on 2026-11-24. |
| accessibility | 5/5 | info | Single <main>, single <h1>, sequential h2/h3 headings, <nav class='local-nav'> jump links, captioned semantic tables with <th scope>, keyboard-focusable .table-wrap scroll regions with :focus-visible outline, and role='note' Baseline banner. |
| responsive-ux | 5/5 | info | Verified via npm run responsive -- --page v160/enhanced-canvas-textmetrics --screenshots (desktop:ok mobile:ok) and visual inspection of desktop and mobile screenshots; added <wbr> breakpoints inside OffscreenCanvasRenderingContext2D so narrow 360px lines wrap cleanly at word boundaries with 0px overflow. |
| showcase-demo-relationship | 4/5 | info | HEAD check on https://chrome-platform-showcase.paulkinlan-ea.deno.net/v160/enhanced-canvas-textmetrics/ returned 404 on 2026-11-24; no broken iframe or speculative showcase link emitted so manifest demo remains honestly null. |
modern-web-guidance consulted
- responsive reference documentation table scroll focus navigation code blocks — Use semantic landmarks (<main>, <header>, <nav>, <footer>), sequential headings, tables with <caption> and <th scope>, aria-labelledby over duplicated aria-label, and visible :focus-visible outlines on focusable scroll regions. (Applied: single <main>, sequential h1/h2/h3, <nav class='local-nav' aria-label='On this page'>, captioned tables with <th scope='col|row'>, focusable .table-wrap regions linked via aria-labelledby with 3px :focus-visible outline.)
- responsive data table mobile overflow typography code blocks — Use logical sizing properties (max-inline-size), flex-wrap with gap, and horizontal scroll containers rather than masking overflow with overflow: hidden. (Applied: .table-wrap uses max-inline-size: 100% with horizontal scrolling on wide geometry/error/compat tables; shared styles handle flex-wrap on .baseline-browsers and overflow-x: auto on <pre>.)
- responsive data table mobile overflow typography code blocks — Keep headings balanced and code/tables legible on narrow mobile screens without breaking layout. (Applied: uses shared /public/styles.css editorial tokens with zero inline overrides on pre, h1, code, blockquote, or .baseline-browsers.)
- dark mode color-scheme semantic tokens light-dark — Use semantic design tokens that adapt across light and dark color schemes. (Applied: uses only CSS variables from /public/styles.css with no hard-coded inline colors.)
open questions
- Track crbug 580852205 for whether actualBoundingBox(start, end) and glyphClusters(start, end) align their start === text.length bounds rule with selectionRects().
- Update Specifications and Browser compatibility tables once WHATWG HTML PR #11000 updates to the ShapedText/GlyphRun IDL and once BCD adds ShapedText/GlyphRun entries.
- Embed a live Chrome Platform Showcase iframe if a v160/enhanced-canvas-textmetrics concept demo is published.
follow-up goals
- [low · targeted-fix] Embed a live Chrome Platform Showcase iframe once a v160/enhanced-canvas-textmetrics concept demo is published.
- [low · targeted-fix] Refresh Specifications and Browser compatibility tables once WHATWG PR #11000 merges and BCD adds ShapedText/GlyphRun.