Skip to content

Regression: for el.style.transform = "translate((10%), 10%)" whitespace is removed (worked in v26, fails in v27) #3939

@htho

Description

@htho

Node.js version

v22

jsdom version

v27

Minimal reproduction case

const { JSDOM } = require("jsdom");

const dom = new JSDOM(``, {});
const document = dom.window.document;

const p = document.createElement("p");

const transform = "translate(calc(10%), 10%)";
p.style.transform = transform;
console.assert(p.style.transform === transform, "p.style.transform should be\n", transform, "\nbut is\n", p.style.transform);

How does similar code behave in browsers?

In Chrome this assertion just passes.

What is the problem?

The assertion fails with:

Assertion failed: p.style.transform should be
 translate(calc(10%), 10%)
but is
 translate(calc(10%),10%)

In v26 there were no semantic checks, but at least my tests did not fail.
If I update my tests, I need to update them again as soon as jsdom aligns with the browser again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    csshas to-upstream testThis bug has a failing to-upstream web platform test waiting to be fixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions