Skip to content

conformance: MQ L4/5 range, syntax token separators, typed-om position values, and feasibility consensus - #3

Merged
paulirish merged 20 commits into
mainfrom
phase85plus
Aug 12, 2026
Merged

conformance: MQ L4/5 range, syntax token separators, typed-om position values, and feasibility consensus#3
paulirish merged 20 commits into
mainfrom
phase85plus

Conversation

@paulirish

Copy link
Copy Markdown
Member

Lifts WPT multi-spec conformance to 14,967 / 17,318 passed (86.42% raw / 86.96% normalized) by implementing Media Queries Level 4/5 range syntax and evaluation, CSS Syntax Level 3 pairwise token serialization separators, and CSS Typed OM Level 1 position value reification.

Major Changes

1. Media Queries Level 4/5 & MediaList Conformance (mediaqueries: 113 ➔ 417 / 417, 100%)

  • Implemented MQ4/5 range syntax ((width >= 600px), (400px < width <= 800px)), boolean combinations (and, or, not), and <general-enclosed> AST preservation per Media Queries 4 § 2–4 and Media Queries 5 § 2–3.
  • Added canonical MediaList serialization, appendMedium(), and deleteMedium() per CSSOM Level 1 § 6.2.
  • Integrated Kleene 3-valued boolean evaluation in src/MediaParser.ts and wired media query evaluation into src/cascade.ts.

2. CSS Syntax & Tokenizer Conformance (css/css-syntax: 227 ➔ 398 / 414, 96.14%)

  • Implemented pairwise consecutive token serialization compatibility table in src/serializer.ts, injecting /**/ empty comments between coalescent tokens per CSS Syntax 3 § 8.
  • Added unrecognized at-rule rejection in style/page/font-face declaration blocks per CSS Syntax 3 § 5.4.4 & CSS Nesting 1 § 4.1, preventing declaration splitting.
  • Treated @charset as a non-rule byte marker per § 3.2, omitting it from CSSStyleSheet.cssRules.
  • Buffered boundary high surrogates and sanitized surrogate pairs ([\uD800-\uDFFF] -> \uFFFD) in src/streaming-tokenizer.ts.

3. Typed OM Position Reification & Numeric Normalization (css/css-typed-om: 11,044 ➔ 11,368 / 12,210, 93.10%)

  • Reified 1-4 value position properties (background-position, object-position, transform-origin) into CSSPositionValue(x, y) with keyword alignment per CSS Typed OM 1 § 3.3.
  • Added same-unit numeric addition simplification (calc(0% + 0%)CSSUnitValue(0, 'percent')) and physical unit base conversion (cm, mm, in, pt, pc, qpx) per CSS Values 4 § 6.1, § 10.7.
  • Preserved var() fallback tokens in CSSVariableReferenceValue and clamped opacity values to [0, 1].

4. Delphi Feasibility Baseline & Manifest Modernization

  • Replaced stale hardcoded exclusion counts with a dynamic, manifest-driven baseline grounded in tests/fixtures/wpt-browser-only-manifest.json (106 consensus-agreed browser-only test files) via 3-way Delphi subagent evaluation (Scrutineer, Grizz, Architect).
  • Documented terminology, objective classification criteria, and reproduction instructions in scripts/wpt/node/feasibility/README.md.
  • Added a 10ms setTimeout yield in scripts/wpt/node/run.ts to prevent event loop starvation during bulk test runs.

5. Tooling & Repository Reorganization

  • Reorganized scripts/ into domain subdirectories: scripts/wpt/node/, scripts/wpt/browser/, scripts/codegen/, scripts/external_suites/, and scripts/baselines/.
  • Migrated the 10,000-iteration random fuzzer from tools/fuzz/ into native node:test at tests/fuzz.test.ts.
  • Moved benchmarks to scripts/benchmarks/parser.bench.ts and removed root-level clutter.
  • Standardized property syntax codegen from @webref/css (815 properties) and converted API surface verification to native snapshots (tests/api-surface.test.ts.snapshot).
WPT Multi-Spec Conformance Summary
Spec Domain Total Tests ($N$) Browser-Only ($E$) Feasible Target ($M$) Current Passing ($P$) Raw Score ($P/N$) Normalized Conformance ($P/M$)
css-typed-om 12,210 0 12,210 11,368 93.10% 93.10%
cssom 973 18 955 440 45.22% 46.07%
css-syntax 414 16 398 398 96.14% 100.00%
css-nesting 117 0 117 68 58.12% 58.12%
css-variables 526 13 513 215 40.87% 41.91%
selectors 2,661 59 2,602 2,061 77.45% 79.21%
mediaqueries 417 0 417 417 100.00% 100.00%
OVERALL 17,318 106 17,212 14,967 86.42% 86.96%

@paulirish
paulirish merged commit 8b39dc2 into main Aug 12, 2026
8 checks passed
@paulirish
paulirish deleted the phase85plus branch August 12, 2026 19:28
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