Summary
Extra commas in font-family should cause errors. It parses them as an array containing empty strings ",," -> ["", "", ""], but unquoted empty strings aren't allowed.
e.g. Setting font-family to Arial, should fail, but actually results in Arial, (with a space inserted after each comma).
const el = document.createElement("input");
el.style.fontFamily = "Arial,";
expect(el.style.fontFamily).toBe(""); // actually: "Arial, "
More examples: ,Arial Arial, Arial,,Arial ,,
Expected
It should be an error. The result should be "".
Actual
It succeeds, and inserts a space after each comma.
Version
# pnpm why cssstyle
jsdom 28.1.0
└── cssstyle 6.0.1
Also affects 5.3.7.
Summary
Extra commas in
font-familyshould cause errors. It parses them as an array containing empty strings",," -> ["", "", ""], but unquoted empty strings aren't allowed.e.g. Setting
font-familytoArial,should fail, but actually results inArial,(with a space inserted after each comma).More examples:
,ArialArial,Arial,,Arial,,Expected
It should be an error. The result should be
"".Actual
It succeeds, and inserts a space after each comma.
Version
Also affects 5.3.7.