Skip to content

conformance: normalized WPT% => 91.4%. Nesting 1, Variables 1, and Typed OM math - #4

Merged
paulirish merged 16 commits into
mainfrom
phase90plus
Aug 13, 2026
Merged

conformance: normalized WPT% => 91.4%. Nesting 1, Variables 1, and Typed OM math#4
paulirish merged 16 commits into
mainfrom
phase90plus

Conversation

@paulirish

Copy link
Copy Markdown
Member

Advances conformance across 7 W3C Web Platform Test (WPT) suites in pure Node.js, achieving a +91.4% normalized pass rate across 16,842 feasible tests (+883 net passing assertions).

Key Capabilities & Spec Alignments

  • CSS Nesting Level 1 (css-nesting):

    • Implemented CSSNestedDeclarations serialization, omitting empty wrapper blocks per § 4.1.
    • Added relative combinator desugaring for leading combinators (& + .bar, & > .baz) per § 3.
    • Propagated outer rule.selectorText mutations dynamically into nested child rules referencing &.
    • Restricted & nesting scope to CSSStyleRule parents, preventing spurious & prefixes inside grouping rules (@media, @supports).
  • CSS Variables Level 1 & Cascade Level 5 (css-variables):

    • Implemented revert and revert-layer cascade fallback rollback when referenced variables are unassigned.
    • Implemented dependency cycle detection for self, 2-node, and multi-node dependency chains (guaranteed-invalid).
    • Preserved single-space tokenization for empty custom property definitions (--foo: ; vs --foo:;).
    • Integrated SVG presentation attributes (alignment-baseline, baseline-shift, flood-color, lighting-color, stop-color, clip-rule) into getCascadedStyle variable substitution.
  • CSS Values Level 4 & CSS Typed OM Level 1 (css-typed-om):

    • Simplified calculation trees: combined same-unit numeric literals in min()/max() and distributed negation over CSSMathSum.
    • Implemented indexed property proxy setters (array[array.length] = item) on CSSUnparsedValue and CSSTransformValue.
    • Preserved case sensitivity for custom properties during StylePropertyMap validation.
  • CSSOM Core & Condition Rules (cssom):

    • Introduced CSSConditionRule base class for CSSMediaRule, CSSSupportsRule, and CSSContainerRule with conditionText.
    • Added containerName and containerQuery properties on CSSContainerRule.
    • Reconciled specified declaration order in CSSStyleDeclaration._addDeclaration per cssom-1 § 6.4.1.
    • Enforced strict shorthand getPropertyValue completeness checks.
  • DOMMatrix & W3C Geometry Interfaces (src/DOMMatrix.ts):

    • Implemented 0-allocation in-place 2D affine fast paths (multiplySelf, rotateSelf, translateSelf, scaleSelf, invertSelf, transformPoint).
    • Replaced unrolled matrix math with compact 2-loop dot products and 2x2 block Laplace expansion for inversion, correctly handling NaN and singular determinants.
    • Eliminated double-transposition cloning overhead in constructors and deduplicated prototype getters.
  • Spec-Driven Automation & Harness Safety:

    • Extracted cascade initial values, SVG presentation attributes, and color properties dynamically from @webref/css and mdn-data into src/data/gen/cascade-data.ts.
    • Hardened parallel WPT runner against memory leaks with dual-tier /proc/[pid]/stat RSS watchdogs, state D detection, and mandatory --max-old-space-size=1024 enforcement across 24 worker pools.

Technical Breakdown by Module
Module Core Changes
src/cascade.ts Added cycle graph detection in substituteVariables; implemented revert / revert-layer cascade rollback; wired generated SVG presentation attributes and default values.
src/CSSOM.ts Added CSSConditionRule inheritance; updated CSSContainerRule, CSSMediaRule, and CSSSupportsRule; implemented empty CSSNestedDeclarations serialization omission and ancestor-scoped nesting checks.
src/CSSStyleDeclaration.ts Aligned specified declaration order in _addDeclaration; implemented strict shorthand getPropertyValue / getPropertyPriority completeness.
src/DOMMatrix.ts Added in-place 2D affine fast paths; optimized 4x4 matrix multiplication; refactored invertMatrix to block Laplace expansion; deduplicated prototype getters.
src/math-parser.ts Added same-unit combining in simplifyMinMax; added negation distribution over CSSMathSum.
src/typed-om.ts Added indexed append proxy setters on CSSUnparsedValue and CSSTransformValue; preserved custom property case in StylePropertyMap.
src/parser.ts Desugared leading combinators in nested selector parsing; preserved empty custom property whitespace tokens; rejected unknown at-rules in declaration blocks.
scripts/codegen/ Added generate_cascade_data.ts consuming @webref/css and mdn-data to emit src/data/gen/cascade-data.ts.
scripts/wpt/node/ Added V8 memory limits, state-D watchdog polling via /proc/[pid]/stat, and synchronized 16,842 feasible denominator baseline.

@paulirish
paulirish merged commit e2f73ae into main Aug 13, 2026
8 checks passed
@paulirish
paulirish deleted the phase90plus branch August 13, 2026 01:23
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