capricorn86 / happy-dom

A JavaScript implementation of a web browser without its graphical user interface
MIT License
3.28k stars 200 forks source link

window.getComputedStyle(element).width does not return the correct size in pixels #1440

Open jgonte opened 4 months ago

jgonte commented 4 months ago

Describe the bug window.getComputedStyle(element).width does not return the correct size in pixels

To Reproduce Steps to reproduce the behavior: const e= document.createElement('div');

document.body.appendChild(e);

e.style.width = "10ch";

const width= window.getComputedStyle(e).width;

width equals "10ch"

Expected behavior It should be the size in pixels, for example "120px"