Socket
Socket
Sign inDemoInstall

cssstyle

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cssstyle - npm Package Compare versions

Comparing version 0.2.35 to 0.2.36

12

lib/properties/height.js

@@ -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 () {

2

package.json

@@ -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();

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc