Skip to content

Commit

Permalink
Add CSSMathValue and CSSNumericValue to cssOMTypes directly.
Browse files Browse the repository at this point in the history
  • Loading branch information
flackr committed Feb 2, 2024
1 parent eb89c3b commit eb78b57
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/proxy-cssom.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ export function installCSSOM() {
}

const cssOMTypes = {
'CSSNumericValue': CSSNumericValue,
'CSSMathValue': CSSMathValue,
'CSSUnitValue': class extends CSSNumericValue {
constructor(value, unit) {
super();
Expand Down Expand Up @@ -359,7 +361,7 @@ export function installCSSOM() {
});
}

for (let [type, value] of Object.entries({'CSSMathValue': CSSMathValue, 'CSSNumericValue': CSSNumericValue, ...cssOMTypes})) {
for (let [type, value] of Object.entries({cssOMTypes})) {
if (type in window)
continue;
if (!Reflect.defineProperty(window, type, { value }))
Expand Down

0 comments on commit eb78b57

Please sign in to comment.