← Back to release summary

Expose CSSStyleValue hierarchy to Worker contexts

Category
Miscellaneous
Type
Chromium catches up
Status
Proposed (Chrome Proposed)
Intent stage
None

WPT details: css/css-typed-om/stylevalue-subclasses/*.any.js (global=window,worker): cssKeywordValue, cssKeywordValue-value, cssUnparsedValue-empty, numeric-objects/cssUnitValue-to; and (full‑scope) the converted create-a-type, cssMathInvert-type, cssMathNegate-type, add-two-types, cssnumericvalue-multiply-two-types, arithmetic, to .any.js. (The CSSMath* ones require the full‑scope exposure.) https://wpt.fyi/results/css/css-typed-om/stylevalue-subclasses?label=experimental&label=master&aligned

Summary

The CSS Typed OM spec exposes the CSSStyleValue hierarchy to worker global scopes ([Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]), but Blink only exposed CSSStyleValue, CSSKeywordValue, CSSNumericValue, CSSUnitValue and CSSUnparsedValue to Window and the worklets. As a result these constructors were undefined in Workers, unlike in Firefox and Safari.

Motivation

Aligns Chrome with the spec's [Exposed] set and removes a cross‑thread inconsistency (these constructors are currently undefined in workers); enables off‑main‑thread CSS value manipulation

Standards & signals

Ecosystem

View on chromestatus.com