LibWeb: Allow custom properties in CSSStyleDeclaration.setProperty()

This change fixes unhoverable toolbar on https://excalidraw.com/
The problem was that React.js uses setProperty() to add style properties
specified in the "style" attribute in the virtual DOM, and we were
failing to add the CSS variable used to set the "pointer-events" value
to "all".
This commit is contained in:
Aliaksandr Kalenik 2024-11-20 15:48:04 +01:00 committed by Alexander Kalenik
commit 3a2cc1aa20
Notes: github-actions[bot] 2024-11-21 12:17:27 +00:00
4 changed files with 47 additions and 13 deletions

View file

@ -0,0 +1,19 @@
<!DOCTYPE html>
<script src="../include.js"></script>
<body></body>
<script>
test(() => {
const div = document.createElement('div');
div.style.setProperty("--redcolor", "red");
const nested = document.createElement('div');
nested.style["backgroundColor"] = "var(--redcolor)";
nested.style["width"] = "100px";
nested.style["height"] = "100px";
div.appendChild(nested);
document.body.appendChild(div);
println(getComputedStyle(nested).backgroundColor);
});
</script>