Browse files

special casing ms properties in hyphenate, since they're weird and do…

…nt respect standard hyphenation rules.
  • Loading branch information...
1 parent 71012f7 commit 586ba62e322c84ba5c1c06b06eba13ecd75eb5f1 @kamicane kamicane committed Apr 7, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/browser.js
View
9 lib/browser.js
@@ -18,7 +18,6 @@ var prime = require("prime/prime"),
string = require("prime/types/string")
var camelize = string.camelize,
- hyphenate = string.hyphenate,
clean = string.clean,
capitalize = string.capitalize
@@ -30,6 +29,11 @@ var nodes = require("nodes/lib/nodes")
// util
+var hyphenated = {}
+var hyphenate = function(self){
+ return hyphenated[self] || (hyphenated[self] = string.hyphenate(self))
+}
+
var round = function(number){
return +(+number).toPrecision(3)
}
@@ -359,7 +363,8 @@ var parseTextShadow = parsers.textShadow = function(value, normalize, node){
each(['Webkit', "Moz", "ms"], function(prefix){
each(["transition", "transform", "transformOrigin", "transformStyle", "perspective", "perspectiveOrigin", "backfaceVisibility"], function(style){
- var cc = prefix + capitalize(style)
+ var cc = prefix + capitalize(style)
+ if (prefix === "ms") hyphenated[cc] = "-ms-" + hyphenate(style)
if (test.style[cc] != null) aliases[style] = cc
})
})

0 comments on commit 586ba62

Please sign in to comment.