Describe the bug
In a browser window.getComputedStyle returns some kind of a normalized style, e.g. if a div has font-weight: bold on it, getComputedStyle will return font-weight: 700.
To Reproduce
Run the following script:
import { Window } from "happy-dom";
const window = new Window();
const { document } = window;
const div = document.createElement("div");
div.style.fontWeight = "bold";
document.body.appendChild(div);
console.log(window.getComputedStyle(div).fontWeight);
It will print bold.
Expected behavior
Running the script in a browser (without the first three lines) results in 700 being printed to console.
Device and details:
- OS: Linux 7.1.3-200.fc44.x86_64
- Node version: v20.20.0
- Package version: 20.10.6
Additional context
Similar issues: #1829
Describe the bug
In a browser
window.getComputedStylereturns some kind of a normalized style, e.g. if adivhasfont-weight: boldon it,getComputedStylewill returnfont-weight: 700.To Reproduce
Run the following script:
It will print
bold.Expected behavior
Running the script in a browser (without the first three lines) results in
700being printed to console.Device and details:
Additional context
Similar issues: #1829