Skip to content

[css-typed-om-1] Clarify reification of computed 1–4 side values #13958

@janvarga

Description

@janvarga

There appears to be a gap around Typed OM reification of computed values for properties using 1–4 side patterns, such as:

  • border-image-outset
  • border-image-slice
  • border-image-width

Consider:

document.body.attributeStyleMap.set("border-image-outset", new CSSUnitValue(0, "number"));
console.log(getComputedStyle(document.body).borderImageOutset);
console.log(document.body.computedStyleMap().get("border-image-outset"));

Current behavior (Chrome & Safari):

  • CSSOM serialization:
    • getComputedStyle(...).borderImageOutset -> "0" or "auto"
  • Typed OM:
    • computedStyleMap().get(...) -> CSSStyleValue {} (unsupported)

Current WPT coverage assumes these computed values are unsupported because the computed value conceptually expands to four values:

// Computed value is always four values, which are not supported in
// Typed OM level 1.

However, CSSOM serialization collapses equal computed sides to a shorter form, for example:

0 0 0 0 -> 0
1 2 1 2 -> 1 2

This raises the question whether Typed OM reification should follow:

  • the conceptual computed value shape (always 4 values), or
  • the canonical CSSOM serialization shape (collapsed representation)

Firefox's in-progress implementation will likely initially follow existing WPT coverage for compatibility (or relax WPT tests), but this behavior seems worth clarifying at the specification level.

Links:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Agenda+css-typed-omspec-test-mismatchIssues about tests that seem to assume things that contradict the spec or are not specified at all

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions