mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
Improved support for converting CSS properties to their JS equivalent in CPBrowserStyleProperty
For example, the following CSS property names all resolve to the same correct JS equivalent for the current browser:
* CPBrowserStyleProperty('TransformOrigin') -> 'WebkitTransformOrigin'
* CPBrowserStyleProperty('transform-origin') -> 'WebkitTransformOrigin'
This commit is contained in:
@@ -310,11 +310,18 @@ function CPBrowserStyleProperty(aProperty)
|
||||
break;
|
||||
default:
|
||||
var prefixes = ["Webkit", "Moz", "O", "ms"],
|
||||
capProperty = [aProperty capitalizedString];
|
||||
strippedProperty = aProperty.split('-').join(' '),
|
||||
capProperty = [strippedProperty capitalizedString].split(' ').join('');
|
||||
|
||||
for (var i = 0; i < prefixes.length; i++)
|
||||
{
|
||||
if (prefixes[i] + capProperty in testElement.style)
|
||||
// First check if the property is already valid without being formatted, otherwise try the capitalized property
|
||||
if (prefixes[i] + aProperty in testElement.style)
|
||||
{
|
||||
r = prefixes[i] + aProperty;
|
||||
break;
|
||||
}
|
||||
else if (prefixes[i] + capProperty in testElement.style)
|
||||
{
|
||||
r = prefixes[i] + capProperty;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user