Skip to content

Commit 7433b10

Browse files
authored
Fix background-* spelling
Closes #214.
1 parent 030a609 commit 7433b10

File tree

6 files changed

+19
-5
lines changed

6 files changed

+19
-5
lines changed

lib/properties/backgroundAttachment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports.definition = {
1919
v = parsers.prepareValue(v, this._global);
2020
if (parsers.hasVarFunc(v)) {
2121
this._setProperty("background", "");
22-
this._setProperty("backgound-attachemnt", v);
22+
this._setProperty("background-attachemnt", v);
2323
} else {
2424
this._setProperty("background-attachment", module.exports.parse(v));
2525
}

lib/properties/backgroundColor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports.definition = {
2222
v = parsers.prepareValue(v, this._global);
2323
if (parsers.hasVarFunc(v)) {
2424
this._setProperty("background", "");
25-
this._setProperty("backgound-color", v);
25+
this._setProperty("background-color", v);
2626
} else {
2727
this._setProperty("background-color", module.exports.parse(v));
2828
}

lib/properties/backgroundImage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports.definition = {
1818
v = parsers.prepareValue(v, this._global);
1919
if (parsers.hasVarFunc(v)) {
2020
this._setProperty("background", "");
21-
this._setProperty("backgound-image", v);
21+
this._setProperty("background-image", v);
2222
} else {
2323
this._setProperty("background-image", module.exports.parse(v));
2424
}

lib/properties/backgroundPosition.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module.exports.definition = {
3939
v = parsers.prepareValue(v, this._global);
4040
if (parsers.hasVarFunc(v)) {
4141
this._setProperty("background", "");
42-
this._setProperty("backgound-position", v);
42+
this._setProperty("background-position", v);
4343
} else {
4444
this._setProperty("background-position", module.exports.parse(v));
4545
}

lib/properties/backgroundRepeat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports.definition = {
1919
v = parsers.prepareValue(v, this._global);
2020
if (parsers.hasVarFunc(v)) {
2121
this._setProperty("background", "");
22-
this._setProperty("backgound-repeat", v);
22+
this._setProperty("background-repeat", v);
2323
} else {
2424
this._setProperty("background-repeat", module.exports.parse(v));
2525
}

test/CSSStyleDeclaration.test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,3 +1100,17 @@ describe("regression test for https://github.com/jsdom/jsdom/issues/3021", () =>
11001100
assert.strictEqual(style.font, "bold 4px sans-serif");
11011101
});
11021102
});
1103+
1104+
describe("regression test for https://github.com/jsdom/cssstyle/issues/214", () => {
1105+
it("should return value for each property", () => {
1106+
const style = new CSSStyleDeclaration();
1107+
const key = "background-color";
1108+
const camel = "backgroundColor";
1109+
const value = "var(--foo)";
1110+
style[key] = value;
1111+
assert.strictEqual(style[key], value);
1112+
style[key] = null;
1113+
style[camel] = value;
1114+
assert.strictEqual(style[camel], value);
1115+
});
1116+
});

0 commit comments

Comments
 (0)