Skip to content

getComputedStyle of a border-color repeats the color thrice #3972

@rijenkii

Description

@rijenkii

Node.js version

22.15.0

jsdom version

27.0.1

Minimal reproduction case

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

const { window } = new JSDOM(undefined, {
  virtualConsole: new VirtualConsole(),
});
const { document } = window;

const div = document.createElement("div");
document.body.appendChild(div);

div.style.setProperty("border-color", "gray");

console.log(window.getComputedStyle(div).getPropertyValue("border-color"));

How does similar code behave in browsers?

https://jsfiddle.net/s5dL1n93/

Chrome and Firefox outputs "rgb(128, 128, 128)".

What is the problem?

jsdom outputs "rgb(128, 128, 128) rgb(128, 128, 128) rgb(128, 128, 128)" instead.

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