This code adds the ability to fn.css() to get an array as a first input argument to read multiple css values from a DOM element. It returns a key/value map.
(this feature was also added to jQuery in v.1.9)
add array as an input argument to fn.css() to enable to receive multi…
…ple css values form an object
Ah, didn't see this pull request. I'll look into it! :)
I like the addition, but I think the implementation is quite repetitive. This probably better implemented treating a single string as a one item array, and using one code path.
I though about that too but in this case we would probably end up treating arrays with one element and the string property the same way and return the value instead of the string value. If I give an array to css() then I expect an object to be returned rather than a string (even if my given array just has one entry) WDYT?
There should be tests that prove that the resulting object doesn't contain properties that weren't given as part of the array to css(), even though an element might have these properties set.
In other words, a test that shows only requested properties are returned, not all.
modified test for css()
if css value is set on the dom element but not requested by the callee then the value must not be contained in the return object of fn.css()
@mislav I agree