Skip to content

getComputedStyle() doesn't inherit font-family #3614

@danon

Description

@danon

Basic info:

  • Node.js version: 18.13.0
  • jsdom version: 22.1.0

Minimal reproduction case

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

const {window} = new JSDOM(`<!DOCTYPE html>
<html>
    <body>
        <div id="parent" style="font-family: Arial;">
            <div id="child">Hello, Dave!</div>
        </div>
    </body>
</html>`);

const parent = window.document.querySelector("#parent");
const child = window.document.querySelector("#child");

console.log(window.getComputedStyle(parent).fontFamily);
console.log(window.getComputedStyle(child).fontFamily);

How does similar code behave in browsers?

In browser the font family is inherited.

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