bug fixes

This commit is contained in:
Avad3 2024-07-14 14:33:57 -04:00
parent 20caf32b5b
commit b293eea0bd
2 changed files with 9 additions and 15 deletions

View file

@ -1,8 +1,7 @@
import { rewriteCss } from "./shared";
const cssProperties = ["background", "background-image", "mask", "mask-image", "list-style", "list-style-image", "border-image", "border-image-source", "cursor"];
const jsProperties = ["background", "backgroundImage", "mask", "maskImage", "listStyle", "listStyleImage", "borderImage", "borderImageSource", "cursor"];
// const jsProperties = ["background", "backgroundImage", "mask", "maskImage", "listStyle", "listStyleImage", "borderImage", "borderImageSource", "cursor"];
CSSStyleDeclaration.prototype.setProperty = new Proxy(CSSStyleDeclaration.prototype.setProperty, {
apply(target, thisArg, argArray) {
@ -10,17 +9,4 @@ CSSStyleDeclaration.prototype.setProperty = new Proxy(CSSStyleDeclaration.protot
return Reflect.apply(target, thisArg, argArray);
},
});
jsProperties.forEach((prop) => {
const propDescriptor = Object.getOwnPropertyDescriptor(CSSStyleDeclaration.prototype, prop);
Object.defineProperty(CSSStyleDeclaration.prototype, prop, {
get() {
return propDescriptor.get.call(this);
},
set(v) {
return propDescriptor.set.call(this, rewriteCss(v));
},
})
});