mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-02 18:33:34 +00:00
Merge pull request #1713 from milestinsley/CPBrowserStyleProperty-fix
Improved support for converting CSS properties to their JS equivalent in CPBrowserStyleProperty
This commit is contained in:
@@ -359,9 +359,21 @@ function CPBrowserCSSProperty(aProperty)
|
||||
{
|
||||
if (browserProperty.substring(0, prefix.length) == prefix)
|
||||
{
|
||||
return prefixes[prefix] + browserProperty.substring(prefix.length).toLowerCase();
|
||||
var browserPropertyWithoutPrefix = browserProperty.substring(prefix.length),
|
||||
parts = browserPropertyWithoutPrefix.match(/[A-Z][a-z]+/g);
|
||||
|
||||
// If there were any capitalized words in the browserProperty, insert a "-" between each one
|
||||
if (parts && parts.length > 0)
|
||||
browserPropertyWithoutPrefix = parts.join("-");
|
||||
|
||||
return prefixes[prefix] + browserPropertyWithoutPrefix.toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
var parts = browserProperty.match(/[A-Z][a-z]+/g);
|
||||
|
||||
if (parts && parts.length > 0)
|
||||
browserProperty = parts.join("-");
|
||||
|
||||
return browserProperty.toLowerCase();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user