Comparing version 0.2.35 to 0.2.36
@@ -5,5 +5,15 @@ 'use strict'; | ||
function parse(v) { | ||
if (String(v).toLowerCase() === 'auto') { | ||
return 'auto'; | ||
} | ||
if (String(v).toLowerCase() === 'inherit') { | ||
return 'inherit'; | ||
} | ||
return parseMeasurement(v); | ||
} | ||
module.exports.definition = { | ||
set: function (v) { | ||
this._setProperty('height', parseMeasurement(v)); | ||
this._setProperty('height', parse(v)); | ||
}, | ||
@@ -10,0 +20,0 @@ get: function () { |
@@ -5,5 +5,15 @@ 'use strict'; | ||
function parse(v) { | ||
if (String(v).toLowerCase() === 'auto') { | ||
return 'auto'; | ||
} | ||
if (String(v).toLowerCase() === 'inherit') { | ||
return 'inherit'; | ||
} | ||
return parseMeasurement(v); | ||
} | ||
module.exports.definition = { | ||
set: function (v) { | ||
this._setProperty('width', parseMeasurement(v)); | ||
this._setProperty('width', parse(v)); | ||
}, | ||
@@ -10,0 +20,0 @@ get: function () { |
@@ -5,3 +5,3 @@ { | ||
"keywords": ["CSS", "CSSStyleDeclaration", "StyleSheet"], | ||
"version": "0.2.35", | ||
"version": "0.2.36", | ||
"homepage": "https://github.com/chad3814/CSSStyleDeclaration", | ||
@@ -8,0 +8,0 @@ "maintainers": [{ |
@@ -284,2 +284,14 @@ "use strict"; | ||
}, | ||
'Width and height of auto should work': function (test) { | ||
var style = new cssstyle.CSSStyleDeclaration(); | ||
test.expect(4); | ||
style.width = "auto"; | ||
test.equal(style.cssText,'width: auto;', 'cssText is not "width: auto;": ' + style.cssText); | ||
test.equal(style.width,'auto', 'width is not "auto": ' + style.width); | ||
style = new cssstyle.CSSStyleDeclaration(); | ||
style.height = "auto"; | ||
test.equal(style.cssText,'height: auto;', 'cssText is not "height: auto;": ' + style.cssText); | ||
test.equal(style.height,'auto', 'height is not "auto": ' + style.height); | ||
test.done(); | ||
}, | ||
'Padding and margin should set/clear shorthand properties': function (test) { | ||
@@ -286,0 +298,0 @@ var style = new cssstyle.CSSStyleDeclaration(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
268460
7313