Skip to content

Commit

Permalink
Merge pull request #79 from michalbednarski/gh-pages
Browse files Browse the repository at this point in the history
Fix dynamic-dom plugin to correctly choose prefixed properties
  • Loading branch information
LeaVerou committed Jun 10, 2012
2 parents eb60165 + 07d824b commit b49dbeb
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions plugins/prefixfree.dynamic-dom.js
Expand Up @@ -54,18 +54,29 @@ if(!self) {
if(window.CSSStyleDeclaration) {
for(var i=0; i<self.properties.length; i++) {
var property = StyleFix.camelCase(self.properties[i]),
prefixed = self.prefixProperty(property),
prefixed = self.prefixProperty(property, true),
proto = CSSStyleDeclaration.prototype,
getter = (function(prefixed) {
return function() {
return this[prefixed];
}
})(prefixed),
setter = (function(prefixed) {
return function(value) {
this[prefixed] = value;
}
})(prefixed);
getter,
setter;

// Lowercase prefix for IE
if(!(prefixed in proto)) {
prefixed = prefixed.charAt(0).toLowerCase() + prefixed.slice(1);
if(!(prefixed in proto)) {
continue;
}
}

getter = (function(prefixed) {
return function() {
return this[prefixed];
}
})(prefixed);
setter = (function(prefixed) {
return function(value) {
this[prefixed] = value;
}
})(prefixed);

if(Object.defineProperty) {
Object.defineProperty(proto, property, {
Expand Down

0 comments on commit b49dbeb

Please sign in to comment.