XuelesszzZ 94af2b8e7b 6-30-5 há 1 ano atrás
..
lib 94af2b8e7b 6-30-5 há 1 ano atrás
scripts 94af2b8e7b 6-30-5 há 1 ano atrás
tests 94af2b8e7b 6-30-5 há 1 ano atrás
.eslintignore 94af2b8e7b 6-30-5 há 1 ano atrás
.eslintrc.js 94af2b8e7b 6-30-5 há 1 ano atrás
.travis.yml 94af2b8e7b 6-30-5 há 1 ano atrás
MIT-LICENSE.txt 94af2b8e7b 6-30-5 há 1 ano atrás
README.md 94af2b8e7b 6-30-5 há 1 ano atrás
package.json 94af2b8e7b 6-30-5 há 1 ano atrás

README.md

CSSStyleDeclaration

NpmVersion Build Status

CSSStyleDeclaration is a work-a-like to the CSSStyleDeclaration class in Nikita Vasilyev's CSSOM. I made it so that when using jQuery in node setting css attributes via $.fn.css() would work. node-jquery uses jsdom to create a DOM to use in node. jsdom uses CSSOM for styling, and CSSOM's implementation of the CSSStyleDeclaration doesn't support CSS2Properties, which is how jQuery's $.fn.css() operates.

Why not just issue a pull request?

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.

How do I test this code?

npm test should do the trick, assuming you have the dev dependencies installed:

$ npm test

tests
✔ Verify Has Properties
✔ Verify Has Functions
✔ Verify Has Special Properties
✔ Test From Style String
✔ Test From Properties
✔ Test Shorthand Properties
✔ Test width and height Properties and null and empty strings
✔ Test Implicit Properties