Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style object must include dashed properties #1613

Open
dead-claudia opened this issue Nov 15, 2024 · 0 comments
Open

Style object must include dashed properties #1613

dead-claudia opened this issue Nov 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@dead-claudia
Copy link

dead-claudia commented Nov 15, 2024

Describe the bug
Per spec, all supported CSS properties that are not custom properties must have corresponding dashed properties on elem.style. This includes vendor-prefixed properties like -webkit-*.

These properties appear missing.

To Reproduce

const { Window } = require('happy-dom')
const window = new Window()

window.document.body.innerHTML = '<p>Hello world</p>'
const element = window.document.querySelector("p")

// mutate hyphenated property
element.style["font-size"] = "10px"

// print value
console.log(element.style.getProperty("font-size"))

Expected behavior
It to print the value that was set

Additional context
Resulted in MithrilJS/mithril.js#2989 (comment) being filed.

I don't have version or OS info, but it appears it's likely the latest version if https://github.com/capricorn86/happy-dom/blob/master/packages/happy-dom/src/css/declaration/CSSStyleDeclaration.ts is the only relevant file. @kfule may have more info as he's the one who reported it as an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant