Created
August 19, 2012 07:41
-
-
Save jonathantneal/3393376 to your computer and use it in GitHub Desktop.
vendorlessStyle // allows DOM elements to support vendorless properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.CSSStyleDeclaration && function (CSSStyleDeclarationPrototype, defaultStyles, defaultProperty, specialProperty) { | |
for (defaultProperty in defaultStyles) { | |
specialProperty = defaultProperty.match(/^(O|Moz|ms|webkit)([A-Z])(.*)$/); | |
specialProperty && function (defaultProperty, genericProperty) { | |
Object.defineProperty(CSSStyleDeclarationPrototype, genericProperty, { | |
get: function () { | |
return this[defaultProperty]; | |
}, | |
set: function (value) { | |
return this[defaultProperty] = value; | |
}, | |
enumerable: true | |
}); | |
}(defaultProperty, specialProperty[2].toLowerCase() + specialProperty[3]); | |
} | |
}(CSSStyleDeclaration.prototype, document.createElement("x").style); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment