cappuccino/cappuccino — pull request #1713 by milestinsley (2013-01-06 13:48:14+00:00)
Title: Improved support for converting CSS properties to their JS equivalent in CPBrowserStyleProperty

Currently __CPBrowserStyleProperty__ does not support hyphenated or camel cased property names. For example:

* CPBrowserStyleProperty('TransformOrigin') -> 'WebkitTransformorigin' // Incorrect
* CPBrowserStyleProperty('transform-origin') -> 'WebkitTransform-origin' // Incorrect

Both of these are invalid CSS properties.

Therefore, I've fixed this by:

* Firstly, checking if the unformatted property name is in fact already valid. E.g. 'WebKit' + 'TransformOrigin' is valid with no further formatting.
* Secondly, checking if the formatted property name is valid by first stripping any "-" and ensuring the string is properly camel cased. E.g 'transform-origin' -> 'TransformOrigin'.

With this fix the following examples now work correctly:

* CPBrowserStyleProperty('TransformOrigin') -> 'WebkitTransformOrigin' // Correct
* CPBrowserStyleProperty('transform-origin') -> 'WebkitTransformOrigin' // Correct

__Note:__
I first noticed this bug in __\_CPAttachedWindow__ in which line 444 is:

```[self setCSS3Property:@"TransformOrigin" value:transformOrigin];```

As per the example above this would result in a CSS property of 'WebkitTransformorigin' being used, which is invalid.

This would ultimately result in the attached window (in this case a popover) scaling from the center, rather than an offset origin as expected if ```setAnimates:YES```. With this fix, the popover scales from the transform origin correctly and I've tested this in all the main browsers.