cssstyle 0.3.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,7 +6,7 @@ CSSStyleDeclaration is a work-a-like to the CSSStyleDeclaration class in Nikita
6
6
 
7
7
  Why not just issue a pull request?
8
8
  ----
9
- Well, NV wants to keep CSSOM fast (which I can appreciate) and CSS2Properties aren't required by the standard (though every browser has the interface). So I figured the path of least resistence would be to just modify this one class, publish it as a node module (that requires CSSOM) and then make a pull request of jsdom to use it.
9
+ Well, NV wants to keep CSSOM fast (which I can appreciate) and CSS2Properties aren't required by the standard (though every browser has the interface). So I figured the path of least resistance would be to just modify this one class, publish it as a node module (that requires CSSOM) and then make a pull request of jsdom to use it.
10
10
 
11
11
  How do I test this code?
12
12
  ---
@@ -10,6 +10,9 @@ var parse = function parse(v) {
10
10
  if (v === '' || v === null) {
11
11
  return undefined;
12
12
  }
13
+ if (v === 0) {
14
+ return "0px";
15
+ }
13
16
  if (v.toLowerCase() === 'inherit') {
14
17
  return v;
15
18
  }
package/lib/properties.js CHANGED
@@ -934,6 +934,10 @@ var borderSpacing_local_var_parse = function parse(v) {
934
934
  return undefined;
935
935
  }
936
936
 
937
+ if (v === 0) {
938
+ return "0px";
939
+ }
940
+
937
941
  if (v.toLowerCase() === 'inherit') {
938
942
  return v;
939
943
  }
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "CSSStyleDeclaration",
7
7
  "StyleSheet"
8
8
  ],
9
- "version": "0.3.1",
9
+ "version": "1.0.0",
10
10
  "homepage": "https://github.com/jsakas/CSSStyleDeclaration",
11
11
  "maintainers": [
12
12
  {
@@ -50,7 +50,7 @@
50
50
  "resolve": "~1.1.7"
51
51
  },
52
52
  "scripts": {
53
- "test": "./scripts/run_tests.sh",
53
+ "test": "node ./scripts/generate_properties.js && nodeunit tests",
54
54
  "prepublish": "node ./scripts/generate_properties.js"
55
55
  },
56
56
  "license": "MIT"
package/tests/tests.js CHANGED
@@ -420,5 +420,12 @@ module.exports = {
420
420
  style.flexDirection = 'row';
421
421
  test.equal(style.cssText, 'flex-direction: row;', 'flex-direction is not column');
422
422
  test.done();
423
+ },
424
+ 'Support non string entries in border-spacing': function (test) {
425
+ var style = new cssstyle.CSSStyleDeclaration();
426
+ test.expect(1);
427
+ style.borderSpacing = 0;
428
+ test.equal(style.cssText, 'border-spacing: 0px;', 'border-spacing is not 0');
429
+ test.done();
423
430
  }
424
431
  };
@@ -1,4 +0,0 @@
1
- #!/bin/sh
2
-
3
- node ./scripts/generate_properties.js
4
- nodeunit tests